n8n-nodes-api3 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 (76) hide show
  1. package/LICENSE +46 -0
  2. package/README.md +365 -0
  3. package/dist/credentials/Api3Credentials.credentials.d.ts +10 -0
  4. package/dist/credentials/Api3Credentials.credentials.d.ts.map +1 -0
  5. package/dist/credentials/Api3Credentials.credentials.js +113 -0
  6. package/dist/credentials/Api3Credentials.credentials.js.map +1 -0
  7. package/dist/index.d.ts +4 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +26 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/nodes/Api3/Api3.node.d.ts +12 -0
  12. package/dist/nodes/Api3/Api3.node.d.ts.map +1 -0
  13. package/dist/nodes/Api3/Api3.node.js +1116 -0
  14. package/dist/nodes/Api3/Api3.node.js.map +1 -0
  15. package/dist/nodes/Api3/Api3Trigger.node.d.ts +14 -0
  16. package/dist/nodes/Api3/Api3Trigger.node.d.ts.map +1 -0
  17. package/dist/nodes/Api3/Api3Trigger.node.js +396 -0
  18. package/dist/nodes/Api3/Api3Trigger.node.js.map +1 -0
  19. package/dist/nodes/Api3/actions/airnodes/index.d.ts +6 -0
  20. package/dist/nodes/Api3/actions/airnodes/index.d.ts.map +1 -0
  21. package/dist/nodes/Api3/actions/airnodes/index.js +142 -0
  22. package/dist/nodes/Api3/actions/airnodes/index.js.map +1 -0
  23. package/dist/nodes/Api3/actions/dao/index.d.ts +6 -0
  24. package/dist/nodes/Api3/actions/dao/index.d.ts.map +1 -0
  25. package/dist/nodes/Api3/actions/dao/index.js +229 -0
  26. package/dist/nodes/Api3/actions/dao/index.js.map +1 -0
  27. package/dist/nodes/Api3/actions/dapis/index.d.ts +6 -0
  28. package/dist/nodes/Api3/actions/dapis/index.d.ts.map +1 -0
  29. package/dist/nodes/Api3/actions/dapis/index.js +153 -0
  30. package/dist/nodes/Api3/actions/dapis/index.js.map +1 -0
  31. package/dist/nodes/Api3/actions/dataFeeds/index.d.ts +6 -0
  32. package/dist/nodes/Api3/actions/dataFeeds/index.d.ts.map +1 -0
  33. package/dist/nodes/Api3/actions/dataFeeds/index.js +147 -0
  34. package/dist/nodes/Api3/actions/dataFeeds/index.js.map +1 -0
  35. package/dist/nodes/Api3/actions/governance/index.d.ts +6 -0
  36. package/dist/nodes/Api3/actions/governance/index.d.ts.map +1 -0
  37. package/dist/nodes/Api3/actions/governance/index.js +295 -0
  38. package/dist/nodes/Api3/actions/governance/index.js.map +1 -0
  39. package/dist/nodes/Api3/actions/insurance/index.d.ts +6 -0
  40. package/dist/nodes/Api3/actions/insurance/index.d.ts.map +1 -0
  41. package/dist/nodes/Api3/actions/insurance/index.js +194 -0
  42. package/dist/nodes/Api3/actions/insurance/index.js.map +1 -0
  43. package/dist/nodes/Api3/actions/oev/index.d.ts +6 -0
  44. package/dist/nodes/Api3/actions/oev/index.d.ts.map +1 -0
  45. package/dist/nodes/Api3/actions/oev/index.js +140 -0
  46. package/dist/nodes/Api3/actions/oev/index.js.map +1 -0
  47. package/dist/nodes/Api3/actions/subscriptions/index.d.ts +6 -0
  48. package/dist/nodes/Api3/actions/subscriptions/index.d.ts.map +1 -0
  49. package/dist/nodes/Api3/actions/subscriptions/index.js +235 -0
  50. package/dist/nodes/Api3/actions/subscriptions/index.js.map +1 -0
  51. package/dist/nodes/Api3/actions/token/index.d.ts +6 -0
  52. package/dist/nodes/Api3/actions/token/index.d.ts.map +1 -0
  53. package/dist/nodes/Api3/actions/token/index.js +174 -0
  54. package/dist/nodes/Api3/actions/token/index.js.map +1 -0
  55. package/dist/nodes/Api3/actions/utility/index.d.ts +6 -0
  56. package/dist/nodes/Api3/actions/utility/index.d.ts.map +1 -0
  57. package/dist/nodes/Api3/actions/utility/index.js +211 -0
  58. package/dist/nodes/Api3/actions/utility/index.js.map +1 -0
  59. package/dist/nodes/Api3/api3.svg +8 -0
  60. package/dist/nodes/Api3/constants/index.d.ts +101 -0
  61. package/dist/nodes/Api3/constants/index.d.ts.map +1 -0
  62. package/dist/nodes/Api3/constants/index.js +407 -0
  63. package/dist/nodes/Api3/constants/index.js.map +1 -0
  64. package/dist/nodes/Api3/transport/index.d.ts +98 -0
  65. package/dist/nodes/Api3/transport/index.d.ts.map +1 -0
  66. package/dist/nodes/Api3/transport/index.js +333 -0
  67. package/dist/nodes/Api3/transport/index.js.map +1 -0
  68. package/dist/nodes/Api3/utils/helpers.d.ts +112 -0
  69. package/dist/nodes/Api3/utils/helpers.d.ts.map +1 -0
  70. package/dist/nodes/Api3/utils/helpers.js +294 -0
  71. package/dist/nodes/Api3/utils/helpers.js.map +1 -0
  72. package/dist/nodes/Api3/utils/types.d.ts +452 -0
  73. package/dist/nodes/Api3/utils/types.d.ts.map +1 -0
  74. package/dist/nodes/Api3/utils/types.js +9 -0
  75. package/dist/nodes/Api3/utils/types.js.map +1 -0
  76. package/package.json +86 -0
