Chains
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 | 2 |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Quickstart
export HANZO_API_KEY=hk-... # console.hanzo.ai → API keysThen the first call — a read that needs nothing but the key. GET /v1/chains, operation get_chains:
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, ChainsApi } from 'hanzoai';
const api = new ChainsApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getChains();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ChainsApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ChainsApi(client).get_chains()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.ChainsAPI.GetChains(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, chains_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = chains_api::get_chains(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ChainsApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new ChainsApi(client).getChains();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/chains \
-H "Authorization: Bearer $HANZO_API_KEY"The door declares no tool for chains — 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.
chains
GET /v1/chains/{chain}
Reports one chain and whether its upstream is answering. An unreachable chain is still a 200 with live:false — the chain is configured, which is a different fact from the chain being up, and a 502 here would make a console page error rather than show the outage.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
chain | path | string | yes | Chain is the registry id, as in /v1/chains/lux. |
GET /v1/chains
Reports the chains this deployment can reach. The list is the declared registry, so it is exactly what /v1/rpc will accept — a chain that appears here is one this deployment actually has an upstream for.
How is this guide?