@crossmint/openclaw-wallet 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +157 -0
- package/index.ts +72 -0
- package/openclaw.plugin.json +12 -0
- package/package.json +42 -0
- package/skills/crossmint/SKILL.md +274 -0
- package/src/api.test.ts +211 -0
- package/src/api.ts +495 -0
- package/src/config.ts +11 -0
- package/src/tools.ts +787 -0
- package/src/wallet.test.ts +291 -0
- package/src/wallet.ts +154 -0
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Crossmint Wallet Plugin
|
|
2
|
+
|
|
3
|
+
Solana wallet integration for OpenClaw agents using Crossmint smart wallets with delegated signing.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This plugin enables OpenClaw agents to:
|
|
8
|
+
- Generate and manage local Solana signing keys (ed25519)
|
|
9
|
+
- Use Crossmint smart wallets on Solana
|
|
10
|
+
- Check wallet balances (SOL, USDC, SPL tokens)
|
|
11
|
+
- Send tokens to other addresses
|
|
12
|
+
|
|
13
|
+
The key innovation is **delegated signing**: the agent holds its own private key locally, and users authorize the agent to operate their Crossmint wallet through a web-based delegation flow.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
openclaw plugins install @crossmint/openclaw-wallet
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Configuration
|
|
22
|
+
|
|
23
|
+
Enable the plugin in `~/.openclaw/.openclaw.json5`:
|
|
24
|
+
|
|
25
|
+
```json5
|
|
26
|
+
{
|
|
27
|
+
plugins: {
|
|
28
|
+
entries: {
|
|
29
|
+
"openclaw-wallet": {
|
|
30
|
+
enabled: true
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
> **Note:** Currently only Solana devnet (staging) is supported. Mainnet support coming soon.
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
### Setting Up a Wallet (2-Step Process)
|
|
42
|
+
|
|
43
|
+
**Step 1: Generate keypair and get delegation URL**
|
|
44
|
+
|
|
45
|
+
Ask the agent: "Set up my Crossmint wallet"
|
|
46
|
+
|
|
47
|
+
The agent will:
|
|
48
|
+
1. Generate a local Solana keypair (ed25519)
|
|
49
|
+
2. Provide a URL with the public key for delegation setup
|
|
50
|
+
|
|
51
|
+
**Step 2: Complete setup on the web app**
|
|
52
|
+
|
|
53
|
+
1. Open the delegation URL in your browser
|
|
54
|
+
2. The web app will:
|
|
55
|
+
- Create a Crossmint smart wallet
|
|
56
|
+
- Add the agent's public key as a delegated signer
|
|
57
|
+
- Show you the **wallet address** and **API key**
|
|
58
|
+
|
|
59
|
+
**Step 3: Configure the agent**
|
|
60
|
+
|
|
61
|
+
Tell the agent: "Configure my wallet with address X and API key Y"
|
|
62
|
+
|
|
63
|
+
The agent will use `crossmint_configure` to save these credentials securely.
|
|
64
|
+
|
|
65
|
+
### Checking Balance
|
|
66
|
+
|
|
67
|
+
Ask the agent: "What's my wallet balance?"
|
|
68
|
+
|
|
69
|
+
### Sending Tokens
|
|
70
|
+
|
|
71
|
+
Ask the agent: "Send 10 USDC to <solana-address>"
|
|
72
|
+
|
|
73
|
+
The agent will:
|
|
74
|
+
1. Confirm the recipient and amount
|
|
75
|
+
2. Sign the transaction locally using ed25519
|
|
76
|
+
3. Submit to Crossmint for execution on Solana
|
|
77
|
+
|
|
78
|
+
## Tools
|
|
79
|
+
|
|
80
|
+
| Tool | Description |
|
|
81
|
+
|------|-------------|
|
|
82
|
+
| `crossmint_setup` | Generate Solana keypair and get delegation URL |
|
|
83
|
+
| `crossmint_configure` | Save wallet address and API key from web app |
|
|
84
|
+
| `crossmint_balance` | Check wallet balances (SOL, USDC, SPL tokens) |
|
|
85
|
+
| `crossmint_send` | Send tokens to another Solana address |
|
|
86
|
+
| `crossmint_wallet_info` | Get detailed wallet information |
|
|
87
|
+
| `crossmint_tx_status` | Check transaction status |
|
|
88
|
+
| `crossmint_buy` | Buy products from Amazon with SOL or USDC |
|
|
89
|
+
| `crossmint_order_status` | Check Amazon order/delivery status |
|
|
90
|
+
|
|
91
|
+
## Architecture
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
95
|
+
│ OpenClaw Agent │
|
|
96
|
+
├─────────────────────────────────────────────────────────────┤
|
|
97
|
+
│ Local Solana Keypair (ed25519) │
|
|
98
|
+
│ - Private key stored at ~/.openclaw/crossmint-wallets/ │
|
|
99
|
+
│ - Signs transaction approvals locally │
|
|
100
|
+
│ - Wallet address + API key stored after web setup │
|
|
101
|
+
└────────────────────────┬────────────────────────────────────┘
|
|
102
|
+
│
|
|
103
|
+
▼
|
|
104
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
105
|
+
│ Delegation Web App (external) │
|
|
106
|
+
├─────────────────────────────────────────────────────────────┤
|
|
107
|
+
│ - Receives agent's public key via URL │
|
|
108
|
+
│ - Creates Crossmint smart wallet │
|
|
109
|
+
│ - Adds agent as delegated signer │
|
|
110
|
+
│ - Returns wallet address + API key to user │
|
|
111
|
+
└────────────────────────┬────────────────────────────────────┘
|
|
112
|
+
│
|
|
113
|
+
▼
|
|
114
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
115
|
+
│ Crossmint Smart Wallet │
|
|
116
|
+
├─────────────────────────────────────────────────────────────┤
|
|
117
|
+
│ - Deployed on Solana │
|
|
118
|
+
│ - Agent's address registered as delegated signer │
|
|
119
|
+
│ - User retains admin control │
|
|
120
|
+
└─────────────────────────────────────────────────────────────┘
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Security
|
|
124
|
+
|
|
125
|
+
- Private keys are stored locally on the agent's machine with secure file permissions
|
|
126
|
+
- Keys are never transmitted to Crossmint
|
|
127
|
+
- Uses ed25519 cryptography (Solana native)
|
|
128
|
+
- API key is stored locally after user retrieves it from web app
|
|
129
|
+
- Users maintain admin control and can revoke delegation at any time
|
|
130
|
+
- The agent can only perform actions explicitly authorized through delegation
|
|
131
|
+
|
|
132
|
+
## Troubleshooting
|
|
133
|
+
|
|
134
|
+
**"No wallet found for agent"**
|
|
135
|
+
- Run `crossmint_setup` first to generate a keypair
|
|
136
|
+
|
|
137
|
+
**"Wallet not fully configured"**
|
|
138
|
+
- Complete the web setup flow and run `crossmint_configure` with wallet address and API key
|
|
139
|
+
|
|
140
|
+
**"Failed to get balance" or "Failed to send"**
|
|
141
|
+
- Verify the API key is correct
|
|
142
|
+
- Check that the wallet address matches the one shown in the web app
|
|
143
|
+
- Ensure the wallet has sufficient balance
|
|
144
|
+
|
|
145
|
+
## Plugin Management
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# List all plugins
|
|
149
|
+
openclaw plugins list
|
|
150
|
+
|
|
151
|
+
# Check plugin info
|
|
152
|
+
openclaw plugins info openclaw-wallet
|
|
153
|
+
|
|
154
|
+
# Enable/disable
|
|
155
|
+
openclaw plugins enable openclaw-wallet
|
|
156
|
+
openclaw plugins disable openclaw-wallet
|
|
157
|
+
```
|
package/index.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
2
|
+
import {
|
|
3
|
+
createCrossmintSetupTool,
|
|
4
|
+
createCrossmintConfigureTool,
|
|
5
|
+
createCrossmintBalanceTool,
|
|
6
|
+
createCrossmintSendTool,
|
|
7
|
+
createCrossmintWalletInfoTool,
|
|
8
|
+
createCrossmintTxStatusTool,
|
|
9
|
+
createCrossmintBuyTool,
|
|
10
|
+
createCrossmintOrderStatusTool,
|
|
11
|
+
} from "./src/tools.js";
|
|
12
|
+
import { crossmintConfigSchema } from "./src/config.js";
|
|
13
|
+
|
|
14
|
+
const plugin = {
|
|
15
|
+
id: "openclaw-wallet",
|
|
16
|
+
name: "Crossmint Wallet",
|
|
17
|
+
description:
|
|
18
|
+
"Solana wallet integration with Crossmint. Manage wallets, check balances, and send tokens using delegated signing.",
|
|
19
|
+
|
|
20
|
+
configSchema: crossmintConfigSchema,
|
|
21
|
+
|
|
22
|
+
register(api: OpenClawPluginApi) {
|
|
23
|
+
// Parse and validate config at registration time
|
|
24
|
+
const config = crossmintConfigSchema.parse(api.pluginConfig);
|
|
25
|
+
|
|
26
|
+
// Register wallet setup tool (generates keypair, shows delegation URL)
|
|
27
|
+
api.registerTool(createCrossmintSetupTool(api, config), {
|
|
28
|
+
name: "crossmint_setup",
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Register configure tool (saves wallet address and API key from web)
|
|
32
|
+
api.registerTool(createCrossmintConfigureTool(api, config), {
|
|
33
|
+
name: "crossmint_configure",
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Register balance tool
|
|
37
|
+
api.registerTool(createCrossmintBalanceTool(api, config), {
|
|
38
|
+
name: "crossmint_balance",
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Register send tool
|
|
42
|
+
api.registerTool(createCrossmintSendTool(api, config), {
|
|
43
|
+
name: "crossmint_send",
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Register wallet info tool
|
|
47
|
+
api.registerTool(createCrossmintWalletInfoTool(api, config), {
|
|
48
|
+
name: "crossmint_wallet_info",
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Register transaction status tool
|
|
52
|
+
api.registerTool(createCrossmintTxStatusTool(api, config), {
|
|
53
|
+
name: "crossmint_tx_status",
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// Register Amazon buy tool
|
|
57
|
+
api.registerTool(createCrossmintBuyTool(api, config), {
|
|
58
|
+
name: "crossmint_buy",
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// Register order status tool
|
|
62
|
+
api.registerTool(createCrossmintOrderStatusTool(api, config), {
|
|
63
|
+
name: "crossmint_order_status",
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
api.logger.info("Crossmint wallet plugin loaded", {
|
|
67
|
+
environment: "staging",
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default plugin;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "openclaw-wallet",
|
|
3
|
+
"name": "Crossmint",
|
|
4
|
+
"description": "Solana wallet integration using Crossmint smart wallets with delegated signing.",
|
|
5
|
+
"version": "0.2.2",
|
|
6
|
+
"skills": ["skills/crossmint"],
|
|
7
|
+
"configSchema": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {}
|
|
11
|
+
}
|
|
12
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@crossmint/openclaw-wallet",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "OpenClaw plugin for Solana wallet integration with Crossmint smart wallets",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"index.ts",
|
|
9
|
+
"src/",
|
|
10
|
+
"skills/",
|
|
11
|
+
"openclaw.plugin.json",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/Crossmint/openclaw-crossmint-plugin"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"openclaw",
|
|
21
|
+
"crossmint",
|
|
22
|
+
"solana",
|
|
23
|
+
"wallet",
|
|
24
|
+
"plugin",
|
|
25
|
+
"crypto",
|
|
26
|
+
"web3"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@sinclair/typebox": "^0.34.48",
|
|
30
|
+
"@solana/web3.js": "^1.98.0",
|
|
31
|
+
"bs58": "^6.0.0",
|
|
32
|
+
"tweetnacl": "^1.0.3"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"openclaw": ">=2026.1.26"
|
|
36
|
+
},
|
|
37
|
+
"openclaw": {
|
|
38
|
+
"extensions": [
|
|
39
|
+
"./index.ts"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: crossmint
|
|
3
|
+
description: Use when the user wants to manage Solana wallets, check crypto balances, send tokens (SOL, USDC), buy products from Amazon with crypto, or set up Crossmint smart wallet delegation. Activate on wallet setup, balance checks, token transfers, Amazon purchases, or Crossmint mentions.
|
|
4
|
+
metadata: { "openclaw": { "emoji": "💳" } }
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Crossmint Wallet
|
|
8
|
+
|
|
9
|
+
Manage Solana wallets using Crossmint smart wallets with delegated signing. The agent holds a local signing key, and users authorize it via a web-based delegation flow.
|
|
10
|
+
|
|
11
|
+
> **Note:** Currently only **Solana devnet** (staging environment) is supported. Mainnet/production support coming soon.
|
|
12
|
+
|
|
13
|
+
## When to Activate
|
|
14
|
+
|
|
15
|
+
Use this skill when the user:
|
|
16
|
+
|
|
17
|
+
- Wants to set up a crypto/Solana wallet
|
|
18
|
+
- Asks about wallet balance (SOL, USDC, tokens)
|
|
19
|
+
- Wants to send tokens to someone
|
|
20
|
+
- Wants to buy something from Amazon with crypto
|
|
21
|
+
- Mentions Crossmint or smart wallets
|
|
22
|
+
- Asks about wallet delegation or signing
|
|
23
|
+
|
|
24
|
+
## Tools Overview
|
|
25
|
+
|
|
26
|
+
| Tool | Purpose |
|
|
27
|
+
|------|---------|
|
|
28
|
+
| `crossmint_setup` | Generate local keypair, get delegation URL |
|
|
29
|
+
| `crossmint_configure` | Save wallet address + API key after web setup |
|
|
30
|
+
| `crossmint_balance` | Check SOL, USDC, and token balances |
|
|
31
|
+
| `crossmint_send` | Send tokens to another address (supports wait for confirmation) |
|
|
32
|
+
| `crossmint_tx_status` | Check transaction status or wait for completion |
|
|
33
|
+
| `crossmint_wallet_info` | Get detailed wallet information |
|
|
34
|
+
| `crossmint_buy` | Buy products from Amazon with SOL or USDC |
|
|
35
|
+
| `crossmint_order_status` | Check Amazon order/delivery status |
|
|
36
|
+
|
|
37
|
+
## Setup Workflow (First Time)
|
|
38
|
+
|
|
39
|
+
### Step 1: Generate keypair
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
User: "Set up my Crossmint wallet"
|
|
43
|
+
Agent: Use crossmint_setup
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This generates a local ed25519 keypair and returns a delegation URL.
|
|
47
|
+
|
|
48
|
+
### Step 2: User completes web setup
|
|
49
|
+
|
|
50
|
+
The user opens the delegation URL in their browser. The web app will:
|
|
51
|
+
1. Create a Crossmint smart wallet
|
|
52
|
+
2. Add the agent's public key as a delegated signer
|
|
53
|
+
3. Display the **wallet address** and **API key**
|
|
54
|
+
|
|
55
|
+
### Step 3: Configure the agent
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
User: "My wallet address is X and API key is Y"
|
|
59
|
+
Agent: Use crossmint_configure with walletAddress and apiKey
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Now the wallet is ready to use.
|
|
63
|
+
|
|
64
|
+
## Common Operations
|
|
65
|
+
|
|
66
|
+
### Check balance
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
User: "What's my wallet balance?"
|
|
70
|
+
Agent: Use crossmint_balance
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Returns SOL, USDC, and other token balances.
|
|
74
|
+
|
|
75
|
+
### Send tokens
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
User: "Send 10 USDC to <address>"
|
|
79
|
+
Agent: Use crossmint_send with to, amount, token="usdc"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
User: "Send 0.1 SOL to <address> and wait for confirmation"
|
|
84
|
+
Agent: Use crossmint_send with to, amount, token="sol", wait=true
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Supported tokens:
|
|
88
|
+
- `sol` - Native SOL
|
|
89
|
+
- `usdc` - USDC stablecoin
|
|
90
|
+
- Any SPL token address
|
|
91
|
+
|
|
92
|
+
### Check transaction status
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
User: "What's the status of transaction abc-123?"
|
|
96
|
+
Agent: Use crossmint_tx_status with transactionId="abc-123"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
User: "Wait for transaction abc-123 to complete"
|
|
101
|
+
Agent: Use crossmint_tx_status with transactionId="abc-123", wait=true
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Get wallet info
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
User: "Show my wallet details"
|
|
108
|
+
Agent: Use crossmint_wallet_info
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Amazon Purchases
|
|
112
|
+
|
|
113
|
+
Buy products from Amazon using SOL or USDC from the agent's wallet. Crossmint acts as Merchant of Record, handling payments, shipping, and taxes.
|
|
114
|
+
|
|
115
|
+
### Buy a product
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
User: "Buy me this Amazon product: B00O79SKV6"
|
|
119
|
+
Agent: Use crossmint_buy with product ASIN and shipping address
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Required information:
|
|
123
|
+
- Amazon product ASIN or URL
|
|
124
|
+
- Recipient email
|
|
125
|
+
- Full shipping address (name, street, city, postal code, country)
|
|
126
|
+
|
|
127
|
+
### Check order status
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
User: "What's the status of my order?"
|
|
131
|
+
Agent: Use crossmint_order_status with the order ID
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Amazon Product Locator Formats
|
|
135
|
+
|
|
136
|
+
- ASIN: `B00O79SKV6`
|
|
137
|
+
- Full URL: `https://www.amazon.com/dp/B00O79SKV6`
|
|
138
|
+
|
|
139
|
+
### Amazon Order Restrictions
|
|
140
|
+
|
|
141
|
+
Orders may fail if:
|
|
142
|
+
- Item not sold by Amazon or verified seller
|
|
143
|
+
- Item requires special shipping
|
|
144
|
+
- Item is digital (ebooks, software, etc.)
|
|
145
|
+
- Item is from Amazon Fresh, Pantry, Pharmacy, or Subscribe & Save
|
|
146
|
+
|
|
147
|
+
## Tool Parameters
|
|
148
|
+
|
|
149
|
+
### crossmint_setup
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"agentId": "optional - defaults to current agent"
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### crossmint_configure
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"walletAddress": "required - smart wallet address from web app",
|
|
162
|
+
"apiKey": "required - API key from web app",
|
|
163
|
+
"agentId": "optional"
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### crossmint_balance
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"agentId": "optional"
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### crossmint_send
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"to": "required - recipient Solana address or email locator",
|
|
180
|
+
"amount": "required - e.g., '10', '0.5'",
|
|
181
|
+
"token": "optional - 'sol', 'usdc', or SPL address (default: 'usdc')",
|
|
182
|
+
"wait": "optional - if true, wait for confirmation (default: false)",
|
|
183
|
+
"timeoutMs": "optional - max wait time in ms (default: 60000)",
|
|
184
|
+
"agentId": "optional"
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### crossmint_tx_status
|
|
189
|
+
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"transactionId": "required - transaction ID from crossmint_send",
|
|
193
|
+
"wait": "optional - if true, wait for terminal state (default: false)",
|
|
194
|
+
"timeoutMs": "optional - max wait time in ms (default: 60000)",
|
|
195
|
+
"agentId": "optional"
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### crossmint_wallet_info
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"agentId": "optional"
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### crossmint_buy
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"productId": "required - Amazon ASIN or URL",
|
|
212
|
+
"recipientEmail": "required - for order confirmation",
|
|
213
|
+
"recipientName": "required - full name for shipping",
|
|
214
|
+
"addressLine1": "required - street address",
|
|
215
|
+
"addressLine2": "optional - apt, suite, etc.",
|
|
216
|
+
"city": "required",
|
|
217
|
+
"state": "optional - state/province code",
|
|
218
|
+
"postalCode": "required",
|
|
219
|
+
"country": "required - e.g., 'US'",
|
|
220
|
+
"currency": "optional - 'sol' or 'usdc' (default: 'usdc')",
|
|
221
|
+
"agentId": "optional"
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### crossmint_order_status
|
|
226
|
+
|
|
227
|
+
```json
|
|
228
|
+
{
|
|
229
|
+
"orderId": "required - from crossmint_buy response",
|
|
230
|
+
"agentId": "optional"
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Troubleshooting
|
|
235
|
+
|
|
236
|
+
### "No wallet found for agent"
|
|
237
|
+
|
|
238
|
+
The user hasn't run setup yet.
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
Agent: Use crossmint_setup first to generate a keypair
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### "Wallet not fully configured"
|
|
245
|
+
|
|
246
|
+
Keypair exists but web setup wasn't completed.
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
Agent:
|
|
250
|
+
1. Use crossmint_wallet_info to get the delegation URL
|
|
251
|
+
2. Ask user to complete web setup
|
|
252
|
+
3. Use crossmint_configure with the wallet address and API key
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### "Failed to get balance" or "Failed to send"
|
|
256
|
+
|
|
257
|
+
- Verify the API key is correct
|
|
258
|
+
- Check wallet address matches the web app
|
|
259
|
+
- Ensure sufficient balance for transfers
|
|
260
|
+
|
|
261
|
+
## Security Notes
|
|
262
|
+
|
|
263
|
+
- Private keys are stored locally at `~/.openclaw/crossmint-wallets/`
|
|
264
|
+
- Keys never leave the agent's machine
|
|
265
|
+
- Uses ed25519 cryptography (Solana native)
|
|
266
|
+
- Users retain admin control and can revoke delegation anytime
|
|
267
|
+
- Always verify recipient addresses before sending
|
|
268
|
+
|
|
269
|
+
## Best Practices
|
|
270
|
+
|
|
271
|
+
1. **Always check balance before sending** - Avoid failed transactions
|
|
272
|
+
2. **Confirm recipient with user** - Double-check addresses for large transfers
|
|
273
|
+
3. **Get devnet tokens for testing** - Use Solana devnet faucets to get test SOL
|
|
274
|
+
4. **One wallet per agent** - Each agent ID gets its own keypair
|