SDK · Base mainnet
Shadow mode: the SDK inside your agent
A few lines around the wallet your agent already uses (viem or Coinbase AgentKit). Shadow mode blocks nothing Sayso has answered, except a gas fee above the SDK’s limits or a signed transaction that is not the one checked, and records what it would have said; with no answer in time, the agent does not sign.
// npm install saysoio viem
import { createWalletClient, http } from 'viem'
import { base } from 'viem/chains'
import { Oathline } from 'saysoio'
const oathline = new Oathline({
apiUrl: 'https://api.saysoio.com',
apiKey: process.env.OATHLINE_API_KEY!,
chainId: 8453,
// mode left out: every wallet starts in shadow mode (watches only; it still refuses fees above the limits);
// the owner turns enforce on from the wallet’s page in the dashboard
})
const walletClient = createWalletClient({ account: agentAccount, chain: base, transport: http() })
const wallet = oathline.guard(walletClient) // the agent now uses `wallet`// the same Oathline setup as for viem, then:
const walletProvider = oathline.guardWalletProvider(provider)
const agentkit = await AgentKit.from({ walletProvider, actionProviders: [/* yours */] })
// give the agent only `agentkit`; keep `provider` privateAdd Sayso to this agent’s wallet. Follow https://saysoio.com/skill.md exactly.
Ask me for the invite code and the owner’s wallet address; never ask for, hold or use the owner’s key.
Leave mode out of the code (the wallet starts in shadow mode).