wallet

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Wallet

钱包

Interact with this agent's on-chain wallets. Each agent has one wallet per chain (EVM + Solana). Supports balance queries, transfers (policy-gated), message signing, and transaction history.
Authentication is automatic via Fly OIDC token — no API keys or wallet addresses needed. Wallets are bound to this machine at deploy time.
与该Agent的链上钱包进行交互。每个Agent在每条链(EVM + Solana)上都有一个钱包。支持余额查询、受策略管控的转账、消息签名及交易历史查看。
通过Fly OIDC令牌自动完成身份验证——无需API密钥或钱包地址。钱包在部署时绑定到当前机器。

Available Tools (13)

可用工具(13个)

Multi-Chain Tools

多链工具

ToolDescription
wallet_info
Get all wallet addresses and chain types
wallet_get_all_balances
PRIMARY TOOL - Get complete portfolio across ALL chains (EVM + Solana) with USD values
工具描述
wallet_info
获取所有钱包地址及链类型
wallet_get_all_balances
主要工具 - 获取所有链(EVM + Solana)上的完整资产组合,包含USD估值

EVM Tools

EVM工具

ToolDescription
wallet_balance
Get ETH/token balances on a specific chain (requires
chain
parameter)
wallet_transactions
Get recent EVM transaction history
wallet_transfer
Sign and broadcast a transaction on-chain (policy-gated). Funds leave the wallet.
wallet_sign_transaction
Sign a transaction WITHOUT broadcasting (returns RLP-encoded signed tx, nothing sent on-chain)
wallet_sign
Sign a message (EIP-191 personal_sign)
wallet_sign_typed_data
Sign EIP-712 structured data (permits, orders, etc.)
工具描述
wallet_balance
获取特定链上的ETH/代币余额(需传入
chain
参数)
wallet_transactions
获取近期EVM交易历史
wallet_transfer
签名并广播链上交易(受策略管控)。资金将从钱包转出。
wallet_sign_transaction
签名交易但不广播(返回RLP编码的已签名交易,不会发送至链上)
wallet_sign
签名消息(EIP-191 personal_sign格式)
wallet_sign_typed_data
签名EIP-712结构化数据(如授权、订单等)

Solana Tools

Solana工具

ToolDescription
wallet_sol_balance
Get SOL/SPL token balances with USD values
wallet_sol_transactions
Get recent Solana transaction history
wallet_sol_transfer
Sign and broadcast a Solana transaction on-chain (policy-gated). Funds leave the wallet.
wallet_sol_sign_transaction
Sign a Solana transaction WITHOUT broadcasting (returns base64 signed tx, nothing sent on-chain)
wallet_sol_sign
Sign a message with the Solana wallet

工具描述
wallet_sol_balance
获取SOL/SPL代币余额及USD估值
wallet_sol_transactions
获取近期Solana交易历史
wallet_sol_transfer
签名并广播Solana链上交易(受策略管控)。资金将从钱包转出。
wallet_sol_sign_transaction
签名Solana交易但不广播(返回Base64编码的已签名交易,不会发送至链上)
wallet_sol_sign
使用Solana钱包签名消息

Tool Usage Examples

工具使用示例

Check Wallet Info (All Chains)

查看钱包信息(所有链)

wallet_info()
Returns: list of
wallets
with
wallet_address
and
chain_type
for each active wallet.
Use this first to see all available wallets before any operations.
wallet_info()
返回结果:包含每个活跃钱包的
wallet_address
chain_type
wallets
列表。
在进行任何操作前,请先使用该工具查看所有可用钱包。

EVM — Check Balance

EVM — 查看余额

