Provider
A thin JSON-RPC wrapper for interacting with chains and Blocto wallet.
Blocto SDK comes with an EIP-1193 compatible provider, you can use it to interact with EVM-compatible chains.
Note that Blocto SDK for EVM-compatible chains is still in Beta. APIs are subject to breaking changes.
Installation
Install from npm/yarn/pnpm
... or via CDN
Usage
Initiate Blocto SDK
After SDK 0.9.0
, you can load all evm-compatiable chains once when initiating.
Parameter | Type | Description | Required |
---|---|---|---|
defaultChainId | string (hex) | Hexadecimal chainId | Yes |
switchableChains | Array | Array of AddEthereumChainParameter | Yes |
Initiate Blocto SDK before v0.9.0
Before 0.9.0
, you can only initiate with one evm-compatiable chain.
Parameter | Type | Description | Required |
---|---|---|---|
| String (hex) Number | EVM chain ID to connect to Reference: EVM Networks | Yes |
| String | JSON RPC endpoint | Yes |
| String | Blocto dApp ID | No |
Support Chains
Network | Chain ID |
---|---|
Ethereum Mainnet | 1 |
Ethereum Sepolia Testnet | 11155111 |
Arbitrum Mainnet | 42161 |
Arbitrum Sepolia | 421614 |
Optimism Mainnet | 10 |
Optimism Sepolia | 11155420 |
Polygon Mainnet | 137 |
Polygon Amoy Testnet | 80002 |
BSC Mainnet | 56 |
BSC Chapel Testnet | 97 |
Avalanche Mainnet | 43114 |
Avalanche Fuji Testnet | 43113 |
Base Mainnet | 8453 |
Base Sepolia | 84532 |
Zora Mainnet | 7777777 |
Zora Sepolia | 999999999 |
Scroll Mainnet | 534352 |
Scroll Sepolia Testnet | 534351 |
Connect to Blocto wallet
Once the connection request is fired, there would be a prompt modal to guide user to register/login to Blocto wallet
After connected with Blocto wallet, you can start to send JSON-RPC request with blocto provider
Last updated