Broadcast Transaction

Transaction API requires just your seed. To create a new transfer funds transaction from the wallet we created earlier, send the funds to the donation address and broadcast it to the network run the command

seed64 = "2k3LidUYf6c6Lxs5YR2RY9mT7gJS6663XbyfarMQx8V5Pf28NF5XCQaecZrvYty6sKHxr5w4RoUct2t16agNTAQd"
receiver = "69TDon8KJp3vicNeFR3dg5x5sKY8PJFLmoizX3RN31YL4fwr266AVcXgwy1mjCLy6M"
amount = 1.0  # AMA has 9 decimals. the API converts type float to integer currency
              # 1.0 is actually 1_000_000_000 AMA
              # if you pass amount = 1 you will send 1 of the lowest denomination of AMA
symbol = "AMA"

RPC.API.Wallet.transfer(seed64, receiver, amount, symbol)
%{error: "ok", hash: "CNzM2qvuPBVgV92LnBDtSrbFAm3iTwupEWiVGEBmrKpy"}
#Wait a second
RPC.API.Wallet.balance(receiver, symbol)
RPC.API.Chain.tx("CNzM2qvuPBVgV92LnBDtSrbFAm3iTwupEWiVGEBmrKpy")

Your transaction will be broadcast to an RPC node and added to the TXPool. Reasons your TX might not be found are mainly it failed due to not having enough balance on your account, or you sent all the coins off the address and did not leave enough to pay for exec costs (always leave at least 0.1 AMA). In the future there will be dust management.

Sending OTHER coins

If you wish to send something other than AMA you can specify via the 4th argument the symbol name:

RPC.API.Wallet.transfer(seed64, receiver, amount, "NEURAL")

Bulk Transfer

Size 2 tuple implies AMA, otherwise 3rd element is the symbol to send.

Last updated