IMPORTANT: Always specify the
chain
parameter! To check all chains at once, use
wallet_get_all_balances
instead.
wallet_balance(chain="ethereum")  # Get ALL tokens on Ethereum
wallet_balance(chain="base", asset="usdc")  # Check specific asset on Base
wallet_balance(chain="polygon", asset="pol")  # Polygon requires explicit asset
chain parameter is REQUIRED. Valid chains:
ethereum
,
base
,
arbitrum
,
optimism
,
polygon
,
linea
Asset naming:
  • For Polygon native token, use
    "pol"
    NOT
    "matic"
  • Use lowercase symbolic names like
    "usdc"
    ,
    "weth"
    ,
    "usdt"
  • DO NOT pass contract addresses (e.g.,
    "0x..."
    ), use symbols only
  • Omit
    asset
    parameter to discover ALL tokens on the specified chain
Known Limitation - Polygon: The Polygon chain requires explicit asset parameters. Instead of:
wallet_balance(chain="polygon")  # ❌ May fail with "eth not supported"
Use:
wallet_balance(chain="polygon", asset="pol")  # ✅ Check POL balance
wallet_balance(chain="polygon", asset="usdc")  # ✅ Check USDC balance
For complete Polygon portfolio, use
wallet_get_all_balances()
which handles this correctly.
For checking balances across ALL chains in one call, use
wallet_get_all_balances()
instead.
重要提示:请务必指定
chain
参数!若要一次性查看所有链的余额,请使用
wallet_get_all_balances
wallet_balance(chain="ethereum")  # 获取以太坊上的所有代币
wallet_balance(chain="base", asset="usdc")  # 查看Base链上的特定资产
wallet_balance(chain="polygon", asset="pol")  # Polygon链需明确指定资产
chain参数为必填项。支持的链:
ethereum
base
arbitrum
optimism
polygon
linea
资产命名规则:
  • Polygon原生代币请使用
    "pol"
    而非
    "matic"
  • 使用小写符号名称,如
    "usdc"
    "weth"
    "usdt"
  • 请勿传入合约地址(如
    "0x..."
    ),仅使用符号
  • 若省略
    asset
    参数,将查询指定链上的所有代币
已知限制 - Polygon链: Polygon链需要明确指定资产参数。请勿使用:
wallet_balance(chain="polygon")  # ❌ 可能会提示"eth not supported"错误
请使用:
wallet_balance(chain="polygon", asset="pol")  # ✅ 查看POL余额
wallet_balance(chain="polygon", asset="usdc")  # ✅ 查看USDC余额
若要查看完整的Polygon资产组合,请使用
wallet_get_all_balances()
,该工具可正确处理此情况。
若要一次性查看所有链的余额,请使用
wallet_get_all_balances()
而非多次调用
wallet_balance()

Multi-Chain — Get All Balances

多链 — 获取所有余额

wallet_get_all_balances()
This is the PRIMARY tool for comprehensive balance checks.
Automatically checks ALL supported chains (Ethereum, Base, Arbitrum, Optimism, Polygon, Linea, Solana) and returns complete portfolio with USD values.
Use this instead of calling
wallet_balance()
multiple times for different chains.
wallet_get_all_balances()
这是进行全面余额检查的主要工具。
自动检查所有支持的链(以太坊、Base、Arbitrum、Optimism、Polygon、Linea、Solana),返回包含USD估值的完整资产组合。
请使用该工具替代针对不同链多次调用
wallet_balance()

EVM — Query Transaction History

EVM — 查询交易历史

wallet_transactions()
wallet_transactions(chain="ethereum", asset="eth", limit=10)
wallet_transactions(limit=50)
Defaults:
chain="ethereum"
,
asset="eth"
,
limit=20
(max 100).
Returns: list of transactions with
tx_hash
,
from
,
to
,
amount
,
status
,
timestamp
.
wallet_transactions()
wallet_transactions(chain="ethereum", asset="eth", limit=10)
wallet_transactions(limit=50)
默认值:
chain="ethereum"
asset="eth"
limit=20
(最大值100)。
返回结果:包含
tx_hash
from
to
amount
status
timestamp
的交易列表。

EVM — Transfer Funds / Contract Calls

EVM — 转账/合约调用

