wallet
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWallet
钱包
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
多链工具
| Tool | Description |
|---|---|
| Get all wallet addresses and chain types |
| PRIMARY TOOL - Get complete portfolio across ALL chains (EVM + Solana) with USD values |
| 工具 | 描述 |
|---|---|
| 获取所有钱包地址及链类型 |
| 主要工具 - 获取所有链(EVM + Solana)上的完整资产组合,包含USD估值 |
EVM Tools
EVM工具
| Tool | Description |
|---|---|
| Get ETH/token balances on a specific chain (requires |
| Get recent EVM transaction history |
| Sign and broadcast a transaction on-chain (policy-gated). Funds leave the wallet. |
| Sign a transaction WITHOUT broadcasting (returns RLP-encoded signed tx, nothing sent on-chain) |
| Sign a message (EIP-191 personal_sign) |
| Sign EIP-712 structured data (permits, orders, etc.) |
| 工具 | 描述 |
|---|---|
| 获取特定链上的ETH/代币余额(需传入 |
| 获取近期EVM交易历史 |
| 签名并广播链上交易(受策略管控)。资金将从钱包转出。 |
| 签名交易但不广播(返回RLP编码的已签名交易,不会发送至链上) |
| 签名消息(EIP-191 personal_sign格式) |
| 签名EIP-712结构化数据(如授权、订单等) |
Solana Tools
Solana工具
| Tool | Description |
|---|---|
| Get SOL/SPL token balances with USD values |
| Get recent Solana transaction history |
| Sign and broadcast a Solana transaction on-chain (policy-gated). Funds leave the wallet. |
| Sign a Solana transaction WITHOUT broadcasting (returns base64 signed tx, nothing sent on-chain) |
| Sign a message with the Solana wallet |
| 工具 | 描述 |
|---|---|
| 获取SOL/SPL代币余额及USD估值 |
| 获取近期Solana交易历史 |
| 签名并广播Solana链上交易(受策略管控)。资金将从钱包转出。 |
| 签名Solana交易但不广播(返回Base64编码的已签名交易,不会发送至链上) |
| 使用Solana钱包签名消息 |
Tool Usage Examples
工具使用示例
Check Wallet Info (All Chains)
查看钱包信息(所有链)
wallet_info()Returns: list of with and for each active wallet.
walletswallet_addresschain_typeUse this first to see all available wallets before any operations.
wallet_info()返回结果:包含每个活跃钱包的和的列表。
wallet_addresschain_typewallets在进行任何操作前,请先使用该工具查看所有可用钱包。
EVM — Check Balance
EVM — 查看余额
IMPORTANT: Always specify the parameter! To check all chains at once, use instead.
chainwallet_get_all_balanceswallet_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 assetchain parameter is REQUIRED. Valid chains: , , , , ,
ethereumbasearbitrumoptimismpolygonlineaAsset naming:
- For Polygon native token, use NOT
"pol""matic" - Use lowercase symbolic names like ,
"usdc","weth""usdt" - DO NOT pass contract addresses (e.g., ), use symbols only
"0x..." - Omit parameter to discover ALL tokens on the specified chain
asset
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 balanceFor complete Polygon portfolio, use which handles this correctly.
wallet_get_all_balances()For checking balances across ALL chains in one call, use instead.
wallet_get_all_balances()重要提示:请务必指定参数!若要一次性查看所有链的余额,请使用。
chainwallet_get_all_balanceswallet_balance(chain="ethereum") # 获取以太坊上的所有代币
wallet_balance(chain="base", asset="usdc") # 查看Base链上的特定资产
wallet_balance(chain="polygon", asset="pol") # Polygon链需明确指定资产chain参数为必填项。支持的链:、、、、、
ethereumbasearbitrumoptimismpolygonlinea资产命名规则:
- 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 multiple times for different chains.
wallet_balance()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: , , (max 100).
chain="ethereum"asset="eth"limit=20Returns: list of transactions with , , , , , .
tx_hashfromtoamountstatustimestampwallet_transactions()
wallet_transactions(chain="ethereum", asset="eth", limit=10)
wallet_transactions(limit=50)默认值:、、(最大值100)。
chain="ethereum"asset="eth"limit=20返回结果:包含、、、、、的交易列表。
tx_hashfromtoamountstatustimestampEVM — 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)- : Target wallet or contract address (0x...)
to - : Amount in wei (not ETH).
amount= 1 ETH. Use"1000000000000000000"for contract calls that don't send ETH."0" - : Chain ID (default: 1 = Ethereum mainnet, 8453 = Base, 10 = Optimism)
chain_id - : Hex-encoded calldata for contract calls (e.g. ERC-20 transfer, swap). Optional — omit for simple ETH transfers.
data - : Gas limit (decimal string). Optional — Privy estimates if omitted.
gas_limit - : Gas price in wei (decimal string, for legacy transactions). Optional.
gas_price - : Max fee per gas in wei (decimal string, for EIP-1559 transactions). Optional.
max_fee_per_gas - : Max priority fee in wei (decimal string, for EIP-1559 transactions). Optional.
max_priority_fee_per_gas - : Transaction nonce (decimal string). Optional — auto-determined if omitted.
nonce - : Transaction type integer.
tx_type=legacy,0=EIP-2930,1=EIP-1559,2=EIP-7702. Optional.4
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)- : 目标钱包或合约地址(0x...格式)
to - : 金额,单位为wei(非ETH)。
amount= 1 ETH。对于无需发送ETH的合约调用,请传入"1000000000000000000"。"0" - : 链ID(默认值:1 = 以太坊主网,8453 = Base,10 = Optimism)
chain_id - : 合约调用的十六进制编码调用数据(如ERC-20转账、交易兑换)。可选——简单ETH转账可省略。
data - : 燃气上限(十进制字符串)。可选——若省略,Privy将自动估算。
gas_limit - : 燃气价格,单位wei(十进制字符串,适用于传统交易)。可选。
gas_price - : 每单位燃气的最高费用,单位wei(十进制字符串,适用于EIP-1559交易)。可选。
max_fee_per_gas - : 每单位燃气的最高优先费用,单位wei(十进制字符串,适用于EIP-1559交易)。可选。
max_priority_fee_per_gas - : 交易随机数(十进制字符串)。可选——若省略将自动确定。
nonce - : 交易类型整数。
tx_type=传统交易,0=EIP-2930,1=EIP-1559,2=EIP-7702。可选。4
策略管控: 转账受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 , plus and for EIP-1559.
wallet_transfermax_fee_per_gasmax_priority_fee_per_gasReturns: (RLP-encoded hex), ("rlp")
signed_transactionencodingUse 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")参数与相同,额外支持EIP-1559交易的和。
wallet_transfermax_fee_per_gasmax_priority_fee_per_gas返回结果:(RLP编码十六进制字符串)、("rlp")
signed_transactionencoding使用场景:预签名交易以便后续提交、多步骤流程、外部广播。
EVM — Sign a Message
EVM — 签名消息
wallet_sign(message="Hello World")
wallet_sign(message="Verify ownership of this wallet")Returns: (EIP-191 personal_sign format)
signatureUse cases: prove wallet ownership, sign off-chain messages, create verifiable attestations.
wallet_sign(message="Hello World")
wallet_sign(message="Verify ownership of this wallet")返回结果:(EIP-191 personal_sign格式)
signature使用场景:证明钱包所有权、签名链下消息、创建可验证的证明。
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..."}
)- : EIP-712 domain separator (name, version, chainId, verifyingContract)
domain - : Type definitions — mapping of type name to array of
typesfields{name, type} - : The primary type being signed (must exist in
primaryType)types - : The structured data to sign (must match
messageschema)primaryType
Returns: (hex)
signatureUse 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..."}
)- : EIP-712域分隔符(name、version、chainId、verifyingContract)
domain - : 类型定义——类型名称到
types字段数组的映射{name, type} - : 待签名的主类型(必须存在于
primaryType中)types - : 待签名的结构化数据(必须匹配
message的 schema)primaryType
返回结果:(十六进制字符串)
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: , , (max 100).
chain="solana"asset="sol"limit=20wallet_sol_transactions()
wallet_sol_transactions(chain="solana", asset="sol", limit=10)默认值:、、(最大值100)。
chain="solana"asset="sol"limit=20Solana — Sign and Send Transaction
Solana — 签名并发送交易
wallet_sol_transfer(transaction="<base64-encoded-transaction>")
wallet_sol_transfer(transaction="<base64-encoded-transaction>", caip2="solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1")- : Base64-encoded serialized Solana transaction
transaction - : CAIP-2 chain identifier (default:
caip2for mainnet, use"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"for devnet)"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
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")- : Base64编码的序列化Solana交易
transaction - : CAIP-2链标识符(默认值:主网为
caip2,测试网为"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
策略管控: 与EVM相同——转账受Privy TEE策略管控。
Solana — Sign Transaction (without broadcasting)
Solana — 签名交易(不广播)
wallet_sol_sign_transaction(transaction="<base64-encoded-transaction>")- : Base64-encoded serialized Solana transaction
transaction
Returns: (base64), ("base64")
signed_transactionencodingUse cases: pre-sign transactions for later submission, multi-step flows, external broadcast.
wallet_sol_sign_transaction(transaction="<base64-encoded-transaction>")- : Base64编码的序列化Solana交易
transaction
返回结果:(Base64编码字符串)、("base64")
signed_transactionencoding使用场景:预签名交易以便后续提交、多步骤流程、外部广播。
Solana — Sign a Message
Solana — 签名消息
wallet_sol_sign(message="<base64-encoded-message>")Returns: (base64)
signaturewallet_sol_sign(message="<base64-encoded-message>")返回结果:(Base64编码字符串)
signatureCommon Workflows
常见工作流
Pre-Transfer Check (EVM)
转账前检查(EVM)
- — Confirm wallets are active
wallet_info() - — Check available funds on specific chain (or use
wallet_balance(chain="ethereum"))wallet_get_all_balances() - — Execute transfer
wallet_transfer(to="0x...", amount="...") - — Confirm transaction status
wallet_transactions(limit=1)
- — 确认钱包处于活跃状态
wallet_info() - — 检查特定链上的可用资金(或使用
wallet_balance(chain="ethereum"))wallet_get_all_balances() - — 执行转账
wallet_transfer(to="0x...", amount="...") - — 确认交易状态
wallet_transactions(limit=1)
Pre-Transfer Check (Solana)
转账前检查(Solana)
- — Confirm wallets are active
wallet_info() - — Check available SOL funds
wallet_sol_balance() - — Sign and send transaction
wallet_sol_transfer(transaction="...") - — Confirm transaction status
wallet_sol_transactions(limit=1)
- — 确认钱包处于活跃状态
wallet_info() - — 检查可用SOL资金
wallet_sol_balance() - — 签名并发送交易
wallet_sol_transfer(transaction="...") - — 确认交易状态
wallet_sol_transactions(limit=1)
Monitor All Wallet Activity
监控所有钱包活动
- — See all wallets
wallet_info() - — Complete portfolio across ALL chains (EVM + Solana)
wallet_get_all_balances() - — Recent EVM activity
wallet_transactions(limit=20) - — Recent Solana activity
wallet_sol_transactions(limit=20)
- — 查看所有钱包
wallet_info() - — 获取所有链(EVM + Solana)上的完整资产组合
wallet_get_all_balances() - — 近期EVM活动
wallet_transactions(limit=20) - — 近期Solana活动
wallet_sol_transactions(limit=20)
Prove Wallet Ownership
证明钱包所有权
- — Get all wallet addresses
wallet_info() - — EVM proof
wallet_sign(message="I am the owner of this wallet at timestamp 1234567890") - — Solana proof
wallet_sol_sign(message="<base64-encoded-message>")
- — 获取所有钱包地址
wallet_info() - — EVM证明
wallet_sign(message="I am the owner of this wallet at timestamp 1234567890") - — Solana证明
wallet_sol_sign(message="<base64-encoded-message>")
Wei Conversion Reference (EVM)
Wei转换参考(EVM)
Amounts are always in wei (smallest unit). Conversion table:
| Amount | Wei String |
|---|---|
| 0.001 ETH | |
| 0.01 ETH | |
| 0.1 ETH | |
| 1 ETH | |
| 10 ETH | |
Formula:
wei = eth_amount * 10^18金额始终以wei为单位(最小单位)。转换表:
| 金额 | Wei字符串 |
|---|---|
| 0.001 ETH | |
| 0.01 ETH | |
| 0.1 ETH | |
| 1 ETH | |
| 10 ETH | |
公式:
wei = eth_amount * 10^18Chain ID Reference (EVM)
链ID参考(EVM)
| Chain | ID | CAIP-2 | Native Asset |
|---|---|---|---|
| Ethereum Mainnet | 1 | | |
| Ethereum Sepolia | 11155111 | | |
| Base | 8453 | | |
| Optimism | 10 | | |
| Arbitrum One | 42161 | | |
| Polygon | 137 | | |
| Linea | 59144 | | |
| 链 | ID | CAIP-2 | 原生资产 |
|---|---|---|---|
| Ethereum Mainnet | 1 | | |
| Ethereum Sepolia | 11155111 | | |
| Base | 8453 | | |
| Optimism | 10 | | |
| Arbitrum One | 42161 | | |
| Polygon | 137 | | |
| Linea | 59144 | | |
Solana CAIP-2 Reference
Solana CAIP-2参考
| Network | CAIP-2 |
|---|---|
| Solana Mainnet | |
| Solana Devnet | |
| 网络 | CAIP-2 |
|---|---|
| Solana Mainnet | |
| Solana Devnet | |
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
错误处理
| Error | Meaning | Action |
|---|---|---|
| "Not running on a Fly Machine" | Wallet requires Fly deployment | Cannot use wallet locally |
| "Policy violation: ..." | Transfer rejected by Privy policy | Check whitelist and daily limits |
| "HTTP 404" | Wallet not found for this machine | Wallet may not be created yet |
| "HTTP 403" | OIDC token invalid or expired | Token will auto-refresh, retry |
| 错误 | 含义 | 操作 |
|---|---|---|
| "Not running on a Fly Machine" | 钱包需要Fly部署 | 无法在本地使用钱包 |
| "Policy violation: ..." | 转账被Privy策略拒绝 | 检查白名单及每日限额 |
| "HTTP 404" | 当前机器未找到钱包 | 钱包可能尚未创建 |
| "HTTP 403" | OIDC令牌无效或已过期 | 令牌将自动刷新,请重试 |