Skip to Content
SDK & CLI ReferenceSDK & CLI Reference

SDK & CLI Reference

WaaP exposes wallet functionality through two interfaces: the SDK (for browser-based dApps) and the CLI (for agents and scripts). Both use the same underlying 2PC signing infrastructure.

Authentication

import { initWaaP } from "@human.tech/waap-sdk" // Initialize and show login modal initWaaP({ config: { authenticationMethods: ['email', 'phone', 'social'] } }) const loginType = await window.waap.login() // Logout await window.waap.logout()

Get Wallet Address

const accounts = await window.waap.request({ method: 'eth_requestAccounts' }) console.log(accounts[0]) // 0xAbc...

Sign a Message

const signature = await window.waap.request({ method: 'personal_sign', params: ['Hello WaaP', accounts[0]] })

Sign Typed Data (EIP-712)

const signature = await window.waap.request({ method: 'eth_signTypedData_v4', params: [accounts[0], JSON.stringify(typedData)] })

Send a Transaction

const txHash = await window.waap.request({ method: 'eth_sendTransaction', params: [{ from: accounts[0], to: '0xRecipient', value: '0x2386F26FC10000' // 0.01 ETH in wei }] })

Switch Chain

await window.waap.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: '0x89' }] // Polygon })

Policy & 2FA (CLI only)

These features are specific to the CLI for agent safety controls.

# View policy settings waap-cli policy get # Set daily spend limit waap-cli policy set --daily-spend-limit 500 # Enable 2FA waap-cli 2fa enable --email agent@example.com # Check 2FA status waap-cli 2fa status

Deep Dives