Skip to content

Conversation

@jo7ueb
Copy link
Collaborator

@jo7ueb jo7ueb commented Dec 3, 2025

I wrote 2 examples brc100_wallet_demo and django_server.

brc100_wallet_demo provides interactive and comprehensive CUI demo application.
It provides access to all of 28 BRC100 method's with intaractive command line.
It can reproduce most of Go's example (with manual input) and do more.

django_servver is JSON-RPC complient server implementation.
Currently it lacks integration with py-middleware so it should be implemented soon.
It will be next task.

@jo7ueb
Copy link
Collaborator Author

jo7ueb commented Dec 4, 2025

unintended close

@jo7ueb
Copy link
Collaborator Author

jo7ueb commented Dec 4, 2025

unintended close, reopen

@jo7ueb
Copy link
Collaborator Author

jo7ueb commented Dec 4, 2025

reopen!

@jo7ueb jo7ueb reopened this Dec 4, 2025
@jo7ueb jo7ueb marked this pull request as ready for review December 4, 2025 04:50
@jo7ueb jo7ueb requested a review from Copilot December 4, 2025 04:55
@jo7ueb jo7ueb requested a review from F1r3Hydr4nt December 4, 2025 04:55
Copilot finished reviewing on behalf of jo7ueb December 4, 2025 04:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds comprehensive Python example code ported from the Go wallet toolbox, providing interactive demonstrations of wallet functionality. The PR includes fixes to ensure examples can be executed successfully.

Key Changes

  • Created internal helper modules (setup.py, show.py, services_helpers.py) for shared configuration, console output formatting, and service interactions
  • Added 11 wallet example scripts demonstrating features like balance checking, transaction creation, encryption/decryption, and advanced patterns like NoSend/SendWith
  • Provided comprehensive documentation in README.md with step-by-step execution instructions

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 23 comments.

Show a summary per file
File Description
examples/from_go/internal/setup.py Configuration loading, wallet initialization, and environment setup utilities
examples/from_go/internal/show.py Console output formatting utilities with ANSI color support
examples/from_go/internal/services_helpers.py Helper functions for interacting with wallet services and building BEEF structures
examples/from_go/internal/__init__.py Package initialization for internal helpers
examples/from_go/wallet_examples/show_address_for_tx_from_faucet/show_address_for_tx_from_faucet.py Generates and displays a BRC-29 testnet address for receiving faucet funds
examples/from_go/wallet_examples/internalize_tx_from_faucet/internalize_tx_from_faucet.py Demonstrates how to internalize a faucet transaction into the wallet database
examples/from_go/wallet_examples/internalize_wallet_payment/internalize_wallet_payment.py Shows how to internalize wallet payments with BRC-29 derivation
examples/from_go/wallet_examples/get_balance/get_balance.py Simple example for retrieving wallet balance
examples/from_go/wallet_examples/encrypt/encrypt.py Demonstrates message encryption using wallet keys
examples/from_go/wallet_examples/decrypt/decrypt.py Demonstrates message decryption using wallet keys
examples/from_go/wallet_examples/create_data_tx/create_data_tx.py Creates and broadcasts a transaction with OP_RETURN data output
examples/from_go/wallet_examples/create_p2pkh_tx/create_p2pkh_tx.py Creates and broadcasts a standard P2PKH payment transaction
examples/from_go/wallet_examples/list_actions/list_actions.py Lists wallet action history with pagination support
examples/from_go/wallet_examples/list_failed_actions/list_failed_actions.py Lists failed wallet actions for debugging purposes
examples/from_go/wallet_examples/list_outputs/list_outputs.py Lists wallet UTXOs with filtering and pagination
examples/from_go/wallet_examples/no_send_send_with/no_send_send_with.py Advanced example showing batch transaction construction and broadcasting
examples/from_go/wallet_examples/no_send_send_with/token/token.py Token data structure for PushDrop example
examples/from_go/wallet_examples/no_send_send_with/token/mint.py Token minting implementation using P2PKH for demonstration
examples/from_go/wallet_examples/no_send_send_with/token/redeem.py Token redemption implementation for PushDrop example
examples/from_go/requirements.txt Python dependencies for running the examples
examples/from_go/README.md Comprehensive documentation with setup and execution instructions
examples/from_go/.gitignore Git ignore rules for generated config files
examples/from_go/__init__.py Package initialization for Go-port examples
examples/__init__.py Root examples package initialization
Comments suppressed due to low confidence (9)

examples/from_go/wallet_examples/internalize_wallet_payment/internalize_wallet_payment.py:44

  • Variable derivation_prefix is not used.
            derivation_prefix = base64.b64decode(PREFIX).decode("utf-8") # Go decodes to bytes, Python string in JSON often expects str or bytes

examples/from_go/wallet_examples/create_p2pkh_tx/create_p2pkh_tx.py:12

  • Import of 'PublicKey' is not used.
from bsv.keys import PublicKey

examples/from_go/wallet_examples/create_p2pkh_tx/create_p2pkh_tx.py:13

  • Import of 'Script' is not used.
from bsv.script import Script

examples/from_go/wallet_examples/internalize_wallet_payment/internalize_wallet_payment.py:12

  • Import of 'PublicKey' is not used.
from bsv.keys import PublicKey

examples/from_go/wallet_examples/no_send_send_with/token/mint.py:7

  • Import of 'json' is not used.
import json

examples/from_go/internal/show.py:6

  • Import of 'sys' is not used.
import sys

examples/from_go/internal/setup.py:10

  • Import of 'Optional' is not used.
from typing import Callable, Optional, Tuple

examples/from_go/wallet_examples/no_send_send_with/token/token.py:8

  • Import of 'Optional' is not used.
from typing import List, Optional

examples/from_go/wallet_examples/internalize_wallet_payment/internalize_wallet_payment.py:53

  • Unnecessary 'pass' statement.
            pass

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

F1r3Hydr4nt and others added 17 commits December 4, 2025 14:04
…ough an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ough an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@F1r3Hydr4nt F1r3Hydr4nt requested a review from Copilot December 4, 2025 05:10
Copilot finished reviewing on behalf of F1r3Hydr4nt December 4, 2025 05:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 15 comments.

Comments suppressed due to low confidence (1)

src/bsv_wallet_toolbox/wallet.py:619

  • Syntax Error (in Python 3).
<<<<<<< HEAD

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jo7ueb
Copy link
Collaborator Author

jo7ueb commented Dec 4, 2025

I fixed 1 failing test.
Stil looking for another warning test.

F1r3Hydr4nt and others added 2 commits December 4, 2025 14:57
Removed unused imports

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@F1r3Hydr4nt F1r3Hydr4nt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed, leaving warnings in place

@F1r3Hydr4nt F1r3Hydr4nt merged commit c34e06a into bsv-blockchain:master Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants