n8n-nodes-crypto-com-exchange 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 (52) hide show
  1. package/LICENSE +46 -0
  2. package/README.md +316 -0
  3. package/dist/credentials/CryptoComExchangeApi.credentials.d.ts +10 -0
  4. package/dist/credentials/CryptoComExchangeApi.credentials.d.ts.map +1 -0
  5. package/dist/credentials/CryptoComExchangeApi.credentials.js +59 -0
  6. package/dist/credentials/CryptoComExchangeApi.credentials.js.map +1 -0
  7. package/dist/nodes/CryptoComExchange/CryptoComExchange.node.d.ts +6 -0
  8. package/dist/nodes/CryptoComExchange/CryptoComExchange.node.d.ts.map +1 -0
  9. package/dist/nodes/CryptoComExchange/CryptoComExchange.node.js +187 -0
  10. package/dist/nodes/CryptoComExchange/CryptoComExchange.node.js.map +1 -0
  11. package/dist/nodes/CryptoComExchange/actions/derivatives/derivatives.d.ts +4 -0
  12. package/dist/nodes/CryptoComExchange/actions/derivatives/derivatives.d.ts.map +1 -0
  13. package/dist/nodes/CryptoComExchange/actions/derivatives/derivatives.js +296 -0
  14. package/dist/nodes/CryptoComExchange/actions/derivatives/derivatives.js.map +1 -0
  15. package/dist/nodes/CryptoComExchange/actions/index.d.ts +7 -0
  16. package/dist/nodes/CryptoComExchange/actions/index.d.ts.map +1 -0
  17. package/dist/nodes/CryptoComExchange/actions/index.js +49 -0
  18. package/dist/nodes/CryptoComExchange/actions/index.js.map +1 -0
  19. package/dist/nodes/CryptoComExchange/actions/margin/margin.d.ts +4 -0
  20. package/dist/nodes/CryptoComExchange/actions/margin/margin.d.ts.map +1 -0
  21. package/dist/nodes/CryptoComExchange/actions/margin/margin.js +261 -0
  22. package/dist/nodes/CryptoComExchange/actions/margin/margin.js.map +1 -0
  23. package/dist/nodes/CryptoComExchange/actions/marketData/marketData.d.ts +4 -0
  24. package/dist/nodes/CryptoComExchange/actions/marketData/marketData.d.ts.map +1 -0
  25. package/dist/nodes/CryptoComExchange/actions/marketData/marketData.js +312 -0
  26. package/dist/nodes/CryptoComExchange/actions/marketData/marketData.js.map +1 -0
  27. package/dist/nodes/CryptoComExchange/actions/spotAccount/spotAccount.d.ts +4 -0
  28. package/dist/nodes/CryptoComExchange/actions/spotAccount/spotAccount.d.ts.map +1 -0
  29. package/dist/nodes/CryptoComExchange/actions/spotAccount/spotAccount.js +394 -0
  30. package/dist/nodes/CryptoComExchange/actions/spotAccount/spotAccount.js.map +1 -0
  31. package/dist/nodes/CryptoComExchange/actions/spotTrading/spotTrading.d.ts +4 -0
  32. package/dist/nodes/CryptoComExchange/actions/spotTrading/spotTrading.d.ts.map +1 -0
  33. package/dist/nodes/CryptoComExchange/actions/spotTrading/spotTrading.js +384 -0
  34. package/dist/nodes/CryptoComExchange/actions/spotTrading/spotTrading.js.map +1 -0
  35. package/dist/nodes/CryptoComExchange/actions/wallet/wallet.d.ts +4 -0
  36. package/dist/nodes/CryptoComExchange/actions/wallet/wallet.d.ts.map +1 -0
  37. package/dist/nodes/CryptoComExchange/actions/wallet/wallet.js +320 -0
  38. package/dist/nodes/CryptoComExchange/actions/wallet/wallet.js.map +1 -0
  39. package/dist/nodes/CryptoComExchange/constants/constants.d.ts +90 -0
  40. package/dist/nodes/CryptoComExchange/constants/constants.d.ts.map +1 -0
  41. package/dist/nodes/CryptoComExchange/constants/constants.js +154 -0
  42. package/dist/nodes/CryptoComExchange/constants/constants.js.map +1 -0
  43. package/dist/nodes/CryptoComExchange/cryptocom.svg +7 -0
  44. package/dist/nodes/CryptoComExchange/transport/GenericFunctions.d.ts +26 -0
  45. package/dist/nodes/CryptoComExchange/transport/GenericFunctions.d.ts.map +1 -0
  46. package/dist/nodes/CryptoComExchange/transport/GenericFunctions.js +227 -0
  47. package/dist/nodes/CryptoComExchange/transport/GenericFunctions.js.map +1 -0
  48. package/dist/nodes/CryptoComExchange/types/CryptoComTypes.d.ts +159 -0
  49. package/dist/nodes/CryptoComExchange/types/CryptoComTypes.d.ts.map +1 -0
  50. package/dist/nodes/CryptoComExchange/types/CryptoComTypes.js +31 -0
  51. package/dist/nodes/CryptoComExchange/types/CryptoComTypes.js.map +1 -0
  52. package/package.json +80 -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,316 @@
