Cloud SDK
Prices, activity, and NFTs
Fetch USD prices, paginated transaction history, and NFT holdings with @gray3/cloud.
Prices
ts
// One token (omit address for the native asset)
const eth = await gray.prices.get({ chainId: "ethereum" });
// Up to 50 tokens across chains in one call
const prices = await gray.prices.getMany({
tokens: [
{ chainId: "ethereum" },
{ chainId: "ethereum", address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" },
{ chainId: "solana" },
],
});
// { quotes: [{ chainId, address?, priceUsd, … }], failures: [...], asOf }Prices are mainnet-only. Portfolio responses often include priceUsd already, so call the prices methods only when you need a fresh quote or a token the user does not hold.
Activity
ts
let cursor: string | undefined;
do {
const page = await gray.activity.list({
chainId: "ethereum",
address: "0xYourAddress",
cursor,
});
render(page.items);
cursor = page.nextCursor;
} while (cursor && userWantsMore());Cursors are opaque strings of up to 1024 characters; pass them back unchanged. A page may contain more items than limit, so always follow nextCursor rather than counting items. Items may include rawAmount and decimals. Activity is single-chain. For several chains, call activity.list for each one in parallel and merge the results. Testnet chain IDs such as ethereum-sepolia are supported.
NFTs
ts
const nfts = await gray.nfts.list({
chainId: "ethereum",
address: "0xYourAddress",
});NFT listing is single-chain and mainnet-only. See List NFTs for the response fields.