simulate
The simulate
method executes a dry run of any transaction type, enabling you to preview the results and metadata of a transaction without committing them to the XRP Ledger. Since this command never submits a transaction to the network, it doesn't incur any fees.
Request Format
The request includes the following parameters:
tx_blob
String
Yes
The transaction to simulate, in binary format. If you include this field, do not also include tx_json
.
tx_json
Object
Yes
The transaction to simulate, in JSON format. If you include this field, do not also include tx_blob
.
binary
Boolean
No
The default value is false
, which returns data and metadata in JSON format. If true
, returns data and metadata in binary format, serialized to a hexadecimal string.
The simulated transaction must be unsigned.
The server autofills
Fee
,Sequence
,SigningPubKey
, andNetworkID
fields.
Response Format
An example of a successful response:
The response follows the standard format, with a successful result containing the following fields:
tx_json
Object
The transaction that was simulated, including auto-filled values. Included if binary
was false
.
tx_blob
String
The serialized transaction that was simulated, including auto-filled values. Included if binary
was true
.
meta
Object
Transaction metadata, which describes the results of the transaction. Not included if the transaction fails with a code that means it wouldn’t be included in the ledger (such as a non-TEC code). Included if binary
was false
.
meta_blob
String
Transaction metadata, which describes the results of the transaction. Not included if the transaction fails with a code that means it wouldn’t be included in the ledger (such as a non-TEC code). Included if binary
was true
.
Possible Errors
invalidParams
- One or more fields are specified incorrectly, or one or more required fields are missing.transactionSigned
- The transaction was signed. The simulated transaction must be unsigned.
Last updated