Skip to main content
useTokens fetches the token list from the Alphscan API (GET /token/all) using the client from context. It manages page index, loading, error, and refetch.

When to use

  • Inside AlphscanProvider.
  • When you need a paginated list of tokens with loading/error state and page control.

Signature

UseTokensOptions

UseTokensResult

Example

The hook uses 0-based page internally and sends page + 1 to the API.