1
+ # n8n-nodes-crypto-com-exchange
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 Crypto.com Exchange providing spot trading, derivatives, margin trading, wallet management, and market data operations with HMAC-SHA256 authentication.
12
+
13
+ ![n8n](https://img.shields.io/badge/n8n-community--node-orange)
14
+ ![Version](https://img.shields.io/badge/version-1.0.0-blue)
15
+ ![License](https://img.shields.io/badge/license-BSL--1.1-blue)
16
+ ![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue)
17
+
18
+ ## Features
19
+
20
+ - **Spot Account Management**: View balances, transaction history, deposit/withdrawal operations
21
+ - **Spot Trading**: Place orders (limit, market, stop), cancel orders, view order history and trades
22
+ - **Derivatives Trading**: Manage positions, transfers between spot and derivatives accounts
23
+ - **Margin Trading**: Borrow/repay funds, view loan and interest history
24
+ - **Market Data**: Access real-time tickers, order books, candlesticks, and instrument data
25
+ - **Wallet Operations**: Manage deposit addresses, withdrawals across multiple networks
26
+ - **HMAC-SHA256 Authentication**: Secure API authentication with proper signature generation
27
+ - **Comprehensive Error Handling**: All Crypto.com API error codes properly mapped
28
+
29
+ ## Installation
30
+
31
+ ### Community Nodes (Recommended)
32
+
33
+ 1. Open your n8n instance
34
+ 2. Go to **Settings** > **Community Nodes**
35
+ 3. Click **Install a community node**
36
+ 4. Enter `n8n-nodes-crypto-com-exchange`
37
+ 5. Click **Install**
38
+
39
+ ### Manual Installation
40
+
41
+ ```bash
42
+ # Navigate to your n8n installation directory
43
+ cd ~/.n8n
44
+
45
+ # Install the package
46
+ npm install n8n-nodes-crypto-com-exchange
47
+ ```
48
+
49
+ ### Development Installation
50
+
51
+ ```bash
52
+ # 1. Extract the zip file
53
+ unzip n8n-nodes-crypto-com-exchange.zip
54
+ cd n8n-nodes-crypto-com-exchange
55
+
56
+ # 2. Install dependencies
57
+ npm install
58
+
59
+ # 3. Build the project
60
+ npm run build
61
+
62
+ # 4. Create symlink to n8n custom nodes directory
63
+ # For Linux/macOS:
64
+ mkdir -p ~/.n8n/custom
65
+ ln -s $(pwd) ~/.n8n/custom/n8n-nodes-crypto-com-exchange
66
+
67
+ # For Windows (run as Administrator):
68
+ # mklink /D %USERPROFILE%\.n8n\custom\n8n-nodes-crypto-com-exchange %CD%
69
+
70
+ # 5. Restart n8n
71
+ n8n start
72
+ ```
73
+
74
+ ## Credentials Setup
75
+
76
+ ### Creating API Credentials
77
+
78
+ 1. Log in to [Crypto.com Exchange](https://crypto.com/exchange)
79
+ 2. Navigate to **Settings** > **API Management**
80
+ 3. Create a new API key with the required permissions
81
+ 4. Save both the API Key and Secret Key securely
82
+
83
+ ### Configuring in n8n
84
+
85
+ | Field | Description |
86
+ |-------|-------------|
87
+ | API Key | Your Crypto.com Exchange API Key |
88
+ | API Secret | Your Crypto.com Exchange Secret Key |
89
+
90
+ **Note**: For security, store your API credentials securely and never share them.
91
+
92
+ ## Resources & Operations
93
+
94
+ ### Spot Account (7 operations)
95
+
96
+ | Operation | Description |
97
+ |-----------|-------------|
98
+ | Get Account Summary | Get all account balances |
99
+ | Get Account Balance | Get balance for a specific currency |
100
+ | Get Transaction History | List account transactions |
101
+ | Get Deposit Address | Get crypto deposit address |
102
+ | Create Withdrawal | Initiate a withdrawal |
103
+ | Get Withdrawal History | List withdrawals |
104
+ | Get Deposit History | List deposits |
105
+
106
+ ### Spot Trading (7 operations)
107
+
108
+ | Operation | Description |
109
+ |-----------|-------------|
110
+ | Create Order | Place a new order (LIMIT, MARKET, STOP_LIMIT, etc.) |
111
+ | Cancel Order | Cancel an order by ID |
112
+ | Cancel All Orders | Cancel all open orders |
113
+ | Get Open Orders | List all open orders |
114
+ | Get Order Detail | Get details of a specific order |
115
+ | Get Order History | List historical orders |
116
+ | Get Trades | Get trade history |
117
+
118
+ ### Derivatives (5 operations)
119
+
120
+ | Operation | Description |
121
+ |-----------|-------------|
122
+ | Get Positions | List all open positions |
123
+ | Get Position | Get a specific position |
124
+ | Close Position | Close an open position |
125
+ | Get Transfer History | List transfers between spot and derivatives |
126
+ | Transfer | Transfer funds between spot and derivatives |
127
+
128
+ ### Margin (6 operations)
129
+
130
+ | Operation | Description |
131
+ |-----------|-------------|
132
+ | Get Margin Account | Get margin account details |
133
+ | Borrow | Borrow funds for margin trading |
134
+ | Repay | Repay margin loan |
135
+ | Get Loan History | List loan history |
136
+ | Get Interest History | List interest charges |
137
+ | Get Margin Trading User | Get margin trading user status |
138
+
139
+ ### Market Data (7 operations)
140
+
141
+ | Operation | Description |
142
+ |-----------|-------------|
143
+ | Get Instruments | List all available trading pairs |
144
+ | Get Order Book | Get order book for an instrument |
145
+ | Get Ticker | Get ticker data for an instrument |
146
+ | Get All Tickers | Get ticker data for all instruments |
147
+ | Get Public Trades | Get recent public trades |
148
+ | Get Candlestick | Get OHLC candlestick data |
149
+ | Get Valuations | Get price valuations |
150
+
151
+ ### Wallet (5 operations)
152
+
153
+ | Operation | Description |
154
+ |-----------|-------------|
155
+ | Get Currency Networks | Get available networks for a currency |
156
+ | Get Deposit Address | Generate a deposit address |
157
+ | Create Withdrawal | Initiate a withdrawal |
158
+ | Get Deposit History | List deposit history |
159
+ | Get Withdrawal History | List withdrawal history |
160
+
161
+ ## Usage Examples
162
+
163
+ ### Get Account Balance
164
+
165
+ ```javascript
166
+ // Configure the node:
167
+ // Resource: Spot Account
168
+ // Operation: Get Account Summary
169
+ // Returns all currency balances
170
+ ```
171
+
172
+ ### Place a Limit Order
173
+
174
+ ```javascript
175
+ // Configure the node:
176
+ // Resource: Spot Trading
177
+ // Operation: Create Order
178
+ // Instrument Name: BTC_USDT
179
+ // Side: BUY
180
+ // Type: LIMIT
181
+ // Quantity: 0.001
182
+ // Price: 40000
183
+ ```
184
+
185
+ ### Get Market Data
186
+
187
+ ```javascript
188
+ // Configure the node:
189
+ // Resource: Market Data
190
+ // Operation: Get Candlestick
191
+ // Instrument Name: BTC_USDT
192
+ // Timeframe: 1h
193
+ // Options:
194
+ // Count: 100
195
+ ```
196
+
197
+ ## API Concepts
198
+
199
+ ### Instrument Names
200
+ Trading pairs are formatted as `BASE_QUOTE`, for example:
201
+ - `BTC_USDT` - Bitcoin/Tether
202
+ - `ETH_USDT` - Ethereum/Tether
203
+ - `CRO_USDT` - Cronos/Tether
204
+
205
+ ### Order Types
206
+
207
+ | Type | Description |
208
+ |------|-------------|
209
+ | LIMIT | Order at a specific price |
210
+ | MARKET | Order at current market price |
211
+ | STOP_LIMIT | Limit order triggered at stop price |
212
+ | STOP_LOSS | Market order triggered at stop price |
213
+ | TAKE_PROFIT_LIMIT | Limit order triggered at take profit price |
214
+
215
+ ### Time in Force
216
+
217
+ | Value | Description |
218
+ |-------|-------------|
219
+ | GTC | Good Till Cancelled |
220
+ | IOC | Immediate or Cancel |
221
+ | FOK | Fill or Kill |
222
+
223
+ ### Candlestick Timeframes
224
+
225
+ Supported intervals: `1m`, `5m`, `15m`, `30m`, `1h`, `4h`, `6h`, `12h`, `1D`, `7D`, `14D`, `1M`
226
+
227
+ ## Error Handling
228
+
229
+ The node handles all Crypto.com API error codes:
230
+
231
+ | Code | Description |
232
+ |------|-------------|
233
+ | 0 | Success |
234
+ | 10001 | System error |
235
+ | 10002 | Invalid request |
236
+ | 10004 | IP rate limit exceeded |
237
+ | 10005 | User rate limit exceeded |
238
+ | 10007 | Invalid signature |
239
+ | 20001 | Insufficient balance |
240
+ | 30003 | Invalid instrument_name |
241
+ | 40001 | Order not found |
242
+
243
+ ## Security Best Practices
244
+
245
+ 1. **API Key Permissions**: Only enable the permissions you need
246
+ 2. **IP Whitelisting**: Restrict API access to specific IPs
247
+ 3. **Credential Storage**: Use n8n's credential system, never hardcode
248
+ 4. **Test Environment**: Test with small amounts first
249
+ 5. **Rate Limiting**: Be aware of API rate limits to avoid blocks
250
+
251
+ ## Development
252
+
253
+ ```bash
254
+ # Install dependencies
255
+ npm install
256
+
257
+ # Build the project
258
+ npm run build
259
+
260
+ # Run tests
261
+ npm test
262
+
263
+ # Run tests with coverage
264
+ npm run test:coverage
265
+
266
+ # Lint code
267
+ npm run lint
268
+
269
+ # Fix linting issues
270
+ npm run lint:fix
271
+
272
+ # Watch mode for development
273
+ npm run dev
274
+ ```
275
+
276
+ ## Author
277
+
278
+ **Velocity BPA**
279
+ - Website: [velobpa.com](https://velobpa.com)
280
+ - GitHub: [Velocity-BPA](https://github.com/Velocity-BPA)
281
+
282
+ ## Licensing
283
+
284
+ This n8n community node is licensed under the **Business Source License 1.1**.
285
+
286
+ ### Free Use
287
+ Permitted for personal, educational, research, and internal business use.
288
+
289
+ ### Commercial Use
290
+ Use of this node within any SaaS, PaaS, hosted platform, managed service,
291
+ or paid automation offering requires a commercial license.
292
+
293
+ For licensing inquiries:
294
+ **licensing@velobpa.com**
295
+
296
+ See [LICENSE](LICENSE), [COMMERCIAL_LICENSE.md](COMMERCIAL_LICENSE.md), and [LICENSING_FAQ.md](LICENSING_FAQ.md) for details.
297
+
298
+ ## Contributing
299
+
300
+ 1. Fork the repository
301
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
302
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
303
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
304
+ 5. Open a Pull Request
305
+
306
+ ## Support
307
+
308
+ - **Issues**: [GitHub Issues](https://github.com/Velocity-BPA/n8n-nodes-crypto-com-exchange/issues)
309
+ - **Documentation**: [Crypto.com Exchange API](https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html)
310
+ - **Email**: support@velobpa.com
311
+
312
+ ## Acknowledgments
313
+
314
+ - [Crypto.com](https://crypto.com) for their comprehensive Exchange API
315
+ - [n8n](https://n8n.io) for the workflow automation platform
316
+ - The n8n community for their continued support
@@ -0,0 +1,10 @@
1
+ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class CryptoComExchangeApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: IAuthenticateGeneric;
8
+ test: ICredentialTestRequest;
9
+ }
10
+ //# sourceMappingURL=CryptoComExchangeApi.credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CryptoComExchangeApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/CryptoComExchangeApi.credentials.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,qBAAa,oBAAqB,YAAW,eAAe;IAC1D,IAAI,SAA0B;IAC9B,WAAW,SAA6B;IACxC,gBAAgB,SAAqE;IAErF,UAAU,EAAE,eAAe,EAAE,CAoB3B;IAIF,YAAY,EAAE,oBAAoB,CAGhC;IAEF,IAAI,EAAE,sBAAsB,CAa1B;CACH"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) Velocity BPA, LLC
4
+ * Licensed under the Business Source License 1.1
5
+ * Commercial use requires a separate commercial license.
6
+ * See LICENSE file for details.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.CryptoComExchangeApi = void 0;
10
+ class CryptoComExchangeApi {
11
+ constructor() {
12
+ this.name = 'cryptoComExchangeApi';
13
+ this.displayName = 'Crypto.com Exchange API';
14
+ this.documentationUrl = 'https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html';
15
+ this.properties = [
16
+ {
17
+ displayName: 'API Key',
18
+ name: 'apiKey',
19
+ type: 'string',
20
+ default: '',
21
+ required: true,
22
+ description: 'Your Crypto.com Exchange API Key',
23
+ },
24
+ {
25
+ displayName: 'API Secret',
26
+ name: 'apiSecret',
27
+ type: 'string',
28
+ typeOptions: {
29
+ password: true,
30
+ },
31
+ default: '',
32
+ required: true,
33
+ description: 'Your Crypto.com Exchange API Secret',
34
+ },
35
+ ];
36
+ // Note: Crypto.com uses custom HMAC-SHA256 authentication
37
+ // The actual authentication is handled in GenericFunctions.ts
38
+ this.authenticate = {
39
+ type: 'generic',
40
+ properties: {},
41
+ };
42
+ this.test = {
43
+ request: {
44
+ baseURL: 'https://api.crypto.com/exchange/v1',
45
+ url: '',
46
+ method: 'POST',
47
+ body: {
48
+ id: Date.now(),
49
+ method: 'public/get-instruments',
50
+ params: {},
51
+ nonce: Date.now(),
52
+ },
53
+ json: true,
54
+ },
55
+ };
56
+ }
57
+ }
58
+ exports.CryptoComExchangeApi = CryptoComExchangeApi;
59
+ //# sourceMappingURL=CryptoComExchangeApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CryptoComExchangeApi.credentials.js","sourceRoot":"","sources":["../../credentials/CryptoComExchangeApi.credentials.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AASH,MAAa,oBAAoB;IAAjC;QACE,SAAI,GAAG,sBAAsB,CAAC;QAC9B,gBAAW,GAAG,yBAAyB,CAAC;QACxC,qBAAgB,GAAG,iEAAiE,CAAC;QAErF,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,kCAAkC;aAChD;YACD;gBACE,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,qCAAqC;aACnD;SACF,CAAC;QAEF,0DAA0D;QAC1D,8DAA8D;QAC9D,iBAAY,GAAyB;YACnC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,EAAE;SACf,CAAC;QAEF,SAAI,GAA2B;YAC7B,OAAO,EAAE;gBACP,OAAO,EAAE,oCAAoC;gBAC7C,GAAG,EAAE,EAAE;gBACP,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE;oBACJ,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;oBACd,MAAM,EAAE,wBAAwB;oBAChC,MAAM,EAAE,EAAE;oBACV,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE;iBAClB;gBACD,IAAI,EAAE,IAAI;aACX;SACF,CAAC;IACJ,CAAC;CAAA;AAhDD,oDAgDC"}
@@ -0,0 +1,6 @@
1
+ import type { IExecuteFunctions, INodeType, INodeTypeDescription, INodeExecutionData } from 'n8n-workflow';
2
+ export declare class CryptoComExchange implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
6
+ //# sourceMappingURL=CryptoComExchange.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CryptoComExchange.node.d.ts","sourceRoot":"","sources":["../../../nodes/CryptoComExchange/CryptoComExchange.node.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,iBAAiB,EACjB,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAStB,qBAAa,iBAAkB,YAAW,SAAS;IACjD,WAAW,EAAE,oBAAoB,CAuF/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAiDxE"}
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) Velocity BPA, LLC
4
+ * Licensed under the Business Source License 1.1
5
+ * Commercial use requires a separate commercial license.
6
+ * See LICENSE file for details.
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
20
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
21
+ }) : function(o, v) {
22
+ o["default"] = v;
23
+ });
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.CryptoComExchange = void 0;
43
+ const spotAccount = __importStar(require("./actions/spotAccount/spotAccount"));
44
+ const spotTrading = __importStar(require("./actions/spotTrading/spotTrading"));
45
+ const derivatives = __importStar(require("./actions/derivatives/derivatives"));
46
+ const margin = __importStar(require("./actions/margin/margin"));
47
+ const marketData = __importStar(require("./actions/marketData/marketData"));
48
+ const wallet = __importStar(require("./actions/wallet/wallet"));
49
+ class CryptoComExchange {
50
+ constructor() {
51
+ this.description = {
52
+ displayName: 'Crypto.com Exchange',
53
+ name: 'cryptoComExchange',
54
+ icon: 'file:cryptocom.svg',
55
+ group: ['transform'],
56
+ version: 1,
57
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
58
+ description: 'Interact with Crypto.com Exchange API for spot trading, derivatives, margin trading, wallet management, and market data',
59
+ defaults: {
60
+ name: 'Crypto.com Exchange',
61
+ },
62
+ inputs: ['main'],
63
+ outputs: ['main'],
64
+ credentials: [
65
+ {
66
+ name: 'cryptoComExchangeApi',
67
+ required: true,
68
+ displayOptions: {
69
+ show: {
70
+ resource: ['spotAccount', 'spotTrading', 'derivatives', 'margin', 'wallet'],
71
+ },
72
+ },
73
+ },
74
+ {
75
+ name: 'cryptoComExchangeApi',
76
+ required: false,
77
+ displayOptions: {
78
+ show: {
79
+ resource: ['marketData'],
80
+ },
81
+ },
82
+ },
83
+ ],
84
+ properties: [
85
+ {
86
+ displayName: 'Resource',
87
+ name: 'resource',
88
+ type: 'options',
89
+ noDataExpression: true,
90
+ options: [
91
+ {
92
+ name: 'Spot Account',
93
+ value: 'spotAccount',
94
+ description: 'Manage spot account balances, deposits, and withdrawals',
95
+ },
96
+ {
97
+ name: 'Spot Trading',
98
+ value: 'spotTrading',
99
+ description: 'Place and manage spot trading orders',
100
+ },
101
+ {
102
+ name: 'Derivatives',
103
+ value: 'derivatives',
104
+ description: 'Manage derivatives positions and transfers',
105
+ },
106
+ {
107
+ name: 'Margin',
108
+ value: 'margin',
109
+ description: 'Manage margin trading, borrowing, and repaying',
110
+ },
111
+ {
112
+ name: 'Market Data',
113
+ value: 'marketData',
114
+ description: 'Get market data, tickers, order books, and candlesticks',
115
+ },
116
+ {
117
+ name: 'Wallet',
118
+ value: 'wallet',
119
+ description: 'Manage wallet addresses and transaction history',
120
+ },
121
+ ],
122
+ default: 'spotAccount',
123
+ },
124
+ // Spot Account Operations
125
+ ...spotAccount.description,
126
+ // Spot Trading Operations
127
+ ...spotTrading.description,
128
+ // Derivatives Operations
129
+ ...derivatives.description,
130
+ // Margin Operations
131
+ ...margin.description,
132
+ // Market Data Operations
133
+ ...marketData.description,
134
+ // Wallet Operations
135
+ ...wallet.description,
136
+ ],
137
+ };
138
+ }
139
+ async execute() {
140
+ const items = this.getInputData();
141
+ const returnData = [];
142
+ const resource = this.getNodeParameter('resource', 0);
143
+ for (let i = 0; i < items.length; i++) {
144
+ try {
145
+ let result = [];
146
+ switch (resource) {
147
+ case 'spotAccount':
148
+ result = await spotAccount.execute.call(this, i);
149
+ break;
150
+ case 'spotTrading':
151
+ result = await spotTrading.execute.call(this, i);
152
+ break;
153
+ case 'derivatives':
154
+ result = await derivatives.execute.call(this, i);
155
+ break;
156
+ case 'margin':
157
+ result = await margin.execute.call(this, i);
158
+ break;
159
+ case 'marketData':
160
+ result = await marketData.execute.call(this, i);
161
+ break;
162
+ case 'wallet':
163
+ result = await wallet.execute.call(this, i);
164
+ break;
165
+ default:
166
+ throw new Error(`Unknown resource: ${resource}`);
167
+ }
168
+ returnData.push(...result);
169
+ }
170
+ catch (error) {
171
+ if (this.continueOnFail()) {
172
+ returnData.push({
173
+ json: {
174
+ error: error.message,
175
+ },
176
+ pairedItem: { item: i },
177
+ });
178
+ continue;
179
+ }
180
+ throw error;
181
+ }
182
+ }
183
+ return [returnData];
184
+ }
185
+ }
186
+ exports.CryptoComExchange = CryptoComExchange;
187
+ //# sourceMappingURL=CryptoComExchange.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CryptoComExchange.node.js","sourceRoot":"","sources":["../../../nodes/CryptoComExchange/CryptoComExchange.node.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASH,+EAAiE;AACjE,+EAAiE;AACjE,+EAAiE;AACjE,gEAAkD;AAClD,4EAA8D;AAC9D,gEAAkD;AAElD,MAAa,iBAAiB;IAA9B;QACE,gBAAW,GAAyB;YAClC,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EACT,yHAAyH;YAC3H,QAAQ,EAAE;gBACR,IAAI,EAAE,qBAAqB;aAC5B;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACX;oBACE,IAAI,EAAE,sBAAsB;oBAC5B,QAAQ,EAAE,IAAI;oBACd,cAAc,EAAE;wBACd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ACE,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,EAAE,CAAC,CAAC;gBACrD,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;YAC7B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC1B,UAAU,CAAC,IAAI,CAAC;wBACd,IAAI,EAAE;4BACJ,KAAK,EAAG,KAAe,CAAC,OAAO;yBAChC;wBACD,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;qBACxB,CAAC,CAAC;oBACH,SAAS;gBACX,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACtB,CAAC;CACF;AA3ID,8CA2IC"}
@@ -0,0 +1,4 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]>;
4
+ //# sourceMappingURL=derivatives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derivatives.d.ts","sourceRoot":"","sources":["../../../../../nodes/CryptoComExchange/actions/derivatives/derivatives.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAe,MAAM,cAAc,CAAC;AAIxG,eAAO,MAAM,WAAW,EAAE,eAAe,EA+NxC,CAAC;AAEF,wBAAsB,OAAO,CAC3B,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAqE/B"}