@functornetwork/agentic-wallet
v0.3.2
Published
TypeScript SDK for creating non-custodial agentic wallets with on-chain session-key delegation.
Maintainers
Readme
@functornetwork/agentic-wallet
TypeScript SDK for creating non-custodial agentic wallets with on-chain session-key delegation.
npm install @functornetwork/agentic-wallet viemQuick start
Create a client for the chains you want. Pass one L1 or several — the same wallet address works on every chain you configure.
import { createClient, SEPOLIA, BNB_TESTNET } from "@functornetwork/agentic-wallet";
// Both L1s, or just one — your choice.
const client = createClient({ chains: [SEPOLIA, BNB_TESTNET] });Passkey wallet (browser)
const wallet = await client.createPasskeyWallet({ name: "My Agent Wallet" });Private-key wallet (server / agent)
import { signerFromPrivateKey } from "@functornetwork/agentic-wallet";
const signer = signerFromPrivateKey(process.env.PRIVATE_KEY);
const wallet = await client.createWallet({ signer });Grant a session and execute
Operations take an optional chainId (defaults to the client's first chain):
const session = await client.grantSession({
wallet,
signer,
permissions: {
calls: [{ to: "0x…" }],
spend: [{ limit: 1_000_000n, period: "day" }], // 1 USDC/day
},
expiry: Math.floor(Date.now() / 1000) + 60 * 60, // 1 hour
});
await client.execute({
session,
chainId: 97, // BNB testnet; omit to use the default chain
calls: [{ to: "0x…", value: 0n, data: "0x…" }],
});Documentation
Full docs, concept guides, and SDK reference: docs.functor.sh.
Source: github.com/functornetwork/sdk.
License
GPL-3.0-or-later