wallet_transfer(to="0xRecipientAddress", amount="1000000000000000000")
wallet_transfer(to="0xRecipientAddress", amount="1000000000000000000", chain_id=8453)
wallet_transfer(to="0xContractAddress", amount="0", data="0xa9059cbb000000...", chain_id=8453)
  • to
    : Target wallet or contract address (0x...)
  • amount
    : Amount in wei (not ETH).
    "1000000000000000000"
    = 1 ETH. Use
    "0"
    for contract calls that don't send ETH.
  • chain_id
    : Chain ID (default: 1 = Ethereum mainnet, 8453 = Base, 10 = Optimism)
  • data
    : Hex-encoded calldata for contract calls (e.g. ERC-20 transfer, swap). Optional — omit for simple ETH transfers.
  • gas_limit
    : Gas limit (decimal string). Optional — Privy estimates if omitted.
  • gas_price
    : Gas price in wei (decimal string, for legacy transactions). Optional.
  • max_fee_per_gas
    : Max fee per gas in wei (decimal string, for EIP-1559 transactions). Optional.
  • max_priority_fee_per_gas
    : Max priority fee in wei (decimal string, for EIP-1559 transactions). Optional.
  • nonce
    : Transaction nonce (decimal string). Optional — auto-determined if omitted.
  • tx_type
    : Transaction type integer.
    0
    =legacy,
    1
    =EIP-2930,
    2
    =EIP-1559,
    4
    =EIP-7702. Optional.
Policy enforcement: Transfers are gated by Privy TEE policy. The target address must be on the whitelist and the amount must be within daily limits. Policy violations return an error.
wallet_transfer(to="0xRecipientAddress", amount="1000000000000000000")
wallet_transfer(to="0xRecipientAddress", amount="1000000000000000000", chain_id=8453)
wallet_transfer(to="0xContractAddress", amount="0", data="0xa9059cbb000000...", chain_id=8453)
  • to
    : 目标钱包或合约地址(0x...格式)
  • amount
    : 金额,单位为wei(非ETH)。
    "1000000000000000000"
    = 1 ETH。对于无需发送ETH的合约调用,请传入
    "0"
  • chain_id
    : 链ID(默认值:1 = 以太坊主网,8453 = Base,10 = Optimism)
  • data
    : 合约调用的十六进制编码调用数据(如ERC-20转账、交易兑换)。可选——简单ETH转账可省略。
  • gas_limit
    : 燃气上限(十进制字符串)。可选——若省略,Privy将自动估算。
  • gas_price
    : 燃气价格,单位wei(十进制字符串,适用于传统交易)。可选。
  • max_fee_per_gas
    : 每单位燃气的最高费用,单位wei(十进制字符串,适用于EIP-1559交易)。可选。
  • max_priority_fee_per_gas
    : 每单位燃气的最高优先费用,单位wei(十进制字符串,适用于EIP-1559交易)。可选。
  • nonce
    : 交易随机数(十进制字符串)。可选——若省略将自动确定。
  • tx_type
    : 交易类型整数。
    0
    =传统交易,
    1
    =EIP-2930,
    2
    =EIP-1559,
    4
    =EIP-7702。可选。
策略管控: 转账受Privy TEE策略管控。目标地址必须在白名单内,且金额需在每日限额内。违反策略将返回错误。

EVM — Sign Transaction (without broadcasting)

EVM — 签名交易(不广播)

