createExplorerClient.
Early release. This is published in
@uzolabs/sdk 0.2.0 on npm and you can use it today. The API may change before 1.0, so pin the version.What it does
BOTScan is BOT Chain’s block explorer. It runs Blockscout, which has a public JSON API. The explorer client wraps two of its endpoints and returns small, typed results:
No API key is needed.
Why use it
- Check before you call. Confirm a user-supplied address is a verified contract, or a token with the decimals you expect, before you send a transaction to it.
- Load ABIs at runtime. For contracts the SDK doesn’t include, fetch the verified ABI instead of pasting it in by hand.
- Clear errors. Network failures, HTTP errors and bad addresses all throw
ExplorerErrororInvalidAddressErrorwith a message that says what to do.
createExplorerClient
Signature
677 | 968
required
Which BOTScan to query:
677 uses https://scan.botchain.ai/api/v2, 968 uses https://scan.bohr.life/api/v2. Any other value throws UnsupportedChainError.Example
explorer.ts
Output
Limits
- The client doesn’t retry or time out on its own. If BOTScan is slow, wrap calls in your own retry.
- BOTScan’s rate limits aren’t documented. Cache results that don’t change, such as a verified ABI.
- For anything else BOTScan offers, such as transaction history or logs, call its API directly. See Use the BOTScan API.
Next steps
getAddressInfo
Wallet, contract or token.
getContract
Verified ABI and proxy details.