@coinbase/cdp-sdk
Version:
SDK for interacting with the Coinbase Developer Platform Wallet API
38 lines (33 loc) • 1.45 kB
text/typescript
/**
* Generated by orval v7.6.0 🍺
* Do not edit manually.
* Coinbase Developer Platform APIs
* The Coinbase Developer Platform APIs - leading the world's transition onchain.
* OpenAPI spec version: 2.0.0
*/
import type {
ListSolanaTokenBalances200,
ListSolanaTokenBalancesNetwork,
ListSolanaTokenBalancesParams,
} from "../coinbaseDeveloperPlatformAPIs.schemas.js";
import { cdpApiClient } from "../../cdpApiClient.js";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* Lists the token balances of a Solana address on a given network. The balances include SPL tokens and the native SOL token. The response is paginated, and by default, returns 20 balances per page.
**Note:** This endpoint is still under development and does not yet provide strong availability or freshness guarantees. Freshness and availability of new token balances will improve over the coming weeks.
* @summary List Solana token balances
*/
export const listSolanaTokenBalances = (
network: ListSolanaTokenBalancesNetwork,
address: string,
params?: ListSolanaTokenBalancesParams,
options?: SecondParameter<typeof cdpApiClient>,
) => {
return cdpApiClient<ListSolanaTokenBalances200>(
{ url: `/v2/solana/token-balances/${network}/${address}`, method: "GET", params },
options,
);
};
export type ListSolanaTokenBalancesResult = NonNullable<
Awaited<ReturnType<typeof listSolanaTokenBalances>>
>;