Skip to content

iou.retrieve()

[Source]

Read a single IOU trust line (point-in-time).

Signature

iou.retrieve(
  params: IOURetrieveParams
): Promise<IOURetrieveResult>

Parameters

ParameterTypeRequiredDescription
tickerstringYesThe currency code (3-character ISO-4217-style or 40-character hex; other codes are auto-encoded to hex).
issuerstringYesThe IOU issuer's r-address.
accountstringNoThe holder account to read from. Defaults to the primary signer's account.

Returns

Resolves to an IOURetrieveResult:

FieldTypeDescription
iouIDstringCurrency code and issuer, e.g. USD.rIssuer... — pass to the write operations.
dataIOUTrustLine | undefinedThe point-in-time trust line snapshot, or undefined if no line exists.

IOUTrustLine

FieldTypeDescription
currencystringThe currency ticker (hex codes decoded to ASCII where printable).
peerstringThe counterparty r-address (the issuer, when querying as holder).
balancestringThe trust line balance, from the queried account's perspective.
limitstringThe queried account's trust limit.
limitPeerstringThe counterparty's trust limit.
noRipplebooleanWhether rippling is disabled on this line.
frozenbooleanWhether the queried account has frozen this line.
authorizedbooleanWhether the line is authorized (issuer authorized the holder).

Underlying XRPL request

Read-only — no signer is required and nothing is submitted. Queries the ledger with account_lines.

Example

const { data } = await client.iou.retrieve({
  ticker: 'USD',
  issuer: 'rIssuer...',
})

console.log(data?.balance)