@uzolabs/sdk to any Node.js or browser project and import only the parts you need.
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.Requirements
- Node.js 18 or later.
- viem v2. It’s a peer dependency, so you install it yourself.
- TypeScript is optional. The package includes its own types.
Install
Why viem is a peer dependency
The SDK’s chain objects and ABIs are plain viem types. If the SDK bundled its own copy of viem, your app could end up with two copies whose types don’t match. Because viem is a peer dependency, it’s installed once, at the version you choose. Any version in^2.0.0 works.
Subpath imports
Each module has its own entry point. Import from the narrowest one you need, so your bundle includes only that code.imports.ts
These are the limits the SDK’s CI enforces, not measured sizes. viem isn’t included in them.
The package includes both ES module and CommonJS builds. It’s marked as free of side effects, so bundlers can drop any exports you don’t use.
Check it works
check.ts
Output
Troubleshooting
npm warns about a missing peer dependency
npm warns about a missing peer dependency
Install viem:
npm install viem. Any 2.x version works.Cannot find module '@uzolabs/sdk/chains'
Cannot find module '@uzolabs/sdk/chains'
Your TypeScript
moduleResolution setting may not read package exports. In tsconfig.json, set it to "bundler", "node16" or "nodenext".ERR_REQUIRE_ESM or a similar module error
ERR_REQUIRE_ESM or a similar module error
Use Node.js 18 or later. The SDK supports both
import and require, so check you aren’t using both in the same file.Next steps
SDK quickstart
Make your first read.
Use with wagmi
Add BOT Chain to a React app.
Use with ethers
Use the SDK’s addresses and ABIs with ethers v6.
Use with Next.js
Add BOT Chain to a Next.js App Router app.