Read an account's on-chain state — XRP balance, sequence, owner count, and flags.
account.retrieve(
params?: AccountRetrieveParams,
): Promise<AccountRetrieveResult>| Parameter | Type | Required | Description |
|---|---|---|---|
account | string | No | The account to read. Defaults to the primary signer's account. |
Resolves to an AccountRetrieveResult:
| Field | Type | Description |
|---|---|---|
data | AccountData | The point-in-time account snapshot. |
| Field | Type | Description |
|---|---|---|
address | string | The account's r-address. |
xrpBalance | string | The XRP balance (converted from drops). |
sequence | number | The account sequence number. |
ownerCount | number | The number of owned ledger objects (drives the reserve). |
flags | Readonly<Record<string, boolean>> | Account flags as booleans, as reported by account_flags. |
Read-only — no signer is required and nothing is submitted. Queries the ledger with account_info (flags are resolved via account_flags).
const { data } = await client.account.retrieve()
console.log(data.xrpBalance)