@@ -0,0 +1,211 @@
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.execute = execute;
10
+ const n8n_workflow_1 = require("n8n-workflow");
11
+ const helpers_1 = require("../../utils/helpers");
12
+ const transport_1 = require("../../transport");
13
+ const constants_1 = require("../../constants");
14
+ /**
15
+ * Execute utility operations
16
+ */
17
+ async function execute(operation, itemIndex) {
18
+ const credentials = await (0, helpers_1.getCredentials)(this);
19
+ switch (operation) {
20
+ case 'getSupportedChains':
21
+ return getSupportedChainsOperation.call(this, credentials, itemIndex);
22
+ case 'getContractAddresses':
23
+ return getContractAddressesOperation.call(this, credentials, itemIndex);
24
+ case 'encodeParameters':
25
+ return encodeParametersOperation.call(this, credentials, itemIndex);
26
+ case 'getAPIHealth':
27
+ return getAPIHealthOperation.call(this, credentials, itemIndex);
28
+ default:
29
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`);
30
+ }
31
+ }
32
+ /**
33
+ * Get list of supported blockchain networks
34
+ */
35
+ async function getSupportedChainsOperation(_credentials, _itemIndex) {
36
+ // Build list from SUPPORTED_CHAINS constant
37
+ const chains = Object.entries(constants_1.SUPPORTED_CHAINS).map(([id, config]) => ({
38
+ chainId: config.chainId,
39
+ name: config.name,
40
+ shortName: id,
41
+ nativeCurrency: config.nativeCurrency,
42
+ explorerUrl: config.explorerUrl,
43
+ testnet: config.testnet,
44
+ }));
45
+ return chains;
46
+ }
47
+ /**
48
+ * Get contract addresses for a network
49
+ */
50
+ async function getContractAddressesOperation(credentials, itemIndex) {
51
+ const network = this.getNodeParameter('network', itemIndex, credentials.network);
52
+ try {
53
+ const config = (0, transport_1.getNetworkConfig)(network);
54
+ return {
55
+ network,
56
+ chainId: config.chainId,
57
+ dapiServer: config.dapiServerAddress,
58
+ api3Token: config.api3TokenAddress,
59
+ stakingPool: config.stakingPoolAddress,
60
+ governance: config.governanceAddress,
61
+ oevAuctionHouse: undefined, // Not in basic config
62
+ coverage: undefined, // Not in basic config
63
+ };
64
+ }
65
+ catch (error) {
66
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to get contract addresses: ${error.message}`, { itemIndex });
67
+ }
68
+ }
69
+ /**
70
+ * Encode Airnode parameters
71
+ */
72
+ async function encodeParametersOperation(_credentials, itemIndex) {
73
+ const parametersJson = this.getNodeParameter('parameters', itemIndex);
74
+ try {
75
+ // Parse JSON parameters
76
+ let parameters;
77
+ try {
78
+ parameters = JSON.parse(parametersJson);
79
+ }
80
+ catch {
81
+ throw new Error('Invalid JSON parameters');
82
+ }
83
+ // Encode parameters for Airnode
84
+ // Parameters are typically encoded as key-value pairs
85
+ const encodedParts = [];
86
+ for (const [key, value] of Object.entries(parameters)) {
87
+ // Simple encoding: key + value as hex
88
+ const keyHex = Buffer.from(key).toString('hex');
89
+ const valueStr = typeof value === 'string' ? value : JSON.stringify(value);
90
+ const valueHex = Buffer.from(valueStr).toString('hex');
91
+ encodedParts.push(keyHex + valueHex);
92
+ }
93
+ const encodedParameters = '0x' + encodedParts.join('');
94
+ // Calculate hash (simplified - in production use keccak256)
95
+ const parametersHash = (0, transport_1.dapiNameToBytes32)(JSON.stringify(parameters));
96
+ return {
97
+ encodedParameters,
98
+ parametersHash,
99
+ decodedPreview: parameters,
100
+ };
101
+ }
102
+ catch (error) {
103
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to encode parameters: ${error.message}`, { itemIndex });
104
+ }
105
+ }
106
+ /**
107
+ * Check API3 service health
108
+ */
109
+ async function getAPIHealthOperation(credentials, itemIndex) {
110
+ try {
111
+ const startTime = Date.now();
112
+ // Check RPC connection
113
+ let rpcHealthy = false;
114
+ let rpcLatency = 0;
115
+ let lastBlockTime = 0;
116
+ let syncStatus = 'behind';
117
+ try {
118
+ const blockNumberResult = await (0, transport_1.makeRpcCall)(this, credentials.rpcEndpoint, 'eth_blockNumber', []);
119
+ rpcLatency = Date.now() - startTime;
120
+ rpcHealthy = true;
121
+ // Get block timestamp
122
+ const blockNumber = blockNumberResult;
123
+ const blockResult = (await (0, transport_1.makeRpcCall)(this, credentials.rpcEndpoint, 'eth_getBlockByNumber', [
124
+ blockNumber,
125
+ false,
126
+ ]));
127
+ if (blockResult?.timestamp) {
128
+ lastBlockTime = parseInt(blockResult.timestamp, 16);
129
+ const now = Math.floor(Date.now() / 1000);
130
+ // Check if block is recent (within 2 minutes)
131
+ if (now - lastBlockTime < 120) {
132
+ syncStatus = 'synced';
133
+ }
134
+ else if (now - lastBlockTime < 600) {
135
+ syncStatus = 'syncing';
136
+ }
137
+ else {
138
+ syncStatus = 'behind';
139
+ }
140
+ }
141
+ }
142
+ catch {
143
+ rpcHealthy = false;
144
+ }
145
+ // Check dAPI server
146
+ let dapiServerHealthy = false;
147
+ if (rpcHealthy) {
148
+ try {
149
+ const config = (0, transport_1.getNetworkConfig)(credentials.network);
150
+ // Try to read a common dAPI
151
+ await (0, transport_1.makeRpcCall)(this, credentials.rpcEndpoint, 'eth_call', [
152
+ {
153
+ to: config.dapiServerAddress,
154
+ data: '0x82a0cf08' + '0'.repeat(64), // readDataFeedWithDapiName with empty bytes32
155
+ },
156
+ 'latest',
157
+ ]);
158
+ dapiServerHealthy = true;
159
+ }
160
+ catch {
161
+ // dAPI server might still be healthy, just no data for empty name
162
+ dapiServerHealthy = true;
163
+ }
164
+ }
165
+ // Check API3 Market API
166
+ let api3MarketHealthy = false;
167
+ try {
168
+ await (0, transport_1.makeApiRequest)(this, 'GET', `${constants_1.API_ENDPOINTS.API3_MARKET}/health`);
169
+ api3MarketHealthy = true;
170
+ }
171
+ catch {
172
+ api3MarketHealthy = false;
173
+ }
174
+ // Check OEV Network
175
+ let oevNetworkHealthy = false;
176
+ try {
177
+ await (0, transport_1.makeApiRequest)(this, 'GET', `${constants_1.API_ENDPOINTS.OEV_NETWORK}/health`);
178
+ oevNetworkHealthy = true;
179
+ }
180
+ catch {
181
+ oevNetworkHealthy = false;
182
+ }
183
+ // Determine overall status
184
+ let status;
185
+ const healthyCount = [rpcHealthy, dapiServerHealthy, api3MarketHealthy].filter(Boolean).length;
186
+ if (healthyCount === 3) {
187
+ status = 'healthy';
188
+ }
189
+ else if (healthyCount >= 1) {
190
+ status = 'degraded';
191
+ }
192
+ else {
193
+ status = 'down';
194
+ }
195
+ return {
196
+ status,
197
+ rpcLatency,
198
+ lastBlockTime,
199
+ syncStatus,
200
+ services: {
201
+ dapiServer: dapiServerHealthy,
202
+ oevNetwork: oevNetworkHealthy,
203
+ governance: rpcHealthy, // Governance uses same RPC
204
+ },
205
+ };
206
+ }
207
+ catch (error) {
208
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to check API health: ${error.message}`, { itemIndex });
209
+ }
210
+ }
211
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Api3/actions/utility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Y,IAAI,CAAC,EAAE,CAAC;YAC7B,MAAM,GAAG,UAAU,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,MAAM,CAAC;QAClB,CAAC;QAED,OAAO;YACL,MAAM;YACN,UAAU;YACV,aAAa;YACb,UAAU;YACV,QAAQ,EAAE;gBACR,UAAU,EAAE,iBAAiB;gBAC7B,UAAU,EAAE,iBAAiB;gBAC7B,UAAU,EAAE,UAAU,EAAE,2BAA2B;aACpD;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,iCAAkB,CAC1B,IAAI,CAAC,OAAO,EAAE,EACd,+BAAgC,KAAe,CAAC,OAAO,EAAE,EACzD,EAAE,SAAS,EAAE,CACd,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none">
2
+ <rect width="256" height="256" rx="40" fill="#4F46E5"/>
3
+ <g fill="#FFFFFF">
4
+ <!-- API3 Logo - Stylized -->
5
+ <path d="M128 40L48 96v64l80 56 80-56V96L128 40zm0 24l52 36v44l-52 36-52-36v-44l52-36z"/>
6
+ <text x="128" y="145" font-family="Arial, sans-serif" font-size="48" font-weight="bold" text-anchor="middle" fill="#FFFFFF">API3</text>
7
+ </g>
8
+ </svg>
@@ -0,0 +1,101 @@
1
+ import type { NetworkConfig, SupportedChain } from '../utils/types';
2
+ /**
3
+ * Licensing notice - displayed once per node load
4
+ */
5
+ export declare const LICENSING_NOTICE = "[Velocity BPA Licensing Notice]\n\nThis n8n node is licensed under the Business Source License 1.1 (BSL 1.1).\n\nUse of this node by for-profit organizations in production environments requires a commercial license from Velocity BPA.\n\nFor licensing information, visit https://velobpa.com/licensing or contact licensing@velobpa.com.";
6
+ /**
7
+ * Network configurations
8
+ */
9
+ export declare const NETWORK_CONFIGS: Record<string, NetworkConfig>;
10
+ /**
11
+ * Supported chains list
12
+ */
13
+ export declare const SUPPORTED_CHAINS: SupportedChain[];
14
+ /**
15
+ * dAPI Server ABI (subset for reading)
16
+ */
17
+ export declare const DAPI_SERVER_ABI: {
18
+ inputs: {
19
+ internalType: string;
20
+ name: string;
21
+ type: string;
22
+ }[];
23
+ name: string;
24
+ outputs: {
25
+ internalType: string;
26
+ name: string;
27
+ type: string;
28
+ }[];
29
+ stateMutability: string;
30
+ type: string;
31
+ }[];
32
+ /**
33
+ * API3 Token ABI (subset)
34
+ */
35
+ export declare const API3_TOKEN_ABI: {
36
+ inputs: {
37
+ internalType: string;
38
+ name: string;
39
+ type: string;
40
+ }[];
41
+ name: string;
42
+ outputs: {
43
+ internalType: string;
44
+ name: string;
45
+ type: string;
46
+ }[];
47
+ stateMutability: string;
48
+ type: string;
49
+ }[];
50
+ /**
51
+ * Staking Pool ABI (subset)
52
+ */
53
+ export declare const STAKING_POOL_ABI: {
54
+ inputs: {
55
+ internalType: string;
56
+ name: string;
57
+ type: string;
58
+ }[];
59
+ name: string;
60
+ outputs: {
61
+ internalType: string;
62
+ name: string;
63
+ type: string;
64
+ }[];
65
+ stateMutability: string;
66
+ type: string;
67
+ }[];
68
+ /**
69
+ * Default decimals for dAPIs (most price feeds use 18 decimals)
70
+ */
71
+ export declare const DEFAULT_DECIMALS = 18;
72
+ /**
73
+ * API endpoints
74
+ */
75
+ export declare const API_ENDPOINTS: {
76
+ API3_MARKET: string;
77
+ OEV_NETWORK: string;
78
+ COINGECKO: string;
79
+ };
80
+ /**
81
+ * Common dAPI names
82
+ */
83
+ export declare const COMMON_DAPIS: string[];
84
+ /**
85
+ * Poll intervals for triggers (in milliseconds)
86
+ */
87
+ export declare const POLL_INTERVALS: {
88
+ FAST: number;
89
+ NORMAL: number;
90
+ SLOW: number;
91
+ };
92
+ /**
93
+ * Cache TTL (in milliseconds)
94
+ */
95
+ export declare const CACHE_TTL: {
96
+ DAPI_VALUE: number;
97
+ DAPI_INFO: number;
98
+ TOKEN_PRICE: number;
99
+ STAKING_INFO: number;
100
+ };
101
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../nodes/Api3/constants/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,gBAAgB,kVAMoE,CAAC;AAElG;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CA4HzD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAiF5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;GA4B3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;GAyB1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;GAkD5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,aAAa;;;;CAIzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,UA0BxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc;;;;CAI1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC"}