@n8n-dev/n8n-nodes-0x 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.
- package/README.md +98 -0
- package/dist/credentials/N0xApi.credentials.d.ts +10 -0
- package/dist/credentials/N0xApi.credentials.js +56 -0
- package/dist/credentials/N0xApi.credentials.js.map +1 -0
- package/dist/icons/0x.dark.svg +4 -0
- package/dist/icons/0x.svg +4 -0
- package/dist/nodes/N0x/0x.dark.svg +4 -0
- package/dist/nodes/N0x/0x.svg +4 -0
- package/dist/nodes/N0x/N0x.node.d.ts +4 -0
- package/dist/nodes/N0x/N0x.node.js +75 -0
- package/dist/nodes/N0x/N0x.node.js.map +1 -0
- package/dist/nodes/N0x/N0x.node.json +20 -0
- package/dist/nodes/N0x/resources/gasless/index.d.ts +2 -0
- package/dist/nodes/N0x/resources/gasless/index.js +1364 -0
- package/dist/nodes/N0x/resources/gasless/index.js.map +1 -0
- package/dist/nodes/N0x/resources/index.d.ts +4 -0
- package/dist/nodes/N0x/resources/index.js +12 -0
- package/dist/nodes/N0x/resources/index.js.map +1 -0
- package/dist/nodes/N0x/resources/sources/index.d.ts +2 -0
- package/dist/nodes/N0x/resources/sources/index.js +129 -0
- package/dist/nodes/N0x/resources/sources/index.js.map +1 -0
- package/dist/nodes/N0x/resources/swap/index.d.ts +2 -0
- package/dist/nodes/N0x/resources/swap/index.js +2381 -0
- package/dist/nodes/N0x/resources/swap/index.js.map +1 -0
- package/dist/nodes/N0x/resources/trade-analytics/index.d.ts +2 -0
- package/dist/nodes/N0x/resources/trade-analytics/index.js +334 -0
- package/dist/nodes/N0x/resources/trade-analytics/index.js.map +1 -0
- package/dist/package.json +62 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# @n8n-dev/n8n-nodes-0x
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@n8n-dev/n8n-nodes-0x)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Stop writing 0x API integrations by hand.**
|
|
9
|
+
|
|
10
|
+
Every time you connect n8n to 0x, you waste hours mapping endpoints, defining parameters, and debugging schemas. You copy-paste from docs, fix edge cases, and pray nothing breaks.
|
|
11
|
+
|
|
12
|
+
**What if connecting n8n to 0x took 5 minutes, not half a day?**
|
|
13
|
+
|
|
14
|
+
This node gives you **4+ resources** out of the box: **Swap**, **Gasless**, **Sources**, **Trade Analytics**: with full CRUD operations, typed parameters, and zero manual configuration.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## What You Get
|
|
19
|
+
|
|
20
|
+
- **Zero boilerplate**: Resources, operations, and fields are pre-configured and ready to use
|
|
21
|
+
- **Full CRUD**: Create, read, update, and delete support where the API allows it
|
|
22
|
+
- **Typed parameters**: No more guessing field types
|
|
23
|
+
- **Built-in auth**: API key authentication, ready to go
|
|
24
|
+
- **Declarative**: Native n8n performance, no custom execute() overhead
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install @n8n-dev/n8n-nodes-0x
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Or in n8n:**
|
|
35
|
+
1. **Settings → Community Nodes → Install**
|
|
36
|
+
2. Search: `@n8n-dev/n8n-nodes-0x`
|
|
37
|
+
3. Click **Install**
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Quick Start
|
|
42
|
+
|
|
43
|
+
1. Install the node (above)
|
|
44
|
+
2. Add credentials: **0x API** → paste your API key
|
|
45
|
+
3. Drag the **0x** node into your workflow
|
|
46
|
+
4. Pick a resource → pick an operation → done.
|
|
47
|
+
|
|
48
|
+
That's it. No configuration files. No code. It just works.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Resources
|
|
53
|
+
|
|
54
|
+
| Resource | Operations |
|
|
55
|
+
|----------|------------|
|
|
56
|
+
| Swap | GET getPrice (Allowance Holder), GET getQuote (Allowance Holder), GET getPrice (Permit2), GET getQuote (Permit2), GET getChains |
|
|
57
|
+
| Gasless | GET getPrice, GET getQuote, POST submit, GET getStatus, GET getGaslessApprovalTokens, GET getChains |
|
|
58
|
+
| Sources | GET getSources |
|
|
59
|
+
| Trade Analytics | GET getSwapTrades, GET getGaslessTrades |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Why This Node?
|
|
64
|
+
|
|
65
|
+
**Without this node:**
|
|
66
|
+
- Hours of manual API integration
|
|
67
|
+
- Copy-pasting from 0x docs
|
|
68
|
+
- Debugging auth, pagination, error handling
|
|
69
|
+
- Maintaining your own client code
|
|
70
|
+
|
|
71
|
+
**With this node:**
|
|
72
|
+
- Install → configure → use. 5 minutes.
|
|
73
|
+
- Auto-generated from the official 0x OpenAPI spec
|
|
74
|
+
- Always up to date when the API changes
|
|
75
|
+
- Native n8n performance
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Auto-Generated
|
|
80
|
+
This node was auto-generated from the official **0x** OpenAPI specification using
|
|
81
|
+
[@n8n-dev/n8n-openapi-node-ultimate](https://github.com/kelvinzer0/n8n-openapi-node-ultimate),
|
|
82
|
+
then validated against the live API so you get accurate types and real parameters, not guesswork.
|
|
83
|
+
|
|
84
|
+
When the 0x API updates, this node updates too.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Support This Project
|
|
89
|
+
|
|
90
|
+
If this node saved you hours of work, consider supporting continued development, new APIs, better error handling, and faster updates.
|
|
91
|
+
|
|
92
|
+
[](https://n8n-code.github.io/membership/#/eyJ0aXRsZSI6IktlZXAgSXQgTW92aW5nIiwiZGVzYyI6Ik9uZSBkZXZlbG9wZXIgYnVpbHQgYSB0b29sIHRoYXQgYXV0by1nZW5lcmF0ZXNcbm44biBub2RlcyBmcm9tIGFueSBPcGVuQVBJIHNwZWMuXG5cbllvdXIgZG9uYXRpb24gZnVuZHMgbmV3IGZlYXR1cmVzLCBtb3JlIEFQSSBzdXBwb3J0LFxuYW5kIGJldHRlciB0b29saW5nIGZvciBldmVyeSBkZXZlbG9wZXIgYWZ0ZXIgeW91LiIsInRhcmdldCI6NTAwMCwiYWRkcmVzc2VzIjp7ImV0aGVyZXVtIjoiMHhmMDU1NWQ0MGRiRkI0ZTNCZjA3MDQ0MjgyQjc4RjJmRTFmNTFFZjcyIiwic29sYW5hIjoiNlpEVk5BYmpZZExEcXo4cGt3VUNHYllaNVV3QlFranB0QzU1Wk5vTFcybVUifSwiZGlzY29yZCI6Imh0dHBzOi8vZGlzY29yZC5nZy9wdERaOGU0aDkzIn0)
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
MIT © [kelvinzer0](https://github.com/n8n-code)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class N0xApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.N0xApi = void 0;
|
|
4
|
+
class N0xApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'N8nDevN0xApi';
|
|
7
|
+
this.displayName = '0x API';
|
|
8
|
+
this.icon = { light: 'file:../nodes/N0x/0x.svg', dark: 'file:../nodes/N0x/0x.dark.svg' };
|
|
9
|
+
this.documentationUrl = '';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Base URL',
|
|
13
|
+
name: 'url',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: 'https://api.0x.org',
|
|
16
|
+
required: true,
|
|
17
|
+
placeholder: 'https://api.0x.org',
|
|
18
|
+
description: 'The base URL of your 0x API server',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'API Key',
|
|
22
|
+
name: 'apiKey',
|
|
23
|
+
type: 'string',
|
|
24
|
+
typeOptions: { password: true },
|
|
25
|
+
default: '',
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"displayName": "❤️ Keep It Moving: One developer built a tool that auto-generates n8n nodes from any OpenAPI spec. Your donation funds new features, more API support, and better tooling for every developer after you. <a href=\"https://n8n-code.github.io/membership/#/eyJ0aXRsZSI6IktlZXAgSXQgTW92aW5nIiwiZGVzYyI6Ik9uZSBkZXZlbG9wZXIgYnVpbHQgYSB0b29sIHRoYXQgYXV0by1nZW5lcmF0ZXNcbm44biBub2RlcyBmcm9tIGFueSBPcGVuQVBJIHNwZWMuXG5cbllvdXIgZG9uYXRpb24gZnVuZHMgbmV3IGZlYXR1cmVzLCBtb3JlIEFQSSBzdXBwb3J0LFxuYW5kIGJldHRlciB0b29saW5nIGZvciBldmVyeSBkZXZlbG9wZXIgYWZ0ZXIgeW91LiIsInRhcmdldCI6NTAwMCwiYWRkcmVzc2VzIjp7ImV0aGVyZXVtIjoiMHhmMDU1NWQ0MGRiRkI0ZTNCZjA3MDQ0MjgyQjc4RjJmRTFmNTFFZjcyIiwic29sYW5hIjoiNlpEVk5BYmpZZExEcXo4cGt3VUNHYllaNVV3QlFranB0QzU1Wk5vTFcybVUifSwiZGlzY29yZCI6Imh0dHBzOi8vZGlzY29yZC5nZy9wdERaOGU0aDkzIn0\" target=\"_blank\">☕ Buy me a coffee</a>",
|
|
30
|
+
"name": "n8nCodeNotice",
|
|
31
|
+
"type": "notice",
|
|
32
|
+
"default": "",
|
|
33
|
+
"displayOptions": {
|
|
34
|
+
"show": {}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
this.authenticate = {
|
|
39
|
+
type: 'generic',
|
|
40
|
+
properties: {
|
|
41
|
+
headers: {
|
|
42
|
+
'0x-api-key': '={{$credentials.apiKey}}',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
this.test = {
|
|
47
|
+
request: {
|
|
48
|
+
baseURL: '={{$credentials.url}}',
|
|
49
|
+
url: '/',
|
|
50
|
+
method: 'GET',
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.N0xApi = N0xApi;
|
|
56
|
+
//# sourceMappingURL=N0xApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"N0xApi.credentials.js","sourceRoot":"","sources":["../../credentials/N0xApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,MAAM;IAAnB;QACC,SAAI,GAAG,cAAc,CAAC;QAEtB,gBAAW,GAAG,QAAQ,CAAC;QAEvB,SAAI,GAAS,EAAE,KAAK,EAAE,0BAA0B,EAAE,IAAI,EAAE,+BAA+B,EAAE,CAAC;QAE1F,qBAAgB,GAAG,EAAE,CAAC;QAEtB,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,oBAAoB;gBAC7B,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,oBAAoB;gBACjC,WAAW,EAAE,oCAAoC;aACjD;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,aAAa,EAAE,k0BAAk0B;gBACj1B,MAAM,EAAE,eAAe;gBACvB,MAAM,EAAE,QAAQ;gBAChB,SAAS,EAAE,EAAE;gBACb,gBAAgB,EAAE;oBACjB,MAAM,EAAE,EAAE;iBACV;aACD;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,YAAY,EAAE,0BAA0B;iBACxC;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,uBAAuB;gBAChC,GAAG,EAAE,GAAG;gBACR,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AAtDD,wBAsDC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.N0x = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const swap_1 = require("./resources/swap");
|
|
6
|
+
const gasless_1 = require("./resources/gasless");
|
|
7
|
+
const sources_1 = require("./resources/sources");
|
|
8
|
+
const trade_analytics_1 = require("./resources/trade-analytics");
|
|
9
|
+
class N0x {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.description = {
|
|
12
|
+
displayName: '0x',
|
|
13
|
+
name: 'N8nDevN0x',
|
|
14
|
+
icon: { light: 'file:./0x.svg', dark: 'file:./0x.dark.svg' },
|
|
15
|
+
group: ['input'],
|
|
16
|
+
version: 1,
|
|
17
|
+
subtitle: '={{\$parameter["operation"] + ": " + \$parameter["resource"]}}',
|
|
18
|
+
description: '0x DEX aggregator providing unified interface for liquidity aggregation token swap pricing and onchain trading across EVM Solana and cross-chain',
|
|
19
|
+
defaults: { name: '0x' },
|
|
20
|
+
usableAsTool: true,
|
|
21
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
22
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
23
|
+
credentials: [
|
|
24
|
+
{
|
|
25
|
+
name: 'N8nDevN0xApi',
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
requestDefaults: {
|
|
30
|
+
baseURL: '={{\$credentials.url}}',
|
|
31
|
+
headers: {
|
|
32
|
+
Accept: 'application/json',
|
|
33
|
+
'Content-Type': 'application/json',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
properties: [
|
|
37
|
+
{
|
|
38
|
+
"displayName": "Resource",
|
|
39
|
+
"name": "resource",
|
|
40
|
+
"type": "options",
|
|
41
|
+
"noDataExpression": true,
|
|
42
|
+
"options": [
|
|
43
|
+
{
|
|
44
|
+
"name": "Swap",
|
|
45
|
+
"value": "Swap",
|
|
46
|
+
"description": "Swap API endpoints"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "Gasless",
|
|
50
|
+
"value": "Gasless",
|
|
51
|
+
"description": "Gasless API endpoints"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "Sources",
|
|
55
|
+
"value": "Sources",
|
|
56
|
+
"description": "Sources API endpoints"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Trade Analytics",
|
|
60
|
+
"value": "Trade Analytics",
|
|
61
|
+
"description": "Trade Analytics API endpoints"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"default": ""
|
|
65
|
+
},
|
|
66
|
+
...swap_1.swapDescription,
|
|
67
|
+
...gasless_1.gaslessDescription,
|
|
68
|
+
...sources_1.sourcesDescription,
|
|
69
|
+
...trade_analytics_1.tradeAnalyticsDescription
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.N0x = N0x;
|
|
75
|
+
//# sourceMappingURL=N0x.node.js.map
|
|
@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SAAS;4BAClB,aAAa,EAAE,uBAAuB;yBACtC;wBACD;4BACC,MAAM,EAAE,iBAAiB;4BACzB,OAAO,EAAE,iBAAiB;4BAC1B,aAAa,EAAE,+BAA+B;yBAC9C;qBACD;oBACD,SAAS,EAAE,EAAE;iBACb;gBACD,GAAG,sBAAe;gBAClB,GAAG,4BAAkB;gBACrB,GAAG,4BAAkB;gBACrB,GAAG,2CAAyB;aAC3B;SACD,CAAC;IACH,CAAC;CAAA;AA9DD,kBA8DC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "N8nDevN0x",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": [
|
|
6
|
+
"Development"
|
|
7
|
+
],
|
|
8
|
+
"resources": {
|
|
9
|
+
"primaryDocumentation": [
|
|
10
|
+
{
|
|
11
|
+
"url": "https://github.com/n8n-code/n8n-nodes-0x"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"credentialDocumentation": [
|
|
15
|
+
{
|
|
16
|
+
"url": "https://github.com/n8n-code/n8n-nodes-0x?tab=readme-ov-file#credentials"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|