wallet_sign_transaction(to="0xRecipientAddress", amount="1000000000000000000")
wallet_sign_transaction(to="0xRecipientAddress", amount="1000000000000000000", chain_id=8453)
wallet_sign_transaction(to="0xContractAddress", amount="0", data="0xa9059cbb000000...", chain_id=8453, tx_type=2, max_fee_per_gas="30000000000", max_priority_fee_per_gas="2000000000")
Same parameters as
wallet_transfer
, plus
max_fee_per_gas
and
max_priority_fee_per_gas
for EIP-1559.
Returns:
signed_transaction
(RLP-encoded hex),
encoding
("rlp")
Use cases: pre-sign transactions for later submission, multi-step flows, external broadcast.
wallet_sign_transaction(to="0xRecipientAddress", amount="1000000000000000000")
wallet_sign_transaction(to="0xRecipientAddress", amount="1000000000000000000", chain_id=8453)
wallet_sign_transaction(to="0xContractAddress", amount="0", data="0xa9059cbb000000...", chain_id=8453, tx_type=2, max_fee_per_gas="30000000000", max_priority_fee_per_gas="2000000000")
参数与
wallet_transfer
相同,额外支持EIP-1559交易的
max_fee_per_gas
max_priority_fee_per_gas
返回结果:
signed_transaction
(RLP编码十六进制字符串)、
encoding
("rlp")
使用场景:预签名交易以便后续提交、多步骤流程、外部广播。

EVM — Sign a Message

EVM — 签名消息

wallet_sign(message="Hello World")
wallet_sign(message="Verify ownership of this wallet")
Returns:
signature
(EIP-191 personal_sign format)
Use cases: prove wallet ownership, sign off-chain messages, create verifiable attestations.
wallet_sign(message="Hello World")
wallet_sign(message="Verify ownership of this wallet")
返回结果:
signature
(EIP-191 personal_sign格式)
使用场景:证明钱包所有权、签名链下消息、创建可验证的证明。

EVM — Sign EIP-712 Typed Data

EVM — 签名EIP-712结构化数据

wallet_sign_typed_data(
  domain={"name": "MyDApp", "version": "1", "chainId": 1, "verifyingContract": "0x..."},
  types={"Person": [{"name": "name", "type": "string"}, {"name": "wallet", "type": "address"}]},
  primaryType="Person",
  message={"name": "Alice", "wallet": "0x..."}
)
  • domain
    : EIP-712 domain separator (name, version, chainId, verifyingContract)
  • types
    : Type definitions — mapping of type name to array of
    {name, type}
    fields
  • primaryType
    : The primary type being signed (must exist in
    types
    )
  • message
    : The structured data to sign (must match
    primaryType
    schema)
Returns:
signature
(hex)
Use cases: EIP-2612 permit approvals, off-chain order signing (Seaport, 0x), gasless approvals, structured attestations.
wallet_sign_typed_data(
  domain={"name": "MyDApp", "version": "1", "chainId": 1, "verifyingContract": "0x..."},
  types={"Person": [{"name": "name", "type": "string"}, {"name": "wallet", "type": "address"}]},
  primaryType="Person",
  message={"name": "Alice", "wallet": "0x..."}
)
  • domain
    : EIP-712域分隔符(name、version、chainId、verifyingContract)
  • types
    : 类型定义——类型名称到
    {name, type}
    字段数组的映射
  • primaryType
    : 待签名的主类型(必须存在于
    types
    中)
  • message
    : 待签名的结构化数据(必须匹配
    primaryType
    的 schema)
返回结果:
signature
(十六进制字符串)
使用场景:EIP-2612授权、链下订单签名(Seaport、0x)、无燃气授权、结构化证明。

Solana — Check Balance

Solana — 查看余额

wallet_sol_balance()
wallet_sol_balance(chain="solana", asset="sol")
All parameters are optional. Returns balances with USD-equivalent values.
wallet_sol_balance()
wallet_sol_balance(chain="solana", asset="sol")
所有参数均为可选。返回包含USD等价估值的余额信息。

Solana — Query Transaction History

Solana — 查询交易历史

wallet_sol_transactions()
wallet_sol_transactions(chain="solana", asset="sol", limit=10)
Defaults:
chain="solana"
,
asset="sol"
,
limit=20
(max 100).
wallet_sol_transactions()
wallet_sol_transactions(chain="solana", asset="sol", limit=10)
默认值:
chain="solana"
asset="sol"
limit=20
(最大值100)。

Solana — Sign and Send Transaction

Solana — 签名并发送交易

