account_currencies
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:
The request includes the following parameters:
Field
Type
Required?
Description
account
String - [Address][]
Yes
Look up currencies this account can send or receive.
The following fields are deprecated and should not be provided: account_index
, strict
.
Response Format
An example of a successful response:
The response follows the [standard format][], with a successful result containing the following fields:
Field
Type
Description
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 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 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.
Last updated