n8n-nodes-dominusnode 1.1.0 → 1.3.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/CHANGELOG.md +1 -0
- package/README.md +13 -10
- package/dist/credentials/DominusNodeApi.credentials.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/nodes/DominusNodeAccount/DominusNodeAccount.node.d.ts +23 -0
- package/dist/nodes/DominusNodeAccount/DominusNodeAccount.node.js +346 -0
- package/dist/nodes/DominusNodeAccount/DominusNodeAccount.node.js.map +1 -0
- package/dist/nodes/DominusNodeKeys/DominusNodeKeys.node.d.ts +20 -0
- package/dist/nodes/DominusNodeKeys/DominusNodeKeys.node.js +162 -0
- package/dist/nodes/DominusNodeKeys/DominusNodeKeys.node.js.map +1 -0
- package/dist/nodes/DominusNodePlans/DominusNodePlans.node.d.ts +19 -0
- package/dist/nodes/DominusNodePlans/DominusNodePlans.node.js +142 -0
- package/dist/nodes/DominusNodePlans/DominusNodePlans.node.js.map +1 -0
- package/dist/nodes/DominusNodeProxy/DominusNodeProxy.node.d.ts +2 -1
- package/dist/nodes/DominusNodeProxy/DominusNodeProxy.node.js +33 -9
- package/dist/nodes/DominusNodeProxy/DominusNodeProxy.node.js.map +1 -1
- package/dist/nodes/DominusNodeTeams/DominusNodeTeams.node.d.ts +27 -0
- package/dist/nodes/DominusNodeTeams/DominusNodeTeams.node.js +309 -0
- package/dist/nodes/DominusNodeTeams/DominusNodeTeams.node.js.map +1 -0
- package/dist/nodes/DominusNodeUsage/DominusNodeUsage.node.d.ts +3 -1
- package/dist/nodes/DominusNodeUsage/DominusNodeUsage.node.js +47 -1
- package/dist/nodes/DominusNodeUsage/DominusNodeUsage.node.js.map +1 -1
- package/dist/nodes/DominusNodeWallet/DominusNodeWallet.node.d.ts +5 -1
- package/dist/nodes/DominusNodeWallet/DominusNodeWallet.node.js +361 -38
- package/dist/nodes/DominusNodeWallet/DominusNodeWallet.node.js.map +1 -1
- package/dist/shared/auth.js +1 -1
- package/dist/shared/auth.js.map +1 -1
- package/dist/shared/ssrf.js.map +1 -1
- package/package.json +8 -3
- package/src/credentials/DominusNodeApi.credentials.ts +0 -48
- package/src/index.ts +0 -4
- package/src/nodes/DominusNodeProxy/DominusNodeProxy.node.ts +0 -460
- package/src/nodes/DominusNodeUsage/DominusNodeUsage.node.ts +0 -131
- package/src/nodes/DominusNodeWallet/DominusNodeWallet.node.ts +0 -899
- package/src/shared/auth.ts +0 -287
- package/src/shared/constants.ts +0 -11
- package/src/shared/ssrf.ts +0 -257
- package/tests/DominusNodeProxy.test.ts +0 -281
- package/tests/DominusNodeUsage.test.ts +0 -250
- package/tests/DominusNodeWallet.test.ts +0 -591
- package/tests/ssrf.test.ts +0 -238
- package/tsconfig.json +0 -18
- package/vitest.config.ts +0 -8
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Dominus Node Wallet n8n community node.
|
|
4
4
|
*
|
|
5
|
-
* Operations:
|
|
5
|
+
* Operations (25 tools):
|
|
6
6
|
* - Check Balance: Get current wallet balance
|
|
7
7
|
* - Top Up (Stripe): Create a Stripe checkout session
|
|
8
8
|
* - Top Up (Crypto): Create a crypto payment invoice
|
|
9
9
|
* - Top Up (PayPal): Create a PayPal checkout session via Stripe
|
|
10
|
+
* - Get Transactions: Get wallet transaction history
|
|
11
|
+
* - Get Forecast: Get wallet spend forecast
|
|
12
|
+
* - Check Payment: Check crypto payment invoice status
|
|
10
13
|
* - Create Agentic Wallet: Create a sub-wallet with spending limits
|
|
11
14
|
* - Fund Agentic Wallet: Transfer funds to an agentic wallet
|
|
12
15
|
* - Get Agentic Wallet Balance: Check an agentic wallet's balance
|
|
@@ -24,6 +27,7 @@
|
|
|
24
27
|
* - Team Usage: Get team wallet transaction history
|
|
25
28
|
* - Update Team: Update team name/max members
|
|
26
29
|
* - Update Team Member Role: Update a team member's role
|
|
30
|
+
* - x402 Info: Get x402 micropayment protocol information
|
|
27
31
|
*
|
|
28
32
|
* @module
|
|
29
33
|
*/
|
|
@@ -35,7 +39,16 @@ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
|
|
|
35
39
|
const CONTROL_CHAR_RE = /[\x00-\x1f\x7f]/;
|
|
36
40
|
const DOMAIN_RE = /^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
|
|
37
41
|
const VALID_CRYPTO_CURRENCIES = new Set([
|
|
38
|
-
"btc",
|
|
42
|
+
"btc",
|
|
43
|
+
"eth",
|
|
44
|
+
"ltc",
|
|
45
|
+
"xmr",
|
|
46
|
+
"zec",
|
|
47
|
+
"usdc",
|
|
48
|
+
"sol",
|
|
49
|
+
"usdt",
|
|
50
|
+
"dai",
|
|
51
|
+
"bnb",
|
|
39
52
|
]);
|
|
40
53
|
class DominusNodeWallet {
|
|
41
54
|
description = {
|
|
@@ -58,31 +71,184 @@ class DominusNodeWallet {
|
|
|
58
71
|
noDataExpression: true,
|
|
59
72
|
options: [
|
|
60
73
|
// Wallet
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
{
|
|
75
|
+
name: "Check Balance",
|
|
76
|
+
value: "checkBalance",
|
|
77
|
+
description: "Get current wallet balance",
|
|
78
|
+
action: "Check balance",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "Top Up (Stripe)",
|
|
82
|
+
value: "topUpStripe",
|
|
83
|
+
description: "Create a Stripe checkout session",
|
|
84
|
+
action: "Top up stripe",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "Top Up (Crypto)",
|
|
88
|
+
value: "topUpCrypto",
|
|
89
|
+
description: "Create a crypto payment invoice",
|
|
90
|
+
action: "Top up crypto",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "Top Up (PayPal)",
|
|
94
|
+
value: "topUpPaypal",
|
|
95
|
+
description: "Create a PayPal checkout session",
|
|
96
|
+
action: "Top up paypal",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "Get Transactions",
|
|
100
|
+
value: "getTransactions",
|
|
101
|
+
description: "Get wallet transaction history",
|
|
102
|
+
action: "Get transactions",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "Get Forecast",
|
|
106
|
+
value: "getForecast",
|
|
107
|
+
description: "Get wallet spend forecast",
|
|
108
|
+
action: "Get forecast",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "Check Payment",
|
|
112
|
+
value: "checkPayment",
|
|
113
|
+
description: "Check crypto payment invoice status",
|
|
114
|
+
action: "Check payment",
|
|
115
|
+
},
|
|
65
116
|
// Agentic Wallets
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
|
|
117
|
+
{
|
|
118
|
+
name: "Create Agentic Wallet",
|
|
119
|
+
value: "createAgenticWallet",
|
|
120
|
+
description: "Create a sub-wallet with spending limits",
|
|
121
|
+
action: "Create agentic wallet",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "Fund Agentic Wallet",
|
|
125
|
+
value: "fundAgenticWallet",
|
|
126
|
+
description: "Transfer funds to an agentic wallet",
|
|
127
|
+
action: "Fund agentic wallet",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "Get Agentic Wallet Balance",
|
|
131
|
+
value: "getAgenticBalance",
|
|
132
|
+
description: "Get agentic wallet balance",
|
|
133
|
+
action: "Get agentic wallet balance",
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "List Agentic Wallets",
|
|
137
|
+
value: "listAgenticWallets",
|
|
138
|
+
description: "List all agentic wallets",
|
|
139
|
+
action: "List agentic wallets",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "Get Agentic Transactions",
|
|
143
|
+
value: "getAgenticTransactions",
|
|
144
|
+
description: "Get agentic wallet transactions",
|
|
145
|
+
action: "Get agentic transactions",
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: "Freeze Agentic Wallet",
|
|
149
|
+
value: "freezeAgenticWallet",
|
|
150
|
+
description: "Freeze an agentic wallet",
|
|
151
|
+
action: "Freeze agentic wallet",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "Unfreeze Agentic Wallet",
|
|
155
|
+
value: "unfreezeAgenticWallet",
|
|
156
|
+
description: "Unfreeze an agentic wallet",
|
|
157
|
+
action: "Unfreeze agentic wallet",
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: "Delete Agentic Wallet",
|
|
161
|
+
value: "deleteAgenticWallet",
|
|
162
|
+
description: "Delete an agentic wallet",
|
|
163
|
+
action: "Delete agentic wallet",
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "Update Wallet Policy",
|
|
167
|
+
value: "updateWalletPolicy",
|
|
168
|
+
description: "Update agentic wallet spending policy",
|
|
169
|
+
action: "Update wallet policy",
|
|
170
|
+
},
|
|
75
171
|
// Teams
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
|
|
172
|
+
{
|
|
173
|
+
name: "Create Team",
|
|
174
|
+
value: "createTeam",
|
|
175
|
+
description: "Create a new team",
|
|
176
|
+
action: "Create team",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "List Teams",
|
|
180
|
+
value: "listTeams",
|
|
181
|
+
description: "List all teams",
|
|
182
|
+
action: "List teams",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: "Team Details",
|
|
186
|
+
value: "teamDetails",
|
|
187
|
+
description: "Get team details",
|
|
188
|
+
action: "Team details",
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "Fund Team",
|
|
192
|
+
value: "fundTeam",
|
|
193
|
+
description: "Fund a team wallet",
|
|
194
|
+
action: "Fund team",
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "Create Team Key",
|
|
198
|
+
value: "createTeamKey",
|
|
199
|
+
description: "Create an API key for a team",
|
|
200
|
+
action: "Create team key",
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "Team Usage",
|
|
204
|
+
value: "teamUsage",
|
|
205
|
+
description: "Get team wallet transactions",
|
|
206
|
+
action: "Team usage",
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "Update Team",
|
|
210
|
+
value: "updateTeam",
|
|
211
|
+
description: "Update team settings",
|
|
212
|
+
action: "Update team",
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: "Update Team Member Role",
|
|
216
|
+
value: "updateTeamMemberRole",
|
|
217
|
+
description: "Update a team member role",
|
|
218
|
+
action: "Update team member role",
|
|
219
|
+
},
|
|
84
220
|
// x402
|
|
85
|
-
{
|
|
221
|
+
{
|
|
222
|
+
name: "x402 Info",
|
|
223
|
+
value: "x402Info",
|
|
224
|
+
description: "Get x402 micropayment protocol information",
|
|
225
|
+
action: "Get x402 info",
|
|
226
|
+
},
|
|
227
|
+
// MPP
|
|
228
|
+
{
|
|
229
|
+
name: "MPP Info",
|
|
230
|
+
value: "mppInfo",
|
|
231
|
+
description: "Get MPP protocol information",
|
|
232
|
+
action: "Get MPP info",
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "Pay MPP",
|
|
236
|
+
value: "payMpp",
|
|
237
|
+
description: "Top up wallet via MPP",
|
|
238
|
+
action: "Pay via MPP",
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
name: "MPP Session Open",
|
|
242
|
+
value: "mppSessionOpen",
|
|
243
|
+
description: "Open a pay-as-you-go MPP session",
|
|
244
|
+
action: "Open MPP session",
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: "MPP Session Close",
|
|
248
|
+
value: "mppSessionClose",
|
|
249
|
+
description: "Close an MPP session",
|
|
250
|
+
action: "Close MPP session",
|
|
251
|
+
},
|
|
86
252
|
],
|
|
87
253
|
default: "checkBalance",
|
|
88
254
|
},
|
|
@@ -126,6 +292,78 @@ class DominusNodeWallet {
|
|
|
126
292
|
description: "Cryptocurrency to pay with",
|
|
127
293
|
displayOptions: { show: { operation: ["topUpCrypto"] } },
|
|
128
294
|
},
|
|
295
|
+
// --- Transaction / payment params ---
|
|
296
|
+
{
|
|
297
|
+
displayName: "Limit",
|
|
298
|
+
name: "walletTransactionLimit",
|
|
299
|
+
type: "number",
|
|
300
|
+
default: 20,
|
|
301
|
+
description: "Number of transactions to return (1-100)",
|
|
302
|
+
displayOptions: { show: { operation: ["getTransactions"] } },
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
displayName: "Invoice ID",
|
|
306
|
+
name: "invoiceId",
|
|
307
|
+
type: "string",
|
|
308
|
+
default: "",
|
|
309
|
+
required: true,
|
|
310
|
+
description: "Crypto payment invoice UUID to check status",
|
|
311
|
+
displayOptions: { show: { operation: ["checkPayment"] } },
|
|
312
|
+
},
|
|
313
|
+
// --- MPP params ---
|
|
314
|
+
{
|
|
315
|
+
displayName: "Amount (Cents)",
|
|
316
|
+
name: "mppAmountCents",
|
|
317
|
+
type: "number",
|
|
318
|
+
default: 500,
|
|
319
|
+
required: true,
|
|
320
|
+
description: "Amount in cents (min 500 = $5, max 100000 = $1,000)",
|
|
321
|
+
displayOptions: { show: { operation: ["payMpp"] } },
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
displayName: "MPP Method",
|
|
325
|
+
name: "mppMethod",
|
|
326
|
+
type: "options",
|
|
327
|
+
options: [
|
|
328
|
+
{ name: "Tempo", value: "tempo" },
|
|
329
|
+
{ name: "Stripe SPT", value: "stripe_spt" },
|
|
330
|
+
{ name: "Lightning", value: "lightning" },
|
|
331
|
+
],
|
|
332
|
+
default: "tempo",
|
|
333
|
+
required: true,
|
|
334
|
+
description: "MPP payment method",
|
|
335
|
+
displayOptions: { show: { operation: ["payMpp", "mppSessionOpen"] } },
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
displayName: "Max Deposit (Cents)",
|
|
339
|
+
name: "mppMaxDepositCents",
|
|
340
|
+
type: "number",
|
|
341
|
+
default: 500,
|
|
342
|
+
required: true,
|
|
343
|
+
description: "Maximum deposit in cents for the session (min 500, max 100000)",
|
|
344
|
+
displayOptions: { show: { operation: ["mppSessionOpen"] } },
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
displayName: "Pool Type",
|
|
348
|
+
name: "mppPoolType",
|
|
349
|
+
type: "options",
|
|
350
|
+
options: [
|
|
351
|
+
{ name: "Datacenter ($3/GB)", value: "dc" },
|
|
352
|
+
{ name: "Residential ($5/GB)", value: "residential" },
|
|
353
|
+
],
|
|
354
|
+
default: "dc",
|
|
355
|
+
description: "Proxy pool type for the MPP session",
|
|
356
|
+
displayOptions: { show: { operation: ["mppSessionOpen"] } },
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
displayName: "Channel ID",
|
|
360
|
+
name: "mppChannelId",
|
|
361
|
+
type: "string",
|
|
362
|
+
default: "",
|
|
363
|
+
required: true,
|
|
364
|
+
description: "The channelId returned from MPP Session Open",
|
|
365
|
+
displayOptions: { show: { operation: ["mppSessionClose"] } },
|
|
366
|
+
},
|
|
129
367
|
// --- Agentic wallet params ---
|
|
130
368
|
{
|
|
131
369
|
displayName: "Label",
|
|
@@ -158,7 +396,7 @@ class DominusNodeWallet {
|
|
|
158
396
|
name: "allowedDomains",
|
|
159
397
|
type: "string",
|
|
160
398
|
default: "",
|
|
161
|
-
description:
|
|
399
|
+
description: 'Comma-separated domain allowlist (e.g., "example.com,api.example.org"). Leave empty for no restriction.',
|
|
162
400
|
displayOptions: { show: { operation: ["createAgenticWallet"] } },
|
|
163
401
|
},
|
|
164
402
|
{
|
|
@@ -183,7 +421,7 @@ class DominusNodeWallet {
|
|
|
183
421
|
name: "policyAllowedDomains",
|
|
184
422
|
type: "string",
|
|
185
423
|
default: "",
|
|
186
|
-
description:
|
|
424
|
+
description: 'Comma-separated domain allowlist. Leave empty to skip, set to "*" to remove restriction.',
|
|
187
425
|
displayOptions: { show: { operation: ["updateWalletPolicy"] } },
|
|
188
426
|
},
|
|
189
427
|
{
|
|
@@ -221,7 +459,9 @@ class DominusNodeWallet {
|
|
|
221
459
|
type: "number",
|
|
222
460
|
default: 20,
|
|
223
461
|
description: "Number of transactions to return (1-100)",
|
|
224
|
-
displayOptions: {
|
|
462
|
+
displayOptions: {
|
|
463
|
+
show: { operation: ["getAgenticTransactions", "teamUsage"] },
|
|
464
|
+
},
|
|
225
465
|
},
|
|
226
466
|
// --- Team params ---
|
|
227
467
|
{
|
|
@@ -341,16 +581,22 @@ class DominusNodeWallet {
|
|
|
341
581
|
}
|
|
342
582
|
case "topUpStripe": {
|
|
343
583
|
const amountCents = this.getNodeParameter("amountCents", i);
|
|
344
|
-
if (!Number.isInteger(amountCents) ||
|
|
584
|
+
if (!Number.isInteger(amountCents) ||
|
|
585
|
+
amountCents < 500 ||
|
|
586
|
+
amountCents > 1_000_000) {
|
|
345
587
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "amountCents must be an integer between 500 ($5) and 1,000,000 ($10,000)", { itemIndex: i });
|
|
346
588
|
}
|
|
347
|
-
result = await auth.apiRequest("POST", "/api/wallet/topup/stripe", {
|
|
589
|
+
result = await auth.apiRequest("POST", "/api/wallet/topup/stripe", {
|
|
590
|
+
amountCents,
|
|
591
|
+
});
|
|
348
592
|
break;
|
|
349
593
|
}
|
|
350
594
|
case "topUpCrypto": {
|
|
351
595
|
const amountUsd = this.getNodeParameter("amountUsd", i);
|
|
352
596
|
const currency = this.getNodeParameter("currency", i);
|
|
353
|
-
if (typeof amountUsd !== "number" ||
|
|
597
|
+
if (typeof amountUsd !== "number" ||
|
|
598
|
+
amountUsd < 5 ||
|
|
599
|
+
amountUsd > 10_000) {
|
|
354
600
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "amountUsd must be between $5 and $10,000", { itemIndex: i });
|
|
355
601
|
}
|
|
356
602
|
if (!VALID_CRYPTO_CURRENCIES.has(currency)) {
|
|
@@ -364,7 +610,9 @@ class DominusNodeWallet {
|
|
|
364
610
|
}
|
|
365
611
|
case "topUpPaypal": {
|
|
366
612
|
const amountCents = this.getNodeParameter("amountCents", i);
|
|
367
|
-
if (!Number.isInteger(amountCents) ||
|
|
613
|
+
if (!Number.isInteger(amountCents) ||
|
|
614
|
+
amountCents < 500 ||
|
|
615
|
+
amountCents > 1_000_000) {
|
|
368
616
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "amountCents must be an integer between 500 ($5) and 1,000,000 ($10,000)", { itemIndex: i });
|
|
369
617
|
}
|
|
370
618
|
result = await auth.apiRequest("POST", "/api/wallet/topup/stripe", {
|
|
@@ -373,6 +621,24 @@ class DominusNodeWallet {
|
|
|
373
621
|
});
|
|
374
622
|
break;
|
|
375
623
|
}
|
|
624
|
+
case "getTransactions": {
|
|
625
|
+
const limit = this.getNodeParameter("walletTransactionLimit", i, 20);
|
|
626
|
+
validateLimit(this, limit, i);
|
|
627
|
+
const params = new URLSearchParams();
|
|
628
|
+
params.set("limit", String(limit));
|
|
629
|
+
result = await auth.apiRequest("GET", `/api/wallet/transactions?${params.toString()}`);
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
632
|
+
case "getForecast": {
|
|
633
|
+
result = await auth.apiRequest("GET", "/api/wallet/forecast");
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
|
+
case "checkPayment": {
|
|
637
|
+
const invoiceId = this.getNodeParameter("invoiceId", i);
|
|
638
|
+
validateUuid(this, invoiceId, "invoiceId", i);
|
|
639
|
+
result = await auth.apiRequest("GET", `/api/wallet/topup/crypto/${encodeURIComponent(invoiceId)}/status`);
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
376
642
|
// ----- Agentic Wallets -----
|
|
377
643
|
case "createAgenticWallet": {
|
|
378
644
|
const label = this.getNodeParameter("agenticLabel", i);
|
|
@@ -395,13 +661,17 @@ class DominusNodeWallet {
|
|
|
395
661
|
}
|
|
396
662
|
const body = { label, spendingLimitCents };
|
|
397
663
|
if (dailyLimitCents > 0) {
|
|
398
|
-
if (!Number.isInteger(dailyLimitCents) ||
|
|
664
|
+
if (!Number.isInteger(dailyLimitCents) ||
|
|
665
|
+
dailyLimitCents > 1_000_000) {
|
|
399
666
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "dailyLimitCents must be an integer between 1 and 1,000,000", { itemIndex: i });
|
|
400
667
|
}
|
|
401
668
|
body.dailyLimitCents = dailyLimitCents;
|
|
402
669
|
}
|
|
403
670
|
if (allowedDomainsRaw && allowedDomainsRaw.trim().length > 0) {
|
|
404
|
-
const domains = allowedDomainsRaw
|
|
671
|
+
const domains = allowedDomainsRaw
|
|
672
|
+
.split(",")
|
|
673
|
+
.map((d) => d.trim())
|
|
674
|
+
.filter(Boolean);
|
|
405
675
|
if (domains.length > 100) {
|
|
406
676
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "allowedDomains may contain at most 100 entries", { itemIndex: i });
|
|
407
677
|
}
|
|
@@ -475,7 +745,8 @@ class DominusNodeWallet {
|
|
|
475
745
|
body.dailyLimitCents = null;
|
|
476
746
|
}
|
|
477
747
|
else if (dailyLimitCents > 0) {
|
|
478
|
-
if (!Number.isInteger(dailyLimitCents) ||
|
|
748
|
+
if (!Number.isInteger(dailyLimitCents) ||
|
|
749
|
+
dailyLimitCents > 1_000_000) {
|
|
479
750
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "dailyLimitCents must be an integer between 1 and 1,000,000 (or -1 to remove)", { itemIndex: i });
|
|
480
751
|
}
|
|
481
752
|
body.dailyLimitCents = dailyLimitCents;
|
|
@@ -483,8 +754,12 @@ class DominusNodeWallet {
|
|
|
483
754
|
if (allowedDomainsRaw === "*") {
|
|
484
755
|
body.allowedDomains = null;
|
|
485
756
|
}
|
|
486
|
-
else if (allowedDomainsRaw &&
|
|
487
|
-
|
|
757
|
+
else if (allowedDomainsRaw &&
|
|
758
|
+
allowedDomainsRaw.trim().length > 0) {
|
|
759
|
+
const domains = allowedDomainsRaw
|
|
760
|
+
.split(",")
|
|
761
|
+
.map((d) => d.trim())
|
|
762
|
+
.filter(Boolean);
|
|
488
763
|
if (domains.length > 100) {
|
|
489
764
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "allowedDomains may contain at most 100 entries", { itemIndex: i });
|
|
490
765
|
}
|
|
@@ -516,7 +791,9 @@ class DominusNodeWallet {
|
|
|
516
791
|
}
|
|
517
792
|
const body = { name };
|
|
518
793
|
if (maxMembers) {
|
|
519
|
-
if (!Number.isInteger(maxMembers) ||
|
|
794
|
+
if (!Number.isInteger(maxMembers) ||
|
|
795
|
+
maxMembers < 1 ||
|
|
796
|
+
maxMembers > 100) {
|
|
520
797
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "maxMembers must be an integer between 1 and 100", { itemIndex: i });
|
|
521
798
|
}
|
|
522
799
|
body.maxMembers = maxMembers;
|
|
@@ -615,6 +892,50 @@ class DominusNodeWallet {
|
|
|
615
892
|
result = await auth.apiRequest("GET", "/api/x402/info");
|
|
616
893
|
break;
|
|
617
894
|
}
|
|
895
|
+
case "mppInfo": {
|
|
896
|
+
result = await auth.apiRequest("GET", "/api/mpp/info");
|
|
897
|
+
break;
|
|
898
|
+
}
|
|
899
|
+
case "payMpp": {
|
|
900
|
+
const amountCents = this.getNodeParameter("mppAmountCents", i);
|
|
901
|
+
const method = this.getNodeParameter("mppMethod", i);
|
|
902
|
+
if (!Number.isInteger(amountCents) ||
|
|
903
|
+
amountCents < 500 ||
|
|
904
|
+
amountCents > 100_000) {
|
|
905
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "amount_cents must be between 500 and 100,000", { itemIndex: i });
|
|
906
|
+
}
|
|
907
|
+
result = await auth.apiRequest("POST", "/api/mpp/topup", {
|
|
908
|
+
amountCents,
|
|
909
|
+
method,
|
|
910
|
+
});
|
|
911
|
+
break;
|
|
912
|
+
}
|
|
913
|
+
case "mppSessionOpen": {
|
|
914
|
+
const maxDepositCents = this.getNodeParameter("mppMaxDepositCents", i);
|
|
915
|
+
const method = this.getNodeParameter("mppMethod", i);
|
|
916
|
+
const poolType = this.getNodeParameter("mppPoolType", i);
|
|
917
|
+
if (!Number.isInteger(maxDepositCents) ||
|
|
918
|
+
maxDepositCents < 500 ||
|
|
919
|
+
maxDepositCents > 100_000) {
|
|
920
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "max_deposit_cents must be between 500 and 100,000", { itemIndex: i });
|
|
921
|
+
}
|
|
922
|
+
result = await auth.apiRequest("POST", "/api/mpp/session/open", {
|
|
923
|
+
maxDepositCents,
|
|
924
|
+
method,
|
|
925
|
+
poolType,
|
|
926
|
+
});
|
|
927
|
+
break;
|
|
928
|
+
}
|
|
929
|
+
case "mppSessionClose": {
|
|
930
|
+
const channelId = this.getNodeParameter("mppChannelId", i);
|
|
931
|
+
if (!channelId) {
|
|
932
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "channel_id is required", { itemIndex: i });
|
|
933
|
+
}
|
|
934
|
+
result = await auth.apiRequest("POST", "/api/mpp/session/close", {
|
|
935
|
+
channelId,
|
|
936
|
+
});
|
|
937
|
+
break;
|
|
938
|
+
}
|
|
618
939
|
default:
|
|
619
940
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`, { itemIndex: i });
|
|
620
941
|
}
|
|
@@ -643,7 +964,9 @@ exports.DominusNodeWallet = DominusNodeWallet;
|
|
|
643
964
|
// ---------------------------------------------------------------------------
|
|
644
965
|
function validateUuid(ctx, value, fieldName, itemIndex) {
|
|
645
966
|
if (!value || typeof value !== "string") {
|
|
646
|
-
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `${fieldName} is required`, {
|
|
967
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `${fieldName} is required`, {
|
|
968
|
+
itemIndex,
|
|
969
|
+
});
|
|
647
970
|
}
|
|
648
971
|
if (!UUID_RE.test(value)) {
|
|
649
972
|
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `${fieldName} must be a valid UUID`, { itemIndex });
|