mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 04:05:49 +00:00
Re-level non-docs content to top of repo and rename content→docs
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
---
|
||||
html: transaction-methods.html # watch for clashes w/ this filename
|
||||
parent: public-api-methods.html
|
||||
metadata:
|
||||
indexPage: true
|
||||
---
|
||||
# Transaction Methods
|
||||
|
||||
Transactions are the only thing that can modify the shared state of the XRP Ledger. All business on the XRP Ledger takes the form of transactions. Use these methods to work with transactions.
|
||||
|
||||
|
||||
{% child-pages /%}
|
||||
@@ -0,0 +1,334 @@
|
||||
---
|
||||
html: submit.html
|
||||
parent: transaction-methods.html
|
||||
seo:
|
||||
description: Send a transaction to the network.
|
||||
labels:
|
||||
- Transaction Sending
|
||||
- Payments
|
||||
---
|
||||
# submit
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/rpc/handlers/Submit.cpp "Source")
|
||||
|
||||
The `submit` method applies a [transaction](../../../protocol/transactions/index.md) 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](../../../../concepts/accounts/multi-signing.md). |
|
||||
| `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`. |
|
||||
|
||||
### Request Format
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
```json
|
||||
{
|
||||
"id": 3,
|
||||
"command": "submit",
|
||||
"tx_blob": "1200002280000000240000001E61D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000B732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB7447304502210095D23D8AF107DF50651F266259CC7139D0CD0C64ABBA3A958156352A0D95A21E02207FCF9B77D7510380E49FF250C21B57169E14E9B4ACFD314CEDC79DDD0A38B8A681144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754"
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
```json
|
||||
{
|
||||
"method": "submit",
|
||||
"params": [
|
||||
{
|
||||
"tx_blob": "1200002280000000240000000361D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000A732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100D184EB4AE5956FF600E7536EE459345C7BBCF097A84CC61A93B9AF7197EDB98702201CEA8009B7BEEBAA2AACC0359B41C427C1C5B550A4CA4B80CF2174AF2D6D5DCE81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
```sh
|
||||
#Syntax: submit tx_blob
|
||||
submit 1200002280000000240000000361D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000A732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100D184EB4AE5956FF600E7536EE459345C7BBCF097A84CC61A93B9AF7197EDB98702201CEA8009B7BEEBAA2AACC0359B41C427C1C5B550A4CA4B80CF2174AF2D6D5DCE81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
[Try it! >](/resources/dev-tools/websocket-api-tool#submit)
|
||||
|
||||
|
||||
## 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](../../../../concepts/accounts/multi-signing.md).
|
||||
|
||||
_By default, sign-and-submit mode is [admin-only](../../admin-api-methods/index.md)._ It can be used as a public method if the server has [enabled public signing](../../../../infrastructure/configuration/enable-public-signing.md).
|
||||
|
||||
You can provide the secret key used to sign the transaction in the following ways:
|
||||
|
||||
* Provide a `secret` value and omit the `key_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 of `seed`, `seed_hex`, or `passphrase`. Omit the `secret` field. (Not supported by the commandline syntax.)
|
||||
|
||||
The request includes the following parameters:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------------|:--------|:--------------------------------------------------|
|
||||
| `tx_json` | Object | [Transaction definition](../../../protocol/transactions/index.md) 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`. {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.5.0" %}Updated in: rippled 1.5.0{% /badge %} |
|
||||
| `offline` | Boolean | _(Optional)_ If `true`, when constructing the transaction, do not try to automatically fill in or validate values. The default is `false`. |
|
||||
| `build_path` | Boolean | _(Optional)_ If this field is provided, the server [auto-fills](../../../protocol/transactions/common-fields.md#auto-fillable-fields) the `Paths` field of a [Payment transaction][] before signing. You must omit this field if the transaction is a [direct XRP payment](../../../../concepts/payment-types/direct-xrp-payments.md) or if it is not a Payment-type transaction. **Caution:** The server looks for the presence or absence of this field, not its value. This behavior may change. ([Issue #3272](https://github.com/XRPLF/rippled/issues/3272)) |
|
||||
| `fee_mult_max` | Integer | _(Optional)_ Sign-and-submit fails with the error `rpcHIGH_FEE` if the [auto-filled `Fee` value](../../../protocol/transactions/common-fields.md#auto-fillable-fields) would be greater than the [reference transaction cost](../../../../concepts/transactions/transaction-cost.md#special-transaction-costs) × `fee_mult_max` ÷ `fee_div_max`. This field has no effect if you explicitly specify the `Fee` field of the transaction. The default is `10`. |
|
||||
| `fee_div_max` | Integer | _(Optional)_ Sign-and-submit fails with the error `rpcHIGH_FEE` if the [auto-filled `Fee` value](../../../protocol/transactions/common-fields.md#auto-fillable-fields) would be greater than the [reference transaction cost](../../../../concepts/transactions/transaction-cost.md#special-transaction-costs) × `fee_mult_max` ÷ `fee_div_max`. This field has no effect if you explicitly specify the `Fee` field of the transaction. The default is `1`. |
|
||||
|
||||
See the [sign method][] for detailed information on how the server automatically fills in certain fields.
|
||||
|
||||
### Request Format
|
||||
An example of the request format:
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
```json
|
||||
{
|
||||
"id": 2,
|
||||
"command": "submit",
|
||||
"tx_json" : {
|
||||
"TransactionType" : "Payment",
|
||||
"Account" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"Destination" : "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||||
"Amount" : {
|
||||
"currency" : "USD",
|
||||
"value" : "1",
|
||||
"issuer" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
|
||||
}
|
||||
},
|
||||
"secret" : "s████████████████████████████",
|
||||
"offline": false,
|
||||
"fee_mult_max": 1000
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
```json
|
||||
{
|
||||
"method": "submit",
|
||||
"params": [
|
||||
{
|
||||
"offline": false,
|
||||
"secret": "s████████████████████████████",
|
||||
"tx_json": {
|
||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"Amount": {
|
||||
"currency": "USD",
|
||||
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"value": "1"
|
||||
},
|
||||
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||||
"TransactionType": "Payment"
|
||||
},
|
||||
"fee_mult_max": 1000
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
```sh
|
||||
#Syntax: submit secret json [offline]
|
||||
rippled submit s████████████████████████████ '{"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "Amount": { "currency": "USD", "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "value": "1" }, "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "TransactionType": "Payment", "Fee": "10000"}'
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
[Try it! >](/resources/dev-tools/websocket-api-tool#submit)
|
||||
|
||||
## Response Format
|
||||
|
||||
An example of a successful response:
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"status": "success",
|
||||
"type": "response",
|
||||
"result": {
|
||||
"accepted" : true,
|
||||
"account_sequence_available" : 362,
|
||||
"account_sequence_next" : 362,
|
||||
"applied" : true,
|
||||
"broadcast" : true,
|
||||
"engine_result": "tesSUCCESS",
|
||||
"engine_result_code": 0,
|
||||
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
||||
"kept" : true,
|
||||
"open_ledger_cost": "10",
|
||||
"queued" : false,
|
||||
"tx_blob": "1200002280000000240000016861D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA9684000000000002710732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB7446304402200E5C2DD81FDF0BE9AB2A8D797885ED49E804DBF28E806604D878756410CA98B102203349581946B0DDA06B36B35DBC20EDA27552C1F167BCF5C6ECFF49C6A46F858081144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754",
|
||||
"tx_json": {
|
||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"Amount": {
|
||||
"currency": "USD",
|
||||
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"value": "1"
|
||||
},
|
||||
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||||
"Fee": "10000",
|
||||
"Flags": 2147483648,
|
||||
"Sequence": 360,
|
||||
"SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
|
||||
"TransactionType": "Payment",
|
||||
"TxnSignature": "304402200E5C2DD81FDF0BE9AB2A8D797885ED49E804DBF28E806604D878756410CA98B102203349581946B0DDA06B36B35DBC20EDA27552C1F167BCF5C6ECFF49C6A46F8580",
|
||||
"hash": "4D5D90890F8D49519E4151938601EF3D0B30B16CD6A519D9C99102C9FA77F7E0"
|
||||
},
|
||||
"validated_ledger_index" : 21184416
|
||||
}
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
```json
|
||||
{
|
||||
"result": {
|
||||
"accepted" : true,
|
||||
"account_sequence_available" : 362,
|
||||
"account_sequence_next" : 362,
|
||||
"applied" : true,
|
||||
"broadcast" : true,
|
||||
"engine_result": "tesSUCCESS",
|
||||
"engine_result_code": 0,
|
||||
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
||||
"status": "success",
|
||||
"kept" : true,
|
||||
"open_ledger_cost": "10",
|
||||
"queued" : false,
|
||||
"tx_blob": "1200002280000000240000016961D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA9684000000000002710732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100A7CCD11455E47547FF617D5BFC15D120D9053DFD0536B044F10CA3631CD609E502203B61DEE4AC027C5743A1B56AF568D1E2B8E79BB9E9E14744AC87F38375C3C2F181144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754",
|
||||
"tx_json": {
|
||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"Amount": {
|
||||
"currency": "USD",
|
||||
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"value": "1"
|
||||
},
|
||||
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||||
"Fee": "10000",
|
||||
"Flags": 2147483648,
|
||||
"Sequence": 361,
|
||||
"SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
|
||||
"TransactionType": "Payment",
|
||||
"TxnSignature": "3045022100A7CCD11455E47547FF617D5BFC15D120D9053DFD0536B044F10CA3631CD609E502203B61DEE4AC027C5743A1B56AF568D1E2B8E79BB9E9E14744AC87F38375C3C2F1",
|
||||
"hash": "5B31A7518DC304D5327B4887CD1F7DC2C38D5F684170097020C7C9758B973847"
|
||||
}
|
||||
},
|
||||
"validated_ledger_index" : 21184416
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
```json
|
||||
Loading: "/etc/rippled.cfg"
|
||||
Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result": {
|
||||
"accepted" : true,
|
||||
"account_sequence_available" : 362,
|
||||
"account_sequence_next" : 362,
|
||||
"applied" : true,
|
||||
"broadcast" : true,
|
||||
"engine_result": "tesSUCCESS",
|
||||
"engine_result_code": 0,
|
||||
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
||||
"status": "success",
|
||||
"kept" : true,
|
||||
"open_ledger_cost": "10",
|
||||
"queued" : false,
|
||||
"tx_blob": "1200002280000000240000016961D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA9684000000000002710732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100A7CCD11455E47547FF617D5BFC15D120D9053DFD0536B044F10CA3631CD609E502203B61DEE4AC027C5743A1B56AF568D1E2B8E79BB9E9E14744AC87F38375C3C2F181144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754",
|
||||
"tx_json": {
|
||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"Amount": {
|
||||
"currency": "USD",
|
||||
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"value": "1"
|
||||
},
|
||||
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||||
"Fee": "10000",
|
||||
"Flags": 2147483648,
|
||||
"Sequence": 361,
|
||||
"SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
|
||||
"TransactionType": "Payment",
|
||||
"TxnSignature": "3045022100A7CCD11455E47547FF617D5BFC15D120D9053DFD0536B044F10CA3631CD609E502203B61DEE4AC027C5743A1B56AF568D1E2B8E79BB9E9E14744AC87F38375C3C2F1",
|
||||
"hash": "5B31A7518DC304D5327B4887CD1F7DC2C38D5F684170097020C7C9758B973847"
|
||||
}
|
||||
},
|
||||
"validated_ledger_index" : 21184416
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
The response follows the [standard format][], with a successful result containing the following fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:------------------------|:--------|:-----------------------------------------|
|
||||
| `engine_result` | String | Text [result code](../../../protocol/transactions/transaction-results/transaction-results.md) indicating the preliminary result of the transaction, for example `tesSUCCESS` |
|
||||
| `engine_result_code` | Integer | Numeric version of the [result code](../../../protocol/transactions/transaction-results/transaction-results.md). **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](../../../../concepts/transactions/transaction-queue.md) 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](../../../../concepts/transactions/transaction-queue.md). |
|
||||
| `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](../../../../concepts/transactions/transaction-queue.md), 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](../../../../concepts/transactions/transaction-cost.md#open-ledger-cost) before processing this transaction. Transactions with a lower cost are likely to be [queued](../../../../concepts/transactions/transaction-queue.md). |
|
||||
| `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](../../../protocol/transactions/transaction-results/transaction-results.md) 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 the `rippled` server is [amendment blocked](../../../../concepts/networks-and-servers/amendments.md#amendment-blocked-servers).
|
||||
* `highFee` - The `fee_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](../../admin-api-methods/index.md), or you could [enable public signing](../../../../infrastructure/configuration/enable-public-signing.md).
|
||||
|
||||
{% raw-partial file="/_snippets/common-links.md" /%}
|
||||
@@ -0,0 +1,308 @@
|
||||
---
|
||||
html: submit_multisigned.html
|
||||
parent: transaction-methods.html
|
||||
seo:
|
||||
description: Send a multi-signed transaction to the network.
|
||||
labels:
|
||||
- Transaction Sending
|
||||
---
|
||||
# submit_multisigned
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/release/src/ripple/rpc/handlers/SubmitMultiSigned.cpp "Source")
|
||||
|
||||
The `submit_multisigned` command applies a [multi-signed](../../../../concepts/accounts/multi-signing.md) transaction and sends it to the network to be included in future ledgers. (You can also submit multi-signed transactions in binary form using the [`submit` command in submit-only mode](submit.md#submit-only-mode).)
|
||||
|
||||
This command requires the [MultiSign amendment][] to be enabled.
|
||||
|
||||
## Request Format
|
||||
An example of the request format:
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
```json
|
||||
{
|
||||
"id": "submit_multisigned_example",
|
||||
"command": "submit_multisigned",
|
||||
"tx_json": {
|
||||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||||
"Fee": "30000",
|
||||
"Flags": 262144,
|
||||
"LimitAmount": {
|
||||
"currency": "USD",
|
||||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"value": "100"
|
||||
},
|
||||
"Sequence": 2,
|
||||
"Signers": [{
|
||||
"Signer": {
|
||||
"Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||||
"SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF",
|
||||
"TxnSignature": "30450221009C195DBBF7967E223D8626CA19CF02073667F2B22E206727BFE848FF42BEAC8A022048C323B0BED19A988BDBEFA974B6DE8AA9DCAE250AA82BBD1221787032A864E5"
|
||||
}
|
||||
}, {
|
||||
"Signer": {
|
||||
"Account": "rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v",
|
||||
"SigningPubKey": "028FFB276505F9AC3F57E8D5242B386A597EF6C40A7999F37F1948636FD484E25B",
|
||||
"TxnSignature": "30440220680BBD745004E9CFB6B13A137F505FB92298AD309071D16C7B982825188FD1AE022004200B1F7E4A6A84BB0E4FC09E1E3BA2B66EBD32F0E6D121A34BA3B04AD99BC1"
|
||||
}
|
||||
}],
|
||||
"SigningPubKey": "",
|
||||
"TransactionType": "TrustSet",
|
||||
"hash": "BD636194C48FD7A100DE4C972336534C8E710FD008C0F3CF7BC5BF34DAF3C3E6"
|
||||
}
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
```json
|
||||
{
|
||||
"method": "submit_multisigned",
|
||||
"params": [
|
||||
{
|
||||
"tx_json": {
|
||||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||||
"Fee": "30000",
|
||||
"Flags": 262144,
|
||||
"LimitAmount": {
|
||||
"currency": "USD",
|
||||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"value": "0"
|
||||
},
|
||||
"Sequence": 4,
|
||||
"Signers": [
|
||||
{
|
||||
"Signer": {
|
||||
"Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||||
"SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF",
|
||||
"TxnSignature": "3045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B7"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Signer": {
|
||||
"Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
|
||||
"SigningPubKey": "03398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C1",
|
||||
"TxnSignature": "3045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D08"
|
||||
}
|
||||
}
|
||||
],
|
||||
"SigningPubKey": "",
|
||||
"TransactionType": "TrustSet",
|
||||
"hash": "81A477E2A362D171BB16BE17B4120D9F809A327FA00242ABCA867283BEA2F4F8"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
```sh
|
||||
#Syntax: submit_multisigned <tx_json>
|
||||
rippled submit_multisigned '{
|
||||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||||
"Fee": "30000",
|
||||
"Flags": 262144,
|
||||
"LimitAmount": {
|
||||
"currency": "USD",
|
||||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"value": "0"
|
||||
},
|
||||
"Sequence": 4,
|
||||
"Signers": [
|
||||
{
|
||||
"Signer": {
|
||||
"Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||||
"SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF",
|
||||
"TxnSignature": "3045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B7"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Signer": {
|
||||
"Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
|
||||
"SigningPubKey": "03398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C1",
|
||||
"TxnSignature": "3045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D08"
|
||||
}
|
||||
}
|
||||
],
|
||||
"SigningPubKey": "",
|
||||
"TransactionType": "TrustSet",
|
||||
"hash": "81A477E2A362D171BB16BE17B4120D9F809A327FA00242ABCA867283BEA2F4F8"
|
||||
}'
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
The request includes the following parameters:
|
||||
|
||||
| `Field` | Type | Required? | Description |
|
||||
|:------------|:--------|:----------|:-----------------------------------------------------|
|
||||
| `tx_json` | Object | Yes | [Transaction in JSON format](../../../protocol/transactions/index.md) with an array of `Signers`. To be successful, the weights of the signatures must be equal or higher than the quorum of the [SignerList](../../../protocol/ledger-data/ledger-entry-types/signerlist.md). |
|
||||
| `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`. |
|
||||
|
||||
## Response Format
|
||||
|
||||
An example of a successful response:
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
```json
|
||||
{
|
||||
"id": "submit_multisigned_example",
|
||||
"status": "success",
|
||||
"type": "response",
|
||||
"result": {
|
||||
"engine_result": "tesSUCCESS",
|
||||
"engine_result_code": 0,
|
||||
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
||||
"tx_blob": "1200142200040000240000000263D5038D7EA4C680000000000000000000000000005553440000000000B5F762798A53D543A014CAF8B297CFF8F2F937E868400000000000753073008114A3780F5CB5A44D366520FC44055E8ED44D9A2270F3E010732102B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF744730450221009C195DBBF7967E223D8626CA19CF02073667F2B22E206727BFE848FF42BEAC8A022048C323B0BED19A988BDBEFA974B6DE8AA9DCAE250AA82BBD1221787032A864E58114204288D2E47F8EF6C99BCC457966320D12409711E1E0107321028FFB276505F9AC3F57E8D5242B386A597EF6C40A7999F37F1948636FD484E25B744630440220680BBD745004E9CFB6B13A137F505FB92298AD309071D16C7B982825188FD1AE022004200B1F7E4A6A84BB0E4FC09E1E3BA2B66EBD32F0E6D121A34BA3B04AD99BC181147908A7F0EDD48EA896C3580A399F0EE78611C8E3E1F1",
|
||||
"tx_json": {
|
||||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||||
"Fee": "30000",
|
||||
"Flags": 262144,
|
||||
"LimitAmount": {
|
||||
"currency": "USD",
|
||||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"value": "100"
|
||||
},
|
||||
"Sequence": 2,
|
||||
"Signers": [
|
||||
{
|
||||
"Signer": {
|
||||
"Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||||
"SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF",
|
||||
"TxnSignature": "30450221009C195DBBF7967E223D8626CA19CF02073667F2B22E206727BFE848FF42BEAC8A022048C323B0BED19A988BDBEFA974B6DE8AA9DCAE250AA82BBD1221787032A864E5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Signer": {
|
||||
"Account": "rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v",
|
||||
"SigningPubKey": "028FFB276505F9AC3F57E8D5242B386A597EF6C40A7999F37F1948636FD484E25B",
|
||||
"TxnSignature": "30440220680BBD745004E9CFB6B13A137F505FB92298AD309071D16C7B982825188FD1AE022004200B1F7E4A6A84BB0E4FC09E1E3BA2B66EBD32F0E6D121A34BA3B04AD99BC1"
|
||||
}
|
||||
}
|
||||
],
|
||||
"SigningPubKey": "",
|
||||
"TransactionType": "TrustSet",
|
||||
"hash": "BD636194C48FD7A100DE4C972336534C8E710FD008C0F3CF7BC5BF34DAF3C3E6"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result": {
|
||||
"engine_result": "tesSUCCESS",
|
||||
"engine_result_code": 0,
|
||||
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
||||
"status": "success",
|
||||
"tx_blob": "120014220004000024000000046380000000000000000000000000000000000000005553440000000000B5F762798A53D543A014CAF8B297CFF8F2F937E868400000000000753073008114A3780F5CB5A44D366520FC44055E8ED44D9A2270F3E010732102B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF74473045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B78114204288D2E47F8EF6C99BCC457966320D12409711E1E010732103398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C174473045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D0881143A4C02EA95AD6AC3BED92FA036E0BBFB712C030CE1F1",
|
||||
"tx_json": {
|
||||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||||
"Fee": "30000",
|
||||
"Flags": 262144,
|
||||
"LimitAmount": {
|
||||
"currency": "USD",
|
||||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"value": "0"
|
||||
},
|
||||
"Sequence": 4,
|
||||
"Signers": [
|
||||
{
|
||||
"Signer": {
|
||||
"Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||||
"SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF",
|
||||
"TxnSignature": "3045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B7"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Signer": {
|
||||
"Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
|
||||
"SigningPubKey": "03398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C1",
|
||||
"TxnSignature": "3045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D08"
|
||||
}
|
||||
}
|
||||
],
|
||||
"SigningPubKey": "",
|
||||
"TransactionType": "TrustSet",
|
||||
"hash": "81A477E2A362D171BB16BE17B4120D9F809A327FA00242ABCA867283BEA2F4F8"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
```
|
||||
Loading: "/etc/rippled.cfg"
|
||||
Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result": {
|
||||
"engine_result": "tesSUCCESS",
|
||||
"engine_result_code": 0,
|
||||
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
||||
"status": "success",
|
||||
"tx_blob": "120014220004000024000000046380000000000000000000000000000000000000005553440000000000B5F762798A53D543A014CAF8B297CFF8F2F937E868400000000000753073008114A3780F5CB5A44D366520FC44055E8ED44D9A2270F3E010732102B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF74473045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B78114204288D2E47F8EF6C99BCC457966320D12409711E1E010732103398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C174473045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D0881143A4C02EA95AD6AC3BED92FA036E0BBFB712C030CE1F1",
|
||||
"tx_json": {
|
||||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||||
"Fee": "30000",
|
||||
"Flags": 262144,
|
||||
"LimitAmount": {
|
||||
"currency": "USD",
|
||||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"value": "0"
|
||||
},
|
||||
"Sequence": 4,
|
||||
"Signers": [
|
||||
{
|
||||
"Signer": {
|
||||
"Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||||
"SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF",
|
||||
"TxnSignature": "3045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B7"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Signer": {
|
||||
"Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
|
||||
"SigningPubKey": "03398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C1",
|
||||
"TxnSignature": "3045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D08"
|
||||
}
|
||||
}
|
||||
],
|
||||
"SigningPubKey": "",
|
||||
"TransactionType": "TrustSet",
|
||||
"hash": "81A477E2A362D171BB16BE17B4120D9F809A327FA00242ABCA867283BEA2F4F8"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
The response follows the [standard format][], with a successful result containing the following fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:------------------------|:--------|:-----------------------------------------|
|
||||
| `engine_result` | String | Code indicating the preliminary result of the transaction, for example `tesSUCCESS` |
|
||||
| `engine_result_code` | Integer | Numeric code indicating the preliminary result of the transaction, directly correlated to `engine_result` |
|
||||
| `engine_result_message` | String | Human-readable explanation of the preliminary transaction result |
|
||||
| `tx_blob` | String | The complete [transaction](../../../protocol/transactions/index.md) in hex string format |
|
||||
| `tx_json` | Object | The complete [transaction](../../../protocol/transactions/index.md) in JSON format |
|
||||
|
||||
## Possible Errors
|
||||
|
||||
* Any of the [universal error types][].
|
||||
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
|
||||
* `srcActMalformed` - The `Account` field from the `tx_json` was invalid or missing.
|
||||
* `internal` - An internal error occurred. This includes the case where a signature is not valid for the transaction JSON provided.
|
||||
|
||||
{% raw-partial file="/_snippets/common-links.md" /%}
|
||||
@@ -0,0 +1,468 @@
|
||||
---
|
||||
html: transaction_entry.html
|
||||
parent: transaction-methods.html
|
||||
seo:
|
||||
description: Retrieve info about a transaction from a particular ledger version.
|
||||
labels:
|
||||
- Transaction Sending
|
||||
---
|
||||
# transaction_entry
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/rpc/handlers/TransactionEntry.cpp "Source")
|
||||
|
||||
The `transaction_entry` method retrieves information on a single transaction from a specific ledger version. (The [tx method][], by contrast, searches all ledgers for the specified transaction. We recommend using that method instead.)
|
||||
|
||||
## Request Format
|
||||
|
||||
An example of the request format:
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
```json
|
||||
{
|
||||
"id": 4,
|
||||
"command": "transaction_entry",
|
||||
"tx_hash": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9",
|
||||
"ledger_index": 56865245
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
```json
|
||||
{
|
||||
"method": "transaction_entry",
|
||||
"params": [
|
||||
{
|
||||
"tx_hash": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9",
|
||||
"ledger_index": 56865245
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
```sh
|
||||
#Syntax: transaction_entry transaction_hash ledger_index|ledger_hash
|
||||
rippled transaction_entry C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9 56865245
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
[Try it! >](/resources/dev-tools/websocket-api-tool#transaction_entry)
|
||||
|
||||
The request includes the following parameters:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------------|:---------------------------|:-------------------------------|
|
||||
| `ledger_hash` | String | _(Optional)_ A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
|
||||
| `ledger_index` | String or Unsigned Integer | _(Optional)_ The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
|
||||
| `tx_hash` | String | Unique hash of the transaction you are looking up |
|
||||
|
||||
**Note:** This method does not support retrieving information from the current in-progress ledger. You must specify a ledger version in either `ledger_index` or `ledger_hash`.
|
||||
|
||||
## Response Format
|
||||
|
||||
An example of a successful response:
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
```json
|
||||
{
|
||||
"id": 4,
|
||||
"result": {
|
||||
"ledger_hash": "793E56131D8D4ABFB27FA383BFC44F2978B046E023FF46C588D7E0C874C2472A",
|
||||
"ledger_index": 56865245,
|
||||
"metadata": {
|
||||
"AffectedNodes": [
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"ExchangeRate": "4F04C66806CF7400",
|
||||
"Flags": 0,
|
||||
"RootIndex": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400",
|
||||
"TakerGetsCurrency": "0000000000000000000000000000000000000000",
|
||||
"TakerGetsIssuer": "0000000000000000000000000000000000000000",
|
||||
"TakerPaysCurrency": "000000000000000000000000434E590000000000",
|
||||
"TakerPaysIssuer": "CED6E99370D5C00EF4EBF72567DA99F5661BFB3A"
|
||||
},
|
||||
"LedgerEntryType": "DirectoryNode",
|
||||
"LedgerIndex": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"Balance": "10404767991",
|
||||
"Flags": 0,
|
||||
"OwnerCount": 3,
|
||||
"Sequence": 5037711
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "1DECD9844E95FFBA273F1B94BA0BF2564DDF69F2804497A6D7837B52050174A2",
|
||||
"PreviousFields": {
|
||||
"Balance": "10404768003",
|
||||
"Sequence": 5037710
|
||||
},
|
||||
"PreviousTxnID": "4DC47B246B5EB9CCE92ABA8C482479E3BF1F946CABBEF74CA4DE36521D5F9008",
|
||||
"PreviousTxnLgrSeq": 56865244
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"BookDirectory": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "8F5FF57B404827F12BDA7561876A13C3E3B3095CBF75334DBFB5F227391A660C",
|
||||
"PreviousTxnLgrSeq": 56865244,
|
||||
"Sequence": 5037708,
|
||||
"TakerGets": "15000000000",
|
||||
"TakerPays": {
|
||||
"currency": "CNY",
|
||||
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||||
"value": "20160.75"
|
||||
}
|
||||
},
|
||||
"LedgerEntryType": "Offer",
|
||||
"LedgerIndex": "26AAE6CA8D29E28A47C92ADF22D5D96A0216F0551E16936856DDC8CB1AAEE93B"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Flags": 0,
|
||||
"IndexNext": "0000000000000000",
|
||||
"IndexPrevious": "0000000000000000",
|
||||
"Owner": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"RootIndex": "47FAF5D102D8CE655574F440CDB97AC67C5A11068BB3759E87C2B9745EE94548"
|
||||
},
|
||||
"LedgerEntryType": "DirectoryNode",
|
||||
"LedgerIndex": "47FAF5D102D8CE655574F440CDB97AC67C5A11068BB3759E87C2B9745EE94548"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CreatedNode": {
|
||||
"LedgerEntryType": "Offer",
|
||||
"LedgerIndex": "8BAEE3C7DE04A568E96007420FA11ABD0BC9AE44D35932BB5640E9C3FB46BC9B",
|
||||
"NewFields": {
|
||||
"Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"BookDirectory": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400",
|
||||
"Sequence": 5037710,
|
||||
"TakerGets": "15000000000",
|
||||
"TakerPays": {
|
||||
"currency": "CNY",
|
||||
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||||
"value": "20160.75"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex": 0,
|
||||
"TransactionResult": "tesSUCCESS"
|
||||
},
|
||||
"tx_json": {
|
||||
"Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"Fee": "12",
|
||||
"Flags": 0,
|
||||
"LastLedgerSequence": 56865248,
|
||||
"OfferSequence": 5037708,
|
||||
"Sequence": 5037710,
|
||||
"SigningPubKey": "03B51A3EDF70E4098DA7FB053A01C5A6A0A163A30ED1445F14F87C7C3295FCB3BE",
|
||||
"TakerGets": "15000000000",
|
||||
"TakerPays": {
|
||||
"currency": "CNY",
|
||||
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||||
"value": "20160.75"
|
||||
},
|
||||
"TransactionType": "OfferCreate",
|
||||
"TxnSignature": "3045022100A5023A0E64923616FCDB6D664F569644C7C9D1895772F986CD6B981B515B02A00220530C973E9A8395BC6FE2484948D2751F6B030FC7FB8575D1BFB406368AD554D9",
|
||||
"hash": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9"
|
||||
},
|
||||
"validated": true
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
```json
|
||||
{
|
||||
"result": {
|
||||
"ledger_hash": "793E56131D8D4ABFB27FA383BFC44F2978B046E023FF46C588D7E0C874C2472A",
|
||||
"ledger_index": 56865245,
|
||||
"metadata": {
|
||||
"AffectedNodes": [
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"ExchangeRate": "4F04C66806CF7400",
|
||||
"Flags": 0,
|
||||
"RootIndex": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400",
|
||||
"TakerGetsCurrency": "0000000000000000000000000000000000000000",
|
||||
"TakerGetsIssuer": "0000000000000000000000000000000000000000",
|
||||
"TakerPaysCurrency": "000000000000000000000000434E590000000000",
|
||||
"TakerPaysIssuer": "CED6E99370D5C00EF4EBF72567DA99F5661BFB3A"
|
||||
},
|
||||
"LedgerEntryType": "DirectoryNode",
|
||||
"LedgerIndex": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"Balance": "10404767991",
|
||||
"Flags": 0,
|
||||
"OwnerCount": 3,
|
||||
"Sequence": 5037711
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "1DECD9844E95FFBA273F1B94BA0BF2564DDF69F2804497A6D7837B52050174A2",
|
||||
"PreviousFields": {
|
||||
"Balance": "10404768003",
|
||||
"Sequence": 5037710
|
||||
},
|
||||
"PreviousTxnID": "4DC47B246B5EB9CCE92ABA8C482479E3BF1F946CABBEF74CA4DE36521D5F9008",
|
||||
"PreviousTxnLgrSeq": 56865244
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"BookDirectory": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "8F5FF57B404827F12BDA7561876A13C3E3B3095CBF75334DBFB5F227391A660C",
|
||||
"PreviousTxnLgrSeq": 56865244,
|
||||
"Sequence": 5037708,
|
||||
"TakerGets": "15000000000",
|
||||
"TakerPays": {
|
||||
"currency": "CNY",
|
||||
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||||
"value": "20160.75"
|
||||
}
|
||||
},
|
||||
"LedgerEntryType": "Offer",
|
||||
"LedgerIndex": "26AAE6CA8D29E28A47C92ADF22D5D96A0216F0551E16936856DDC8CB1AAEE93B"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Flags": 0,
|
||||
"IndexNext": "0000000000000000",
|
||||
"IndexPrevious": "0000000000000000",
|
||||
"Owner": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"RootIndex": "47FAF5D102D8CE655574F440CDB97AC67C5A11068BB3759E87C2B9745EE94548"
|
||||
},
|
||||
"LedgerEntryType": "DirectoryNode",
|
||||
"LedgerIndex": "47FAF5D102D8CE655574F440CDB97AC67C5A11068BB3759E87C2B9745EE94548"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CreatedNode": {
|
||||
"LedgerEntryType": "Offer",
|
||||
"LedgerIndex": "8BAEE3C7DE04A568E96007420FA11ABD0BC9AE44D35932BB5640E9C3FB46BC9B",
|
||||
"NewFields": {
|
||||
"Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"BookDirectory": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400",
|
||||
"Sequence": 5037710,
|
||||
"TakerGets": "15000000000",
|
||||
"TakerPays": {
|
||||
"currency": "CNY",
|
||||
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||||
"value": "20160.75"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex": 0,
|
||||
"TransactionResult": "tesSUCCESS"
|
||||
},
|
||||
"status": "success",
|
||||
"tx_json": {
|
||||
"Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"Fee": "12",
|
||||
"Flags": 0,
|
||||
"LastLedgerSequence": 56865248,
|
||||
"OfferSequence": 5037708,
|
||||
"Sequence": 5037710,
|
||||
"SigningPubKey": "03B51A3EDF70E4098DA7FB053A01C5A6A0A163A30ED1445F14F87C7C3295FCB3BE",
|
||||
"TakerGets": "15000000000",
|
||||
"TakerPays": {
|
||||
"currency": "CNY",
|
||||
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||||
"value": "20160.75"
|
||||
},
|
||||
"TransactionType": "OfferCreate",
|
||||
"TxnSignature": "3045022100A5023A0E64923616FCDB6D664F569644C7C9D1895772F986CD6B981B515B02A00220530C973E9A8395BC6FE2484948D2751F6B030FC7FB8575D1BFB406368AD554D9",
|
||||
"hash": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9"
|
||||
},
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
```json
|
||||
{
|
||||
"result" : {
|
||||
"ledger_hash" : "793E56131D8D4ABFB27FA383BFC44F2978B046E023FF46C588D7E0C874C2472A",
|
||||
"ledger_index" : 56865245,
|
||||
"metadata" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"ExchangeRate" : "4F04C66806CF7400",
|
||||
"Flags" : 0,
|
||||
"RootIndex" : "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400",
|
||||
"TakerGetsCurrency" : "0000000000000000000000000000000000000000",
|
||||
"TakerGetsIssuer" : "0000000000000000000000000000000000000000",
|
||||
"TakerPaysCurrency" : "000000000000000000000000434E590000000000",
|
||||
"TakerPaysIssuer" : "CED6E99370D5C00EF4EBF72567DA99F5661BFB3A"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"Balance" : "10404767991",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 3,
|
||||
"Sequence" : 5037711
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "1DECD9844E95FFBA273F1B94BA0BF2564DDF69F2804497A6D7837B52050174A2",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "10404768003",
|
||||
"Sequence" : 5037710
|
||||
},
|
||||
"PreviousTxnID" : "4DC47B246B5EB9CCE92ABA8C482479E3BF1F946CABBEF74CA4DE36521D5F9008",
|
||||
"PreviousTxnLgrSeq" : 56865244
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"BookDirectory" : "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400",
|
||||
"BookNode" : "0000000000000000",
|
||||
"Flags" : 0,
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "8F5FF57B404827F12BDA7561876A13C3E3B3095CBF75334DBFB5F227391A660C",
|
||||
"PreviousTxnLgrSeq" : 56865244,
|
||||
"Sequence" : 5037708,
|
||||
"TakerGets" : "15000000000",
|
||||
"TakerPays" : {
|
||||
"currency" : "CNY",
|
||||
"issuer" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||||
"value" : "20160.75"
|
||||
}
|
||||
},
|
||||
"LedgerEntryType" : "Offer",
|
||||
"LedgerIndex" : "26AAE6CA8D29E28A47C92ADF22D5D96A0216F0551E16936856DDC8CB1AAEE93B"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"IndexNext" : "0000000000000000",
|
||||
"IndexPrevious" : "0000000000000000",
|
||||
"Owner" : "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"RootIndex" : "47FAF5D102D8CE655574F440CDB97AC67C5A11068BB3759E87C2B9745EE94548"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "47FAF5D102D8CE655574F440CDB97AC67C5A11068BB3759E87C2B9745EE94548"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CreatedNode" : {
|
||||
"LedgerEntryType" : "Offer",
|
||||
"LedgerIndex" : "8BAEE3C7DE04A568E96007420FA11ABD0BC9AE44D35932BB5640E9C3FB46BC9B",
|
||||
"NewFields" : {
|
||||
"Account" : "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"BookDirectory" : "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400",
|
||||
"Sequence" : 5037710,
|
||||
"TakerGets" : "15000000000",
|
||||
"TakerPays" : {
|
||||
"currency" : "CNY",
|
||||
"issuer" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||||
"value" : "20160.75"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 0,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"tx_json" : {
|
||||
"Account" : "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"Fee" : "12",
|
||||
"Flags" : 0,
|
||||
"LastLedgerSequence" : 56865248,
|
||||
"OfferSequence" : 5037708,
|
||||
"Sequence" : 5037710,
|
||||
"SigningPubKey" : "03B51A3EDF70E4098DA7FB053A01C5A6A0A163A30ED1445F14F87C7C3295FCB3BE",
|
||||
"TakerGets" : "15000000000",
|
||||
"TakerPays" : {
|
||||
"currency" : "CNY",
|
||||
"issuer" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||||
"value" : "20160.75"
|
||||
},
|
||||
"TransactionType" : "OfferCreate",
|
||||
"TxnSignature" : "3045022100A5023A0E64923616FCDB6D664F569644C7C9D1895772F986CD6B981B515B02A00220530C973E9A8395BC6FE2484948D2751F6B030FC7FB8575D1BFB406368AD554D9",
|
||||
"hash" : "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9"
|
||||
},
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
The response follows the [standard format][], with a successful result containing the following fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------------|:--------------------------|:--------------------------------|
|
||||
| `ledger_index` | Number - [Ledger Index][] | The ledger index of the ledger version the transaction was found in; this is the same as the one from the request. |
|
||||
| `ledger_hash` | String - [Hash][] | _(May be omitted)_ The identifying hash of the ledger version the transaction was found in; this is the same as the one from the request. |
|
||||
| `metadata` | Object | The [transaction metadata](../../../protocol/transactions/metadata.md), which shows the exact results of the transaction in detail. |
|
||||
| `tx_json` | Object | JSON representation of the [Transaction object](../../../protocol/transactions/index.md) |
|
||||
|
||||
There are a couple possible reasons the server may fail to find the transaction:
|
||||
|
||||
* The transaction does not exist
|
||||
* The transaction exists, but not in the specified ledger version
|
||||
* The server does not have the specified ledger version available. Another server that has the correct version on hand may have a different response.
|
||||
|
||||
## Possible Errors
|
||||
|
||||
* Any of the [universal error types][].
|
||||
* `fieldNotFoundTransaction` - The `tx_hash` field was omitted from the request
|
||||
* `notYetImplemented` - A ledger version was not specified in the request.
|
||||
* `lgrNotFound` - The ledger specified by the `ledger_hash` or `ledger_index` does not exist, or it does exist but the server does not have it.
|
||||
* `transactionNotFound` - The transaction specified in the request could not be found in the specified ledger. (It might be in a different ledger version, or it might not be available at all.)
|
||||
|
||||
{% raw-partial file="/_snippets/common-links.md" /%}
|
||||
@@ -0,0 +1,331 @@
|
||||
---
|
||||
html: tx.html
|
||||
parent: transaction-methods.html
|
||||
seo:
|
||||
description: Retrieve info about a transaction from all the ledgers on hand.
|
||||
labels:
|
||||
- Transaction Sending
|
||||
- Payments
|
||||
---
|
||||
# tx
|
||||
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/rpc/handlers/Tx.cpp "Source")
|
||||
|
||||
The `tx` method retrieves information on a single [transaction](../../../protocol/transactions/index.md), by its [identifying hash][] or its [CTID](../../api-conventions/ctid.md).
|
||||
|
||||
## Request Format
|
||||
|
||||
An example of the request format:
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="WebSocket (Hash)" %}
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"command": "tx",
|
||||
"transaction": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9",
|
||||
"binary": false
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket (CTID)" %}
|
||||
```json
|
||||
{
|
||||
"id": "CTID example",
|
||||
"command": "tx",
|
||||
"ctid": "C005523E00000000",
|
||||
"binary": false
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC (Hash)" %}
|
||||
```json
|
||||
{
|
||||
"method": "tx",
|
||||
"params": [
|
||||
{
|
||||
"transaction": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9",
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC (CTID)" %}
|
||||
```json
|
||||
{
|
||||
"method": "tx",
|
||||
"params": [
|
||||
{
|
||||
"ctid": "C005523E00000000",
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
```sh
|
||||
#Syntax: tx transaction [binary]
|
||||
rippled tx C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9 false
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
[Try it! >](/resources/dev-tools/websocket-api-tool#tx)
|
||||
|
||||
The request includes the following parameters:
|
||||
|
||||
| Field | Type | Required? | Description |
|
||||
|:--------------|:--------|:----------|----------------------------------------|
|
||||
| `ctid` | String | No | The [compact transaction identifier](../../api-conventions/ctid.md) of the transaction to look up. Must use uppercase hexadecimal only. {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.12.0" %}New in: rippled 1.12.0{% /badge %} _(Not supported in Clio v2.0 and earlier)_ |
|
||||
| `transaction` | String | No | The 256-bit hash of the transaction to look up, as hexadecimal. |
|
||||
| `binary` | Boolean | No | If `true`, return transaction data and metadata as binary [serialized](../../../protocol/binary-format.md) to hexadecimal strings. If `false`, return transaction data and metadata as JSON. The default is `false`. |
|
||||
| `min_ledger` | Number | No | Use this with `max_ledger` to specify a range of up to 1000 [ledger indexes][ledger index], starting with this ledger (inclusive). If the server [cannot find the transaction](#not-found-response), it confirms whether it was able to search all the ledgers in this range. |
|
||||
| `max_ledger` | Number | No | Use this with `min_ledger` to specify a range of up to 1000 [ledger indexes][ledger index], ending with this ledger (inclusive). If the server [cannot find the transaction](#not-found-response), it confirms whether it was able to search all the ledgers in the requested range. |
|
||||
|
||||
You must provide _either_ `ctid` or `transaction`, but not both.
|
||||
|
||||
**Caution:** This command may successfully find the transaction even if it is included in a ledger _outside_ the range of `min_ledger` to `max_ledger`.
|
||||
|
||||
## Response Format
|
||||
|
||||
An example of a successful response:
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="WebSocket (Hash)" %}
|
||||
{% code-snippet file="/_api-examples/tx/ws-response-hash.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket (CTID)" %}
|
||||
{% code-snippet file="/_api-examples/tx/ws-response-ctid.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC (Hash)" %}
|
||||
{% code-snippet file="/_api-examples/tx/jsonrpc-response-hash.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC (CTID)" %}
|
||||
{% code-snippet file="/_api-examples/tx/jsonrpc-response-ctid.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
```json
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"Fee" : "12",
|
||||
"Flags" : 0,
|
||||
"LastLedgerSequence" : 56865248,
|
||||
"OfferSequence" : 5037708,
|
||||
"Sequence" : 5037710,
|
||||
"SigningPubKey" : "03B51A3EDF70E4098DA7FB053A01C5A6A0A163A30ED1445F14F87C7C3295FCB3BE",
|
||||
"TakerGets" : "15000000000",
|
||||
"TakerPays" : {
|
||||
"currency" : "CNY",
|
||||
"issuer" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||||
"value" : "20160.75"
|
||||
},
|
||||
"TransactionType" : "OfferCreate",
|
||||
"TxnSignature" : "3045022100A5023A0E64923616FCDB6D664F569644C7C9D1895772F986CD6B981B515B02A00220530C973E9A8395BC6FE2484948D2751F6B030FC7FB8575D1BFB406368AD554D9",
|
||||
"date" : 648248020,
|
||||
"hash" : "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9",
|
||||
"inLedger" : 56865245,
|
||||
"ledger_index" : 56865245,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"ExchangeRate" : "4F04C66806CF7400",
|
||||
"Flags" : 0,
|
||||
"RootIndex" : "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400",
|
||||
"TakerGetsCurrency" : "0000000000000000000000000000000000000000",
|
||||
"TakerGetsIssuer" : "0000000000000000000000000000000000000000",
|
||||
"TakerPaysCurrency" : "000000000000000000000000434E590000000000",
|
||||
"TakerPaysIssuer" : "CED6E99370D5C00EF4EBF72567DA99F5661BFB3A"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"Balance" : "10404767991",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 3,
|
||||
"Sequence" : 5037711
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "1DECD9844E95FFBA273F1B94BA0BF2564DDF69F2804497A6D7837B52050174A2",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "10404768003",
|
||||
"Sequence" : 5037710
|
||||
},
|
||||
"PreviousTxnID" : "4DC47B246B5EB9CCE92ABA8C482479E3BF1F946CABBEF74CA4DE36521D5F9008",
|
||||
"PreviousTxnLgrSeq" : 56865244
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"BookDirectory" : "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400",
|
||||
"BookNode" : "0000000000000000",
|
||||
"Flags" : 0,
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "8F5FF57B404827F12BDA7561876A13C3E3B3095CBF75334DBFB5F227391A660C",
|
||||
"PreviousTxnLgrSeq" : 56865244,
|
||||
"Sequence" : 5037708,
|
||||
"TakerGets" : "15000000000",
|
||||
"TakerPays" : {
|
||||
"currency" : "CNY",
|
||||
"issuer" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||||
"value" : "20160.75"
|
||||
}
|
||||
},
|
||||
"LedgerEntryType" : "Offer",
|
||||
"LedgerIndex" : "26AAE6CA8D29E28A47C92ADF22D5D96A0216F0551E16936856DDC8CB1AAEE93B"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"IndexNext" : "0000000000000000",
|
||||
"IndexPrevious" : "0000000000000000",
|
||||
"Owner" : "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"RootIndex" : "47FAF5D102D8CE655574F440CDB97AC67C5A11068BB3759E87C2B9745EE94548"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "47FAF5D102D8CE655574F440CDB97AC67C5A11068BB3759E87C2B9745EE94548"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CreatedNode" : {
|
||||
"LedgerEntryType" : "Offer",
|
||||
"LedgerIndex" : "8BAEE3C7DE04A568E96007420FA11ABD0BC9AE44D35932BB5640E9C3FB46BC9B",
|
||||
"NewFields" : {
|
||||
"Account" : "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM",
|
||||
"BookDirectory" : "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400",
|
||||
"Sequence" : 5037710,
|
||||
"TakerGets" : "15000000000",
|
||||
"TakerPays" : {
|
||||
"currency" : "CNY",
|
||||
"issuer" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||||
"value" : "20160.75"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 0,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
The response follows the [standard format][], with a successful result containing the fields of the [Transaction object](../../../protocol/transactions/index.md) as well as the following additional fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------------|:---------------------------------|:-------------------------|
|
||||
| `ctid` | String | The transaction's [compact transaction identifier](../../api-conventions/ctid.md). {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.12.0" %}New in: rippled 1.12.0{% /badge %} _(Not supported in Clio v2.0 and earlier.)_ |
|
||||
| `date` | Number | The [close time](../../../../concepts/ledgers/ledger-close-times.md) of the ledger in which the transaction was applied, in [seconds since the Ripple Epoch][]. |
|
||||
| `hash` | String | The unique [identifying hash][] of the transaction |
|
||||
| `inLedger` | Number | _(Deprecated)_ Alias for `ledger_index`. |
|
||||
| `ledger_index` | Number | The [ledger index][] of the ledger that includes this transaction. |
|
||||
| `meta` | Object (JSON) or String (binary) | [Transaction metadata](../../../protocol/transactions/metadata.md), which describes the results of the transaction. |
|
||||
| `validated` | Boolean | If `true`, this data comes from a validated ledger version; if omitted or set to `false`, this data is not final. |
|
||||
| (Various) | (Various) | Other fields from the [Transaction object](../../../protocol/transactions/index.md) |
|
||||
|
||||
|
||||
### Not Found Response
|
||||
|
||||
If the server does not find the transaction, it returns a `txnNotFound` error, which could mean two things:
|
||||
|
||||
- The transaction has not been included in any ledger version, and has not been executed.
|
||||
- The transaction was included in a ledger version that the server does not have available.
|
||||
|
||||
This means that a `txnNotFound` on its own is not enough to know the [final outcome of a transaction](../../../../concepts/transactions/finality-of-results/index.md).
|
||||
|
||||
To further narrow down the possibilities, you can provide a range of ledgers to search using the `min_ledger` and `max_ledger` fields in the request. If you provide **both** of those fields, the `txnNotFound` response includes the following field:
|
||||
|
||||
| Field | Type | Description |
|
||||
|:---------------|:----------|:-----------------------------------------|
|
||||
| `searched_all` | Boolean | _(Omitted unless the request provided `min_ledger` and `max_ledger`)_ If `true`, the server was able to search all of the specified ledger versions, and the transaction was in none of them. If `false`, the server did not have all of the specified ledger versions available, so it is not sure if one of them might contain the transaction. |
|
||||
|
||||
An example of a `txnNotFound` response that fully searched a requested range of ledgers:
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
```json
|
||||
{
|
||||
"error": "txnNotFound",
|
||||
"error_code": 29,
|
||||
"error_message": "Transaction not found.",
|
||||
"id": 1,
|
||||
"request": {
|
||||
"binary": false,
|
||||
"command": "tx",
|
||||
"id": 1,
|
||||
"max_ledger": 54368673,
|
||||
"min_ledger": 54368573,
|
||||
"transaction": "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7"
|
||||
},
|
||||
"searched_all": true,
|
||||
"status": "error",
|
||||
"type": "response"
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result": {
|
||||
"error": "txnNotFound",
|
||||
"error_code": 29,
|
||||
"error_message": "Transaction not found.",
|
||||
"request": {
|
||||
"binary": false,
|
||||
"command": "tx",
|
||||
"max_ledger": 54368673,
|
||||
"min_ledger": 54368573,
|
||||
"transaction": "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7"
|
||||
},
|
||||
"searched_all": true,
|
||||
"status": "error"
|
||||
}
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## Possible Errors
|
||||
|
||||
* Any of the [universal error types][].
|
||||
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
|
||||
* `txnNotFound` - Either the transaction does not exist, or it was part of an ledger version that `rippled` does not have available.
|
||||
* `excessiveLgrRange` - The `min_ledger` and `max_ledger` fields of the request are more than 1000 apart.
|
||||
* `invalidLgrRange` - The specified `min_ledger` is larger than the `max_ledger`, or one of those parameters is not a valid ledger index.
|
||||
|
||||
{% raw-partial file="/_snippets/common-links.md" /%}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user