把文件直接送进你用户的钱包。
用 Wallet 协议(简单的 API 和 Webhook),把合同、账单、发票、保单、通知和签署请求,送进你的用户本就信任的钱包。
把一份合同投递到用户钱包
await wallet.assets.deliver({
walletId,
type: "contract",
title: "Service Agreement",
requireSignature: true,
agentAssist: true
})Wallet 协议如何工作
1
注册一次投递
一次 API 调用,把合同、账单或通知注册为可投递的钱包资产——有类型、有版本、可追溯。
2
送进用户的钱包
用户在自己信任的钱包里收到文件,可以阅读、签署并妥善保存。
3
订阅事件回执
打开、签署与验证等事件,通过 Webhook 实时回传到你的系统。
API 参考(预览版)
Wallet 协议就是一组普通的 HTTPS API:一个端点把有类型的文件投递进钱包,Webhook 把后续发生的事回传给你。
鉴权
在 x-api-key 请求头中传入你的 API 密钥。密钥在钱包的「集成」页自助创建,按集成隔离权限。
x-api-key: wlt_live_xxxxxxxxxxxxxxxx投递一份文件
POST 一个 envelope 即可投递合同、账单、发票、保单或通知。target 支持钱包地址、钱包 ID 或数字门牌;带上 idempotencyKey 可安全重试。
POST https://service.icloudportal.com/api/theWallet.protocol.deliverAsset
x-api-key: wlt_live_xxxxxxxxxxxxxxxx
Content-Type: application/json
{
"protocolVersion": "2026-01",
"idempotencyKey": "order-2026-0611-001",
"source": { "system": "acme-billing", "organizationName": "Acme Ltd" },
"target": { "walletAddress": "alex@wallet.thewallet.ai" },
"asset": {
"type": "contract",
"title": "Service Agreement",
"requiresSignature": true
},
"options": { "requireUserConfirmation": true }
}返回
{
"status": 0,
"data": {
"deliveryId": "dlv_9f2…",
"assetId": "ast_71c…",
"inboxItemId": "inb_2ab…",
"signatureRequestId": "sig_e04…",
"status": "delivered",
"requireUserConfirmation": true,
"reused": false
}
}Webhook
在「集成」页注册 Webhook 端点即可接收投递事件——例如文件落入钱包时的 asset.created——自动签名并重试。
{
"eventType": "asset.created",
"data": {
"assetId": "ast_71c…",
"assetType": "contract",
"walletId": "wlt_3d8…",
"status": "received"
}
}接入 AI Agent(MCP)
The Wallet 提供 MCP 服务器:Claude 等 Agent 框架可以直接投递文件、发起签署、请求钱包主人授权——Agent 来准备,主人来确认。
{
"mcpServers": {
"thewallet": {
"command": "npx",
"args": ["@thewallet/mcp"],
"env": { "THEWALLET_API_KEY": "wlt_live_xxxxxxxxxxxxxxxx" }
}
}
}获取你的开发者密钥
先免费创建钱包,然后在「集成」页即可自助创建 API 密钥,无需联系销售。钱包级投递与完整 API 包含在平台版中。
以上为 API 预览。欢迎联系我们获取抢先体验与集成支持。