Get Offers
Fetch a paginated list of Stellar offers using the Blux core SDK.
The getOffers function returns a paginated list of Stellar offers.
forAccount, sponsor, and seller accept G…, M…, SEP-2 federation, or
.xlm; see address resolution.
The return value contains two properties:
response— the records you can use directlybuilder— exposesnext()andprev()to paginate through results
Type
export type CallBuilderOptions = {
cursor?: string;
limit?: number;
network?: string;
order?: "asc" | "desc";
};
type GetOffersOptions = CallBuilderOptions & {
forAccount?: string; // G…/M…, SEP-2 address, or .xlm name
buying?: AssetArg;
selling?: AssetArg;
sponsor?: string; // G…/M…, SEP-2 address, or .xlm name
seller?: string; // G…/M…, SEP-2 address, or .xlm name
};
type GetOffersResult = {
builder: OfferCallBuilder;
response: Horizon.ServerApi.CollectionPage<Horizon.ServerApi.OfferRecord>;
};Usage
import { core } from "@bluxcc/core";
const result = await core.getOffers({ seller: "alice.xlm" });