@uzolabs/sdk and viem. It takes about two minutes and needs no wallet.
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 you’ll build
A script that connects to BOT Chain testnet and prints the latest block number. You’ll also see the same script written without the SDK, which shows exactly what the SDK saves you.Prerequisites
- Node.js 18 or later.
Steps
1
Create a project
2
Write the script
read-block.ts
botChainTestnet includes the chain ID, RPC URL, explorer and Multicall3 address, so you don’t need to pass a URL to http().3
Run it
Verify it worked
Output from a run on 2026-10-02:Output
botChain.
The same script without the SDK
If you can’t add a dependency, you can define the chain yourself with viem’sdefineChain. These are the same values the SDK exports:
read-block-viem.ts
Troubleshooting
HTTP request failed, or status 503
HTTP request failed, or status 503
The public testnet RPC is sometimes slow or briefly unavailable. Wait a few seconds and try again. See Known limitations.
Cannot use import statement outside a module
Cannot use import statement outside a module
Run
npm pkg set type=module, or rename the file to read-block.mts.Next steps
Contract addresses
Read a BDEX quote with typed addresses.
Explorer client
Look up contracts on BOTScan.