n8n-nodes-xdc 1.0.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.
Files changed (112) hide show
  1. package/LICENSE +46 -0
  2. package/README.md +421 -0
  3. package/dist/credentials/XdcNetwork.credentials.d.ts +15 -0
  4. package/dist/credentials/XdcNetwork.credentials.d.ts.map +1 -0
  5. package/dist/credentials/XdcNetwork.credentials.js +106 -0
  6. package/dist/credentials/XdcNetwork.credentials.js.map +1 -0
  7. package/dist/credentials/XdcScan.credentials.d.ts +15 -0
  8. package/dist/credentials/XdcScan.credentials.d.ts.map +1 -0
  9. package/dist/credentials/XdcScan.credentials.js +69 -0
  10. package/dist/credentials/XdcScan.credentials.js.map +1 -0
  11. package/dist/nodes/Xdc/Xdc.node.d.ts +6 -0
  12. package/dist/nodes/Xdc/Xdc.node.d.ts.map +1 -0
  13. package/dist/nodes/Xdc/Xdc.node.js +151 -0
  14. package/dist/nodes/Xdc/Xdc.node.js.map +1 -0
  15. package/dist/nodes/Xdc/XdcTrigger.node.d.ts +6 -0
  16. package/dist/nodes/Xdc/XdcTrigger.node.d.ts.map +1 -0
  17. package/dist/nodes/Xdc/XdcTrigger.node.js +206 -0
  18. package/dist/nodes/Xdc/XdcTrigger.node.js.map +1 -0
  19. package/dist/nodes/Xdc/actions/account/account.operations.d.ts +5 -0
  20. package/dist/nodes/Xdc/actions/account/account.operations.d.ts.map +1 -0
  21. package/dist/nodes/Xdc/actions/account/account.operations.js +303 -0
  22. package/dist/nodes/Xdc/actions/account/account.operations.js.map +1 -0
  23. package/dist/nodes/Xdc/actions/block/block.operations.d.ts +5 -0
  24. package/dist/nodes/Xdc/actions/block/block.operations.d.ts.map +1 -0
  25. package/dist/nodes/Xdc/actions/block/block.operations.js +202 -0
  26. package/dist/nodes/Xdc/actions/block/block.operations.js.map +1 -0
  27. package/dist/nodes/Xdc/actions/contract/contract.operations.d.ts +14 -0
  28. package/dist/nodes/Xdc/actions/contract/contract.operations.d.ts.map +1 -0
  29. package/dist/nodes/Xdc/actions/contract/contract.operations.js +863 -0
  30. package/dist/nodes/Xdc/actions/contract/contract.operations.js.map +1 -0
  31. package/dist/nodes/Xdc/actions/defi/defi.operations.d.ts +5 -0
  32. package/dist/nodes/Xdc/actions/defi/defi.operations.d.ts.map +1 -0
  33. package/dist/nodes/Xdc/actions/defi/defi.operations.js +243 -0
  34. package/dist/nodes/Xdc/actions/defi/defi.operations.js.map +1 -0
  35. package/dist/nodes/Xdc/actions/masternode/masternode.operations.d.ts +5 -0
  36. package/dist/nodes/Xdc/actions/masternode/masternode.operations.d.ts.map +1 -0
  37. package/dist/nodes/Xdc/actions/masternode/masternode.operations.js +229 -0
  38. package/dist/nodes/Xdc/actions/masternode/masternode.operations.js.map +1 -0
  39. package/dist/nodes/Xdc/actions/nft/nft.operations.d.ts +16 -0
  40. package/dist/nodes/Xdc/actions/nft/nft.operations.d.ts.map +1 -0
  41. package/dist/nodes/Xdc/actions/nft/nft.operations.js +662 -0
  42. package/dist/nodes/Xdc/actions/nft/nft.operations.js.map +1 -0
  43. package/dist/nodes/Xdc/actions/token/token.operations.d.ts +16 -0
  44. package/dist/nodes/Xdc/actions/token/token.operations.d.ts.map +1 -0
  45. package/dist/nodes/Xdc/actions/token/token.operations.js +594 -0
  46. package/dist/nodes/Xdc/actions/token/token.operations.js.map +1 -0
  47. package/dist/nodes/Xdc/actions/tradeFinance/tradeFinance.operations.d.ts +5 -0
  48. package/dist/nodes/Xdc/actions/tradeFinance/tradeFinance.operations.d.ts.map +1 -0
  49. package/dist/nodes/Xdc/actions/tradeFinance/tradeFinance.operations.js +142 -0
  50. package/dist/nodes/Xdc/actions/tradeFinance/tradeFinance.operations.js.map +1 -0
  51. package/dist/nodes/Xdc/actions/transaction/transaction.operations.d.ts +14 -0
  52. package/dist/nodes/Xdc/actions/transaction/transaction.operations.d.ts.map +1 -0
  53. package/dist/nodes/Xdc/actions/transaction/transaction.operations.js +766 -0
  54. package/dist/nodes/Xdc/actions/transaction/transaction.operations.js.map +1 -0
  55. package/dist/nodes/Xdc/actions/utility/utility.operations.d.ts +5 -0
  56. package/dist/nodes/Xdc/actions/utility/utility.operations.d.ts.map +1 -0
  57. package/dist/nodes/Xdc/actions/utility/utility.operations.js +267 -0
  58. package/dist/nodes/Xdc/actions/utility/utility.operations.js.map +1 -0
  59. package/dist/nodes/Xdc/constants/abis.d.ts +78 -0
  60. package/dist/nodes/Xdc/constants/abis.d.ts.map +1 -0
  61. package/dist/nodes/Xdc/constants/abis.js +278 -0
  62. package/dist/nodes/Xdc/constants/abis.js.map +1 -0
  63. package/dist/nodes/Xdc/constants/contracts.d.ts +276 -0
  64. package/dist/nodes/Xdc/constants/contracts.d.ts.map +1 -0
  65. package/dist/nodes/Xdc/constants/contracts.js +267 -0
  66. package/dist/nodes/Xdc/constants/contracts.js.map +1 -0
  67. package/dist/nodes/Xdc/constants/index.d.ts +9 -0
  68. package/dist/nodes/Xdc/constants/index.d.ts.map +1 -0
  69. package/dist/nodes/Xdc/constants/index.js +25 -0
  70. package/dist/nodes/Xdc/constants/index.js.map +1 -0
  71. package/dist/nodes/Xdc/constants/networks.d.ts +81 -0
  72. package/dist/nodes/Xdc/constants/networks.d.ts.map +1 -0
  73. package/dist/nodes/Xdc/constants/networks.js +127 -0
  74. package/dist/nodes/Xdc/constants/networks.js.map +1 -0
  75. package/dist/nodes/Xdc/constants/tokens.d.ts +58 -0
  76. package/dist/nodes/Xdc/constants/tokens.d.ts.map +1 -0
  77. package/dist/nodes/Xdc/constants/tokens.js +221 -0
  78. package/dist/nodes/Xdc/constants/tokens.js.map +1 -0
  79. package/dist/nodes/Xdc/transport/explorerApi.d.ts +304 -0
  80. package/dist/nodes/Xdc/transport/explorerApi.d.ts.map +1 -0
  81. package/dist/nodes/Xdc/transport/explorerApi.js +374 -0
  82. package/dist/nodes/Xdc/transport/explorerApi.js.map +1 -0
  83. package/dist/nodes/Xdc/transport/index.d.ts +8 -0
  84. package/dist/nodes/Xdc/transport/index.d.ts.map +1 -0
  85. package/dist/nodes/Xdc/transport/index.js +24 -0
  86. package/dist/nodes/Xdc/transport/index.js.map +1 -0
  87. package/dist/nodes/Xdc/transport/masternodeClient.d.ts +167 -0
  88. package/dist/nodes/Xdc/transport/masternodeClient.d.ts.map +1 -0
  89. package/dist/nodes/Xdc/transport/masternodeClient.js +340 -0
  90. package/dist/nodes/Xdc/transport/masternodeClient.js.map +1 -0
  91. package/dist/nodes/Xdc/transport/provider.d.ts +178 -0
  92. package/dist/nodes/Xdc/transport/provider.d.ts.map +1 -0
  93. package/dist/nodes/Xdc/transport/provider.js +327 -0
  94. package/dist/nodes/Xdc/transport/provider.js.map +1 -0
  95. package/dist/nodes/Xdc/utils/addressUtils.d.ts +92 -0
  96. package/dist/nodes/Xdc/utils/addressUtils.d.ts.map +1 -0
  97. package/dist/nodes/Xdc/utils/addressUtils.js +213 -0
  98. package/dist/nodes/Xdc/utils/addressUtils.js.map +1 -0
  99. package/dist/nodes/Xdc/utils/index.d.ts +8 -0
  100. package/dist/nodes/Xdc/utils/index.d.ts.map +1 -0
  101. package/dist/nodes/Xdc/utils/index.js +24 -0
  102. package/dist/nodes/Xdc/utils/index.js.map +1 -0
  103. package/dist/nodes/Xdc/utils/tradeFinanceUtils.d.ts +180 -0
  104. package/dist/nodes/Xdc/utils/tradeFinanceUtils.d.ts.map +1 -0
  105. package/dist/nodes/Xdc/utils/tradeFinanceUtils.js +327 -0
  106. package/dist/nodes/Xdc/utils/tradeFinanceUtils.js.map +1 -0
  107. package/dist/nodes/Xdc/utils/unitConverter.d.ts +137 -0
  108. package/dist/nodes/Xdc/utils/unitConverter.d.ts.map +1 -0
  109. package/dist/nodes/Xdc/utils/unitConverter.js +268 -0
  110. package/dist/nodes/Xdc/utils/unitConverter.js.map +1 -0
  111. package/dist/nodes/Xdc/xdc.svg +8 -0
  112. package/package.json +82 -0
