@eth-optimism/verbs-sdk
v0.0.2
Published
TypeScript SDK for Verbs
Readme
@eth-optimism/verbs-sdk
Verbs is an SDK of web3 abstractions and adapters for building applications on the OP stack.
Installation
npm install @eth-optimism/verbs-sdkQuick Start
Initialize the SDK with your wallet provider configuration:
import { initVerbs } from '@eth-optimism/verbs-sdk'
const verbs = initVerbs({
wallet: {
type: 'privy',
appId: 'your-privy-app-id',
appSecret: 'your-privy-app-secret',
},
// MORE COMING SOON
})Usage
Creating a Wallet
// Create a new wallet for a user
const wallet = await verbs.createWallet('user123')
console.log(`Wallet created: ${wallet.address}`)
console.log(`Wallet ID: ${wallet.id}`)
// Get wallet balance
const balance = await wallet.getBalance()
console.log(`Balance: ${balance} wei`)Retrieving a Wallet
// Get existing wallet by user ID
const wallet = await verbs.getWallet('user123')
if (wallet) {
console.log(`Found wallet: ${wallet.address}`)
} else {
console.log('Wallet not found')
}Documentation
Generate API documentation:
npm run docs