Re-level non-docs content to top of repo and rename content→docs

This commit is contained in:
mDuo13
2024-01-31 16:24:01 -08:00
parent f841ef173c
commit c10beb85c2
2907 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,194 @@
---
html: account_channels.html
parent: account-methods.html
seo:
description: Get a list of payment channels where the account is the source of the channel.
labels:
- Payment Channels
---
# account_channels
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/rpc/handlers/AccountChannels.cpp "Source")
_(Added by the [PayChan amendment][].)_
The `account_channels` method returns information about an account's Payment Channels. This includes only channels where the specified account is the channel's source, not the destination. (A channel's "source" and "owner" are the same.) All information retrieved is relative to a particular version of the ledger.
## Request Format
An example of the request format:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 1,
"command": "account_channels",
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
"ledger_index": "validated"
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
{
"method": "account_channels",
"params": [{
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
"ledger_index": "validated"
}]
}
```
{% /tab %}
{% tab label="Commandline" %}
```bash
#Syntax: account_channels <account> [<destination_account>] [<ledger>]
rippled account_channels rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn ra5nK24KXen9AHvsdFTKHSANinZseWnPcX validated
```
{% /tab %}
{% /tabs %}
The request includes the following parameters:
| Field | Type | Required? | Description |
|:----------------------|:---------------------|:----------|-------------|
| `account` | String - [Address][] | Yes | Look up channels where this account is the channel's owner/source. |
| `destination_account` | String - [Address][] | No | A second account; if provided, filter results to payment channels whose destination is this account. |
| `ledger_hash` | String | No | A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
| `ledger_index` | Number or String | No | The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
| `limit` | Number | No | Limit the number of transactions to retrieve. Cannot be less than 10 or more than 400. Positive values outside this range are replaced with the closest valid option. The default is 200. |
| `marker` | [Marker][] | No | Value from a previous paginated response. Resume retrieving data where that response left off. |
## Response Format
An example of a successful response:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 1,
"result": {
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"channels": [
{
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"amount": "1000",
"balance": "0",
"channel_id": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7",
"destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
"public_key": "aBR7mdD75Ycs8DRhMgQ4EMUEmBArF8SEh1hfjrT2V9DQTLNbJVqw",
"public_key_hex": "03CFD18E689434F032A4E84C63E2A3A6472D684EAF4FD52CA67742F3E24BAE81B2",
"settle_delay": 60
}
],
"ledger_hash": "1EDBBA3C793863366DF5B31C2174B6B5E6DF6DB89A7212B86838489148E2A581",
"ledger_index": 71766314,
"validated": true
},
"status": "success",
"type": "response"
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
200 OK
{
"result": {
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"channels": [
{
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"amount": "1000",
"balance": "0",
"channel_id": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7",
"destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
"public_key": "aBR7mdD75Ycs8DRhMgQ4EMUEmBArF8SEh1hfjrT2V9DQTLNbJVqw",
"public_key_hex": "03CFD18E689434F032A4E84C63E2A3A6472D684EAF4FD52CA67742F3E24BAE81B2",
"settle_delay": 60
}
],
"ledger_hash": "27F530E5C93ED5C13994812787C1ED073C822BAEC7597964608F2C049C2ACD2D",
"ledger_index": 71766343,
"status": "success",
"validated": true
}
}
```
{% /tab %}
{% tab label="Commandline" %}
```json
200 OK
{
"result": {
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"channels": [
{
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"amount": "1000",
"balance": "0",
"channel_id": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7",
"destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
"public_key": "aBR7mdD75Ycs8DRhMgQ4EMUEmBArF8SEh1hfjrT2V9DQTLNbJVqw",
"public_key_hex": "03CFD18E689434F032A4E84C63E2A3A6472D684EAF4FD52CA67742F3E24BAE81B2",
"settle_delay": 60
}
],
"ledger_hash": "27F530E5C93ED5C13994812787C1ED073C822BAEC7597964608F2C049C2ACD2D",
"ledger_index": 71766343,
"status": "success",
"validated": true
}
}
```
{% /tab %}
{% /tabs %}
The response follows the [standard format][], with a successful result containing the following fields:
| Field | Type | Description |
|:---------------|:-------------------------|:---------------------------------|
| `account` | String | The address of the source/owner of the payment channels. This corresponds to the `account` field of the request. |
| `channels` | Array of Channel Objects | Payment channels owned by this `account`. {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.5.0" %}Updated in: rippled 1.5.0{% /badge %} |
| `ledger_hash` | String | _(May be omitted)_ The identifying [Hash][] of the ledger version used to generate this response. |
| `ledger_index` | Number | The [Ledger Index][] of the ledger version used to generate this response. |
| `validated` | Boolean | _(May be omitted)_ If `true`, the information in this response comes from a validated ledger version. Otherwise, the information is subject to change. |
| `limit` | Number | _(May be omitted)_ The limit to how many channel objects were actually returned by this request. |
| `marker` | [Marker][] | _(May be omitted)_ Server-defined value for pagination. Pass this to the next call to resume getting results where this call left off. Omitted when there are no additional pages after this one. |
Each Channel Object has the following fields:
| Field | Type | Description |
|:----------------------|:-----------------|:----------------------------------|
| `account` | String | The owner of the channel, as an [Address][]. |
| `amount` | String | The total amount of [XRP, in drops][] allocated to this channel. |
| `balance` | String | The total amount of [XRP, in drops][], paid out from this channel, as of the ledger version used. (You can calculate the amount of XRP left in the channel by subtracting `balance` from `amount`.) |
| `channel_id` | String | A unique ID for this channel, as a 64-character hexadecimal string. This is also the [ID of the channel object](../../../protocol/ledger-data/ledger-entry-types/paychannel.md#paychannel-id-format) in the ledger's state data. |
| `destination_account` | String | The destination account of the channel, as an [Address][]. Only this account can receive the XRP in the channel while it is open. |
| `settle_delay` | Unsigned Integer | The number of seconds the payment channel must stay open after the owner of the channel requests to close it. |
| `public_key` | String | _(May be omitted)_ The public key for the payment channel in the XRP Ledger's [base58][] format. Signed claims against this channel must be redeemed with the matching key pair. |
| `public_key_hex` | String | _(May be omitted)_ The public key for the payment channel in hexadecimal format, if one was specified at channel creation. Signed claims against this channel must be redeemed with the matching key pair. |
| `expiration` | Unsigned Integer | _(May be omitted)_ Time, in [seconds since the Ripple Epoch][], when this channel is set to expire. This expiration date is mutable. If this is before the close time of the most recent validated ledger, the channel is expired. |
| `cancel_after` | Unsigned Integer | _(May be omitted)_ Time, in [seconds since the Ripple Epoch][], of this channel's immutable expiration, if one was specified at channel creation. If this is before the close time of the most recent validated ledger, the channel is expired. |
| `source_tag` | Unsigned Integer | _(May be omitted)_ A 32-bit unsigned integer to use as a [source tag](../../../../concepts/transactions/source-and-destination-tags.md) for payments through this payment channel, if one was specified at channel creation. This indicates the payment channel's originator or other purpose at the source account. Conventionally, if you bounce payments from this channel, you should specify this value in the `DestinationTag` of the return payment. |
| `destination_tag` | Unsigned Integer | _(May be omitted)_ A 32-bit unsigned integer to use as a [destination tag](../../../../concepts/transactions/source-and-destination-tags.md) for payments through this channel, if one was specified at channel creation. This indicates the payment channel's beneficiary or other purpose at the destination account. |
## Possible Errors
* Any of the [universal error types][].
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
* `actNotFound` - The address specified in the `account` field of the request does not correspond to an account in the ledger.
* `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.
{% raw-partial file="/_snippets/common-links.md" /%}

View File

@@ -0,0 +1,177 @@
---
html: account_currencies.html
parent: account-methods.html
seo:
description: Get a list of currencies an account can send or receive.
labels:
- Tokens
---
# account_currencies
[[Source]](https://github.com/XRPLF/rippled/blob/df966a9ac6dd986585ecccb206aff24452e41a30/src/ripple/rpc/handlers/AccountCurrencies.cpp "Source")
The `account_currencies` command retrieves a list of currencies that an account can send or receive, based on its trust lines. (This is not a thoroughly confirmed list, but it can be used to populate user interfaces.)
## Request Format
An example of the request format:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"command": "account_currencies",
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"ledger_index": "validated"
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
{
"method": "account_currencies",
"params": [
{
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"account_index": 0,
"ledger_index": "validated"
}
]
}
```
{% /tab %}
{% tab label="Commandline" %}
```sh
#Syntax: account_currencies account [ledger_index|ledger_hash]
rippled account_currencies rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn validated
```
{% /tab %}
{% /tabs %}
[Try it! >](/resources/dev-tools/websocket-api-tool#account_currencies)
The request includes the following parameters:
| `Field` | Type | Required? | Description |
|:---------------|:---------------------|:----------|-------------|
| `account` | String - [Address][] | Yes | Look up currencies this account can send or receive. {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.11.0" %}Updated in: rippled 1.11.0{% /badge %} |
| `ledger_hash` | String | No | A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
| `ledger_index` | Number or String | No | The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
The following fields are deprecated and should not be provided: `account_index`, `strict`.
## Response Format
An example of a successful response:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"result": {
"ledger_index": 11775844,
"receive_currencies": [
"BTC",
"CNY",
"DYM",
"EUR",
"JOE",
"MXN",
"USD",
"015841551A748AD2C1F76FF6ECB0CCCD00000000"
],
"send_currencies": [
"ASP",
"BTC",
"CHF",
"CNY",
"DYM",
"EUR",
"JOE",
"JPY",
"MXN",
"USD"
],
"validated": true
},
"status": "success",
"type": "response"
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
200 OK
{
"result": {
"ledger_index": 11775823,
"receive_currencies": [
"BTC",
"CNY",
"DYM",
"EUR",
"JOE",
"MXN",
"USD",
"015841551A748AD2C1F76FF6ECB0CCCD00000000"
],
"send_currencies": [
"ASP",
"BTC",
"CHF",
"CNY",
"DYM",
"EUR",
"JOE",
"JPY",
"MXN",
"USD"
],
"status": "success",
"validated": true
}
}
```
{% /tab %}
{% tab label="Commandline" %}
```json
{
"result" : {
"ledger_hash" : "F43A801ED4562FA744A35755B86BE898D91C5643BF499924EA3C69491B8C28D1",
"ledger_index" : 56843649,
"receive_currencies" : [ "USD" ],
"send_currencies" : [ "NGN", "TRC" ],
"status" : "success",
"validated" : true
}
}
```
{% /tab %}
{% /tabs %}
The response follows the [standard format][], with a successful result containing the following fields:
| `Field` | Type | Description |
|:---------------------|:---------------------------|:-------------------------|
| `ledger_hash` | String - [Hash][] | (May be omitted) The identifying hash of the ledger version used to retrieve this data, as hex. |
| `ledger_index` | Integer - [Ledger Index][] | The ledger index of the ledger version used to retrieve this data. |
| `receive_currencies` | Array of Strings | Array of [Currency Code][]s for currencies that this account can receive. |
| `send_currencies` | Array of Strings | Array of [Currency Code][]s for currencies that this account can send. |
| `validated` | Boolean | If `true`, this data comes from a validated ledger. |
**Note:** The currencies that an account can send or receive are defined based on a check of its trust lines. If an account has a trust line for a currency and enough room to increase its balance, it can receive that currency. If the trust line's balance can go down, the account can send that currency. This method _doesn't_ check whether the trust line is [frozen](../../../../concepts/tokens/fungible-tokens/freezes.md) or authorized.
## Possible Errors
* Any of the [universal error types][].
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
* `actNotFound` - The address specified in the `account` field of the request does not correspond to an account in the ledger.
* `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.
{% raw-partial file="/_snippets/common-links.md" /%}

View File

@@ -0,0 +1,262 @@
---
html: account_info.html
parent: account-methods.html
seo:
description: Get basic data about an account.
labels:
- Accounts
- XRP
---
# account_info
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/rpc/handlers/AccountInfo.cpp "Source")
The `account_info` command retrieves information about an account, its activity, and its XRP balance. All information retrieved is relative to a particular version of the ledger.
## Request Format
An example of an account_info request:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 2,
"command": "account_info",
"account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
"ledger_index": "current",
"queue": true
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
{
"method": "account_info",
"params": [
{
"account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
"ledger_index": "current",
"queue": true
}
]
}
```
{% /tab %}
{% tab label="Commandline" %}
```sh
#Syntax: account_info account [ledger_index|ledger_hash]
rippled account_info rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn validated
```
{% /tab %}
{% /tabs %}
[Try it! >](/resources/dev-tools/websocket-api-tool#account_info)
The request contains the following parameters:
| `Field` | Type | Required? | Description |
|:---------------|:---------------------|:----------|-------------|
| `account` | String - [Address][] | Yes | The account to look up. {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.11.0" %}Updated in: rippled 1.11.0{% /badge %} |
| `ledger_hash` | String | No | A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
| `ledger_index` | Number or String | No | The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
| `queue` | Boolean | No | If `true`, return stats about [queued transactions](../../../../concepts/transactions/transaction-queue.md) sent by this account. Can only be used when querying for the data from the current open ledger. Not available from servers in [Reporting Mode][]. |
| `signer_lists` | Boolean | No | [API v1][]: If `true`, return any [SignerList objects](../../../protocol/ledger-data/ledger-entry-types/signerlist.md) associated with this account.<br>[API v2][]: Identical to v1, but also returns an `invalidParams` error if you provide a non-boolean value. |
The following fields are deprecated and should not be provided: `ident`, `ledger`, `strict`.
## Response Format
An example of a successful response:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 5,
"status": "success",
"type": "response",
"result": {
"account_data": {
"Account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
"Balance": "999999999960",
"Flags": 8388608,
"LedgerEntryType": "AccountRoot",
"OwnerCount": 0,
"PreviousTxnID": "4294BEBE5B569A18C0A2702387C9B1E7146DC3A5850C1E87204951C6FDAA4C42",
"PreviousTxnLgrSeq": 3,
"Sequence": 6,
"index": "92FA6A9FC8EA6018D5D16532D7795C91BFB0831355BDFDA177E86C8BF997985F"
},
"ledger_current_index": 4,
"queue_data": {
"auth_change_queued": true,
"highest_sequence": 10,
"lowest_sequence": 6,
"max_spend_drops_total": "500",
"transactions": [
{
"auth_change": false,
"fee": "100",
"fee_level": "2560",
"max_spend_drops": "100",
"seq": 6
},
... (trimmed for length) ...
{
"LastLedgerSequence": 10,
"auth_change": true,
"fee": "100",
"fee_level": "2560",
"max_spend_drops": "100",
"seq": 10
}
],
"txn_count": 5
},
"validated": false
}
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
{
"result": {
"account_data": {
"Account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
"Balance": "999999999960",
"Flags": 8388608,
"LedgerEntryType": "AccountRoot",
"OwnerCount": 0,
"PreviousTxnID": "4294BEBE5B569A18C0A2702387C9B1E7146DC3A5850C1E87204951C6FDAA4C42",
"PreviousTxnLgrSeq": 3,
"Sequence": 6,
"index": "92FA6A9FC8EA6018D5D16532D7795C91BFB0831355BDFDA177E86C8BF997985F"
},
"ledger_current_index": 4,
"queue_data": {
"auth_change_queued": true,
"highest_sequence": 10,
"lowest_sequence": 6,
"max_spend_drops_total": "500",
"transactions": [
{
"auth_change": false,
"fee": "100",
"fee_level": "2560",
"max_spend_drops": "100",
"seq": 6
},
... (trimmed for length) ...
{
"LastLedgerSequence": 10,
"auth_change": true,
"fee": "100",
"fee_level": "2560",
"max_spend_drops": "100",
"seq": 10
}
],
"txn_count": 5
},
"status": "success",
"validated": false
}
}
```
{% /tab %}
{% tab label="Commandline" %}
```json
{
"result" : {
"account_data" : {
"Account" : "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
"Balance" : "9986",
"Flags" : 1114112,
"LedgerEntryType" : "AccountRoot",
"OwnerCount" : 0,
"PreviousTxnID" : "0705FE3F52057924C288296EF0EBF668E0C1A3646FBA8FAF9B73DCC0A797B4B2",
"PreviousTxnLgrSeq" : 51948740,
"RegularKey" : "rhLkGGNZdjSpnHJw4XAFw1Jy7PD8TqxoET",
"Sequence" : 192220,
"index" : "92FA6A9FC8EA6018D5D16532D7795C91BFB0831355BDFDA177E86C8BF997985F"
},
"ledger_hash" : "8169428EDF7F046F817CE44F5F1DF23AD9FAEFFA2CBA7645C3254D66AA79B46E",
"ledger_index" : 56843712,
"status" : "success",
"validated" : true
}
}
```
{% /tab %}
{% /tabs %}
The response follows the [standard format][], with the result containing the requested account, its data, and a ledger to which it applies, as the following fields:
| `Field` | Type | Description |
|:-----------------------|:--------|:------------------------------------------|
| `account_data` | Object | The [AccountRoot ledger object](../../../protocol/ledger-data/ledger-entry-types/accountroot.md) with this account's information, as stored in the ledger. |
| `account_flags` | Object | The account's flag statuses (see below), based on the `Flags` field of the account. {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.11.0" %}New in: rippled 1.11.0{% /badge %} |
| `signer_lists` | Array | [API v1][]: _(Omitted unless the request specified `signer_lists` and at least one SignerList is associated with the account.)_ Array of [SignerList ledger objects](../../../protocol/ledger-data/ledger-entry-types/signerlist.md) associated with this account for [Multi-Signing](../../../../concepts/accounts/multi-signing.md). Since an account can own at most one SignerList, this array must have exactly one member if it is present. The field is nested under `account_data`.<br>[API v2][]: Identical to API v1, but the field is returned in the root response instead. [Clio](https://github.com/XRPLF/clio) implements the API v2 behavior in all cases. |
| `ledger_current_index` | Integer | _(Omitted if `ledger_index` is provided instead)_ The [ledger index][] of the current in-progress ledger, which was used when retrieving this information. |
| `ledger_index` | Integer | _(Omitted if `ledger_current_index` is provided instead)_ The [ledger index][] of the ledger version used when retrieving this information. The information does not contain any changes from ledger versions newer than this one. |
| `queue_data` | Object | _(Omitted unless `queue` specified as `true` and querying the current open ledger.)_ Information about [queued transactions](../../../../concepts/transactions/transaction-cost.md#queued-transactions) sent by this account. This information describes the state of the local `rippled` server, which may be different from other servers in the [peer-to-peer XRP Ledger network](../../../../concepts/networks-and-servers/peer-protocol.md). Some fields may be omitted because the values are calculated "lazily" by the queuing mechanism. |
| `validated` | Boolean | True if this data is from a validated ledger version; if omitted or set to false, this data is not final. |
The `account_flags` field contains the following nested fields:
| `Field` | Type | Description |
|:-----------------------|:--------|:------------------------------------------|
| `defaultRipple` | Boolean | If `true`, the account allows [rippling](../../../../concepts/tokens/fungible-tokens/rippling.md) on its trust lines by default. |
| `depositAuth` | Boolean | If `true`, the account is using [Deposit Authorization](../../../../concepts/accounts/depositauth.md) and does not accept any payments from unknown parties. |
| `disableMasterKey` | Boolean | If `true`, the account's [master key pair](../../../../concepts/accounts/cryptographic-keys.md) is disabled. |
| `disallowIncomingCheck` | Boolean | If `true`, the account does not allow others to send [Checks](../../../../concepts/payment-types/checks.md) to it. _(Requires the [DisallowIncoming amendment][])_ |
| `disallowIncomingNFTokenOffer` | Boolean | If `true`, the account does not allow others to make [NFT buy or sell offers](../../../../concepts/tokens/nfts/trading.md) to it. _(Requires the [DisallowIncoming amendment][])_ |
| `disallowIncomingPayChan` | Boolean | If `true`, the account does not allow others to make [Payment Channels](../../../../concepts/payment-types/payment-channels.md) to it. _(Requires the [DisallowIncoming amendment][])_ |
| `disallowIncomingTrustline` | Boolean | If `true`, the account does not allow others to make [trust lines](../../../../concepts/tokens/fungible-tokens/index.md) to it. _(Requires the [DisallowIncoming amendment][])_ |
| `disallowIncomingXRP` | Boolean | If `true`, the account does not want to receive XRP from others. (This is advisory, and not enforced at a protocol level.) |
| `globalFreeze` | Boolean | If `true`, all tokens issued by the account are currently frozen. |
| `noFreeze` | Boolean | If `true`, the account has permanently given up the abilities to freeze individual trust lines or end a global freeze. See [No Freeze](../../../../concepts/tokens/fungible-tokens/freezes.md#no-freeze) for details. |
| `passwordSpent` | Boolean | If `false`, the account can send a special [key reset transaction](../../../../concepts/transactions/transaction-cost.md#key-reset-transaction) with a transaction cost of 0. The protocol turns this flag on and off automatically; it is not controlled by a user-facing setting. |
| `requireAuthorization` | Boolean | If `true`, the account is using [Authorized Trust Lines](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md) to limit who can hold the tokens it issues. |
| `requireDestinationTag` | Boolean | If `true`, the account [requires a destination tag](../../../../tutorials/manage-account-settings/require-destination-tags.md) on all payments it receives. |
The `queue_data` field, if present, contains the following nested fields:
| `Field` | Type | Description |
|:------------------------|:--------|:-----------------------------------------|
| `txn_count` | Integer | Number of queued transactions from this address. |
| `auth_change_queued` | Boolean | (May be omitted) Whether a transaction in the queue changes this address's [ways of authorizing transactions](../../../../concepts/transactions/index.md#authorizing-transactions). If `true`, this address can queue no further transactions until that transaction has been executed or dropped from the queue. |
| `lowest_sequence` | Integer | (May be omitted) The lowest [Sequence Number][] among transactions queued by this address. |
| `highest_sequence` | Integer | (May be omitted) The highest [Sequence Number][] among transactions queued by this address. |
| `max_spend_drops_total` | String | (May be omitted) Integer amount of [drops of XRP][] that could be debited from this address if every transaction in the queue consumes the maximum amount of XRP possible. |
| `transactions` | Array | (May be omitted) Information about each queued transaction from this address. |
Each object in the `transactions` array of `queue_data`, if present, may contain any or all of the following fields:
| `Field` | Type | Description |
|:------------------|:--------|:-----------------------------------------------|
| `auth_change` | Boolean | Whether this transaction changes this address's [ways of authorizing transactions](../../../../concepts/transactions/index.md#authorizing-transactions). |
| `fee` | String | The [Transaction Cost](../../../../concepts/transactions/transaction-cost.md) of this transaction, in [drops of XRP][]. |
| `fee_level` | String | The transaction cost of this transaction, relative to the minimum cost for this type of transaction, in [fee levels][]. |
| `max_spend_drops` | String | The maximum amount of [XRP, in drops][], this transaction could send or destroy. |
| `seq` | Integer | The [Sequence Number][] of this transaction. |
## Possible Errors
* Any of the [universal error types][].
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing. For example, the request specified `queue` as `true` but specified a `ledger_index` that is not the current open ledger.
* `actNotFound` - The address specified in the `account` field of the request does not correspond to an account in the ledger.
* `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.
[fee levels]: ../../../../concepts/transactions/transaction-cost.md#fee-levels
{% raw-partial file="/_snippets/common-links.md" /%}

View File

@@ -0,0 +1,449 @@
---
html: account_lines.html
parent: account-methods.html
seo:
description: Get info about an account's trust lines.
labels:
- Tokens
---
# account_lines
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/rpc/handlers/AccountLines.cpp "Source")
The `account_lines` method returns information about an account's trust lines, which contain balances in all non-XRP currencies and assets. All information retrieved is relative to a particular version of the ledger.
## Request Format
An example of the request format:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 1,
"command": "account_lines",
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
{
"method": "account_lines",
"params": [
{
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"
}
]
}
```
{% /tab %}
{% tab label="Commandline" %}
```sh
#Syntax: account_lines <account> [<peer>] [<ledger_index>|<ledger_hash>]
rippled account_lines r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59
```
{% /tab %}
{% /tabs %}
[Try it! >](/resources/dev-tools/websocket-api-tool#account_lines)
The request accepts the following parameters: /Users/peterchen/xrpl-dev-portal/content/references/http-websocket-apis/public-api-methods/account-methods/account_lines.md
| `Field` | Type | Description |
|:---------------|:---------------------|:---------------|
| `account` | String - [Address][] | Look up trust lines connected to this account. |
| `ledger_hash` | String | _(Optional)_ A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
| `ledger_index` | Number or String | _(Optional)_ The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
| `peer` | String - [Address][] | _(Optional)_ A second account; if provided, filter results to trust lines connecting the two accounts. |
| `limit` | Number | _(Optional)_ Limit the number of trust lines to retrieve. The server may return less than the specified limit, even if there are more pages of results. Must be within the inclusive range 10 to 400. Positive values outside this range are replaced with the closest valid option. The default is 200. |
| `marker` | [Marker][] | _(Optional)_ Value from a previous paginated response. Resume retrieving data where that response left off. |
The following parameters are deprecated and may be removed without further notice: `ledger` and `peer_index`.
## Response Format
An example of a successful response:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 1,
"status": "success",
"type": "response",
"result": {
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"lines": [
{
"account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"balance": "0",
"currency": "ASP",
"limit": "0",
"limit_peer": "10",
"quality_in": 0,
"quality_out": 0
},
{
"account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"balance": "0",
"currency": "XAU",
"limit": "0",
"limit_peer": "0",
"no_ripple": true,
"no_ripple_peer": true,
"quality_in": 0,
"quality_out": 0
},
{
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"balance": "3.497605752725159",
"currency": "USD",
"limit": "5",
"limit_peer": "0",
"no_ripple": true,
"quality_in": 0,
"quality_out": 0
}
]
}
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
200 OK
{
"result": {
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"lines": [
{
"account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"balance": "0",
"currency": "ASP",
"limit": "0",
"limit_peer": "10",
"quality_in": 0,
"quality_out": 0
},
{
"account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"balance": "0",
"currency": "XAU",
"limit": "0",
"limit_peer": "0",
"no_ripple": true,
"no_ripple_peer": true,
"quality_in": 0,
"quality_out": 0
},
{
"account": "rs9M85karFkCRjvc6KMWn8Coigm9cbcgcx",
"balance": "0",
"currency": "015841551A748AD2C1F76FF6ECB0CCCD00000000",
"limit": "10.01037626125837",
"limit_peer": "0",
"no_ripple": true,
"quality_in": 0,
"quality_out": 0
}
],
"status": "success"
}
}
```
{% /tab %}
{% tab label="Commandline" %}
```json
{
"result" : {
"account" : "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"ledger_current_index" : 56867265,
"lines" : [
{
"account" : "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"balance" : "0",
"currency" : "ASP",
"limit" : "0",
"limit_peer" : "10",
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"balance" : "0",
"currency" : "XAU",
"limit" : "0",
"limit_peer" : "0",
"no_ripple" : true,
"no_ripple_peer" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"balance" : "5",
"currency" : "USD",
"limit" : "5",
"limit_peer" : "0",
"no_ripple" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rHpXfibHgSb64n8kK9QWDpdbfqSpYbM9a4",
"balance" : "481.992867407479",
"currency" : "MXN",
"limit" : "1000",
"limit_peer" : "0",
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
"balance" : "0.793598266778297",
"currency" : "EUR",
"limit" : "1",
"limit_peer" : "0",
"no_ripple" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK",
"balance" : "0",
"currency" : "CNY",
"limit" : "3",
"limit_peer" : "0",
"no_ripple" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E",
"balance" : "1.336889190631542",
"currency" : "DYM",
"limit" : "3",
"limit_peer" : "0",
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"balance" : "0.3488146605801446",
"currency" : "CHF",
"limit" : "0",
"limit_peer" : "0",
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"balance" : "0",
"currency" : "BTC",
"limit" : "3",
"limit_peer" : "0",
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"balance" : "11.68225001668339",
"currency" : "USD",
"limit" : "5000",
"limit_peer" : "0",
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rpgKWEmNqSDAGFhy5WDnsyPqfQxbWxKeVd",
"balance" : "-0.00111",
"currency" : "BTC",
"limit" : "0",
"limit_peer" : "10",
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rBJ3YjwXi2MGbg7GVLuTXUWQ8DjL7tDXh4",
"balance" : "-0.0008744482690504699",
"currency" : "BTC",
"limit" : "0",
"limit_peer" : "10",
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
"balance" : "0",
"currency" : "USD",
"limit" : "1",
"limit_peer" : "0",
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA",
"balance" : "9.07619790068559",
"currency" : "CNY",
"limit" : "100",
"limit_peer" : "0",
"no_ripple" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"balance" : "7.292695098901099",
"currency" : "JPY",
"limit" : "0",
"limit_peer" : "0",
"no_ripple" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"balance" : "0",
"currency" : "AUX",
"limit" : "0",
"limit_peer" : "0",
"no_ripple" : true,
"no_ripple_peer" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "r9vbV3EHvXWjSkeQ6CAcYVPGeq7TuiXY2X",
"balance" : "0.0004557360418801623",
"currency" : "USD",
"limit" : "1",
"limit_peer" : "0",
"no_ripple" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"balance" : "12.41688780720394",
"currency" : "EUR",
"limit" : "100",
"limit_peer" : "0",
"no_ripple" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rfF3PNkwkq1DygW2wum2HK3RGfgkJjdPVD",
"balance" : "35",
"currency" : "USD",
"limit" : "500",
"limit_peer" : "0",
"no_ripple" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rwUVoVMSURqNyvocPCcvLu3ygJzZyw8qwp",
"balance" : "-5",
"currency" : "JOE",
"limit" : "0",
"limit_peer" : "50",
"no_ripple_peer" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rE6R3DWF9fBD7CyiQciePF9SqK58Ubp8o2",
"balance" : "0",
"currency" : "USD",
"limit" : "0",
"limit_peer" : "100",
"no_ripple_peer" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rE6R3DWF9fBD7CyiQciePF9SqK58Ubp8o2",
"balance" : "0",
"currency" : "JOE",
"limit" : "0",
"limit_peer" : "100",
"no_ripple_peer" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rs9M85karFkCRjvc6KMWn8Coigm9cbcgcx",
"balance" : "0",
"currency" : "015841551A748AD2C1F76FF6ECB0CCCD00000000",
"limit" : "10.01037626125837",
"limit_peer" : "0",
"no_ripple" : true,
"quality_in" : 0,
"quality_out" : 0
},
{
"account" : "rEhDDUUNxpXgEHVJtC2cjXAgyx5VCFxdMF",
"balance" : "0",
"currency" : "USD",
"limit" : "0",
"limit_peer" : "1",
"quality_in" : 0,
"quality_out" : 0
}
],
"status" : "success",
"validated" : false
}
}
```
{% /tab %}
{% /tabs %}
The response follows the [standard format][], with a successful result containing the address of the account and an array of trust line objects. Specifically, the result object contains the following fields:
| `Field` | Type | Description |
|:-----------------------|:---------------------------|:-----------------------|
| `account` | String | Unique [Address][] of the account this request corresponds to. This is the "perspective account" for purpose of the trust lines. |
| `lines` | Array | Array of trust line objects, as described below. If the number of trust lines is large, only returns up to the `limit` at a time. |
| `ledger_current_index` | Integer - [Ledger Index][] | _(Omitted if `ledger_hash` or `ledger_index` provided)_ The ledger index of the current open ledger, which was used when retrieving this information. |
| `ledger_index` | Integer - [Ledger Index][] | _(Omitted if `ledger_current_index` provided instead)_ The ledger index of the ledger version that was used when retrieving this data. |
| `ledger_hash` | String - [Hash][] | _(May be omitted)_ The identifying hash the ledger version that was used when retrieving this data. |
| `marker` | [Marker][] | Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. Omitted when there are no additional pages after this one. |
Each trust line object has some combination of the following fields:
| `Field` | Type | Description |
|:-----------------|:-----------------|:---------------------------------------|
| `account` | String | The unique [Address][] of the counterparty to this trust line. |
| `balance` | String | Representation of the numeric balance currently held against this line. A positive balance means that the perspective account holds value; a negative balance means that the perspective account owes value. |
| `currency` | String | A [Currency Code][] identifying what currency this trust line can hold. |
| `limit` | String | The maximum amount of the given currency that this account is willing to owe the peer account |
| `limit_peer` | String | The maximum amount of currency that the counterparty account is willing to owe the perspective account |
| `quality_in` | Unsigned Integer | Rate at which the account values incoming balances on this trust line, as a ratio of this value per 1 billion units. (For example, a value of 500 million represents a 0.5:1 ratio.) As a special case, 0 is treated as a 1:1 ratio. |
| `quality_out` | Unsigned Integer | Rate at which the account values outgoing balances on this trust line, as a ratio of this value per 1 billion units. (For example, a value of 500 million represents a 0.5:1 ratio.) As a special case, 0 is treated as a 1:1 ratio. |
| `no_ripple` | Boolean | _(May be omitted)_ If `true`, this account has enabled the [No Ripple flag](../../../../concepts/tokens/fungible-tokens/rippling.md) for this trust line. If present and `false`, this account has disabled the No Ripple flag, but, because the account also has the Default Ripple flag disabled, that is not considered [the default state](../../../protocol/ledger-data/ledger-entry-types/ripplestate.md#contributing-to-the-owner-reserve). If omitted, the account has the No Ripple flag disabled for this trust line and Default Ripple enabled. {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.7.0" %}Updated in: rippled 1.7.0{% /badge %} |
| `no_ripple_peer` | Boolean | _(May be omitted)_ If `true`, the peer account has enabled the [No Ripple flag](../../../../concepts/tokens/fungible-tokens/rippling.md) for this trust line. If present and `false`, this account has disabled the No Ripple flag, but, because the account also has the Default Ripple flag disabled, that is not considered [the default state](../../../protocol/ledger-data/ledger-entry-types/ripplestate.md#contributing-to-the-owner-reserve). If omitted, the account has the No Ripple flag disabled for this trust line and Default Ripple enabled. {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.7.0" %}Updated in: rippled 1.7.0{% /badge %} |
| `authorized` | Boolean | _(May be omitted)_ If `true`, this account has [authorized this trust line](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md). The default is `false`. |
| `peer_authorized`| Boolean | _(May be omitted)_ If `true`, the peer account has [authorized this trust line](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md). The default is `false`. |
| `freeze` | Boolean | _(May be omitted)_ If `true`, this account has [frozen](../../../../concepts/tokens/fungible-tokens/freezes.md) this trust line. The default is `false`. |
| `freeze_peer` | Boolean | _(May be omitted)_ If `true`, the peer account has [frozen](../../../../concepts/tokens/fungible-tokens/freezes.md) this trust line. The default is `false`. |
## Possible Errors
* Any of the [universal error types][].
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
* `actNotFound` - The [Address][] specified in the `account` field of the request does not correspond to an account in the ledger.
* `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.
* `actMalformed` - If the `marker` field provided is not acceptable.
{% raw-partial file="/_snippets/common-links.md" /%}

View File

@@ -0,0 +1,163 @@
---
html: account_nfts.html
parent: account-methods.html
seo:
description: Get a list of all NFTs for an account.
labels:
- Non-fungible Tokens, NFTs
---
# account_nfts
[[Source]](https://github.com/xrplf/rippled/blob/master/src/ripple/rpc/handlers/AccountObjects.cpp "Source")
The `account_nfts` method returns a list of `NFToken` objects for the specified account.
_(Added by the [NonFungibleTokensV1_1 amendment][].)_
## Request Format
An example of the request format:
{% raw-partial file="/_snippets/no-cli-syntax.md" /%}
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"command": "account_nfts",
"account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx",
"ledger_index": "validated"
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
{
"method": "account_nfts",
"params": [{
"account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx",
"ledger_index": "validated"
}]
}
```
{% /tab %}
{% /tabs %}
[Try it! >](/resources/dev-tools/websocket-api-tool#account_nfts)
The request includes the following parameters:
| Field | Type | Description |
|:---------------|:-----------------|:-----------------------------------------|
| `account` | String | The unique identifier of an account, typically the account's [Address][]. The request returns a list of NFTs owned by this account. |
| `ledger_hash` | String | _(Optional)_ A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
| `ledger_index` | String or Number | _(Optional)_ The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
| `limit` | Integer | _(Optional)_ Limit the number of [token pages][NFTokenPage object] to retrieve. Each page can contain up to 32 NFTs. The `limit` value cannot be lower than 20 or more than 400. Positive values outside this range are replaced with the closest valid option. The default is 100. |
| `marker` | [Marker][] | _(Optional)_ Value from a previous paginated response. Resume retrieving data where that response left off. |
## Response Format
An example of a successful response:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"result": {
"account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx",
"account_nfts": [
{
"Flags": 1,
"Issuer": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm",
"NFTokenID": "00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE0875B974D9F00000004",
"NFTokenTaxon": 0,
"URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469",
"nft_serial": 4
},
{
"Flags": 1,
"Issuer": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm",
"NFTokenID": "00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE087727D1EA000000005",
"NFTokenTaxon": 0,
"URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469",
"nft_serial": 5
}
],
"ledger_hash": "7971093E67341E325251268A5B7CD665EF450B126F67DF8384D964DF834961E8",
"ledger_index": 2380540,
"validated": true
},
"status": "success",
"type": "response"
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
{
"result": {
"account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx",
"account_nfts": [
{
"Flags": 1,
"Issuer": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm",
"NFTokenID": "00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE0875B974D9F00000004",
"NFTokenTaxon": 0,
"URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469",
"nft_serial": 4
},
{
"Flags": 1,
"Issuer": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm",
"NFTokenID": "00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE087727D1EA000000005",
"NFTokenTaxon": 0,
"URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469",
"nft_serial": 5
}
],
"ledger_hash": "46497E9FF17A993324F1A0A693DC068B467184023C7FD162812265EAAFEB97CB",
"ledger_index": 2380559,
"status": "success",
"validated": true
}
}
```
{% /tab %}
{% /tabs %}
The response follows the [standard format][], with a successful result containing the following fields:
| `Field` | Type | Description |
|:---------------|:-----------------|:-----------------------------------------|
| `account` | String | The account that owns the list of NFTs. |
| `account_nfts` | Array | A list of NFTs owned by the account, formatted as **NFT Objects** (see below). |
| `ledger_hash` | String | _(May be omitted)_ The identifying hash of the ledger that was used to generate this response. |
| `ledger_index` | Number - [Ledger Index][] | _(May be omitted)_ The ledger index of the ledger that was used to generate this response. |
| `ledger_current_index` | Number - [Ledger Index][] | _(May be omitted)_ The ledger index of the current in-progress ledger version, which was used to generate this response. |
| `validated` | Boolean | If included and set to `true`, the information in this response comes from a validated ledger version. Otherwise, the information is subject to change. |
### NFT Objects
Each object in the `account_nfts` array represents one [NFToken][] and has the following fields:
| `Field` | Type | Description |
|:---------------|:---------------------|:-------------------------------------|
| `Flags` | Number | A bit-map of boolean flags enabled for this NFToken. See [NFToken Flags](../../../protocol/data-types/nftoken.md#nftoken-flags) for possible values. |
| `Issuer` | String - [Address][] | The account that issued this NFToken. |
| `NFTokenID` | String | The unique identifier of this NFToken, in hexadecimal. |
| `NFTokenTaxon` | Number | The unscrambled version of this token's [taxon](../../../protocol/data-types/nftoken.md#nftokentaxon). Several tokens with the same taxon might represent instances of a limited series. |
| `URI` | String | The URI data associated with this NFToken, in hexadecimal. |
| `nft_serial` | Number | The token sequence number of this NFToken, which is unique for its issuer. |
## Possible Errors
* Any of the [universal error types][].
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
* `actNotFound` - The [Address][] specified in the `account` field of the request does not correspond to an account in the ledger.
* `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.
{% raw-partial file="/_snippets/common-links.md" /%}

View File

@@ -0,0 +1,221 @@
---
html: account_offers.html
parent: account-methods.html
seo:
description: Get info about an account's currency exchange offers.
labels:
- Decentralized Exchange
---
# account_offers
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/rpc/handlers/AccountOffers.cpp "Source")
The `account_offers` method retrieves a list of [offers](../../../../concepts/tokens/decentralized-exchange/offers.md) made by a given [account](../../../../concepts/accounts/accounts.md) that are outstanding as of a particular [ledger version](../../../../concepts/ledgers/index.md).
## Request Format
An example of the request format:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 9,
"command": "account_offers",
"account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM"
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
{
"method": "account_offers",
"params": [
{
"account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM"
}
]
}
```
{% /tab %}
{% tab label="Commandline" %}
```sh
#Syntax: account_offers account [ledger_index]
rippled account_offers rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM current
```
{% /tab %}
{% /tabs %}
[Try it! >](/resources/dev-tools/websocket-api-tool#account_offers)
A request can include the following parameters:
| Field | Type | Required? | Description |
|:---------------|:---------------------|:----------|-------------|
| `account` | String - [Address][] | Yes | Look up Offers placed by this account. |
| `ledger_hash` | [Hash][] | No | A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
| `ledger_index` | [Ledger Index][] | No | The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
| `limit` | Number | No | Limit the number of Offers to retrieve. The server may return fewer than this number of results. Must be within the inclusive range 10 to 400. Positive values outside this range are replaced with the closest valid option.The default is 200. |
| `marker` | [Marker][] | No | Value from a previous paginated response. Resume retrieving data where that response left off. |
The following parameters are deprecated should not be provided: `ledger`, `strict`.
## Response Format
An example of a successful response:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 9,
"status": "success",
"type": "response",
"result": {
"account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM",
"ledger_current_index": 18539550,
"offers": [
{
"flags": 0,
"quality": "0.00000000574666765650638",
"seq": 6577664,
"taker_gets": "33687728098",
"taker_pays": {
"currency": "EUR",
"issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq",
"value": "193.5921774819578"
}
},
{
"flags": 0,
"quality": "7989247009094510e-27",
"seq": 6572128,
"taker_gets": "2361918758",
"taker_pays": {
"currency": "XAU",
"issuer": "rrh7rf1gV2pXAoqA8oYbpHd8TKv5ZQeo67",
"value": "0.01886995237307572"
}
},
... trimmed for length ...
],
"validated": false
}
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
200 OK
{
"result": {
"account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM",
"ledger_current_index": 18539596,
"offers": [{
"flags": 0,
"quality": "0.000000007599140009999998",
"seq": 6578020,
"taker_gets": "29740867287",
"taker_pays": {
"currency": "USD",
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"value": "226.0050145327418"
}
}, {
"flags": 0,
"quality": "7989247009094510e-27",
"seq": 6572128,
"taker_gets": "2361918758",
"taker_pays": {
"currency": "XAU",
"issuer": "rrh7rf1gV2pXAoqA8oYbpHd8TKv5ZQeo67",
"value": "0.01886995237307572"
}
}, {
"flags": 0,
"quality": "0.00000004059594001318974",
"seq": 6576905,
"taker_gets": "3892952574",
"taker_pays": {
"currency": "CNY",
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
"value": "158.0380691682966"
}
},
...
],
"status": "success",
"validated": false
}
}
```
{% /tab %}
{% tab label="Commandline" %}
```json
{
"result" : {
"account" : "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM",
"ledger_current_index" : 57110969,
"offers" : [
{
"flags" : 0,
"quality" : "1499850014.892974",
"seq" : 7916201,
"taker_gets" : {
"currency" : "BCH",
"issuer" : "rcyS4CeCZVYvTiKcxj6Sx32ibKwcDHLds",
"value" : "0.5268598580881351"
},
"taker_pays" : "790210766"
}
],
"status" : "success",
"validated" : false
}
}
```
{% /tab %}
{% /tabs %}
The response follows the [standard format][], with a successful result containing the following fields:
| `Field` | Type | Description |
|:-----------------------|:--------------------------|:------------------------|
| `account` | String | Unique [Address][] identifying the account that made the offers |
| `offers` | Array | Array of objects, where each object represents an offer made by this account that is outstanding as of the requested ledger version. If the number of offers is large, only returns up to `limit` at a time. |
| `ledger_current_index` | Number - [Ledger Index][] | _(Omitted if `ledger_hash` or `ledger_index` provided)_ The ledger index of the current in-progress ledger version, which was used when retrieving this data. |
| `ledger_index` | Number - [Ledger Index][] | _(Omitted if `ledger_current_index` provided instead)_ The ledger index of the ledger version that was used when retrieving this data, as requested. |
| `ledger_hash` | String - [Hash][] | _(May be omitted)_ The identifying hash of the ledger version that was used when retrieving this data. |
| `marker` | [Marker][] | _(May be omitted)_ Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. Omitted when there are no pages of information after this one. |
Each offer object contains the following fields:
| `Field` | Type | Description |
|:-------------|:-----------------|:-------------------------------------------|
| `flags` | Unsigned integer | Options set for this offer entry as bit-flags. |
| `seq` | Unsigned integer | Sequence number of the transaction that created this entry. (Transaction [sequence numbers](../../../protocol/data-types/basic-data-types.md#account-sequence) are relative to accounts.) |
| `taker_gets` | String or Object | The amount the account accepting the offer receives, as a String representing an amount in XRP, or a currency specification object. (See [Specifying Currency Amounts][Currency Amount]) |
| `taker_pays` | String or Object | The amount the account accepting the offer provides, as a String representing an amount in XRP, or a currency specification object. (See [Specifying Currency Amounts][Currency Amount]) |
| `quality` | String | The exchange rate of the offer, as the ratio of the original `taker_pays` divided by the original `taker_gets`. When executing offers, the offer with the most favorable (lowest) quality is consumed first; offers with the same quality are executed from oldest to newest. |
| `expiration` | Unsigned integer | (May be omitted) A time after which this offer is considered unfunded, as the number of [seconds since the Ripple Epoch][]. See also: [Offer Expiration](../../../../concepts/tokens/decentralized-exchange/offers.md#offer-expiration). |
## Possible Errors
* Any of the [universal error types][].
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
* `actNotFound` - The [Address][] specified in the `account` field of the request does not correspond to an account in the ledger.
* `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.
* `actMalformed` - The `marker` field provided is incorrect.
{% raw-partial file="/_snippets/common-links.md" /%}

View File

@@ -0,0 +1,464 @@
---
html: account_tx.html
parent: account-methods.html
seo:
description: Get a list of transactions affecting an account.
labels:
- Payments
- Accounts
---
# account_tx
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/rpc/handlers/AccountTx.cpp "Source")
The `account_tx` method retrieves a list of validated transactions that involve a given account.
## Request Format
An example of the request format:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 2,
"command": "account_tx",
"account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"ledger_index_min": -1,
"ledger_index_max": -1,
"binary": false,
"limit": 2,
"forward": false
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
{
"method": "account_tx",
"params": [
{
"account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"binary": false,
"forward": false,
"ledger_index_max": -1,
"ledger_index_min": -1,
"limit": 2
}
]
}
```
{% /tab %}
{% tab label="Commandline" %}
```sh
# Syntax: account_tx account [ledger_index_min [ledger_index_max]] [limit] [offset] [binary] [count] [descending]
# For binary/count/descending, use the parameter name for true and omit for false.
rippled -- account_tx rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w -1 -1 2 0 binary descending
```
{% /tab %}
{% /tabs %}
[Try it! >](/resources/dev-tools/websocket-api-tool#account_tx)
The request includes the following parameters:
| `Field` | Type | Description |
|:-------------------|:-------------------------------------------|:-----------|
| `account` | String | A unique identifier for the account, most commonly the account's address. |
| `tx_type` | String | _(Optional)_ **Clio Only** Return only transactions of a specific type, such as "Clawback", "AccountSet", "AccountDelete", et al. Case-insensitive. Supports any transaction type except `AMM*` (See [Transaction Types](../../../protocol/transactions/types/index.md).) {% badge href="https://github.com/XRPLF/clio/releases/tag/2.0.0" %}New in: Clio v2.0{% /badge %} |
| `ledger_index_min` | Integer | [API v1][]: _(Optional)_ Use to specify the earliest ledger to include transactions from. A value of `-1` instructs the server to use the earliest validated ledger version available.<br>[API v2][]: Identical to v1, but also returns a `lgrIdxMalformed` error if a value is specified beyond the range of ledgers the server has. |
| `ledger_index_max` | Integer | [API v1][]: _(Optional)_ Use to specify the most recent ledger to include transactions from. A value of `-1` instructs the server to use the most recent validated ledger version available.<br>[API v2][]: Identical to v1, but also returns a `lgrIdxMalformed` error if a value is specified beyond the range of ledgers the server has. |
| `ledger_hash` | String | _(Optional)_ Use to look for transactions from a single ledger only. (See [Specifying Ledgers][].) |
| `ledger_index` | String or Unsigned Integer | _(Optional)_ Use to look for transactions from a single ledger only. (See [Specifying Ledgers][].) |
| `binary` | Boolean | [API v1][]: _(Optional)_ Defaults to `false`. If set to `true`, returns transactions as hex strings instead of JSON.<br>[API v2][]: Identical to v1, but also returns an `invalidParams` error if you provide a non-boolean value. |
| `forward` | Boolean | [API v1][]: _(Optional)_ Defaults to `false`. If set to `true`, returns values indexed with the oldest ledger first. Otherwise, the results are indexed with the newest ledger first. (Each page of results may not be internally ordered, but the pages are overall ordered.)<br>[API v2][]: Identical to v1, but also returns an `invalidParams` error if you provide a non-boolean value. |
| `limit` | Integer | _(Optional)_ Default varies. Limit the number of transactions to retrieve. The server is not required to honor this value. |
| `marker` | [Marker][] | Value from a previous paginated response. Resume retrieving data where that response left off. This value is stable even if there is a change in the server's range of available ledgers. |
- You must use at least one of the following fields in your request: `ledger_index`, `ledger_hash`, `ledger_index_min`, or `ledger_index_max`.
- [API v2]: If you specify either `ledger_index` or `ledger_hash`, including `ledger_index_min` and `ledger_index_max` returns an `invalidParams` error.
### Iterating over queried data
As with other paginated methods, you can use the `marker` field to return multiple pages of data.
In the time between requests, `"ledger_index_min": -1` and `"ledger_index_max": -1` may change to refer to different ledger versions than they did before. The `marker` field can safely paginate even if there are changes in the ledger range from the request, so long as the marker does not indicate a point outside the range of ledgers specified in the request.
## Response Format
An example of a successful response:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 2,
"result": {
"account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"ledger_index_max": 57111999,
"ledger_index_min": 55886305,
"limit": 2,
"marker": {
"ledger": 57111981,
"seq": 16
},
"transactions": [
{
"meta": {
"AffectedNodes": [
{
"ModifiedNode": {
"FinalFields": {
"Account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"Balance": "3732969177079",
"Flags": 131072,
"OwnerCount": 0,
"Sequence": 702817
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "140FA03FE8C39540CA8189BC7A7956795C712BC0A542C6409C041150703C8574",
"PreviousFields": {
"Balance": "3713891690008"
},
"PreviousTxnID": "D58864C16344ADCC15995C7986CFC607CB693E88F84D2E019F0A35FB29749202",
"PreviousTxnLgrSeq": 57111994
}
},
{
"ModifiedNode": {
"FinalFields": {
"Account": "rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg",
"Balance": "40010160",
"Flags": 131072,
"OwnerCount": 0,
"Sequence": 466334
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "CC20FEBEA6D2AF969EC46F2BD92684D9FBABC3F238E841B5E056FE4EBF4379A9",
"PreviousFields": {
"Balance": "19117497271",
"Sequence": 466333
},
"PreviousTxnID": "F6B8274D3D419A95A59681E5F55578084C395FF9051924360CA3EA745F5581E8",
"PreviousTxnLgrSeq": 57111993
}
}
],
"TransactionIndex": 25,
"TransactionResult": "tesSUCCESS",
"delivered_amount": "19077487071"
},
"tx": {
"Account": "rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg",
"Amount": "19077487071",
"Destination": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"DestinationTag": 1,
"Fee": "40",
"Flags": 2147483648,
"LastLedgerSequence": 57112020,
"Sequence": 466333,
"SigningPubKey": "0381575032E254BF4D699C3D8D6EFDB63B3A71F97475C6F6885BC7DAEEE55D9A01",
"TransactionType": "Payment",
"TxnSignature": "3045022100CFC5FD057C7C685C690637AD1E639E2642BBC00EFD8E06E3F6C72FA924BC99D40220317D0708E814F69F874D641B6732E37A53B1220B493B2B8390D9EF51E8062515",
"date": 649200260,
"hash": "46BF0B576677B0DEA2D94591424A57A2DE8E3D89383631E16F40D09A513C656C",
"inLedger": 57111998,
"ledger_index": 57111998
},
"validated": true
},
{
"meta": {
"AffectedNodes": [
{
"ModifiedNode": {
"FinalFields": {
"Account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"Balance": "3713891690008",
"Flags": 131072,
"OwnerCount": 0,
"Sequence": 702817
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "140FA03FE8C39540CA8189BC7A7956795C712BC0A542C6409C041150703C8574",
"PreviousFields": {
"Balance": "3714441690048",
"Sequence": 702816
},
"PreviousTxnID": "FDD5007913B39027BAF10B31144DBC1F7DC147528DF31FF048A06DC5D3108BD6",
"PreviousTxnLgrSeq": 57111981
}
},
{
"ModifiedNode": {
"FinalFields": {
"Account": "r9dU6Z7P2i7MrDi1VUZ7uyq6J77eg86YtB",
"Balance": "2629998983",
"Flags": 0,
"OwnerCount": 0,
"Sequence": 10
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "27B96FE681B33825CC95DA197358B30D3A1721F2125F2D76022D46B2418ABA0A",
"PreviousFields": {
"Balance": "2079998983"
},
"PreviousTxnID": "44A47AC04C0C7237C32BE9A532B578D07641705D3A59DB9B3C5B6225001E39B7",
"PreviousTxnLgrSeq": 56613857
}
}
],
"TransactionIndex": 16,
"TransactionResult": "tesSUCCESS",
"delivered_amount": "550000000"
},
"tx": {
"Account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"Amount": "550000000",
"Destination": "r9dU6Z7P2i7MrDi1VUZ7uyq6J77eg86YtB",
"Fee": "40",
"Flags": 2147483648,
"LastLedgerSequence": 57112016,
"Sequence": 702816,
"SigningPubKey": "020A46D8D02AC780C59853ACA309EAA92E7D8E02DD72A0B6AC315A7D18A6C3276A",
"TransactionType": "Payment",
"TxnSignature": "3045022100D589029EF63F9E528F6100C7A36D26AFFF84085EC9AC16DA8E30E11F390D4E87022011466E0FE4A90B89142EE47E535545EEA4A2D65E0BD234DFB447721218B59C9B",
"date": 649200241,
"hash": "D58864C16344ADCC15995C7986CFC607CB693E88F84D2E019F0A35FB29749202",
"inLedger": 57111994,
"ledger_index": 57111994
},
"validated": true
}
],
"validated": true
},
"status": "success",
"type": "response"
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
200 OK
{
"result": {
"account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"ledger_index_max": 57112019,
"ledger_index_min": 56248229,
"limit": 2,
"marker": {
"ledger": 57112007,
"seq": 13
},
"status": "success",
"transactions": [
{
"meta": {
"AffectedNodes": [
{
"ModifiedNode": {
"FinalFields": {
"Account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"Balance": "3732290013101",
"Flags": 131072,
"OwnerCount": 0,
"Sequence": 702820
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "140FA03FE8C39540CA8189BC7A7956795C712BC0A542C6409C041150703C8574",
"PreviousFields": {
"Balance": "3732745656171",
"Sequence": 702819
},
"PreviousTxnID": "7C031FD5B710E3C048EEF31254089BEEC505900BCC9A842257A0319453333998",
"PreviousTxnLgrSeq": 57112010
}
},
{
"ModifiedNode": {
"FinalFields": {
"Account": "raLPjTYeGezfdb6crXZzcC8RkLBEwbBHJ5",
"Balance": "4231510602153",
"Flags": 0,
"OwnerCount": 0,
"Sequence": 96486
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "39DC5D448DECEFC3CD20818788E3DA891CA943935E8D7B12FCB5B5871FCB1638",
"PreviousFields": {
"Balance": "4231054959123"
},
"PreviousTxnID": "33D2014C832610293730028CA37857AC183BFCE3E42B9979C491FB8B82B3E9DC",
"PreviousTxnLgrSeq": 57112004
}
}
],
"TransactionIndex": 12,
"TransactionResult": "tesSUCCESS",
"delivered_amount": "455643030"
},
"tx": {
"Account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"Amount": "455643030",
"Destination": "raLPjTYeGezfdb6crXZzcC8RkLBEwbBHJ5",
"DestinationTag": 18240312,
"Fee": "40",
"Flags": 2147483648,
"LastLedgerSequence": 57112037,
"Sequence": 702819,
"SigningPubKey": "020A46D8D02AC780C59853ACA309EAA92E7D8E02DD72A0B6AC315A7D18A6C3276A",
"TransactionType": "Payment",
"TxnSignature": "30450221008602B2E390C0C7B65182C6DBC86292052C1961B2BEFB79C2C8431722C0ADB911022024B74DCF910A4C8C95572CF662EB7F5FF67E1AC4D7B9B7BFE2A8EE851EC16576",
"date": 649200322,
"hash": "08EF5BDA2825D7A28099219621CDBECCDECB828FEA202DEB6C7ACD5222D36C2C",
"inLedger": 57112015,
"ledger_index": 57112015
},
"validated": true
},
{
"meta": {
"AffectedNodes": [
{
"ModifiedNode": {
"FinalFields": {
"Account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"Balance": "3732745656171",
"Flags": 131072,
"OwnerCount": 0,
"Sequence": 702819
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "140FA03FE8C39540CA8189BC7A7956795C712BC0A542C6409C041150703C8574",
"PreviousFields": {
"Balance": "3732246155784"
},
"PreviousTxnID": "CCBCCB528F602007C937C496F0828C118E073DF180084CCD3646EC1E414844E4",
"PreviousTxnLgrSeq": 57112007
}
},
{
"ModifiedNode": {
"FinalFields": {
"Account": "rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg",
"Balance": "236476361",
"Flags": 131072,
"OwnerCount": 0,
"Sequence": 466335
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "CC20FEBEA6D2AF969EC46F2BD92684D9FBABC3F238E841B5E056FE4EBF4379A9",
"PreviousFields": {
"Balance": "735976788",
"Sequence": 466334
},
"PreviousTxnID": "C528B32DD588EFAE2FE833E8AA92E6AE2DF2C8DB3DB8C6C4F334AD37B253D72A",
"PreviousTxnLgrSeq": 57112010
}
}
],
"TransactionIndex": 33,
"TransactionResult": "tesSUCCESS",
"delivered_amount": "499500387"
},
"tx": {
"Account": "rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg",
"Amount": "499500387",
"Destination": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"DestinationTag": 1,
"Fee": "40",
"Flags": 2147483648,
"LastLedgerSequence": 57112032,
"Sequence": 466334,
"SigningPubKey": "0381575032E254BF4D699C3D8D6EFDB63B3A71F97475C6F6885BC7DAEEE55D9A01",
"TransactionType": "Payment",
"TxnSignature": "3045022100C7EA1701FE48C75508EEBADBC9864CD3FFEDCEB48AB99AEA960BFA360AE163ED0220453C9577502924C9E1A9A450D4B950A44016813BC70E1F16A65A402528D730B7",
"date": 649200302,
"hash": "7C031FD5B710E3C048EEF31254089BEEC505900BCC9A842257A0319453333998",
"inLedger": 57112010,
"ledger_index": 57112010
},
"validated": true
}
],
"validated": true
}
}
```
{% /tab %}
{% tab label="Commandline" %}
```json
{
"result" : {
"account" : "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
"ledger_index_max" : 57112094,
"ledger_index_min" : 57105464,
"limit" : 2,
"marker" : {
"ledger" : 57112074,
"seq" : 9
},
"status" : "success",
"transactions" : [
{
"ledger_index" : 57112090,
"meta" : "201C0000002EF8E51100612503677617551E0297F38EF4FED7004E074D246B4EA3E550D9AE0F61BE40E08D3432091D52CE56140FA03FE8C39540CA8189BC7A7956795C712BC0A542C6409C041150703C8574E624000AB96E624000037771BFD270E1E7220002000024000AB96F2D0000000062400003776C784A418114D2E44C9FAF7BE9C536219800A6E698E4C7D2C911E1E1E311006156F7D315E0E992B1F1AC66B309C9D68961AA327FE770101B74D4C975F8C5DEC96AE8240367761A624000000005478807811403C95DC0C7CE402E8044A5F13304108013CE9963E1E1F1031000",
"tx_blob" : "120000228000000024000AB96E201B036776306140000000054788076840000000000000287321020A46D8D02AC780C59853ACA309EAA92E7D8E02DD72A0B6AC315A7D18A6C3276A74463044022054811EEF61ACCFA1B5FC6BB05D2FA49CF5174062740370328382E6EA557C0E6A0220480584D487638C333A87CA37100354BD36209E355E8DB9FE79791A56E24C1F268114D2E44C9FAF7BE9C536219800A6E698E4C7D2C911831403C95DC0C7CE402E8044A5F13304108013CE9963",
"validated" : true
},
{
"ledger_index" : 57112087,
"meta" : "201C00000026F8E5110061250367760A556B80EE9A9AD3FC40F471F29DCB80C678375137CE36220718902EF1EDCD375E7156140FA03FE8C39540CA8189BC7A7956795C712BC0A542C6409C041150703C8574E66240000376DEB77118E1E7220002000024000AB96E2D00000000624000037771BFD2708114D2E44C9FAF7BE9C536219800A6E698E4C7D2C911E1E1E511006125036776155591DA498D40AFD90670555F3D719883B48D224B4E4E906C634DEFA21163E8197756CC20FEBEA6D2AF969EC46F2BD92684D9FBABC3F238E841B5E056FE4EBF4379A9E62400071DA26240000001C0D849F8E1E722000200002400071DA32D0000000062400000012DCFE87881146914CB622B8E41E150DE431F48DA244A69809366E1E1F1031000",
"tx_blob" : "12000022800000002400071DA22E00000001201B0367762D61400000009308615868400000000000002873210381575032E254BF4D699C3D8D6EFDB63B3A71F97475C6F6885BC7DAEEE55D9A0174473045022100E592BCCFD85CCE0B39075EFC66D6BCA594EBB451F12AD5AD9EE533A267F1381B02203635AB46AC110848FC44E797BD19D77A19E10A0F463AA5540B1C62E5D48C81F081146914CB622B8E41E150DE431F48DA244A698093668314D2E44C9FAF7BE9C536219800A6E698E4C7D2C911",
"validated" : true
}
],
"validated" : true
}
}
```
{% /tab %}
{% /tabs %}
The response follows the [standard format][], with a successful result containing the following fields:
| `Field` | Type | Description |
|:-------------------|:---------------------------|:---------------------------|
| `account` | String | Unique [Address][] identifying the related account |
| `ledger_index_min` | Integer - [Ledger Index][] | The ledger index of the earliest ledger actually searched for transactions. |
| `ledger_index_max` | Integer - [Ledger Index][] | The ledger index of the most recent ledger actually searched for transactions. |
| `limit` | Integer | The `limit` value used in the request. (This may differ from the actual limit value enforced by the server.) |
| `marker` | [Marker][] | Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. |
| `transactions` | Array | Array of transactions matching the request's criteria, as explained below. |
| `validated` | Boolean | If included and set to `true`, the information in this response comes from a validated ledger version. Otherwise, the information is subject to change. |
**Note:** The server may respond with different values of `ledger_index_min` and `ledger_index_max` than you provided in the request, for example if it did not have the versions you specified on hand.
Each transaction object includes the following fields, depending on whether it was requested in JSON or hex string (`"binary":true`) format.
| `Field` | Type | Description |
|:---------------|:---------------------------------|:-------------------------|
| `ledger_index` | Integer | The [ledger index][] of the ledger version that included this transaction. |
| `meta` | Object (JSON) or String (Binary) | If `binary` is True, then this is a hex string of the transaction metadata. Otherwise, the transaction metadata is included in JSON format. |
| `tx` | Object | (JSON mode only) JSON object defining the transaction |
| `tx_blob` | String | (Binary mode only) Unique hashed String representing the transaction. |
| `validated` | Boolean | Whether or not the transaction is included in a validated ledger. Any transaction not yet in a validated ledger is subject to change. |
## Possible Errors
* Any of the [universal error types][].
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
* `actMalformed` - The [Address][] specified in the `account` field of the request is not formatted properly.
* `lgrIdxMalformed` - The ledger specified by the `ledger_index_min` or `ledger_index_max` does not exist, or if it does exist but the server does not have it.
* `lgrIdxsInvalid` - Either the request specifies a `ledger_index_max` that is before the `ledger_index_min`, or the server does not have a validated ledger range because it is [not synced with the network](../../../../infrastructure/troubleshooting/server-doesnt-sync.md).
{% raw-partial file="/_snippets/common-links.md" /%}

View File

@@ -0,0 +1,305 @@
---
html: gateway_balances.html
parent: account-methods.html
seo:
description: Calculate total amounts issued by an account.
labels:
- Tokens
- Accounts
---
# gateway_balances
[[Source]](https://github.com/XRPLF/rippled/blob/9111ad1a9dc37d49d085aa317712625e635197c0/src/ripple/rpc/handlers/GatewayBalances.cpp "Source")
The `gateway_balances` command calculates the total balances issued by a given account, optionally excluding amounts held by [operational addresses](../../../../concepts/accounts/account-types.md).
**Caution:** Some public servers disable this API method because it can require a large amount of processing.
## Request Format
An example of the request format:
{% raw-partial file="/_snippets/no-cli-syntax.md" /%}
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": "example_gateway_balances_1",
"command": "gateway_balances",
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"strict": true,
"hotwallet": ["rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ","ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt"],
"ledger_index": "validated"
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
{
"method": "gateway_balances",
"params": [
{
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"hotwallet": [
"rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ",
"ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt"
],
"ledger_index": "validated",
"strict": true
}
]
}
```
{% /tab %}
{% tab label="Commandline" %}
```sh
rippled json gateway_balances ' {"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", "hotwallet": ["rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ", "ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt"],"ledger_index": "validated","strict": true} '
```
{% /tab %}
{% /tabs %}
The request includes the following parameters:
| `Field` | Type | Description |
|:---------------|:---------------------------|:-------------------------------|
| `account` | String | The [Address][] to check. This should be the [issuing address](../../../../concepts/accounts/account-types.md) |
| `strict` | Boolean | _(Optional)_ If true, only accept an address or public key for the account parameter. Defaults to false. |
| `hotwallet` | String or Array | _(Optional)_ An [operational address](../../../../concepts/accounts/account-types.md) to exclude from the balances issued, or an array of such addresses. |
| `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 version to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
## Response Format
An example of a successful response:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 3,
"status": "success",
"type": "response",
"result": {
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"assets": {
"r9F6wk8HkXrgYWoJ7fsv4VrUBVoqDVtzkH": [
{
"currency": "BTC",
"value": "5444166510000000e-26"
}
],
"rPFLkxQk6xUGdGYEykqe7PR25Gr7mLHDc8": [
{
"currency": "EUR",
"value": "4000000000000000e-27"
}
],
"rPU6VbckqCLW4kb51CWqZdxvYyQrQVsnSj": [
{
"currency": "BTC",
"value": "1029900000000000e-26"
}
],
"rpR95n1iFkTqpoy1e878f4Z1pVHVtWKMNQ": [
{
"currency": "BTC",
"value": "4000000000000000e-30"
}
],
"rwmUaXsWtXU4Z843xSYwgt1is97bgY8yj6": [
{
"currency": "BTC",
"value": "8700000000000000e-30"
}
]
},
"balances": {
"rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ": [
{
"currency": "EUR",
"value": "29826.1965999999"
}
],
"ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt": [
{
"currency": "USD",
"value": "13857.70416"
}
]
},
"ledger_hash": "61DDBF304AF6E8101576BF161D447CA8E4F0170DDFBEAFFD993DC9383D443388",
"ledger_index": 14483195,
"obligations": {
"BTC": "5908.324927635318",
"EUR": "992471.7419793958",
"GBP": "4991.38706013193",
"USD": "1997134.20229482"
},
"validated": true
}
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
200 OK
{
"result": {
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"assets": {
"r9F6wk8HkXrgYWoJ7fsv4VrUBVoqDVtzkH": [
{
"currency": "BTC",
"value": "5444166510000000e-26"
}
],
"rPFLkxQk6xUGdGYEykqe7PR25Gr7mLHDc8": [
{
"currency": "EUR",
"value": "4000000000000000e-27"
}
],
"rPU6VbckqCLW4kb51CWqZdxvYyQrQVsnSj": [
{
"currency": "BTC",
"value": "1029900000000000e-26"
}
],
"rpR95n1iFkTqpoy1e878f4Z1pVHVtWKMNQ": [
{
"currency": "BTC",
"value": "4000000000000000e-30"
}
],
"rwmUaXsWtXU4Z843xSYwgt1is97bgY8yj6": [
{
"currency": "BTC",
"value": "8700000000000000e-30"
}
]
},
"balances": {
"rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ": [
{
"currency": "EUR",
"value": "29826.1965999999"
}
],
"ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt": [
{
"currency": "USD",
"value": "13857.70416"
}
]
},
"ledger_hash": "980FECF48CA4BFDEC896692C31A50D484BDFE865EC101B00259C413AA3DBD672",
"ledger_index": 14483212,
"obligations": {
"BTC": "5908.324927635318",
"EUR": "992471.7419793958",
"GBP": "4991.38706013193",
"USD": "1997134.20229482"
},
"status": "success",
"validated": true
}
}
```
{% /tab %}
{% tab label="Commandline" %}
```json
{
"result" : {
"account" : "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"assets" : {
"r9F6wk8HkXrgYWoJ7fsv4VrUBVoqDVtzkH" : [
{
"currency" : "BTC",
"value" : "5444166510000000e-26"
}
],
"rPU6VbckqCLW4kb51CWqZdxvYyQrQVsnSj" : [
{
"currency" : "BTC",
"value" : "1029900000000000e-26"
}
],
"rpR95n1iFkTqpoy1e878f4Z1pVHVtWKMNQ" : [
{
"currency" : "BTC",
"value" : "4000000000000000e-30"
}
],
"rwmUaXsWtXU4Z843xSYwgt1is97bgY8yj6" : [
{
"currency" : "BTC",
"value" : "8700000000000000e-30"
}
]
},
"balances" : {
"rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ" : [
{
"currency" : "EUR",
"value" : "144816.1965999999"
}
],
"ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt" : [
{
"currency" : "USD",
"value" : "6677.38614"
}
]
},
"frozen_balances" : {
"r4keXr5myiU4iTLh68ZqZ2CgsJ8dM9FSW6" : [
{
"currency" : "BTC",
"value" : "0.091207822800868"
}
]
},
"ledger_hash" : "6C789EAF25A931565E5936042EED037F287F3348B61A70777649552E0385B0E4",
"ledger_index" : 57111383,
"obligations" : {
"BTC" : "1762.700511879441",
"EUR" : "813792.4267005104",
"GBP" : "4974.337212333351",
"USD" : "6739710.218284974"
},
"status" : "success",
"validated" : true
}
}
```
{% /tab %}
{% /tabs %}
The response follows the [standard format][], with a successful result containing the following fields:
| `Field` | Type | Description |
|:-----------------------|:--------------------------|:------------------------|
| `account` | String - [Address][] | The address of the account that issued the balances. |
| `obligations` | Object | (Omitted if empty) Total amounts issued to addresses not excluded, as a map of currencies to the total value issued. |
| `balances` | Object | _(Omitted if empty)_ Amounts issued to the `hotwallet` addresses from the request. The keys are addresses and the values are arrays of currency amounts they hold. |
| `assets` | Object | _(Omitted if empty)_ Total amounts held that are issued by others. In the recommended configuration, the [issuing address](../../../../concepts/accounts/account-types.md) should have none. |
| `ledger_hash` | String - [Hash][] | _(May be omitted)_ The identifying hash of the ledger version that was used to generate this response. |
| `ledger_index` | Number - [Ledger Index][] | _(May be omitted)_ The ledger index of the ledger version that was used to generate this response. |
| `ledger_current_index` | Number - [Ledger Index][] | _(Omitted if `ledger_current_index` is provided)_ The [ledger index][] of the current in-progress ledger version, which was used to retrieve this information. |
## Possible Errors
* Any of the [universal error types][].
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
* `invalidHotWallet` - One or more of the addresses specified in the `hotwallet` field is not the [Address][] of an account holding currency issued by the account from the request.
* `actNotFound` - The [Address][] specified in the `account` field of the request does not correspond to an account in the ledger.
* `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.
{% raw-partial file="/_snippets/common-links.md" /%}

View File

@@ -0,0 +1,12 @@
---
html: account-methods.html
parent: public-api-methods.html
metadata:
indexPage: true
---
# Account Methods
An account in the XRP Ledger represents a holder of XRP and a sender of transactions. Use these methods to work with account info.
{% child-pages /%}

View File

@@ -0,0 +1,194 @@
---
html: noripple_check.html
parent: account-methods.html
seo:
description: Get recommended changes to an account's Default Ripple and No Ripple settings.
labels:
- Tokens
---
# noripple_check
[[Source]](https://github.com/XRPLF/rippled/blob/9111ad1a9dc37d49d085aa317712625e635197c0/src/ripple/rpc/handlers/NoRippleCheck.cpp "Source")
The `noripple_check` command provides a quick way to check the status of [the Default Ripple field for an account and the No Ripple flag of its trust lines](../../../../concepts/tokens/fungible-tokens/rippling.md), compared with the recommended settings.
## Request Format
An example of the request format:
{% raw-partial file="/_snippets/no-cli-syntax.md" /%}
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 0,
"command": "noripple_check",
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"role": "gateway",
"ledger_index": "current",
"limit": 2,
"transactions": true
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
{
"method": "noripple_check",
"params": [
{
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"ledger_index": "current",
"limit": 2,
"role": "gateway",
"transactions": true
}
]
}
```
{% /tab %}
{% /tabs %}
The request includes the following parameters:
| `Field` | Type | Description |
|:---------------|:---------------------------|:-------------------------------|
| `account` | String | A unique identifier for the account, most commonly the account's address. |
| `role` | String | Whether the address refers to a `gateway` or `user`. Recommendations depend on the role of the account. Issuers must have Default Ripple enabled and must disable No Ripple on all trust lines. Users should have Default Ripple disabled, and should enable No Ripple on all trust lines. |
| `transactions` | Boolean | [API v1][]: _(Optional)_ If `true`, include an array of suggested [transactions](../../../protocol/transactions/index.md), as JSON objects, that you can sign and submit to fix the problems. The default is `false`.<br>[API v2][]: Identical to v1, but also returns an `invalidParams` error if you use a non-boolean value. |
| `limit` | Unsigned Integer | _(Optional)_ The maximum number of trust line problems to include in the results. Defaults to 300. |
| `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][]) |
## Response Format
An example of a successful response:
{% tabs %}
{% tab label="WebSocket" %}
```json
{
"id": 0,
"status": "success",
"type": "response",
"result": {
"ledger_current_index": 14342939,
"problems": [
"You should immediately set your default ripple flag",
"You should clear the no ripple flag on your XAU line to r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"You should clear the no ripple flag on your USD line to rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
],
"transactions": [
{
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"Fee": 10000,
"Sequence": 1406,
"SetFlag": 8,
"TransactionType": "AccountSet"
},
{
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"Fee": 10000,
"Flags": 262144,
"LimitAmount": {
"currency": "XAU",
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"value": "0"
},
"Sequence": 1407,
"TransactionType": "TrustSet"
},
{
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"Fee": 10000,
"Flags": 262144,
"LimitAmount": {
"currency": "USD",
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"value": "5"
},
"Sequence": 1408,
"TransactionType": "TrustSet"
}
],
"validated": false
}
}
```
{% /tab %}
{% tab label="JSON-RPC" %}
```json
200 OK
{
"result": {
"ledger_current_index": 14380381,
"problems": [
"You should immediately set your default ripple flag",
"You should clear the no ripple flag on your XAU line to r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"You should clear the no ripple flag on your USD line to rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
],
"status": "success",
"transactions": [
{
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"Fee": 10000,
"Sequence": 1406,
"SetFlag": 8,
"TransactionType": "AccountSet"
},
{
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"Fee": 10000,
"Flags": 262144,
"LimitAmount": {
"currency": "XAU",
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"value": "0"
},
"Sequence": 1407,
"TransactionType": "TrustSet"
},
{
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"Fee": 10000,
"Flags": 262144,
"LimitAmount": {
"currency": "USD",
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"value": "5"
},
"Sequence": 1408,
"TransactionType": "TrustSet"
}
],
"validated": false
}
}
```
{% /tab %}
{% /tabs %}
The response follows the [standard format][], with a successful result containing the following fields:
| `Field` | Type | Description |
|:-----------------------|:-------|:-------------------------------------------|
| `ledger_current_index` | Number | The [ledger index][] of the ledger used to calculate these results. |
| `problems` | Array | Array of strings with human-readable descriptions of the problems. This includes up to one entry if the account's Default Ripple setting is not as recommended, plus up to `limit` entries for trust lines whose No Ripple setting is not as recommended. |
| `transactions` | Array | (May be omitted) If the request specified `transactions` as `true`, this is an array of JSON objects, each of which is the JSON form of a [transaction](../../../protocol/transactions/index.md) that should fix one of the described problems. The length of this array is the same as the `problems` array, and each entry is intended to fix the problem described at the same index into that array. |
## Possible Errors
* Any of the [universal error types][].
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
* `actNotFound` - The [Address][] specified in the `account` field of the request does not correspond to an account in the ledger.
* `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.
{% raw-partial file="/_snippets/common-links.md" /%}