Broadcast Transaction
Send AMA and other tokens from the node shell with RPC.API.Wallet.transfer, encode amounts correctly, and send bulk transfers.
RPC.API.Wallet.transfer signs a transfer locally with your seed and submits it to the RPC set in RPC_URL. You only need the seed of the sending wallet. Start the node as described in Using the REPL. For testnet, start it with OFFLINE=true TESTNET=true RPC_URL=https://testnet-rpc.ama.one so the transaction is signed for testnet.
Send AMA
seed64 = "YOUR_BASE58_SEED"
receiver = "RECEIVER_PUBLIC_KEY"
amount = 1.0 # float: whole AMA, 1.0 = 1 AMA = 1_000_000_000 base units
symbol = "AMA"
RPC.API.Wallet.transfer(seed64, receiver, amount, symbol)
The call waits until the transaction is finalized and returns the result:
%{
error: "ok",
hash: "...",
metadata: %{entry_hash: "...", entry_height: ..., status: "finalized"},
receipt: %{exec_used: "...", logs: [], result: "ok", success: true}
}
receipt.success and receipt.result tell you whether the transfer executed. If the call raises an error instead, check the receiver's balance before you send again: the transaction may still have gone through, and a resend is a new transaction. Check the new balance or look the transaction up again by its hash:
RPC.API.Wallet.balance(receiver, symbol)
RPC.API.Chain.tx("TRANSACTION_HASH")
%{balance: %{flat: ..., float: ..., symbol: "AMA"}, error: "ok"}
How amounts are encoded
AMA has 9 decimals. The amount argument is converted depending on its type:
| You pass | Sent as | Example |
|---|---|---|
| A float | Whole tokens, multiplied by 1,000,000,000 | 1.0 sends 1 AMA |
| An integer | Base units, unchanged | 1 sends 0.000000001 AMA; 1_000_000_000 sends 1 AMA |
Always write whole-AMA amounts as floats (5.0, not 5). The float conversion multiplies by 10^9 for every token symbol.
Fees and minimum balance
Every transaction locks a budget of 0.01 AMA (plus any gas attached to a contract call) from the sender's AMA balance. The transaction's costs are paid from that budget and the unused part is refunded after execution. If the balance can't cover the budget, the RPC rejects the transaction with %{error: "not_enough_tx_exec_balance"} and nothing is sent. The budget is locked before the transfer runs, so the balance must cover the amount plus 0.01 AMA; otherwise the transfer fails with insufficient_funds and its costs are still charged. A plain transfer costs a fraction of the budget (see Transaction fees). When you empty a wallet, keep 0.02 AMA behind: that is the reserve the extension, the web wallet and the mobile wallet hold back on every send (AMA_TRANSFER_FEE in the SDK), and it covers the budget.
If the receiver is not a valid public key, the call returns %{error: :invalid_public_key, pk: ...} and sends nothing.
Send other tokens
Pass the token symbol as the fourth argument:
RPC.API.Wallet.transfer(seed64, receiver, 10.0, "TOKEN_SYMBOL")
Soulbound tokens, such as PRIME, can't be transferred; the transaction fails with soulbound.
Bulk transfer
RPC.API.Wallet.transfer_bulk takes a list of tuples. A 2-tuple sends AMA; in a 3-tuple the third element is the token symbol.
seed64 = "YOUR_BASE58_SEED"
RPC.API.Wallet.transfer_bulk(seed64, [
{"RECEIVER_PUBLIC_KEY_1", 1.0},
{"RECEIVER_PUBLIC_KEY_2", 1_000_000_000},
{"RECEIVER_PUBLIC_KEY_3", 1.0, "TOKEN_SYMBOL"}
])
Each entry is sent as its own transaction, one after another, and each waits for finality before the next is sent. The call returns a list with one result per entry, in the same shape as a single transfer.
To build the list from text with one <public key> <amount> pair per line, separated by a single space, use transfer_bulk_from_text. It only parses the text; pass its result to transfer_bulk. Amounts must be whole numbers of AMA.
text = """
RECEIVER_PUBLIC_KEY_1 5
RECEIVER_PUBLIC_KEY_2 10
"""
list = RPC.API.Wallet.transfer_bulk_from_text(seed64, text)
RPC.API.Wallet.transfer_bulk(seed64, list)
Next steps
- Connect to Testnet: try transfers with free testnet AMA first.
- Explorer links: open a transaction in the explorer.