submit
The submit
method applies a transaction and sends it to the network to be confirmed and included in future ledgers.
This command has two modes:
Submit-only mode takes a signed, serialized transaction as a binary blob, and submits it to the network as-is. Since signed transaction objects are immutable, no part of the transaction can be modified or automatically filled in after submission.
Sign-and-submit mode takes a JSON-formatted Transaction object, completes and signs the transaction in the same manner as the [sign method][], and then submits the signed transaction. We recommend only using this mode for testing and development.
To send a transaction as robustly as possible, you should construct and [sign][sign method] it in advance, persist it somewhere that you can access even after a power outage, then submit
it as a tx_blob
. After submission, monitor the network with the [tx method][] command to see if the transaction was successfully applied; if a restart or other problem occurs, you can safely re-submit the tx_blob
transaction: it won't be applied twice since it has the same sequence number as the old transaction.
Submit-Only Mode
A submit-only request includes the following parameters:
Field
Type
Required?
Description
tx_blob
String
Yes
Hex representation of the signed transaction to submit. This can be a multi-signed transaction.
fail_hard
Boolean
No
If true
, and the transaction fails locally, do not retry or relay the transaction to other servers. The default is false
.
Sign-and-Submit Mode
This mode signs a transaction and immediately submits it. This mode is intended to be used for testing. You cannot use this mode for multi-signed transactions.
By default, sign-and-submit mode is admin-only. It can be used as a public method if the server has enabled public signing.
You can provide the secret key used to sign the transaction in the following ways:
Provide a
secret
value and omit thekey_type
field. This value can be formatted as an XRP Ledger [base58][] seed, RFC-1751, hexadecimal, or as a string passphrase. (secp256k1 keys only)Provide a
key_type
value and exactly one ofseed
,seed_hex
, orpassphrase
. Omit thesecret
field. (Not supported by the commandline syntax.)
The request includes the following parameters:
Field
Type
Description
tx_json
Object
Transaction definition in JSON format, optionally omitting any auto-fillable fields.
secret
String
(Optional) Secret key of the account supplying the transaction, used to sign it. Do not send your secret to untrusted servers or through unsecured network connections. Cannot be used with key_type
, seed
, seed_hex
, or passphrase
.
seed
String
(Optional) Secret key of the account supplying the transaction, used to sign it. Must be in the XRP Ledger's [base58][] format. If provided, you must also specify the key_type
. Cannot be used with secret
, seed_hex
, or passphrase
.
seed_hex
String
(Optional) Secret key of the account supplying the transaction, used to sign it. Must be in hexadecimal format. If provided, you must also specify the key_type
. Cannot be used with secret
, seed
, or passphrase
.
passphrase
String
(Optional) Secret key of the account supplying the transaction, used to sign it, as a string passphrase. If provided, you must also specify the key_type
. Cannot be used with secret
, seed
, or seed_hex
.
key_type
String
(Optional) Type of cryptographic key provided in this request. Valid types are secp256k1
or ed25519
. Defaults to secp256k1
. Cannot be used with secret
. Caution: Ed25519 support is experimental.
fail_hard
Boolean
(Optional) If true
, and the transaction fails locally, do not retry or relay the transaction to other servers. The default is false
.
Request Format
An example of the request format:
Response Format
An example of a successful response:
The response follows the [standard format][], with a successful result containing the following fields:
Field
Type
Description
engine_result
String
Text result code indicating the preliminary result of the transaction, for example tesSUCCESS
engine_result_code
Integer
Numeric version of the result code. Not recommended.
engine_result_message
String
Human-readable explanation of the transaction's preliminary result
tx_blob
String
The complete transaction in hex string format
tx_json
Object
The complete transaction in JSON format
accepted
Boolean
(Omitted in sign-and-submit mode) The value true
indicates that the transaction was applied, queued, broadcast, or kept for later. The value false
indicates that none of those happened, so the transaction cannot possibly succeed as long as you do not submit it again and have not already submitted it another time.
account_sequence_available
Number
(Omitted in sign-and-submit mode) The next [Sequence Number][] available for the sending account after all pending and queued transactions.
account_sequence_next
number
(Omitted in sign-and-submit mode) The next [Sequence Number][] for the sending account after all transactions that have been provisionally applied, but not transactions in the queue.
applied
Boolean
(Omitted in sign-and-submit mode) The value true
indicates that this transaction was applied to the open ledger. In this case, the transaction is likely, but not guaranteed, to be validated in the next ledger version.
broadcast
Boolean
(Omitted in sign-and-submit mode) The value true
indicates this transaction was broadcast to peer servers in the peer-to-peer XRP Ledger network. (Note: if the server has no peers, such as in [stand-alone mode][], the server uses the value true
for cases where it would have broadcast the transaction.) The value false
indicates the transaction was not broadcast to any other servers.
kept
Boolean
(Omitted in sign-and-submit mode) The value true
indicates that the transaction was kept to be retried later.
queued
Boolean
(Omitted in sign-and-submit mode) The value true
indicates the transaction was put in the Transaction Queue, which means it is likely to be included in a future ledger version.
open_ledger_cost
String
(Omitted in sign-and-submit mode) The current open ledger cost before processing this transaction. Transactions with a lower cost are likely to be queued.
validated_ledger_index
Integer
(Omitted in sign-and-submit mode) The [ledger index][] of the newest validated ledger at the time of submission. This provides a lower bound on the ledger versions that the transaction can appear in as a result of this request. (The transaction could only have been validated in this ledger version or earlier if it had already been submitted before.)
Warning: Even if the WebSocket response has "status":"success"
, indicating that the command was successfully received, that does not indicate that the transaction executed successfully. Many situations can prevent a transaction from processing successfully, such as a lack of trust lines connecting the two accounts in a payment, or changes in the state of the ledger since the time the transaction was constructed. Even if nothing is wrong, it may take several seconds to close and validate the ledger version that includes the transaction. See the full list of transaction responses for details, and do not consider the transaction's results final until they appear in a validated ledger version.
Caution: If this command results in an error message, the message can contain the secret key from the request. (This can only happen in sign-and-submit mode.) Make sure that these errors are not visible to others.
Do not write an error including your secret key to a log file that can be seen by multiple people.
Do not paste an error including your secret key to a public place for debugging.
Do not display an error message including your secret key on a website, even by accident.
Possible Errors
Any of the [universal error types][].
amendmentBlocked
- The transaction cannot be submitted to the network because therippled
server is amendment blocked.highFee
- Thefee_mult_max
parameter was specified, but the server's current fee multiplier exceeds the specified one. (Sign-and-Submit mode only)internalJson
- An internal error occurred when serializing the transaction to JSON. This could be caused by many aspects of the transaction, including a bad signature or some fields being malformed.internalSubmit
- An internal error occurred when submitting the transaction. This could be caused by many aspects of the transaction, including a bad signature or some fields being malformed.internalTransaction
- An internal error occurred when processing the transaction. This could be caused by many aspects of the transaction, including a bad signature or some fields being malformed.invalidParams
- One or more fields are specified incorrectly, or one or more required fields are missing.invalidTransaction
- The transaction is malformed or otherwise invalid.noPath
- The transaction did not include paths, and the server was unable to find a path by which this payment can occur. (Sign-and-Submit mode only)tooBusy
- The transaction did not include paths, but the server is too busy to do pathfinding right now. Does not occur if you are connected as an admin. (Sign-and-Submit mode only)notSupported
- Signing is not supported by this server (Sign-and-Submit mode only.) If you are the server admin, you can still access signing when connected as an admin, or you could enable public signing.
Last updated