Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Getting Started · Private-Key Wallet

The path for agents, scripts, and backend services. Anywhere a passkey doesn't make sense.

The private key lives wherever your code runs: your laptop's OS keychain, an env var, an encrypted file, a hardware wallet. Functor never sees it. There is no Functor-side custody, no API key, no off-chain authorization service.

Install

npm install @functornetwork/agentic-wallet viem

Create the wallet

import { createWallet, signerFromPrivateKey } from "@functornetwork/agentic-wallet";
 
const signer = signerFromPrivateKey(process.env.PRIVATE_KEY as `0x${string}`);
const wallet = await createWallet({ signer });
 
console.log(wallet.address);

Or let the SDK generate a fresh key for you:

import { createWallet } from "@functornetwork/agentic-wallet";
 
const wallet = await createWallet();
// wallet.signer is a freshly generated PrivateKeySigner. Persist it however your app stores secrets.

On Sepolia, createWallet faucets enough testnet ETH to activate the wallet on its first transaction. On mainnet, fund wallet.address yourself before continuing, or pass skipFaucet: true to skip the faucet step explicitly.

Run a transaction

import { execute } from "@functornetwork/agentic-wallet";
 
const result = await execute(wallet, signer, {
  to: "0xRecipient...",
  value: 1_000_000_000_000_000n, // 0.001 ETH
});
 
console.log(result.status, result.transactionHash);

The first execute on a fresh wallet does three things in one userOp:

  1. Registers the admin key in Keystore.
  2. Activates the smart account.
  3. Submits your call.

After that, every execute is just your calls.

What's next

  • Grant a session. Give a scoped, time-bounded key to an AI agent.
  • Passkey wallets, the other wallet path, for end-user apps in the browser.
  • Keystore, the public registry of who is authorized to act on a wallet.