@web3marketlabs/sdk
Chain definitions, Viem client factories, ABI parsing utilities, deployment address management, token data fetching, and shared type definitions.
npm install @web3marketlabs/sdkReference
Exports
Chain Management
| Export | Type | Description |
|---|---|---|
chains | Record<string, ChainConfig> | Dictionary of all supported chain configurations |
getChain | function | Look up a chain by numeric ID or string key |
ChainConfig | interface | Type definition for a chain configuration |
Client Factories
| Export | Type | Description |
|---|---|---|
createClient | function | Create a Viem PublicClient for reading blockchain state |
createWalletClient | function | Create a Viem WalletClient for signing transactions |
CreateClientOptions | interface | Options for createClient |
CreateWalletClientOptions | interface | Options for createWalletClient |
ABI Utilities
| Export | Type | Description |
|---|---|---|
categorizeAbi | function | Split an ABI into reads, writes, events, and errors |
getReadFunctions | function | Extract view/pure functions from an ABI |
getWriteFunctions | function | Extract nonpayable/payable functions from an ABI |
getEvents | function | Extract event definitions from an ABI |
formatFunctionName | function | Convert a Solidity function name to PascalCase |
CategorizedAbi | interface | Return type of categorizeAbi |
Address Management
| Export | Type | Description |
|---|---|---|
getAddress | function | Get a contract address for a specific chain from a registry |
hasAddress | function | Check if a registry has an address for a chain |
loadDeployments | function | Load deployment JSON files from a directory |
AddressRegistry | type | Maps chain ID to contract address |
Token Data
| Export | Type | Description |
|---|---|---|
fetchTokenInfo | function | Read on-chain ERC-20 metadata from a token contract |
TokenInfo | interface | Return type of fetchTokenInfo |
Component Types
| Export | Type | Description |
|---|---|---|
KitComponent | interface | Interface for installable modules |
ComponentTier | type | Module tier ("free" or "pro") |
ComponentParameter | interface | Parameter definition for module configuration |
ComponentFile | interface | File definition within a module |
DeployHook | interface | Hook for custom deployment logic |
CodegenPlugin | interface | Plugin interface for the codegen pipeline |
KitModule | interface | Module definition for multi-variant modules |
ModuleVariant | interface | Variant within a module |
DeployStep | interface | A single step in a deployment sequence |
WizardContext | interface | Context passed to interactive wizards |
ModuleFile | interface | File definition within a module variant |