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
SDK
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
SDK
const accounts = await window.waap.request({ method: "eth_requestAccounts" });
console.log(accounts[0]); // 0xAbc...Sign a Message
SDK
const signature = await window.waap.request({
method: "personal_sign",
params: ["Hello WaaP", accounts[0]],
});Sign Typed Data (EIP-712)
SDK
const signature = await window.waap.request({
method: "eth_signTypedData_v4",
params: [accounts[0], JSON.stringify(typedData)],
});Send a Transaction
SDK
const txHash = await window.waap.request({
method: "eth_sendTransaction",
params: [
{
from: accounts[0],
to: "0xRecipient",
value: "0x2386F26FC10000", // 0.01 ETH in wei
},
],
});Switch Chain
SDK
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 statusDeep Dives
- SDK Methods — Full EVM SDK method reference with demos
- Sui Methods — Full Sui SDK method reference
- CLI Commands — Complete CLI command reference
- Agent Patterns — 2FA flows, risk levels, session management
Last updated on