Tokens
Package web3 is the chain-access surface: which chains this deployment can reach, a JSON-RPC door onto each, and the two token reads every wallet UI needs.
Package web3 is the chain-access surface: which chains this deployment can reach, a JSON-RPC door onto each, and the two token reads every wallet UI needs.
| Base URL | https://api.hanzo.ai |
| Operations | 1 |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Quickstart
export HANZO_API_KEY=hk-... # console.hanzo.ai → API keysThen the first call. This one takes arguments — the placeholders are yours to fill. GET /v1/tokens/{chain}/{address}, operation get_tokens_by_chain_by_address:
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, TokensApi } from 'hanzoai';
const api = new TokensApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getTokensByChainByAddress({ chain: 'chain', address: 'address' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import TokensApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = TokensApi(client).get_tokens_by_chain_by_address(chain='chain', address='address')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.TokensAPI.GetTokensByChainByAddress(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, tokens_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = tokens_api::get_tokens_by_chain_by_address(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.TokensApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new TokensApi(client).getTokensByChainByAddress();The method above is the one at the current release of the document. [email protected] (PyPI) was generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl https://api.hanzo.ai/v1/tokens/<chain>/<address> \
-H "Authorization: Bearer $HANZO_API_KEY"The door declares no tool for tokens — tools/list on https://api.hanzo.ai/v1/mcp names the products it does reach. Use HTTP or an SDK.
Answers 200 with object — ok.
tokens
GET /v1/tokens/{chain}/{address}
Reads an address's native balance on a chain.
ERC-20 positions are NOT enumerated here: eth_getBalance answers the native one, but "every token this address holds" is an indexer question — there is no RPC call that answers it, and walking a token list would return a number that silently omits whatever the list missed. explorer owns the indexer relationship; this returns the balance the chain itself can prove.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
chain | path | string | yes | Chain is the registry id. |
address | path | string | yes | Address is the account, 0x-prefixed. |
How is this guide?