SDK CLI prints 0 RTC for canonical /wallet/balance responses
Maintainers usually reply within 10 days
@ArtyormSatori is already working on this.
Since Oct 28, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start with the balance rendering at sdk/python/rustchain_sdk/cli.py lines 108–122 and the client request at sdk/python/rustchain_sdk/client.py lines 347–360. Run the reproduced CLI test with both the canonical response and the legacy control payload; check what the endpoint actually returns before deciding how to handle nonce. Done when canonical amount_rtc displays correctly, the legacy alias still works, and missing balance fields do not display a misleading zero.
Written by the indexing model from the issue text.
Description
Reproduced zero balance display for canonical /wallet/balance responses
Pinned source c3da95d5e6163d7fe06b9d12a7735976392f2318: balance rendering reads result.get("balance", 0) and result.get("nonce", 0), while the client method requests the current GET /wallet/balance?address= endpoint whose documented canonical field is amount_rtc (first-party MCP adapter requires amount_rtc and derives the compatibility aliases from it).
A live read-only GET https://rustchain.org/wallet/balance?miner_id=stmr returns:
{"amount_i64": 21000000, "amount_rtc": 21, "miner_id": "stmr"}
Running the real rustchain wallet balance command against that exact payload prints:
Address: local-fixture
Balance: 0 RTC
Nonce: 0
A control payload carrying balance: 42, nonce: 3 prints Balance: 42 RTC through the same code path, so the display logic works and the canonical field is simply never read. A wallet holding 21 RTC is reported as holding none, with a zero nonce.
This is the CLI sibling of monitor #68 in Scottcjn/rustchain-monitor, where the same canonical-field drift makes successful balances record as 0.0. The two reports cover separate consumers and separate fixes; RustChain issue #7070/#7085 cover stale routes in tools/cli-wallet and shell scripts, not this SDK display path.
Suggested fix: read amount_rtc (and any nonce the endpoint actually returns), keep the legacy balance key as an intentional alias, and print an explicit unavailable state rather than 0 RTC when the response carries none of the accepted fields.
Reproduction
Save the pinned sdk/python package and its dependencies in an isolated environment, save the script below as repro.py, and run python repro.py /path/to/Rustchain/sdk/python. The public CLI entry point and the real client are exercised over httpx.MockTransport; no live node request, seed, signing or transfer occurs.
import json
import sys
sys.path.insert(0, sys.argv[1])
import httpx
from click.testing import CliRunner
from rustchain_sdk import cli
from rustchain_sdk.client import RustChainClient
CASES = [
('live canonical payload (verified from node)', {'amount_i64': 21000000, 'amount_rtc': 21, 'miner_id': 'local-fixture'}),
('working-balance control', {'balance': 42, 'nonce': 3, 'miner_id': 'local-fixture'}),
]
def run(payload):
client = RustChainClient(base_url='https://example.invalid', verify=True)
client._client = httpx.AsyncClient(base_url='https://example.invalid', transport=httpx.MockTransport(lambda request: httpx.Response(200, json=payload, request=request)))
original = cli.RustChainClient
class Fixed:
async def __aenter__(self):
return self
async def __aexit__(self, *args):
await client.close()
async def get_balance(self, address):
return await client.get_balance(address)
cli.RustChainClient = lambda **kwargs: Fixed()
try:
return CliRunner().invoke(cli.main, ['wallet', 'balance', 'local-fixture']).output.strip()
finally:
cli.RustChainClient = original
for label, payload in CASES:
print(label)
print(run(payload))
Executed output, exit 0:
live canonical payload (verified from node)
Address: local-fixture
Balance: 0 RTC
Nonce: 0
working-balance control
Address: local-fixture
Balance: 42 RTC
Nonce: 3
Duplicate screening: Rustchain "cli.py" "balance_rtc" returned 0; broader balance searches returned only stale-route work (7070, 7085, 8318, 8088) and unrelated claims. Novelty and eligibility remain maintainer decisions.
AI assistance disclosure: source inspection, local reproduction and report preparation were AI-assisted. No accounts, credentials, funds or production operations.
- Dominant language
- Python
- Stars
- 850
- Forks
- 589
- Avg merge
- 11d 7h
- Merged PRs (30d)
- 29
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Scottcjn/Rustchain
-
utxo_ledger (reference): failed apply_transaction leaks already-created outputs (supply inflation)Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 10 days
-
utxo_ledger (reference): no coinbase authorization; mempool admits any input-less MINING_REWARDOpen
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Maintainers usually reply within 10 days
-
[SECURITY] Non-finite and garbage weights pass the sybil-guard money chain — enrollment_weight has no isfinite guard and epoch_weight_to_units raises on NaN/infPossibly taken @thinhnx128 claimed this 28 days ago. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Scottcjn/Rustchain#8619 · 2 comments ·
Maintainers usually reply within 10 days
-
[Antiquity] Celeron M (Banias/Dothan, 2004) has no brand rule — real vintage silicon falls to x86 default 1.0x while its Pentium M twin earns 1.9xPossibly taken @Limm-web claimed this 60 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Scottcjn/Rustchain#8578 · 5 comments ·
Maintainers usually reply within 10 days
-
Python SDK attest --json returns status without running advertised attestation flowPossibly taken @ArtyormSatori claimed this 36 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
Scottcjn/Rustchain#8566 · 1 comment ·
Maintainers usually reply within 10 days
All issues in Scottcjn/Rustchain
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
daniel-ospina/tortoise#15308 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
difficulty:easy prio:low type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NatronGitHub/Natron#2405 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Jstar269/nakagawa-recomp#3746 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day