feat: Python SDK for RustChain with CLI and full API coverage#1793
Open
daatsuka wants to merge 2 commits intoScottcjn:mainfrom
Open
feat: Python SDK for RustChain with CLI and full API coverage#1793daatsuka wants to merge 2 commits intoScottcjn:mainfrom
daatsuka wants to merge 2 commits intoScottcjn:mainfrom
Conversation
Implements the typed Python client described in rustchain-bounties#2297. Adds sdk/python/rustchain/ package with RPC client, CLI, typed exception hierarchy (InsufficientFundsError, NetworkError), and block explorer wrapper. Test suite covers client init, RPC error handling, balance/send/stake flows and CLI invocation. Closes Scottcjn/rustchain-bounties#2297
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
Owner
|
NEEDS WORK — The SDK structure is decent but:
Fix these and this could be a useful contribution. |
…remove unrelated script - Switch transfer() to POST /wallet/transfer/signed with the required payload structure: from_address, to_address, amount_rtc, nonce, signature, public_key - Add ARCH_MULTIPLIERS dict to client module (with SPARC, MIPS, ARM, POWER8 populated alongside existing g3/g4/g5/apple_silicon/core2duo) - Export ARCH_MULTIPLIERS via package __init__ - Remove scripts/epoch_settlement.py — unrelated to Python SDK scope
Author
|
Thanks for the precise review! You are completely right. I've updated the endpoint to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a production-ready Python SDK (
rustchain) with full API coverage, typed exceptions, a CLI entry point, and a chain explorer utility.Changes
sdk/python/rustchain/__init__.py: Package exports —RustChainClient, exception hierarchy,__version__sdk/python/rustchain/client.py: Main client — wallet creation, transaction submission, balance queries, epoch queries, with automatic retry on transient errorssdk/python/rustchain/cli.py: Click-based CLI (rustchain wallet create,rustchain tx send,rustchain balance,rustchain epoch info)sdk/python/rustchain/exceptions.py: Typed exception hierarchy (RustChainError→NetworkError,InsufficientFundsError,EpochError, etc.)sdk/python/rustchain/explorer.py: Read-only explorer client for block/transaction lookup and paginationscripts/epoch_settlement.py: Standalone script using the SDK to trigger epoch settlement and verify finalitysdk/python/tests/test_rustchain_sdk.py: Unit tests with mocked HTTP layer covering all public client methodsUsage
Closes Scottcjn/rustchain-bounties#2297