Build And Submit Transaction

Sending a transaction is a convenience method that first builds and then submits a transaction.

Parameters

Required ParamPurposeRequirements

account_id

The account on which to perform this action

Account must exist in the wallet

Optional ParamPurposeRequirements

recipient_public_address

The recipient for this transaction

b58-encoded public address bytes

value_pmob

The amount of MOB to send in this transaction

addresses_and_values

An array of public addresses and value tuples

addresses are b58-encoded public addresses, value is in pmob

input_txo_ids

Specific TXOs to use as inputs to this transaction

TXO IDs (obtain from get_txos_for_account)

fee

The fee amount to submit with this transaction

If not provided, uses MINIMUM_FEE = .01 MOB

tombstone_block

The block after which this transaction expires

If not provided, uses cur_height + 10

max_spendable_value

The maximum amount for an input TXO selected for this transaction

comment

Comment to annotate this transaction in the transaction log

Example

{
  "method": "build_and_submit_transaction",
  "params": {
    "account_id": "a8c9c7acb96cf4ad9154eec9384c09f2c75a340b441924847fe5f60a41805bde",
    "recipient_public_address": "CaE5bdbQxLG2BqAYAz84mhND79iBSs13ycQqN8oZKZtHdr6KNr1DzoX93c6LQWYHEi5b7YLiJXcTRzqhDFB563Kr1uxD6iwERFbw7KLWA6",
    "value_pmob": "42000000000000"
  },
  "jsonrpc": "2.0",
  "id": 1
}

If an account is not fully-synced, you may see the following error message:

{
  "error": "Connection(Operation { error: TransactionValidation(ContainsSpentKeyImage), total_delay: 0ns, tries: 1 })"
}

Call check_balance for the account, and note the synced_blocks value. If that value is less than the local_block_height value, then your TXOs may not all be updated to their spent status.

Last updated