BluxBlux

Get Assets

Fetch a paginated list of Stellar assets using the Blux core SDK.

The getAssets function returns a paginated list of Stellar assets. forIssuer accepts a G…/M… account, SEP-2 federation address, or .xlm name; see address resolution.

The return value contains two properties:

  • response — the asset records you can use directly
  • builder — exposes next() and prev() to paginate through results

Type

export type CallBuilderOptions = {
  cursor?: string;
  limit?: number;
  network?: string;
  order?: "asc" | "desc";
};

type GetAssetsOptions = CallBuilderOptions & {
  forCode?: string;
  forIssuer?: string; // G…/M…, SEP-2 address, or .xlm name
};

type GetAssetsResult = {
  builder: AssetsCallBuilder;
  response: Horizon.ServerApi.CollectionPage<Horizon.ServerApi.AssetRecord>;
};

Usage

import { core } from "@bluxcc/core";

const result = await core.getAssets({
  forCode: "USDC",
  forIssuer: "issuer.xlm",
});

On this page