n8n-nodes-coinbase-cdp-agentkit 0.1.0 → 0.2.0
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 +61 -332
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
# n8n-nodes-coinbase-cdp
|
|
1
|
+
# n8n-nodes-coinbase-cdp-agentkit
|
|
2
|
+
|
|
3
|
+
**This is the only open-source n8n node for Coinbase CDP. Never run security-critical crypto tools — wallets, transfers, swaps — from closed-source packages you cannot audit. If you can't read the code, you can lose your funds. [Audit this package yourself.](https://github.com/pvdyck/n8n-nodes-coinbase-cdp)**
|
|
2
4
|
|
|
3
5
|
n8n community node package for [Coinbase Developer Platform (CDP)](https://docs.cdp.coinbase.com/). Create wallets, transfer tokens, swap assets, and build AI-powered blockchain agents — all from n8n workflows.
|
|
4
6
|
|
|
@@ -6,7 +8,7 @@ n8n community node package for [Coinbase Developer Platform (CDP)](https://docs.
|
|
|
6
8
|
|
|
7
9
|
**3 nodes | 7 resources | 16 operations | 7 AI Agent tools | 12 networks | 100% test coverage**
|
|
8
10
|
|
|
9
|
-
[](https://www.npmjs.com/package/n8n-nodes-coinbase-cdp)
|
|
11
|
+
[](https://www.npmjs.com/package/n8n-nodes-coinbase-cdp-agentkit)
|
|
10
12
|
[](https://opensource.org/licenses/MIT)
|
|
11
13
|
|
|
12
14
|
---
|
|
@@ -31,129 +33,39 @@ n8n community node package for [Coinbase Developer Platform (CDP)](https://docs.
|
|
|
31
33
|
|
|
32
34
|
## Architecture
|
|
33
35
|
|
|
34
|
-
### AgentKit-First Strategy
|
|
35
|
-
|
|
36
36
|
This package uses an **AgentKit-first** architecture: 3 focused nodes + 1 shared credential, designed to align with [Coinbase AgentKit](https://docs.cdp.coinbase.com/agent-kit/welcome) conventions while keeping the bundle lightweight by using [`@coinbase/cdp-sdk`](https://github.com/coinbase/cdp-sdk) directly.
|
|
37
37
|
|
|
38
|
-
```mermaid
|
|
39
|
-
graph TB
|
|
40
|
-
subgraph Package["n8n-nodes-coinbase-cdp"]
|
|
41
|
-
subgraph Credential["CoinbaseCdpApi Credential"]
|
|
42
|
-
AK["API Key ID"]
|
|
43
|
-
AS["API Secret"]
|
|
44
|
-
WS["Wallet Secret<br/><i>(optional)</i>"]
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
Credential -->|shared auth| AT["CoinbaseAgentTool<br/><b>AI Tool Node</b><br/>supplyData → 7 tools"]
|
|
48
|
-
Credential -->|shared auth| CD["CoinbaseCdp<br/><b>Action Node</b><br/>execute → 7 resources"]
|
|
49
|
-
Credential -->|shared auth| CT["CoinbaseTrigger<br/><b>Polling Trigger</b><br/>poll → balance changes"]
|
|
50
|
-
|
|
51
|
-
subgraph Shared["Shared Layer"]
|
|
52
|
-
CF["cdpClientFactory"]
|
|
53
|
-
NO["networkOptions"]
|
|
54
|
-
TF["toolFactory"]
|
|
55
|
-
TY["types"]
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
AT --> Shared
|
|
59
|
-
CD --> Shared
|
|
60
|
-
CT --> Shared
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
Shared -->|initializes| SDK["@coinbase/cdp-sdk"]
|
|
64
|
-
AT -->|creates| LC["DynamicStructuredTool<br/><i>@langchain/core</i>"]
|
|
65
|
-
TF -->|validates with| ZD["Zod Schemas"]
|
|
66
38
|
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
MT --> CDP
|
|
95
|
-
CH --> AI
|
|
96
|
-
SC --> TRG
|
|
97
|
-
|
|
98
|
-
AI -.->|tool calls| T1 & T2 & T3 & T4 & T5 & T6 & T7
|
|
99
|
-
T1 & T2 & T3 & T4 & T5 & T6 & T7 -.->|results| AI
|
|
100
|
-
|
|
101
|
-
CDP --> |json output| Next["Next Node"]
|
|
102
|
-
AI --> |chat response| Resp["Chat Response"]
|
|
103
|
-
TRG --> |balance change event| Alert["Alert / Notification"]
|
|
39
|
+
┌──────────────────────────────────────────────────────────┐
|
|
40
|
+
│ n8n-nodes-coinbase-cdp-agentkit │
|
|
41
|
+
│ │
|
|
42
|
+
│ ┌─────────────────────────────────────────────────────┐ │
|
|
43
|
+
│ │ CoinbaseCdpApi Credential │ │
|
|
44
|
+
│ │ API Key ID | API Secret | Wallet Secret (opt) │ │
|
|
45
|
+
│ └──────┬──────────────┬──────────────┬────────────────┘ │
|
|
46
|
+
│ │ │ │ │
|
|
47
|
+
│ ▼ ▼ ▼ │
|
|
48
|
+
│ ┌────────────┐ ┌────────────┐ ┌──────────────┐ │
|
|
49
|
+
│ │ AgentTool │ │ CoinbaseCdp│ │CoinbaseTrigger│ │
|
|
50
|
+
│ │ (AI Tool) │ │ (Action) │ │ (Polling) │ │
|
|
51
|
+
│ │ 7 tools │ │ 7 resources│ │ balance watch│ │
|
|
52
|
+
│ └─────┬──────┘ └─────┬──────┘ └──────┬───────┘ │
|
|
53
|
+
│ │ │ │ │
|
|
54
|
+
│ └──────┬───────┴───────┬───────┘ │
|
|
55
|
+
│ ▼ ▼ │
|
|
56
|
+
│ ┌──────────────────────────────────────────┐ │
|
|
57
|
+
│ │ Shared Layer │ │
|
|
58
|
+
│ │ cdpClientFactory | networkOptions │ │
|
|
59
|
+
│ │ toolFactory | types │ │
|
|
60
|
+
│ └────────────────────┬─────────────────────┘ │
|
|
61
|
+
└───────────────────────┼──────────────────────────────────┘
|
|
62
|
+
▼
|
|
63
|
+
┌─────────────────┐
|
|
64
|
+
│ @coinbase/cdp-sdk│
|
|
65
|
+
└─────────────────┘
|
|
104
66
|
```
|
|
105
67
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
```mermaid
|
|
109
|
-
graph TD
|
|
110
|
-
subgraph src["src/"]
|
|
111
|
-
subgraph cred["credentials/"]
|
|
112
|
-
C1["CoinbaseCdpApi.credentials.ts<br/><i>3-field credential type</i>"]
|
|
113
|
-
end
|
|
114
|
-
subgraph icons["icons/"]
|
|
115
|
-
I1["coinbase.svg"]
|
|
116
|
-
end
|
|
117
|
-
subgraph nodes["nodes/"]
|
|
118
|
-
subgraph agent["CoinbaseAgentTool/"]
|
|
119
|
-
A1["CoinbaseAgentTool.node.ts<br/><i>supplyData method</i>"]
|
|
120
|
-
A2["CoinbaseAgentTool.node.json<br/><i>AI codex metadata</i>"]
|
|
121
|
-
subgraph actions["actions/"]
|
|
122
|
-
AA1["walletDetails.ts"]
|
|
123
|
-
AA2["nativeTransfer.ts"]
|
|
124
|
-
AA3["erc20Transfer.ts"]
|
|
125
|
-
AA4["erc20Balance.ts"]
|
|
126
|
-
AA5["swap.ts"]
|
|
127
|
-
AA6["getSwapPrice.ts"]
|
|
128
|
-
AA7["requestFaucet.ts"]
|
|
129
|
-
end
|
|
130
|
-
end
|
|
131
|
-
subgraph cdp["CoinbaseCdp/"]
|
|
132
|
-
B1["CoinbaseCdp.node.ts<br/><i>execute method, usableAsTool</i>"]
|
|
133
|
-
B2["CoinbaseCdp.node.json"]
|
|
134
|
-
subgraph resources["resources/"]
|
|
135
|
-
R1["account.ts"]
|
|
136
|
-
R2["solanaAccount.ts"]
|
|
137
|
-
R3["smartAccount.ts"]
|
|
138
|
-
R4["transfer.ts"]
|
|
139
|
-
R5["swap.ts"]
|
|
140
|
-
R6["policy.ts"]
|
|
141
|
-
R7["balance.ts"]
|
|
142
|
-
end
|
|
143
|
-
end
|
|
144
|
-
subgraph trigger["CoinbaseTrigger/"]
|
|
145
|
-
D1["CoinbaseTrigger.node.ts<br/><i>poll method</i>"]
|
|
146
|
-
D2["CoinbaseTrigger.node.json"]
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
subgraph shared["shared/"]
|
|
150
|
-
S1["cdpClientFactory.ts"]
|
|
151
|
-
S2["networkOptions.ts"]
|
|
152
|
-
S3["toolFactory.ts"]
|
|
153
|
-
S4["types.ts"]
|
|
154
|
-
end
|
|
155
|
-
end
|
|
156
|
-
```
|
|
68
|
+
> **See [IMPLEMENTATION.md](IMPLEMENTATION.md) for detailed Mermaid architecture diagrams** (rendered on GitHub).
|
|
157
69
|
|
|
158
70
|
---
|
|
159
71
|
|
|
@@ -162,7 +74,7 @@ graph TD
|
|
|
162
74
|
### n8n Community Nodes (Recommended)
|
|
163
75
|
|
|
164
76
|
1. Go to **Settings > Community Nodes** in your n8n instance
|
|
165
|
-
2. Enter `n8n-nodes-coinbase-cdp`
|
|
77
|
+
2. Enter `n8n-nodes-coinbase-cdp-agentkit`
|
|
166
78
|
3. Click **Install**
|
|
167
79
|
|
|
168
80
|
See the [n8n community nodes installation guide](https://docs.n8n.io/integrations/community-nodes/installation/gui-install/) for details.
|
|
@@ -171,7 +83,7 @@ See the [n8n community nodes installation guide](https://docs.n8n.io/integration
|
|
|
171
83
|
|
|
172
84
|
```bash
|
|
173
85
|
cd ~/.n8n/custom
|
|
174
|
-
npm install n8n-nodes-coinbase-cdp
|
|
86
|
+
npm install n8n-nodes-coinbase-cdp-agentkit
|
|
175
87
|
```
|
|
176
88
|
|
|
177
89
|
Restart n8n after installation. See [manual install docs](https://docs.n8n.io/integrations/community-nodes/installation/manual-install/).
|
|
@@ -198,24 +110,6 @@ You need a **Coinbase CDP API key** from the [CDP Portal](https://portal.cdp.coi
|
|
|
198
110
|
|
|
199
111
|
> **Note**: The Wallet Secret is only shown once during key creation. If you lose it, you'll need to create a new API key.
|
|
200
112
|
|
|
201
|
-
### Credential Flow
|
|
202
|
-
|
|
203
|
-
```mermaid
|
|
204
|
-
sequenceDiagram
|
|
205
|
-
participant User
|
|
206
|
-
participant Portal as CDP Portal
|
|
207
|
-
participant n8n
|
|
208
|
-
participant SDK as CDP SDK
|
|
209
|
-
|
|
210
|
-
User->>Portal: Create API Key
|
|
211
|
-
Portal-->>User: API Key ID + Secret + Wallet Secret
|
|
212
|
-
User->>n8n: Configure CoinbaseCdpApi credential
|
|
213
|
-
n8n->>SDK: CdpClient({ apiKeyId, apiKeySecret, walletSecret })
|
|
214
|
-
SDK-->>n8n: Authenticated client
|
|
215
|
-
n8n->>SDK: Execute blockchain operations
|
|
216
|
-
SDK-->>n8n: Results
|
|
217
|
-
```
|
|
218
|
-
|
|
219
113
|
---
|
|
220
114
|
|
|
221
115
|
## Nodes
|
|
@@ -224,21 +118,12 @@ sequenceDiagram
|
|
|
224
118
|
|
|
225
119
|
The primary node for deterministic blockchain operations. Processes items through a resource/operation pattern. Supports [`usableAsTool: true`](https://docs.n8n.io/integrations/creating-nodes/build/declarative-style-node/#usable-as-tool), so it can also be used directly as an AI Agent tool.
|
|
226
120
|
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
Router -->|solanaAccount| SOL["Solana Ops"]
|
|
234
|
-
Router -->|smartAccount| SMA["Smart Account"]
|
|
235
|
-
Router -->|transfer| TRN["Transfer Ops"]
|
|
236
|
-
Router -->|swap| SWP["Swap Ops"]
|
|
237
|
-
Router -->|policy| POL["Policy CRUD"]
|
|
238
|
-
Router -->|balance| BAL["Balance Query"]
|
|
239
|
-
|
|
240
|
-
ACC & SOL & SMA & TRN & SWP & POL & BAL --> SDK["CDP SDK"]
|
|
241
|
-
SDK --> Output["Output Items"]
|
|
121
|
+
```
|
|
122
|
+
Input Items → execute() → Resource Router → CDP SDK → Output Items
|
|
123
|
+
│
|
|
124
|
+
┌───────┬───────┬───┴───┬───────┬───────┬────────┐
|
|
125
|
+
▼ ▼ ▼ ▼ ▼ ▼ ▼
|
|
126
|
+
Account Solana Smart Transfer Swap Policy Balance
|
|
242
127
|
```
|
|
243
128
|
|
|
244
129
|
#### Resources & Operations
|
|
@@ -300,28 +185,12 @@ flowchart LR
|
|
|
300
185
|
|
|
301
186
|
Connect blockchain operations to n8n's AI Agent node. Each tool is a [LangChain `DynamicStructuredTool`](https://v03.api.js.langchain.com/classes/_langchain_core.tools.DynamicStructuredTool.html) that an LLM can invoke autonomously. Tool names and schemas are compatible with [Coinbase AgentKit](https://docs.cdp.coinbase.com/agent-kit/welcome) conventions.
|
|
302
187
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
Agent -.->|"tool call"| T1["CDP Tool:<br/>Wallet Details"]
|
|
311
|
-
Agent -.->|"tool call"| T2["CDP Tool:<br/>Native Transfer"]
|
|
312
|
-
Agent -.->|"tool call"| T3["CDP Tool:<br/>ERC-20 Transfer"]
|
|
313
|
-
Agent -.->|"tool call"| T4["CDP Tool:<br/>Get Balance"]
|
|
314
|
-
Agent -.->|"tool call"| T5["CDP Tool:<br/>Swap Tokens"]
|
|
315
|
-
Agent -.->|"tool call"| T6["CDP Tool:<br/>Get Swap Price"]
|
|
316
|
-
Agent -.->|"tool call"| T7["CDP Tool:<br/>Request Faucet"]
|
|
317
|
-
|
|
318
|
-
T1 -.->|"result"| Agent
|
|
319
|
-
T2 -.->|"result"| Agent
|
|
320
|
-
T3 -.->|"result"| Agent
|
|
321
|
-
T4 -.->|"result"| Agent
|
|
322
|
-
T5 -.->|"result"| Agent
|
|
323
|
-
T6 -.->|"result"| Agent
|
|
324
|
-
T7 -.->|"result"| Agent
|
|
188
|
+
```
|
|
189
|
+
Chat Trigger → AI Agent (Claude/GPT) → Chat Response
|
|
190
|
+
│ tools
|
|
191
|
+
┌────────────┼────────────┐
|
|
192
|
+
[CDP Tool: [CDP Tool: [CDP Tool:
|
|
193
|
+
Wallet] Transfer] Swap] ... (7 tools)
|
|
325
194
|
```
|
|
326
195
|
|
|
327
196
|
#### Available Tools
|
|
@@ -336,31 +205,6 @@ flowchart TB
|
|
|
336
205
|
| Get Swap Price | `get_swap_price` | `{ accountName, fromToken, toToken, fromAmount, network }` | Get price quote without executing |
|
|
337
206
|
| Request Faucet | `request_faucet` | `{ address, token, network }` | Request testnet tokens (ETH, USDC, SOL) |
|
|
338
207
|
|
|
339
|
-
#### Tool Creation Flow
|
|
340
|
-
|
|
341
|
-
```mermaid
|
|
342
|
-
sequenceDiagram
|
|
343
|
-
participant n8n as n8n AI Agent
|
|
344
|
-
participant Node as CoinbaseAgentTool
|
|
345
|
-
participant TF as toolFactory
|
|
346
|
-
participant LC as DynamicStructuredTool
|
|
347
|
-
participant SDK as CDP SDK
|
|
348
|
-
|
|
349
|
-
n8n->>Node: supplyData(itemIndex)
|
|
350
|
-
Node->>Node: getNodeParameter('tool')
|
|
351
|
-
Node->>Node: getCdpClient(credentials)
|
|
352
|
-
Node->>TF: createAgentTool({ name, schema, func })
|
|
353
|
-
TF->>LC: new DynamicStructuredTool({ name, schema, func })
|
|
354
|
-
TF-->>Node: tool instance
|
|
355
|
-
Node-->>n8n: { response: tool }
|
|
356
|
-
|
|
357
|
-
Note over n8n,SDK: Later, when LLM decides to call the tool:
|
|
358
|
-
n8n->>LC: invoke({ param1, param2 })
|
|
359
|
-
LC->>SDK: CDP API call
|
|
360
|
-
SDK-->>LC: result
|
|
361
|
-
LC-->>n8n: JSON string (or error string)
|
|
362
|
-
```
|
|
363
|
-
|
|
364
208
|
#### AI Agent Setup
|
|
365
209
|
|
|
366
210
|
1. Add a **Chat Trigger** node
|
|
@@ -375,31 +219,6 @@ sequenceDiagram
|
|
|
375
219
|
|
|
376
220
|
Polls for balance changes on any EVM address. Fires when any token balance increases, decreases, or a new token appears.
|
|
377
221
|
|
|
378
|
-
#### Polling Mechanism
|
|
379
|
-
|
|
380
|
-
```mermaid
|
|
381
|
-
stateDiagram-v2
|
|
382
|
-
[*] --> FirstPoll: n8n scheduler triggers
|
|
383
|
-
|
|
384
|
-
FirstPoll --> StoreBaseline: Fetch balances from CDP SDK
|
|
385
|
-
StoreBaseline --> WaitForNext: Store in staticData, return null
|
|
386
|
-
|
|
387
|
-
WaitForNext --> SubsequentPoll: n8n scheduler triggers
|
|
388
|
-
|
|
389
|
-
SubsequentPoll --> FetchCurrent: Fetch balances from CDP SDK
|
|
390
|
-
FetchCurrent --> Compare: Load previous from staticData
|
|
391
|
-
|
|
392
|
-
Compare --> NoChange: Balances identical
|
|
393
|
-
Compare --> Changed: Differences found
|
|
394
|
-
|
|
395
|
-
NoChange --> UpdateState: Update staticData
|
|
396
|
-
UpdateState --> WaitForNext: Return null (no trigger)
|
|
397
|
-
|
|
398
|
-
Changed --> EmitEvents: Build change events
|
|
399
|
-
EmitEvents --> UpdateState2: Update staticData
|
|
400
|
-
UpdateState2 --> WaitForNext: Return events (trigger fires)
|
|
401
|
-
```
|
|
402
|
-
|
|
403
222
|
#### Configuration
|
|
404
223
|
|
|
405
224
|
| Parameter | Description |
|
|
@@ -452,87 +271,17 @@ See the [CDP SDK documentation](https://docs.cdp.coinbase.com/get-started/docs/u
|
|
|
452
271
|
|
|
453
272
|
Import these from the `examples/` directory into your n8n instance.
|
|
454
273
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
### 2. Faucet & Transfer
|
|
466
|
-
|
|
467
|
-
```mermaid
|
|
468
|
-
flowchart LR
|
|
469
|
-
A["Manual Trigger"] --> B["Create Sender<br/><i>account.getOrCreate</i>"]
|
|
470
|
-
B --> C["Request Faucet ETH<br/><i>account.requestFaucet</i>"]
|
|
471
|
-
C --> D["Check Balance<br/><i>balance.listTokens</i>"]
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
Request testnet ETH from the faucet and verify receipt.
|
|
475
|
-
|
|
476
|
-
### 3. Swap Tokens
|
|
477
|
-
|
|
478
|
-
```mermaid
|
|
479
|
-
flowchart LR
|
|
480
|
-
A["Manual Trigger"] --> B["Get Account"]
|
|
481
|
-
B --> C["Get Swap Quote<br/><i>WETH → USDC</i>"]
|
|
482
|
-
C --> D{"Liquidity<br/>Available?"}
|
|
483
|
-
D -->|Yes| E["Execute Swap"]
|
|
484
|
-
D -->|No| F["Stop"]
|
|
485
|
-
```
|
|
274
|
+
| # | Workflow | Description |
|
|
275
|
+
|---|----------|-------------|
|
|
276
|
+
| 1 | **Account & Balance Check** | Create an EVM account on Base Sepolia and query its token balances |
|
|
277
|
+
| 2 | **Faucet & Transfer** | Request testnet ETH from the faucet and verify receipt |
|
|
278
|
+
| 3 | **Swap Tokens** | Quote a WETH→USDC swap on Base, check liquidity, execute if available |
|
|
279
|
+
| 4 | **AI Agent Blockchain** | Chat-driven blockchain operations via LLM tool calling |
|
|
280
|
+
| 5 | **Balance Monitor** | Event-driven balance monitoring with configurable alerts |
|
|
281
|
+
| 6 | **Multi-Chain Accounts** | Parallel account creation across EVM and Solana with testnet funding |
|
|
282
|
+
| 7 | **Policy Management** | Query CDP governance policies for the organization |
|
|
486
283
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
### 4. AI Agent Blockchain
|
|
490
|
-
|
|
491
|
-
```mermaid
|
|
492
|
-
flowchart TB
|
|
493
|
-
A["Chat Trigger"] --> B["AI Agent<br/><i>Claude / GPT</i>"]
|
|
494
|
-
B --> C["Chat Response"]
|
|
495
|
-
B -.->|tools| D["Wallet Details"]
|
|
496
|
-
B -.->|tools| E["Get Balance"]
|
|
497
|
-
B -.->|tools| F["Native Transfer"]
|
|
498
|
-
B -.->|tools| G["Request Faucet"]
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
Chat-driven blockchain operations via LLM tool calling.
|
|
502
|
-
|
|
503
|
-
### 5. Balance Monitor
|
|
504
|
-
|
|
505
|
-
```mermaid
|
|
506
|
-
flowchart LR
|
|
507
|
-
A["CoinbaseTrigger<br/><i>polls every 5min</i>"] --> B{"Is ETH?"}
|
|
508
|
-
B -->|Yes| C["Format Alert"]
|
|
509
|
-
C --> D["Send Notification<br/><i>Slack / Email</i>"]
|
|
510
|
-
B -->|No| E["Skip"]
|
|
511
|
-
```
|
|
512
|
-
|
|
513
|
-
Event-driven balance monitoring with configurable alerts.
|
|
514
|
-
|
|
515
|
-
### 6. Multi-Chain Accounts
|
|
516
|
-
|
|
517
|
-
```mermaid
|
|
518
|
-
flowchart TB
|
|
519
|
-
A["Manual Trigger"] --> B["EVM Account<br/><i>base-sepolia</i>"]
|
|
520
|
-
A --> C["Solana Account<br/><i>solana-devnet</i>"]
|
|
521
|
-
B --> D["EVM Faucet"]
|
|
522
|
-
C --> E["Solana Faucet"]
|
|
523
|
-
E --> F["Smart Account<br/><i>ERC-4337</i>"]
|
|
524
|
-
```
|
|
525
|
-
|
|
526
|
-
Parallel account creation across EVM and Solana with testnet funding.
|
|
527
|
-
|
|
528
|
-
### 7. Policy Management
|
|
529
|
-
|
|
530
|
-
```mermaid
|
|
531
|
-
flowchart LR
|
|
532
|
-
A["Manual Trigger"] --> B["List All Policies<br/><i>policy.list</i>"]
|
|
533
|
-
```
|
|
534
|
-
|
|
535
|
-
Query CDP governance policies for the organization.
|
|
284
|
+
> **See [IMPLEMENTATION.md](IMPLEMENTATION.md#example-workflow-diagrams) for visual workflow diagrams** (rendered on GitHub).
|
|
536
285
|
|
|
537
286
|
---
|
|
538
287
|
|
|
@@ -551,14 +300,6 @@ cd n8n-nodes-coinbase-cdp
|
|
|
551
300
|
npm install
|
|
552
301
|
```
|
|
553
302
|
|
|
554
|
-
### Development Server
|
|
555
|
-
|
|
556
|
-
```bash
|
|
557
|
-
npm run dev
|
|
558
|
-
```
|
|
559
|
-
|
|
560
|
-
Uses [`@n8n/node-cli`](https://www.npmjs.com/package/@n8n/node-cli) to symlink the package into n8n's custom extensions, run the TypeScript compiler in watch mode, and start n8n with hot reload. Open `http://localhost:5678` to access the editor.
|
|
561
|
-
|
|
562
303
|
### Scripts
|
|
563
304
|
|
|
564
305
|
| Command | Description |
|
|
@@ -590,14 +331,6 @@ CDP_WALLET_SECRET=your-wallet-secret
|
|
|
590
331
|
|
|
591
332
|
116 tests across 8 suites with **100% coverage** on all metrics:
|
|
592
333
|
|
|
593
|
-
```
|
|
594
|
-
---------------------------------|---------|----------|---------|---------|
|
|
595
|
-
File | % Stmts | % Branch | % Funcs | % Lines |
|
|
596
|
-
---------------------------------|---------|----------|---------|---------|
|
|
597
|
-
All files | 100 | 100 | 100 | 100 |
|
|
598
|
-
---------------------------------|---------|----------|---------|---------|
|
|
599
|
-
```
|
|
600
|
-
|
|
601
334
|
| Suite | Tests | Covers |
|
|
602
335
|
|-------|:-----:|--------|
|
|
603
336
|
| CoinbaseAgentTool.test.ts | 30 | All 7 AI tool actions, error handling, edge cases |
|
|
@@ -634,15 +367,9 @@ Tool names (`get_wallet_details`, `native_transfer`, etc.) and schemas match [Co
|
|
|
634
367
|
### Triple-Pathway Usage via `usableAsTool`
|
|
635
368
|
|
|
636
369
|
The `CoinbaseCdp` action node sets `usableAsTool: true`, enabling three usage modes:
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
Node["CoinbaseCdp Node"]
|
|
641
|
-
|
|
642
|
-
Node -->|"1. Direct"| D["Trigger → CoinbaseCdp → Next Node<br/><i>Resource/operation UI</i>"]
|
|
643
|
-
Node -->|"2. AI Tool"| A["AI Agent ─ tools ─► CoinbaseCdp<br/><i>LLM selects operation</i>"]
|
|
644
|
-
Node -->|"3. Expression"| E["$('CoinbaseCdp').item.json.address<br/><i>Reference in other nodes</i>"]
|
|
645
|
-
```
|
|
370
|
+
1. **Direct**: Trigger → CoinbaseCdp → Next Node (resource/operation UI)
|
|
371
|
+
2. **AI Tool**: AI Agent → tools → CoinbaseCdp (LLM selects operation)
|
|
372
|
+
3. **Expression**: `$('CoinbaseCdp').item.json.address` (reference in other nodes)
|
|
646
373
|
|
|
647
374
|
### Error-Safe Agent Tools
|
|
648
375
|
|
|
@@ -656,6 +383,8 @@ n8n supports polling natively. The [`@coinbase/cdp-sdk`](https://github.com/coin
|
|
|
656
383
|
|
|
657
384
|
Complex Zod schemas trigger TypeScript error TS2589 (deep instantiation) in LangChain's type system. Typing the schema as `any` in the `ToolDefinition` interface avoids this while keeping runtime validation intact via Zod.
|
|
658
385
|
|
|
386
|
+
> **See [IMPLEMENTATION.md](IMPLEMENTATION.md) for full architecture diagrams.**
|
|
387
|
+
|
|
659
388
|
---
|
|
660
389
|
|
|
661
390
|
## Links & References
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-coinbase-cdp-agentkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "n8n community node for Coinbase Developer Platform (CDP) - wallets, transfers, swaps, and AI agent tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|
|
@@ -36,8 +36,9 @@
|
|
|
36
36
|
"test": "jest",
|
|
37
37
|
"test:coverage": "jest --coverage",
|
|
38
38
|
"test:watch": "jest --watch",
|
|
39
|
-
"test:e2e": "npx ts-node test/e2e/run-workflows.ts",
|
|
40
|
-
"test:
|
|
39
|
+
"test:e2e": "npm run build && npx ts-node test/e2e/run-workflows.ts",
|
|
40
|
+
"test:e2e:ui": "npm run build && npx ts-node test/e2e/run-workflows.ts --keep-running",
|
|
41
|
+
"test:all": "jest --coverage && npm run test:e2e",
|
|
41
42
|
"prepublishOnly": "npm run build"
|
|
42
43
|
},
|
|
43
44
|
"files": [
|