From fe1525cc051925f14870b078a184d382218476b0 Mon Sep 17 00:00:00 2001 From: aitbc Date: Tue, 26 May 2026 14:01:38 +0200 Subject: [PATCH] fix: restructure transaction payload to match RPC server schema - Move amount and recipient/to to top level instead of nested in payload - Remove chain_id from top level (not in TransactionRequest schema) - Match TransactionRequest model in apps/blockchain-node/src/aitbc_chain/rpc/transactions.py - Fixes 422 validation error: field amount is required - Fixes int_from_flo error by ensuring amount and fee are integers --- cli/aitbc_cli/commands/transactions.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cli/aitbc_cli/commands/transactions.py b/cli/aitbc_cli/commands/transactions.py index 12a81895..46443104 100644 --- a/cli/aitbc_cli/commands/transactions.py +++ b/cli/aitbc_cli/commands/transactions.py @@ -104,16 +104,15 @@ def _send_transaction_impl(from_wallet: str, to_address: str, amount: float, fee actual_nonce = 0 # Create transaction + # Match RPC server schema (TransactionRequest in apps/blockchain-node/src/aitbc_chain/rpc/transactions.py) transaction = { "type": "TRANSFER", - "chain_id": chain_id, "from": sender_address, - "nonce": actual_nonce, + "to": to_address, + "amount": int(amount), "fee": int(fee), - "payload": { - "recipient": to_address, - "amount": int(amount) - } + "nonce": actual_nonce, + "payload": {} } # Sign transaction