Documentation Index
Fetch the complete documentation index at: https://docs.chipipay.com/llms.txt
Use this file to discover all available pages before exploring further.
Usage
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
params.chainToken | ChainToken | Yes | Token identifier. Use ChainToken.USDC |
params.chain | Chain | Yes | Blockchain network. Use Chain.STARKNET |
params.walletPublicKey | string | No | Wallet address to check balance for |
params.externalUserId | string | No | External user ID (alternative to walletPublicKey) |
getBearerToken | () => Promise<string> | Yes | Function returning the auth token |
queryOptions | UseQueryOptions | No | React Query options (e.g. staleTime, enabled) |
Return Value
| Property | Type | Description |
|---|---|---|
data | GetTokenBalanceResponse | undefined | Balance data |
isLoading | boolean | True while fetching |
isError | boolean | True if an error occurred |
isSuccess | boolean | True if the query succeeded |
error | Error | null | Error when isError is true |
refetch | () => void | Re-run the query |
fetchTokenBalance | (input) => Promise<GetTokenBalanceResponse> | Imperatively fetch balance with custom params |
Example Implementation
Either
walletPublicKey or externalUserId must be provided to identify the
wallet.