Integration with Libraries (Viem, Ethers, Web3.js)
Install Enclave
Install the Enclave SDK using your preferred package manager:
npm
npm i @enclave-so/sdk
Use Enclave with Libraries
You can use Enclave with libraries like Viem, Ethers, and Web3.js. Here's an example of how to use Enclave with each:
viem
import { provider } from '@enclave-so/sdk'
import { createWalletClient, custom } from 'viem'
import { mainnet } from 'viem/chains'
const client = createWalletClient({
chain: mainnet,
transport: custom(provider),
})
const accounts = await client.requestAddresses()
// ['0x6B944948B5e70e4421034C4C0744A176b0bf9968']