Skip to content

account.listOffers()

[Source]

List the open DEX offers placed by an account.

Signature

account.listOffers(
  params?: AccountListOffersParams,
): Promise<ListOffersResult>

Parameters

ParameterTypeRequiredDescription
accountstringNoThe account whose offers to list. Defaults to the primary signer's account.

Returns

Resolves to a ListOffersResult:

FieldTypeDescription
datareadonly OfferSummary[]The shaped open offers.

OfferSummary

Each offer mirrors the buyOffer / sellOffer input format, so it's composable back into those write operations.

FieldTypeDescription
offerSequencenumberThe offer's sequence number (pass to cancelOffer).
amountstringThe quantity of the base asset being traded, as a decimal string.
priceIOUOfferPriceWhat is paid/received for it, in offer-price form.
orderType'limit' | 'passive'Resting offers are limit, or passive when the passive flag is set.
type'buy' | 'sell'Whether the offer buys or sells the base asset.

Amounts stay strings rather than being coerced to number: these values compose back into iou.buyOffer / iou.sellOffer, and rounding an exact ledger amount through a double would silently change the order you re-place from a read.

Underlying XRPL request

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

Example

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

for (const offer of data) {
  console.log(offer.offerSequence, offer.type, offer.amount)
}