wallet_sol_transfer(transaction="<base64-encoded-transaction>")
wallet_sol_transfer(transaction="<base64-encoded-transaction>", caip2="solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1")
  • transaction
    : Base64-encoded serialized Solana transaction
  • caip2
    : CAIP-2 chain identifier (default:
    "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"
    for mainnet, use
    "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
    for devnet)
Policy enforcement: Same as EVM — transfers are gated by Privy TEE policy.
wallet_sol_transfer(transaction="<base64-encoded-transaction>")
wallet_sol_transfer(transaction="<base64-encoded-transaction>", caip2="solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1")
  • transaction
    : Base64编码的序列化Solana交易
  • caip2
    : CAIP-2链标识符(默认值:主网为
    "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"
    ,测试网为
    "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
策略管控: 与EVM相同——转账受Privy TEE策略管控。

Solana — Sign Transaction (without broadcasting)

Solana — 签名交易(不广播)

wallet_sol_sign_transaction(transaction="<base64-encoded-transaction>")
  • transaction
    : Base64-encoded serialized Solana transaction
Returns:
signed_transaction
(base64),
encoding
("base64")
Use cases: pre-sign transactions for later submission, multi-step flows, external broadcast.
wallet_sol_sign_transaction(transaction="<base64-encoded-transaction>")
  • transaction
    : Base64编码的序列化Solana交易
返回结果:
signed_transaction
(Base64编码字符串)、
encoding
("base64")
使用场景:预签名交易以便后续提交、多步骤流程、外部广播。

Solana — Sign a Message

Solana — 签名消息

wallet_sol_sign(message="<base64-encoded-message>")
Returns:
signature
(base64)

wallet_sol_sign(message="<base64-encoded-message>")
返回结果:
signature
(Base64编码字符串)

Common Workflows

常见工作流

Pre-Transfer Check (EVM)

转账前检查(EVM)

  1. wallet_info()
    — Confirm wallets are active
  2. wallet_balance(chain="ethereum")
    — Check available funds on specific chain (or use
    wallet_get_all_balances()
    )
  3. wallet_transfer(to="0x...", amount="...")
    — Execute transfer
  4. wallet_transactions(limit=1)
    — Confirm transaction status
  1. wallet_info()
    — 确认钱包处于活跃状态
  2. wallet_balance(chain="ethereum")
    — 检查特定链上的可用资金(或使用
    wallet_get_all_balances()
  3. wallet_transfer(to="0x...", amount="...")
    — 执行转账
  4. wallet_transactions(limit=1)
    — 确认交易状态

Pre-Transfer Check (Solana)

转账前检查(Solana)

  1. wallet_info()
    — Confirm wallets are active
  2. wallet_sol_balance()
    — Check available SOL funds
  3. wallet_sol_transfer(transaction="...")
    — Sign and send transaction
  4. wallet_sol_transactions(limit=1)
    — Confirm transaction status
  1. wallet_info()
    — 确认钱包处于活跃状态
  2. wallet_sol_balance()
    — 检查可用SOL资金
  3. wallet_sol_transfer(transaction="...")
    — 签名并发送交易
  4. wallet_sol_transactions(limit=1)
    — 确认交易状态

Monitor All Wallet Activity

监控所有钱包活动

  1. wallet_info()
    — See all wallets
  2. wallet_get_all_balances()
    — Complete portfolio across ALL chains (EVM + Solana)
  3. wallet_transactions(limit=20)
    — Recent EVM activity
  4. wallet_sol_transactions(limit=20)
    — Recent Solana activity
  1. wallet_info()
    — 查看所有钱包
  2. wallet_get_all_balances()
    — 获取所有链(EVM + Solana)上的完整资产组合
  3. wallet_transactions(limit=20)
    — 近期EVM活动
  4. wallet_sol_transactions(limit=20)
    — 近期Solana活动

Prove Wallet Ownership

证明钱包所有权

  1. wallet_info()
    — Get all wallet addresses
  2. wallet_sign(message="I am the owner of this wallet at timestamp 1234567890")
    — EVM proof
  3. wallet_sol_sign(message="<base64-encoded-message>")
    — Solana proof

  1. wallet_info()
    — 获取所有钱包地址
  2. wallet_sign(message="I am the owner of this wallet at timestamp 1234567890")
    — EVM证明
  3. wallet_sol_sign(message="<base64-encoded-message>")
    — Solana证明

Wei Conversion Reference (EVM)

Wei转换参考(EVM)

Amounts are always in wei (smallest unit). Conversion table:
AmountWei String
0.001 ETH
"1000000000000000"
0.01 ETH
"10000000000000000"
0.1 ETH
"100000000000000000"
1 ETH
"1000000000000000000"
10 ETH
"10000000000000000000"
Formula:
wei = eth_amount * 10^18
金额始终以wei为单位(最小单位)。转换表:
金额Wei字符串
0.001 ETH
"1000000000000000"
0.01 ETH
"10000000000000000"
0.1 ETH
"100000000000000000"
1 ETH
"1000000000000000000"
10 ETH
"10000000000000000000"
公式:
wei = eth_amount * 10^18

Chain ID Reference (EVM)

链ID参考(EVM)

ChainIDCAIP-2Native Asset
Ethereum Mainnet1
eip155:1
eth
Ethereum Sepolia11155111
eip155:11155111
eth
Base8453
eip155:8453
eth
Optimism10
eip155:10
eth
Arbitrum One42161
eip155:42161
eth
Polygon137
eip155:137
pol
(NOT "matic")
Linea59144
eip155:59144
eth
IDCAIP-2原生资产
Ethereum Mainnet1
eip155:1
eth
Ethereum Sepolia11155111
eip155:11155111
eth
Base8453
eip155:8453
eth
Optimism10
eip155:10
eth
Arbitrum One42161
eip155:42161
eth
Polygon137
eip155:137
pol
(非"matic")
Linea59144
eip155:59144
eth

Solana CAIP-2 Reference

Solana CAIP-2参考

NetworkCAIP-2
Solana Mainnet
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
Solana Devnet
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1

网络CAIP-2
Solana Mainnet
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
Solana Devnet
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1

Policy & Security

策略与安全

  • Privy TEE enforced: Even if the agent is compromised, transfers that violate policy are rejected at the Privy TEE layer
  • Per-wallet policy: Each chain's wallet has its own independent policy
  • Flexible rules: Policy rules are configured via Privy's rule system (address allowlists, value limits, method restrictions, etc.)
  • Deny-all default: New wallets have no allowed transfers until policy is configured by the user via the backend
  • Pass-through: Policy rules are managed directly via Privy (source of truth), no local cache
Policy is managed by the user through the main backend API, not by the agent.
  • Privy TEE强制执行:即使Agent被攻破,违反策略的转账也会在Privy TEE层被拒绝
  • 钱包级策略:每条链的钱包都有独立的策略
  • 灵活规则:策略规则通过Privy的规则系统配置(地址白名单、金额限制、方法限制等)
  • 默认拒绝所有:新钱包在用户通过后端配置策略前,不允许任何转账
  • 直接传递:策略规则直接通过Privy管理(唯一可信源),无本地缓存
策略由用户通过主后端API管理,而非Agent。

Error Handling

错误处理

ErrorMeaningAction
"Not running on a Fly Machine"Wallet requires Fly deploymentCannot use wallet locally
"Policy violation: ..."Transfer rejected by Privy policyCheck whitelist and daily limits
"HTTP 404"Wallet not found for this machineWallet may not be created yet
"HTTP 403"OIDC token invalid or expiredToken will auto-refresh, retry
错误含义操作
"Not running on a Fly Machine"钱包需要Fly部署无法在本地使用钱包
"Policy violation: ..."转账被Privy策略拒绝检查白名单及每日限额
"HTTP 404"当前机器未找到钱包钱包可能尚未创建
"HTTP 403"OIDC令牌无效或已过期令牌将自动刷新,请重试