Actions is an SDK of abstractions and adapters for building applications on the OP stack
npm install @eth-optimism/actions-sdkInitialize the SDK with your wallet provider configuration:
import { initActions } from '@eth-optimism/actions-sdk'
const actions = initActions({
// MORE COMING SOON
})// Create a new wallet for a user
const wallet = await actions.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`)// Get existing wallet by user ID
const wallet = await actions.getWallet('user123')
if (wallet) {
console.log(`Found wallet: ${wallet.address}`)
} else {
console.log('Wallet not found')
}For running supersim integration tests, you'll need:
-
Supersim - Local multi-chain development environment (GitHub)
# macOS/Linux brew install ethereum-optimism/tap/supersim # Or download from releases # https://github.com/ethereum-optimism/supersim/releases
-
Foundry - Required by supersim
curl -L https://foundry.paradigm.xyz | bash foundryup
Run unit tests:
pnpm testRun tests including external tests (those that make real network requests):
EXTERNAL_TEST=true pnpm testRun tests including supersim integration tests:
SUPERSIM_TEST=true pnpm testExternal tests are used for integration testing with live APIs and services. Supersim tests require supersim to be installed and create local forked networks. Both are disabled by default.
Some tests use supersim for local forked network testing. They automatically start/stop supersim, fund test wallets, and test transaction execution.
Generate API documentation:
npm run docs