wallet

The wallet extension provides wallet connectors for agent operations including challenge signing, transaction signing, and wallet management.

Installation

bun add @regent/wallet

Basic Usage

import { createAgent } from '@regent/core';
import { http } from '@regent/http';
import { wallets, walletsFromEnv } from '@regent/wallet';

const agent = await createAgent({
  name: 'my-agent',
  version: '1.0.0',
})
  .use(http())
  .use(wallets({ config: walletsFromEnv() }))
  .build();

API Reference

wallets(options?)

Creates the wallets extension.

WalletsConfig

walletsFromEnv()

Configure wallets from environment variables:

WalletConnector Interface

All wallet implementations conform to this interface:

WalletMetadata

WalletCapabilities

Connector Types

LocalEoaWalletConnector

Local EOA wallet using a private key.

Options

Capabilities

  • signer: true - Provides LocalEoaSigner

  • walletClient: true - Provides viem WalletClient

ThirdwebWalletConnector

Server wallet via thirdweb Engine.

Options

Dependencies

Requires peer dependency:

ServerOrchestratorWalletConnector

Server-orchestrated wallet via Regent API.

Options

Access Token Management

Environment Variables

Agent Wallet

Common:

For Local Wallets (type=local):

For Thirdweb Wallets (type=thirdweb):

For Regent Wallets (type=regent):

Developer Wallet

Challenge Signing

AgentChallenge

Signing Modes

EIP-712 Typed Data

EIP-191 Message

Message Encoding Detection

LocalEoaSigner Interface

Viem Integration

Signature Utilities

Creating Private Key Signer

Custom Wallet Connector

Bring your own wallet implementation:

CompatibleWallet Interface

WalletsRuntime

When the extension is used, agent.wallets provides:

Address Utilities

Exports

Last updated