Skip to main content

Universal multi-chain secure signing SDK for AI agents

Project description

agent-wallet (Python)

License Python

Universal multi-chain signing SDK for AI agents — Python implementation.

Install

pip install bankofai-agent-wallet

Includes CLI (agent-wallet), EVM and TRON support — no extras needed.

Quick Start

from agent_wallet import resolve_wallet

wallet = await resolve_wallet(network="tron:nile")
signature = await wallet.sign_message(b"hello")

resolve_wallet automatically finds your wallet config in ~/.agent-wallet (or AGENT_WALLET_DIR).

Public API

from agent_wallet import (
    resolve_wallet,           # → Wallet (one-shot)
    resolve_wallet_provider,  # → WalletProvider (manage multiple wallets)
    ConfigWalletProvider,     # file-backed provider (local_secure / raw_secret)
    EnvWalletProvider,        # env-var-backed provider (AGENT_WALLET_PRIVATE_KEY)
)

resolve_wallet

Returns a ready-to-sign Wallet for the given network:

wallet = await resolve_wallet(network="eip155:1")
sig = await wallet.sign_transaction({"to": "0x...", "value": 0})

resolve_wallet_provider

Returns a WalletProvider based on what's available — useful when you need to manage or inspect wallets:

provider = resolve_wallet_provider(network="eip155:1")

# Get the active wallet
wallet = await provider.get_active_wallet()

# Or a specific wallet
wallet = await provider.get_wallet("my_wallet", network="tron:nile")

Provider resolution order

  1. Password available (from runtime_secrets.json or AGENT_WALLET_PASSWORD) → ConfigWalletProvider
  2. wallets_config.json exists with wallets → ConfigWalletProvider
  3. Otherwise → EnvWalletProvider (reads AGENT_WALLET_PRIVATE_KEY / AGENT_WALLET_MNEMONIC)

Wallet Interface

class Wallet(ABC):
    async def get_address() -> str
    async def sign_raw(raw_tx: bytes) -> str
    async def sign_transaction(payload: dict) -> str
    async def sign_message(msg: bytes) -> str

class Eip712Capable(ABC):
    async def sign_typed_data(data: dict) -> str

Both EVM and TRON adapters implement Wallet + Eip712Capable.

Network Routing

Network string Adapter Mnemonic derivation
eip155 or eip155:<chainId> EVM m/44'/60'/0'/0/{index}
tron or tron:<chain> TRON m/44'/195'/0'/0/{index}

Environment Variables

Variable Description
AGENT_WALLET_DIR Wallet directory (default ~/.agent-wallet)
AGENT_WALLET_PASSWORD Password for local_secure wallets
AGENT_WALLET_PRIVATE_KEY Env fallback private key (hex)
AGENT_WALLET_MNEMONIC Env fallback mnemonic phrase
AGENT_WALLET_MNEMONIC_ACCOUNT_INDEX Mnemonic account index (default 0)

Examples

Development

pip install -e ".[dev]"
pytest

License

MIT — BankOfAI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bankofai_agent_wallet-2.3.0b4.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bankofai_agent_wallet-2.3.0b4-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file bankofai_agent_wallet-2.3.0b4.tar.gz.

File metadata

  • Download URL: bankofai_agent_wallet-2.3.0b4.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for bankofai_agent_wallet-2.3.0b4.tar.gz
Algorithm Hash digest
SHA256 e42edb448e59676ce58130424d2c40d0eec207ec6ded7f955c24072a347d16cc
MD5 ae85e72416217afa8130b361b094d50b
BLAKE2b-256 689ee672169537bb791fcd1fdc2a994b3dcd54d0aa356045307c02ad8059bcb0

See more details on using hashes here.

File details

Details for the file bankofai_agent_wallet-2.3.0b4-py3-none-any.whl.

File metadata

File hashes

Hashes for bankofai_agent_wallet-2.3.0b4-py3-none-any.whl
Algorithm Hash digest
SHA256 dd124ae66c69d3fe02c5304464679ce3e46613c8b3b919a2479686d020f998bf
MD5 fe27af271f6a3bda4faf52ea6e2a47a2
BLAKE2b-256 3afc3887583c01af7140b18c74a06b28b43b2a3544a18a9c6cecba9cb0f540b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page