account_lines
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:
The request accepts the following parameters:
| Type | Description |
| String - [Address][] | Look up trust lines connected to this account. |
| String | (Optional) A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
| Number or String | (Optional) The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
| String - [Address][] | (Optional) A second account; if provided, filter results to trust lines connecting the two accounts. |
| 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][] | (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:
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:
| Type | Description |
| String | Unique [Address][] of the account this request corresponds to. This is the "perspective account" for purpose of the trust lines. |
| Array | Array of trust line objects, as described below. If the number of trust lines is large, only returns up to the |
| Integer - [Ledger Index][] | (Omitted if |
| Integer - [Ledger Index][] | (Omitted if |
| String - [Hash][] | (May be omitted) The identifying hash the ledger version that was used when retrieving this data. |
| [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:
| Type | Description |
| String | The unique [Address][] of the counterparty to this trust line. |
| 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. |
| String | A [Currency Code][] identifying what currency this trust line can hold. |
| String | The maximum amount of the given currency that this account is willing to owe the peer account |
| String | The maximum amount of currency that the counterparty account is willing to owe the perspective account |
| 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. |
| 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. |
| Boolean | (May be omitted) If |
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 theaccount
field of the request does not correspond to an account in the ledger.lgrNotFound
- The ledger specified by theledger_hash
orledger_index
does not exist, or it does exist but the server does not have it.actMalformed
- If themarker
field provided is not acceptable.
Last updated