package/LICENSE ADDED
@@ -0,0 +1,46 @@
1
+ Business Source License 1.1
2
+
3
+ License text copyright (c) 2017 MariaDB Corporation Ab.
4
+
5
+ Licensor:
6
+ Velocity BPA, LLC
7
+ https://velobpa.com
8
+
9
+ Licensed Work:
10
+ This repository and all source code, documentation, and associated artifacts
11
+ contained herein, including all n8n community nodes published by Velocity BPA.
12
+
13
+ Additional Use Grant:
14
+ You may use, modify, and run the Licensed Work free of charge for:
15
+ - Personal use
16
+ - Educational use
17
+ - Research use
18
+ - Internal business use, provided such use does not involve resale,
19
+ redistribution, or offering the Licensed Work as part of a commercial
20
+ product or service.
21
+
22
+ Commercial Use Restriction:
23
+ Commercial Use of the Licensed Work is prohibited without a valid
24
+ Commercial License issued by the Licensor.
25
+
26
+ Commercial Use includes, but is not limited to:
27
+ - Use of the Licensed Work within any Software-as-a-Service (SaaS),
28
+ Platform-as-a-Service (PaaS), or hosted application that is sold,
29
+ licensed, or monetized in any form
30
+ - Offering the Licensed Work as part of a managed services engagement
31
+ - Bundling or redistributing the Licensed Work with a paid product
32
+ - Reselling, sublicensing, or white-labeling the Licensed Work
33
+ - Embedding the Licensed Work into any commercial automation platform,
34
+ integration product, or solution offering
35
+
36
+ Change Date:
37
+ January 1, 2030
38
+
39
+ Change License:
40
+ Apache License, Version 2.0
41
+
42
+ For commercial licensing inquiries:
43
+ licensing@velobpa.com
44
+
45
+ Business Source License 1.1 full text:
46
+ https://mariadb.com/bsl11/
package/README.md ADDED
@@ -0,0 +1,421 @@
1
+ # n8n-nodes-xdc
2
+
3
+ > **[Velocity BPA Licensing Notice]**
4
+ >
5
+ > This n8n node is licensed under the Business Source License 1.1 (BSL 1.1).
6
+ >
7
+ > Use of this node by for-profit organizations in production environments requires a commercial license from Velocity BPA.
8
+ >
9
+ > For licensing information, visit https://velobpa.com/licensing or contact licensing@velobpa.com.
10
+
11
+ A comprehensive n8n community node for **XDC Network** - an enterprise-grade hybrid blockchain optimized for trade finance, international payments, and tokenized assets. Provides 10 resource categories and 50+ operations for complete blockchain integration.
12
+
13
+ ![n8n](https://img.shields.io/badge/n8n-community--node-blue)
14
+ ![XDC Network](https://img.shields.io/badge/XDC-Network-blue)
15
+ ![License](https://img.shields.io/badge/license-BSL--1.1-blue)
16
+ ![TypeScript](https://img.shields.io/badge/TypeScript-5.4-blue)
17
+
18
+ ---
19
+
20
+ ## Features
21
+
22
+ ### Resources
23
+ - **Account** - Balance queries, transaction history, token holdings, address validation
24
+ - **Transaction** - Send XDC, monitor transactions, estimate gas, get receipts
25
+ - **XRC-20 Token** - Token transfers, approvals, balances, allowances
26
+ - **XRC-721 NFT** - NFT metadata, transfers, collections, ownership
27
+ - **Smart Contract** - Read/write contract calls, ABI encoding, event logs
28
+ - **Trade Finance** - Document hashing, LC references, ISO 20022 validation
29
+ - **Masternode** - XDPoS staking, voting, rewards, epoch info
30
+ - **DeFi** - DEX swaps, liquidity pools, token prices
31
+ - **Block** - Block data, rewards, timestamps, epoch calculation
32
+ - **Utility** - Address conversion, unit conversion, hashing, signing
33
+
34
+ ### Trigger Events
35
+ - New blocks
36
+ - New epochs (every 900 blocks)
37
+ - Address transactions
38
+ - Token transfers
39
+
40
+ ---
41
+
42
+ ## Installation
43
+
44
+ ### Community Nodes (Recommended)
45
+
46
+ 1. Go to **Settings** → **Community Nodes**
47
+ 2. Select **Install**
48
+ 3. Enter `n8n-nodes-xdc`
49
+ 4. Accept the risks and install
50
+
51
+ ### Manual Installation
52
+
53
+ ```bash
54
+ cd ~/.n8n/nodes
55
+ npm install n8n-nodes-xdc
56
+ ```
57
+
58
+ ### Development Installation
59
+
60
+ ```bash
61
+ # Clone the repository
62
+ git clone https://github.com/Velocity-BPA/n8n-nodes-xdc.git
63
+ cd n8n-nodes-xdc
64
+
65
+ # Install dependencies
66
+ npm install
67
+
68
+ # Build
69
+ npm run build
70
+
71
+ # Link to n8n custom directory
72
+ mkdir -p ~/.n8n/custom
73
+ ln -s $(pwd) ~/.n8n/custom/n8n-nodes-xdc
74
+
75
+ # Restart n8n
76
+ n8n start
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Credentials Setup
82
+
83
+ ### XDC Network Credentials
84
+
85
+ | Field | Description | Required |
86
+ |-------|-------------|----------|
87
+ | Network | Mainnet (Chain 50) or Apothem Testnet (Chain 51) | Yes |
88
+ | RPC URL | Custom RPC endpoint (auto-filled based on network) | No |
89
+ | Private Key | Required for write operations (sending transactions) | No |
90
+
91
+ ### XdcScan Credentials (Optional)
92
+
93
+ | Field | Description | Required |
94
+ |-------|-------------|----------|
95
+ | Network | Mainnet or Apothem | Yes |
96
+ | API Key | BlocksScan API key for explorer data | Yes |
97
+
98
+ ---
99
+
100
+ ## Resources & Operations
101
+
102
+ ### Account
103
+ | Operation | Description |
104
+ |-----------|-------------|
105
+ | Get Balance | Get XDC balance for an address |
106
+ | Get Token Balances | Get all token balances for an address |
107
+ | Get Transactions | Get transaction history for an address |
108
+ | Validate Address | Check if an address is valid |
109
+
110
+ ### Transaction
111
+ | Operation | Description |
112
+ |-----------|-------------|
113
+ | Send XDC | Send XDC to another address |
114
+ | Get History | Get transaction history |
115
+ | Get Receipt | Get transaction receipt by hash |
116
+ | Estimate Gas | Estimate gas for a transaction |
117
+ | Get Status | Check transaction status |
118
+
119
+ ### Token (XRC-20)
120
+ | Operation | Description |
121
+ |-----------|-------------|
122
+ | Get Balance | Get token balance for an address |
123
+ | Transfer | Transfer tokens to another address |
124
+ | Get Info | Get token metadata (name, symbol, decimals) |
125
+ | Approve | Approve spending allowance |
126
+ | Get Allowance | Check spending allowance |
127
+
128
+ ### NFT (XRC-721)
129
+ | Operation | Description |
130
+ |-----------|-------------|
131
+ | Get Metadata | Get NFT metadata and attributes |
132
+ | Get Owner | Get current owner of an NFT |
133
+ | Transfer | Transfer NFT to another address |
134
+ | Get Balance | Get NFT balance for an address |
135
+ | Get Tokens Owned | List all NFTs owned by an address |
136
+
137
+ ### Smart Contract
138
+ | Operation | Description |
139
+ |-----------|-------------|
140
+ | Call | Read data from a contract (no gas) |
141
+ | Execute | Write data to a contract (requires gas) |
142
+ | Get Events | Get contract event logs |
143
+ | Get ABI | Fetch contract ABI from explorer |
144
+ | Deploy | Deploy a new contract |
145
+
146
+ ### Trade Finance
147
+ | Operation | Description |
148
+ |-----------|-------------|
149
+ | Generate Hash | Create SHA256/Keccak256 hash of documents |
150
+ | Verify Hash | Verify document hash matches |
151
+ | Generate LC Reference | Generate Letter of Credit reference |
152
+ | Validate ISO 20022 | Validate ISO 20022 message format |
153
+
154
+ ### Masternode
155
+ | Operation | Description |
156
+ |-----------|-------------|
157
+ | Get Candidates | List all masternode candidates |
158
+ | Get Masternode Info | Get details about a specific masternode |
159
+ | Get Epoch Info | Get current epoch information |
160
+ | Get Voter Info | Get voting information for an address |
161
+ | Calculate Rewards | Estimate staking rewards |
162
+ | Vote | Stake XDC with a masternode |
163
+ | Unvote | Withdraw stake from a masternode |
164
+ | Withdraw | Withdraw available rewards |
165
+
166
+ ### DeFi
167
+ | Operation | Description |
168
+ |-----------|-------------|
169
+ | Get XDC Price | Get current XDC/USD price |
170
+ | Get Token Price | Get token price in XDC or USD |
171
+ | Get Swap Quote | Get quote for token swap |
172
+ | Execute Swap | Execute token swap on DEX |
173
+ | Get Liquidity Pool | Get liquidity pool information |
174
+
175
+ ### Block
176
+ | Operation | Description |
177
+ |-----------|-------------|
178
+ | Get Block | Get block by number or hash |
179
+ | Get Latest Block | Get the most recent block |
180
+ | Get Block Transactions | Get all transactions in a block |
181
+ | Get Block Reward | Get mining reward for a block |
182
+ | Get Block By Timestamp | Find block closest to a timestamp |
183
+
184
+ ### Utility
185
+ | Operation | Description |
186
+ |-----------|-------------|
187
+ | Convert Units | Convert between wei, gwei, and XDC |
188
+ | Convert Address | Convert between xdc and 0x formats |
189
+ | Validate Address | Check if address is valid |
190
+ | Keccak256 | Compute Keccak256 hash |
191
+ | Encode ABI | ABI encode function call |
192
+ | Decode ABI | ABI decode return data |
193
+ | Sign Message | Sign a message with private key |
194
+ | Verify Signature | Verify message signature |
195
+ | Get Network Status | Get network status and gas prices |
196
+ | Generate Wallet | Generate new wallet address |
197
+
198
+ ---
199
+
200
+ ## Trigger Node
201
+
202
+ The XDC Trigger node monitors blockchain events and triggers workflows.
203
+
204
+ ### Events
205
+
206
+ | Event | Description |
207
+ |-------|-------------|
208
+ | New Block | Triggers when a new block is mined |
209
+ | New Epoch | Triggers when a new epoch starts (every 900 blocks) |
210
+ | New Transaction | Triggers when a watched address receives a transaction |
211
+ | Token Transfer | Triggers when a token transfer occurs |
212
+
213
+ ### Configuration
214
+
215
+ | Parameter | Description |
216
+ |-----------|-------------|
217
+ | Event | The event type to monitor |
218
+ | Address | (Optional) Address to watch for transactions |
219
+ | Token Contract | (Optional) Token contract to monitor for transfers |
220
+ | Polling Interval | How often to check for new events (default: 30s) |
221
+
222
+ ---
223
+
224
+ ## Usage Examples
225
+
226
+ ### Get Account Balance
227
+
228
+ ```json
229
+ {
230
+ "resource": "account",
231
+ "operation": "getBalance",
232
+ "address": "xdc1234567890abcdef1234567890abcdef12345678"
233
+ }
234
+ ```
235
+
236
+ ### Send XDC
237
+
238
+ ```json
239
+ {
240
+ "resource": "transaction",
241
+ "operation": "sendXdc",
242
+ "toAddress": "xdc1234567890abcdef1234567890abcdef12345678",
243
+ "amount": "100"
244
+ }
245
+ ```
246
+
247
+ ### Check Token Balance
248
+
249
+ ```json
250
+ {
251
+ "resource": "token",
252
+ "operation": "getBalance",
253
+ "tokenAddress": "xdcTokenContractAddress...",
254
+ "walletAddress": "xdcWalletAddress..."
255
+ }
256
+ ```
257
+
258
+ ### Generate Trade Document Hash
259
+
260
+ ```json
261
+ {
262
+ "resource": "tradeFinance",
263
+ "operation": "generateHash",
264
+ "documentContent": "Bill of Lading content...",
265
+ "hashAlgorithm": "SHA256"
266
+ }
267
+ ```
268
+
269
+ ### Vote for Masternode
270
+
271
+ ```json
272
+ {
273
+ "resource": "masternode",
274
+ "operation": "vote",
275
+ "masternodeAddress": "xdcMasternodeAddress...",
276
+ "stakeAmount": "10000"
277
+ }
278
+ ```
279
+
280
+ ---
281
+
282
+ ## XDC Network Concepts
283
+
284
+ ### Network Overview
285
+ - **Consensus**: XDPoS (Delegated Proof of Stake)
286
+ - **Block Time**: ~2 seconds
287
+ - **Epoch Length**: 900 blocks (~30 minutes)
288
+ - **Masternodes**: 108 validators
289
+ - **Native Token**: XDC
290
+ - **Token Standards**: XRC-20, XRC-721
291
+
292
+ ### Key Ecosystem Protocols
293
+ - **Fathom Protocol** - CDP/stablecoin (FXD)
294
+ - **Plugin Oracle** - Decentralized data feeds (PLI)
295
+ - **XSwap/Globiance** - DEX platforms
296
+ - **XDC Subnet** - Layer 2 scaling
297
+
298
+ ### Address Formats
299
+ XDC Network uses two address formats:
300
+ - **xdc format**: `xdc1234567890abcdef1234567890abcdef12345678`
301
+ - **0x format**: `0x1234567890abcdef1234567890abcdef12345678`
302
+
303
+ Both formats are interchangeable and represent the same address.
304
+
305
+ ---
306
+
307
+ ## Networks
308
+
309
+ | Network | Chain ID | RPC Endpoint | Explorer |
310
+ |---------|----------|--------------|----------|
311
+ | Mainnet | 50 | https://rpc.xinfin.network | https://xdc.blocksscan.io |
312
+ | Apothem | 51 | https://rpc.apothem.network | https://apothem.blocksscan.io |
313
+
314
+ ---
315
+
316
+ ## Error Handling
317
+
318
+ The node includes comprehensive error handling:
319
+
320
+ - **Network Errors**: Automatic retry with exponential backoff
321
+ - **Invalid Address**: Clear error message with address format guidance
322
+ - **Insufficient Funds**: Detailed balance information
323
+ - **Gas Estimation Failed**: Suggested gas limit values
324
+ - **Contract Errors**: Decoded revert reasons when available
325
+
326
+ ---
327
+
328
+ ## Security Best Practices
329
+
330
+ 1. **Private Key Storage**: Never hardcode private keys. Use n8n credentials.
331
+ 2. **Testnet First**: Always test workflows on Apothem testnet before mainnet.
332
+ 3. **Gas Limits**: Set appropriate gas limits to prevent unexpected costs.
333
+ 4. **Address Validation**: Always validate addresses before transactions.
334
+ 5. **Amount Verification**: Double-check amounts before sending transactions.
335
+
336
+ ---
337
+
338
+ ## Development
339
+
340
+ ```bash
341
+ # Install dependencies
342
+ npm install
343
+
344
+ # Build
345
+ npm run build
346
+
347
+ # Watch mode
348
+ npm run dev
349
+
350
+ # Run tests
351
+ npm test
352
+
353
+ # Run tests with coverage
354
+ npm run test:coverage
355
+
356
+ # Lint code
357
+ npm run lint
358
+
359
+ # Fix linting issues
360
+ npm run lint:fix
361
+
362
+ # Format code
363
+ npm run format
364
+ ```
365
+
366
+ ---
367
+
368
+ ## Author
369
+
370
+ **Velocity BPA**
371
+ - Website: [velobpa.com](https://velobpa.com)
372
+ - GitHub: [Velocity-BPA](https://github.com/Velocity-BPA)
373
+
374
+ ---
375
+
376
+ ## Licensing
377
+
378
+ This n8n community node is licensed under the **Business Source License 1.1**.
379
+
380
+ ### Free Use
381
+ Permitted for personal, educational, research, and internal business use.
382
+
383
+ ### Commercial Use
384
+ Use of this node within any SaaS, PaaS, hosted platform, managed service, or paid automation offering requires a commercial license.
385
+
386
+ For licensing inquiries:
387
+ **licensing@velobpa.com**
388
+
389
+ See [LICENSE](LICENSE), [COMMERCIAL_LICENSE.md](COMMERCIAL_LICENSE.md), and [LICENSING_FAQ.md](LICENSING_FAQ.md) for details.
390
+
391
+ ---
392
+
393
+ ## Contributing
394
+
395
+ Contributions are welcome! Please ensure:
396
+
397
+ 1. All code follows the existing style
398
+ 2. Tests are added for new features
399
+ 3. Documentation is updated
400
+ 4. Licensing headers are included in new files
401
+
402
+ ---
403
+
404
+ ## Support
405
+
406
+ - [XDC Network](https://xinfin.org)
407
+ - [XDC Documentation](https://docs.xdc.org)
408
+ - [BlocksScan Explorer](https://xdc.blocksscan.io)
409
+ - [XDC Faucet (Testnet)](https://faucet.apothem.network)
410
+
411
+ ---
412
+
413
+ ## Acknowledgments
414
+
415
+ - [XDC Network](https://xinfin.org) for the enterprise blockchain platform
416
+ - [n8n](https://n8n.io) for the workflow automation platform
417
+ - [ethers.js](https://ethers.org) for Ethereum/XDC library
418
+
419
+ ---
420
+
421
+ Built with ❤️ for the XDC Network community
@@ -0,0 +1,15 @@
1
+ import type { ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ /**
3
+ * XDC Network Credentials
4
+ *
5
+ * Provides connection parameters for XDC Network blockchain.
6
+ * Supports Mainnet, Apothem Testnet, and custom RPC endpoints.
7
+ */
8
+ export declare class XdcNetwork implements ICredentialType {
9
+ name: string;
10
+ displayName: string;
11
+ documentationUrl: string;
12
+ properties: INodeProperties[];
13
+ test: ICredentialTestRequest;
14
+ }
15
+ //# sourceMappingURL=XdcNetwork.credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XdcNetwork.credentials.d.ts","sourceRoot":"","sources":["../../credentials/XdcNetwork.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB;;;;;GAKG;AACH,qBAAa,UAAW,YAAW,eAAe;IACjD,IAAI,SAAgB;IACpB,WAAW,SAAiB;IAC5B,gBAAgB,SAA2B;IAE3C,UAAU,EAAE,eAAe,EAAE,CAyE3B;IAGF,IAAI,EAAE,sBAAsB,CAc1B;CACF"}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.XdcNetwork = void 0;
4
+ /**
5
+ * XDC Network Credentials
6
+ *
7
+ * Provides connection parameters for XDC Network blockchain.
8
+ * Supports Mainnet, Apothem Testnet, and custom RPC endpoints.
9
+ */
10
+ class XdcNetwork {
11
+ name = 'xdcNetwork';
12
+ displayName = 'XDC Network';
13
+ documentationUrl = 'https://docs.xdc.org/';
14
+ properties = [
15
+ {
16
+ displayName: 'Network',
17
+ name: 'network',
18
+ type: 'options',
19
+ default: 'mainnet',
20
+ options: [
21
+ {
22
+ name: 'XDC Mainnet',
23
+ value: 'mainnet',
24
+ description: 'XDC Network main blockchain (Chain ID: 50)',
25
+ },
26
+ {
27
+ name: 'XDC Apothem Testnet',
28
+ value: 'apothem',
29
+ description: 'XDC Network test blockchain (Chain ID: 51)',
30
+ },
31
+ {
32
+ name: 'Custom RPC',
33
+ value: 'custom',
34
+ description: 'Connect to a custom XDC RPC endpoint',
35
+ },
36
+ ],
37
+ description: 'Select the XDC network to connect to',
38
+ },
39
+ {
40
+ displayName: 'RPC URL',
41
+ name: 'rpcUrl',
42
+ type: 'string',
43
+ default: '',
44
+ placeholder: 'https://erpc.xinfin.network',
45
+ description: 'Custom RPC endpoint URL. Leave empty to use default for selected network.',
46
+ displayOptions: {
47
+ show: {
48
+ network: ['custom'],
49
+ },
50
+ },
51
+ },
52
+ {
53
+ displayName: 'Chain ID',
54
+ name: 'chainId',
55
+ type: 'number',
56
+ default: 50,
57
+ description: 'Chain ID for custom network (50 for Mainnet, 51 for Apothem)',
58
+ displayOptions: {
59
+ show: {
60
+ network: ['custom'],
61
+ },
62
+ },
63
+ },
64
+ {
65
+ displayName: 'Private Key',
66
+ name: 'privateKey',
67
+ type: 'string',
68
+ typeOptions: {
69
+ password: true,
70
+ },
71
+ default: '',
72
+ placeholder: 'Enter your wallet private key',
73
+ description: 'Private key for signing transactions. Required for write operations (transfers, contract calls). Never share your private key.',
74
+ hint: 'Leave empty for read-only operations',
75
+ },
76
+ {
77
+ displayName: 'API Key (Optional)',
78
+ name: 'providerApiKey',
79
+ type: 'string',
80
+ typeOptions: {
81
+ password: true,
82
+ },
83
+ default: '',
84
+ placeholder: 'Enter API key for enhanced RPC provider',
85
+ description: 'Optional API key for enhanced RPC providers with higher rate limits',
86
+ },
87
+ ];
88
+ // Test the credential
89
+ test = {
90
+ request: {
91
+ baseURL: '={{$credentials.network === "apothem" ? "https://erpc.apothem.network" : ($credentials.network === "custom" && $credentials.rpcUrl ? $credentials.rpcUrl : "https://erpc.xinfin.network")}}',
92
+ method: 'POST',
93
+ headers: {
94
+ 'Content-Type': 'application/json',
95
+ },
96
+ body: JSON.stringify({
97
+ jsonrpc: '2.0',
98
+ method: 'eth_chainId',
99
+ params: [],
100
+ id: 1,
101
+ }),
102
+ },
103
+ };
104
+ }
105
+ exports.XdcNetwork = XdcNetwork;
106
+ //# sourceMappingURL=XdcNetwork.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XdcNetwork.credentials.js","sourceRoot":"","sources":["../../credentials/XdcNetwork.credentials.ts"],"names":[],"mappings":";;;AAMA;;;;;GAKG;AACH,MAAa,UAAU;IACtB,IAAI,GAAG,YAAY,CAAC;IACpB,WAAW,GAAG,aAAa,CAAC;IAC5B,gBAAgB,GAAG,uBAAuB,CAAC;IAE3C,UAAU,GAAsB;QAC/B;YACC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE;gBACR;oBACC,IAAI,EAAE,aAAa;oBACnB,KAAK,EAAE,SAAS;oBAChB,WAAW,EAAE,4CAA4C;iBACzD;gBACD;oBACC,IAAI,EAAE,qBAAqB;oBAC3B,KAAK,EAAE,SAAS;oBAChB,WAAW,EAAE,4CAA4C;iBACzD;gBACD;oBACC,IAAI,EAAE,YAAY;oBAClB,KAAK,EAAE,QAAQ;oBACf,WAAW,EAAE,sCAAsC;iBACnD;aACD;YACD,WAAW,EAAE,sCAAsC;SACnD;QACD;YACC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,6BAA6B;YAC1C,WAAW,EAAE,2EAA2E;YACxF,cAAc,EAAE;gBACf,IAAI,EAAE;oBACL,OAAO,EAAE,CAAC,QAAQ,CAAC;iBACnB;aACD;SACD;QACD;YACC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,8DAA8D;YAC3E,cAAc,EAAE;gBACf,IAAI,EAAE;oBACL,OAAO,EAAE,CAAC,QAAQ,CAAC;iBACnB;aACD;SACD;QACD;YACC,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE;gBACZ,QAAQ,EAAE,IAAI;aACd;YACD,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,+BAA+B;YAC5C,WAAW,EAAE,gIAAgI;YAC7I,IAAI,EAAE,sCAAsC;SAC5C;QACD;YACC,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE;gBACZ,QAAQ,EAAE,IAAI;aACd;YACD,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,yCAAyC;YACtD,WAAW,EAAE,qEAAqE;SAClF;KACD,CAAC;IAEF,sBAAsB;IACtB,IAAI,GAA2B;QAC9B,OAAO,EAAE;YACR,OAAO,EAAE,6LAA6L;YACtM,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACR,cAAc,EAAE,kBAAkB;aAClC;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACpB,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,aAAa;gBACrB,MAAM,EAAE,EAAE;gBACV,EAAE,EAAE,CAAC;aACL,CAAC;SACF;KACD,CAAC;CACF;AAhGD,gCAgGC"}
@@ -0,0 +1,15 @@
1
+ import type { ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ /**
3
+ * XDCScan API Credentials
4
+ *
5
+ * Provides authentication for XDCScan/BlocksScan explorer APIs.
6
+ * Used for transaction history, token transfers, and contract verification.
7
+ */
8
+ export declare class XdcScan implements ICredentialType {
9
+ name: string;
10
+ displayName: string;
11
+ documentationUrl: string;
12
+ properties: INodeProperties[];
13
+ test: ICredentialTestRequest;
14
+ }
15
+ //# sourceMappingURL=XdcScan.credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XdcScan.credentials.d.ts","sourceRoot":"","sources":["../../credentials/XdcScan.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB;;;;;GAKG;AACH,qBAAa,OAAQ,YAAW,eAAe;IAC9C,IAAI,SAAa;IACjB,WAAW,SAAiB;IAC5B,gBAAgB,SAAoC;IAEpD,UAAU,EAAE,eAAe,EAAE,CAwC3B;IAGF,IAAI,EAAE,sBAAsB,CAU1B;CACF"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.XdcScan = void 0;
4
+ /**
5
+ * XDCScan API Credentials
6
+ *
7
+ * Provides authentication for XDCScan/BlocksScan explorer APIs.
8
+ * Used for transaction history, token transfers, and contract verification.
9
+ */
10
+ class XdcScan {
11
+ name = 'xdcScan';
12
+ displayName = 'XDCScan API';
13
+ documentationUrl = 'https://xdc.blocksscan.io/docs';
14
+ properties = [
15
+ {
16
+ displayName: 'Network',
17
+ name: 'network',
18
+ type: 'options',
19
+ default: 'mainnet',
20
+ options: [
21
+ {
22
+ name: 'XDC Mainnet',
23
+ value: 'mainnet',
24
+ description: 'XDCScan for Mainnet (xdc.blocksscan.io)',
25
+ },
26
+ {
27
+ name: 'XDC Apothem Testnet',
28
+ value: 'apothem',
29
+ description: 'XDCScan for Apothem (apothem.blocksscan.io)',
30
+ },
31
+ ],
32
+ description: 'Select the network for explorer API',
33
+ },
34
+ {
35
+ displayName: 'API Key',
36
+ name: 'apiKey',
37
+ type: 'string',
38
+ typeOptions: {
39
+ password: true,
40
+ },
41
+ default: '',
42
+ placeholder: 'Enter your XDCScan API key',
43
+ description: 'API key for XDCScan/BlocksScan explorer. Get one at xdc.blocksscan.io',
44
+ required: true,
45
+ },
46
+ {
47
+ displayName: 'Custom API URL',
48
+ name: 'customApiUrl',
49
+ type: 'string',
50
+ default: '',
51
+ placeholder: 'https://xdc.blocksscan.io/api',
52
+ description: 'Optional custom API endpoint URL',
53
+ },
54
+ ];
55
+ // Test the credential
56
+ test = {
57
+ request: {
58
+ baseURL: '={{$credentials.customApiUrl || ($credentials.network === "apothem" ? "https://apothem.blocksscan.io/api" : "https://xdc.blocksscan.io/api")}}',
59
+ method: 'GET',
60
+ qs: {
61
+ module: 'stats',
62
+ action: 'xdcprice',
63
+ apikey: '={{$credentials.apiKey}}',
64
+ },
65
+ },
66
+ };
67
+ }
68
+ exports.XdcScan = XdcScan;
69
+ //# sourceMappingURL=XdcScan.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XdcScan.credentials.js","sourceRoot":"","sources":["../../credentials/XdcScan.credentials.ts"],"names":[],"mappings":";;;AAMA;;;;;GAKG;AACH,MAAa,OAAO;IACnB,IAAI,GAAG,SAAS,CAAC;IACjB,WAAW,GAAG,aAAa,CAAC;IAC5B,gBAAgB,GAAG,gCAAgC,CAAC;IAEpD,UAAU,GAAsB;QAC/B;YACC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE;gBACR;oBACC,IAAI,EAAE,aAAa;oBACnB,KAAK,EAAE,SAAS;oBAChB,WAAW,EAAE,yCAAyC;iBACtD;gBACD;oBACC,IAAI,EAAE,qBAAqB;oBAC3B,KAAK,EAAE,SAAS;oBAChB,WAAW,EAAE,6CAA6C;iBAC1D;aACD;YACD,WAAW,EAAE,qCAAqC;SAClD;QACD;YACC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE;gBACZ,QAAQ,EAAE,IAAI;aACd;YACD,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,4BAA4B;YACzC,WAAW,EAAE,uEAAuE;YACpF,QAAQ,EAAE,IAAI;SACd;QACD;YACC,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,+BAA+B;YAC5C,WAAW,EAAE,kCAAkC;SAC/C;KACD,CAAC;IAEF,sBAAsB;IACtB,IAAI,GAA2B;QAC9B,OAAO,EAAE;YACR,OAAO,EAAE,gJAAgJ;YACzJ,MAAM,EAAE,KAAK;YACb,EAAE,EAAE;gBACH,MAAM,EAAE,OAAO;gBACf,MAAM,EAAE,UAAU;gBAClB,MAAM,EAAE,0BAA0B;aAClC;SACD;KACD,CAAC;CACF;AA3DD,0BA2DC"}
@@ -0,0 +1,6 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class Xdc implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
6
+ //# sourceMappingURL=Xdc.node.d.ts.map