Skip to content

account.retrieve()

[Source]

Read an account's on-chain state — XRP balance, sequence, owner count, and flags.

Signature

account.retrieve(
  params?: AccountRetrieveParams,
): Promise<AccountRetrieveResult>

Parameters

ParameterTypeRequiredDescription
accountstringNoThe account to read. Defaults to the primary signer's account.

Returns

Resolves to an AccountRetrieveResult:

FieldTypeDescription
dataAccountDataThe point-in-time account snapshot.

AccountData

FieldTypeDescription
addressstringThe account's r-address.
xrpBalancestringThe XRP balance (converted from drops).
sequencenumberThe account sequence number.
ownerCountnumberThe number of owned ledger objects (drives the reserve).
flagsReadonly<Record<string, boolean>>Account flags as booleans, as reported by account_flags.

Underlying XRPL request

Read-only — no signer is required and nothing is submitted. Queries the ledger with account_info (flags are resolved via account_flags).

Example

const { data } = await client.account.retrieve()

console.log(data.xrpBalance)