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.Import
All types are exported from the package root and from the subpath they belong to. Useimport type so nothing is added to your bundle:
Import
Types in 0.2.0
SupportedChainId
Signature
677 for BOT Chain and 968 for BOT Chain Testnet. getAddresses and createExplorerClient take this type, so passing another number literal is a compile error. If the value comes from a wallet at runtime, it’s a plain number, and the SDK checks it and throws UnsupportedChainError.
is-supported.ts
AddressInfo
Returned bygetAddressInfo.
Present only for tokens with a symbol and whole-number decimals.
ContractInfo
Returned bygetContract.
ExplorerClient
Signature
createExplorerClient. Use it to type a function that accepts a client, or to write a mock in tests.
Address and ABI types
The SDK doesn’t define its ownAddress, Hex or Abi types. It uses viem’s, so values move between the SDK and viem without conversion. The addresses object and the ABIs are declared as const, so getAddresses(968).usdt has its exact address as its type and ABI reads return typed results.
Planned types
The brief for the planned modules names two shared types. Their fields aren’t published, so they aren’t listed here.
Until they ship, viem’s own types cover the same ground. Pass the result of
encodeFunctionData as data in a sendTransaction call, as shown in Send transactions.
Related
Errors
Error classes and codes.
Changelog
What changed in each release.