n8n-nodes-pacifica 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Maxwell de Melo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # n8n-nodes-pacifica
2
+
3
+ This is an n8n community node that integrates with **Pacifica**, a next-generation derivatives trading platform offering perpetual futures trading with AI-powered features.
4
+
5
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
6
+
7
+ [Pacifica](https://pacifica.fi/) is a perpetual futures DEX with advanced trading features.
8
+
9
+ ## Installation
10
+
11
+ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
12
+
13
+ ```bash
14
+ npm install n8n-nodes-pacifica
15
+ ```
16
+
17
+ ## Operations
18
+
19
+ ### Market Data (Public)
20
+ - **Get Market Info** - Get specifications for all trading pairs
21
+ - **Get Prices** - Get current prices, funding rates, and stats for all symbols
22
+ - **Get Orderbook** - Get order book depth for a symbol
23
+ - **Get Candles** - Get historical OHLCV candlestick data
24
+ - **Get Recent Trades** - Get recent trades for a symbol
25
+ - **Get Historical Funding** - Get historical funding rate data
26
+
27
+ ### Account (Authenticated)
28
+ - **Get Account Info** - Get account balance, equity, margin details
29
+ - **Get Trade History** - Get historical trade records
30
+
31
+ ### Orders (Authenticated + Signing)
32
+ - **Create Market Order** - Place immediate market orders with slippage control
33
+ - **Create Limit Order** - Place limit orders with GTC, IOC, ALO, or TOB time-in-force
34
+ - **Cancel Order** - Cancel a specific order by ID or client order ID
35
+ - **Cancel All Orders** - Cancel all open orders (optionally filtered by symbols)
36
+ - **Get Open Orders** - Get all currently open orders
37
+
38
+ ### Positions (Authenticated)
39
+ - **Get Positions** - Get all open positions
40
+ - **Update Leverage** - Update leverage for a symbol
41
+ - **Update Margin Mode** - Switch between cross and isolated margin
42
+ - **Close Position** - Close a position with a market order
43
+
44
+ ### Subaccounts (Authenticated)
45
+ - **Create Subaccount** - Create a new subaccount
46
+ - **List Subaccounts** - List all subaccounts
47
+ - **Transfer Funds** - Transfer funds between subaccounts
48
+
49
+ ## Credentials
50
+
51
+ To use this node, you need to set up API credentials:
52
+
53
+ 1. Go to [https://app.pacifica.fi/apikey](https://app.pacifica.fi/apikey) to generate an Agent Wallet
54
+ 2. In n8n, create new Pacifica API credentials with:
55
+ - **Network**: Mainnet or Testnet
56
+ - **Account Address**: Your main wallet public address
57
+ - **Agent Wallet Address**: The generated agent wallet public address
58
+ - **Agent Private Key**: The agent wallet private key (used for signing)
59
+
60
+ The Agent Wallet can only execute trades and cannot withdraw funds, making it safe for automated trading.
61
+
62
+ ## Compatibility
63
+
64
+ - n8n version: >= 1.0.0
65
+ - Node.js version: >= 20.15
66
+
67
+ ## Resources
68
+
69
+ - [Pacifica Documentation](https://docs.pacifica.fi/)
70
+ - [Pacifica API Reference](https://docs.pacifica.fi/api-documentation/api)
71
+ - [n8n Community Nodes Documentation](https://docs.n8n.io/integrations/community-nodes/)
72
+ - [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk)
73
+
74
+ ## Development
75
+
76
+ ```bash
77
+ # Install dependencies
78
+ npm install
79
+
80
+ # Build the project
81
+ npm run build
82
+
83
+ # Watch for changes
84
+ npm run dev
85
+
86
+ # Lint code
87
+ npm run lint
88
+ ```
89
+
90
+ ## License
91
+
92
+ [MIT](LICENSE)
@@ -0,0 +1,8 @@
1
+ import { ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class PacificaApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ }
8
+ //# sourceMappingURL=PacificaApi.credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PacificaApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/PacificaApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,qBAAa,WAAY,YAAW,eAAe;IACjD,IAAI,SAAiB;IACrB,WAAW,SAAkB;IAC7B,gBAAgB,SAAoD;IAEpE,UAAU,EAAE,eAAe,EAAE,CA2C3B;CACH"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PacificaApi = void 0;
4
+ class PacificaApi {
5
+ constructor() {
6
+ this.name = 'pacificaApi';
7
+ this.displayName = 'Pacifica API';
8
+ this.documentationUrl = 'https://docs.pacifica.fi/api-documentation/api';
9
+ this.properties = [
10
+ {
11
+ displayName: 'Network',
12
+ name: 'network',
13
+ type: 'options',
14
+ options: [
15
+ { name: 'Mainnet', value: 'mainnet' },
16
+ { name: 'Testnet', value: 'testnet' },
17
+ ],
18
+ default: 'mainnet',
19
+ description: 'Pacifica network to connect to',
20
+ },
21
+ {
22
+ displayName: 'Account Address',
23
+ name: 'accountAddress',
24
+ type: 'string',
25
+ default: '',
26
+ required: true,
27
+ placeholder: '0x...',
28
+ description: 'Your main wallet public address (the account that will be trading)',
29
+ },
30
+ {
31
+ displayName: 'Agent Wallet Address',
32
+ name: 'agentWalletAddress',
33
+ type: 'string',
34
+ default: '',
35
+ required: true,
36
+ placeholder: '0x...',
37
+ description: 'API Agent wallet public address. Generate at https://app.pacifica.fi/apikey',
38
+ },
39
+ {
40
+ displayName: 'Agent Private Key',
41
+ name: 'agentPrivateKey',
42
+ type: 'string',
43
+ typeOptions: {
44
+ password: true,
45
+ },
46
+ default: '',
47
+ required: true,
48
+ placeholder: '0x...',
49
+ description: 'API Agent private key (64 hex characters with 0x prefix). Used to sign requests. Encrypted at rest using AES-256.',
50
+ hint: 'This key is used only for signing trading requests and cannot withdraw funds.',
51
+ },
52
+ ];
53
+ }
54
+ }
55
+ exports.PacificaApi = PacificaApi;
56
+ //# sourceMappingURL=PacificaApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PacificaApi.credentials.js","sourceRoot":"","sources":["../../credentials/PacificaApi.credentials.ts"],"names":[],"mappings":";;;AAKA,MAAa,WAAW;IAAxB;QACE,SAAI,GAAG,aAAa,CAAC;QACrB,gBAAW,GAAG,cAAc,CAAC;QAC7B,qBAAgB,GAAG,gDAAgD,CAAC;QAEpE,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACP,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;oBACrC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;iBACtC;gBACD,OAAO,EAAE,SAAS;gBAClB,WAAW,EAAE,gCAAgC;aAC9C;YACD;gBACE,WAAW,EAAE,iBAAiB;gBAC9B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,OAAO;gBACpB,WAAW,EAAE,oEAAoE;aAClF;YACD;gBACE,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,oBAAoB;gBAC1B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,OAAO;gBACpB,WAAW,EAAE,6EAA6E;aAC3F;YACD;gBACE,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,OAAO;gBACpB,WAAW,EAAE,mHAAmH;gBAChI,IAAI,EAAE,+EAA+E;aACtF;SACF,CAAC;IACJ,CAAC;CAAA;AAjDD,kCAiDC"}
@@ -0,0 +1,6 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class Pacifica implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
6
+ //# sourceMappingURL=Pacifica.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pacifica.node.d.ts","sourceRoot":"","sources":["../../../nodes/Pacifica/Pacifica.node.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAErB,MAAM,cAAc,CAAC;AAUtB,qBAAa,QAAS,YAAW,SAAS;IACxC,WAAW,EAAE,oBAAoB,CAmgB/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAwQxE"}