Skip to Content
SDK Reference

SDK Reference

Browser dApp reference for @human.tech/waap-sdk. For headless agents and scripts, see the CLI Reference.

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 });

Deep Dives

Last updated on