n8n-nodes-cronos-paytech 0.1.2
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 +21 -0
- package/README.md +77 -0
- package/dist/credentials/CronosWalletCredentialsApi.credentials.d.ts +9 -0
- package/dist/credentials/CronosWalletCredentialsApi.credentials.js +44 -0
- package/dist/credentials/CronosWalletCredentialsApi.credentials.js.map +1 -0
- package/dist/credentials/cronosX402.svg +25 -0
- package/dist/nodes/CronosX402/CronosX402.node.d.ts +5 -0
- package/dist/nodes/CronosX402/CronosX402.node.js +521 -0
- package/dist/nodes/CronosX402/CronosX402.node.js.map +1 -0
- package/dist/nodes/CronosX402/cronosX402.svg +25 -0
- package/dist/nodes/CronosX402/utils/actions.d.ts +124 -0
- package/dist/nodes/CronosX402/utils/actions.js +299 -0
- package/dist/nodes/CronosX402/utils/actions.js.map +1 -0
- package/dist/package.json +63 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Moch. Ainun Najib
|
|
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,77 @@
|
|
|
1
|
+
# n8n-nodes-cronos-x402
|
|
2
|
+
|
|
3
|
+
This is an n8n community node that enables **Agentic Payments**, **On-Chain Notarization**, and **Web3 Authentication** on the Cronos EVM chain directly within your n8n workflows.
|
|
4
|
+
|
|
5
|
+
It is designed to help AI Agents pay for resources, accept payments, sign/verify messages, and create immutable audit logs.
|
|
6
|
+
|
|
7
|
+
[n8n](https://n8n.io/) is a fair-code licensed workflow automation platform.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
* **Agentic Payments (x402)**: Send and receive payments autonomously using the ERC-20 standard and facilitator payment headers.
|
|
12
|
+
* **On-Chain Notarization**: Write arbitrary text or JSON data to the blockchain for immutable audit logging and reputation tracking.
|
|
13
|
+
* **Web3 Authentication**: Sign messages (SIWE - Sign In With Ethereum) and recover addresses to verify sender identity without transactions.
|
|
14
|
+
* **Smart Contract Interaction**: Poll for event logs and check native token balances.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
### Community Node Install
|
|
19
|
+
You can install this node directly in your n8n instance:
|
|
20
|
+
|
|
21
|
+
1. Go to **Settings** > **Community Nodes**.
|
|
22
|
+
2. Select **Install**.
|
|
23
|
+
3. Enter `n8n-nodes-cronos-x402`.
|
|
24
|
+
|
|
25
|
+
### Manual Install (For Development)
|
|
26
|
+
To install the node from the source code for local development:
|
|
27
|
+
|
|
28
|
+
1. Clone this repository.
|
|
29
|
+
2. Run `npm install` and `npm run build && npm link`.
|
|
30
|
+
3. Link the package to your n8n installation:
|
|
31
|
+
```bash
|
|
32
|
+
# In your n8n custom nodes directory (usually ~/.n8n/custom)
|
|
33
|
+
rm node_modules/n8n-nodes-cronos-x402 && npm link n8n-nodes-cronos-x402
|
|
34
|
+
```
|
|
35
|
+
4. Restart n8n.
|
|
36
|
+
|
|
37
|
+
## Credentials
|
|
38
|
+
|
|
39
|
+
**Cronos Wallet**
|
|
40
|
+
* **Private Key**: The private key of the wallet you wish to control.
|
|
41
|
+
* **Environment**: Select `Mainnet` or `Testnet`.
|
|
42
|
+
|
|
43
|
+
*Note: Credentials are optional for public actions like `Recover Address`, `Generate Challenge`, and `Get Event Logs`.*
|
|
44
|
+
|
|
45
|
+
## Operations
|
|
46
|
+
|
|
47
|
+
### 1. Payment Functions
|
|
48
|
+
* **Pay From Wallet (Client Mode)**: Sign a payment transaction or authorization for a resource. Used by agents to pay for services.
|
|
49
|
+
* **Generate Challenge (Merchant Mode)**: Create a 402 Payment Request. Used by services to request payment from agents.
|
|
50
|
+
* **Verify Payment (Merchant Mode)**: specific Verify valid payment headers received from a client.
|
|
51
|
+
|
|
52
|
+
### 2. Identity & Authentication
|
|
53
|
+
* **Sign Message (Auth)**: Sign a text message using the wallet's private key (compatible with EIP-191/SIWE).
|
|
54
|
+
* **Recover Address (Verify Auth)**: Recover the signer's public address from a message and signature. useful for verifying identity without gas fees.
|
|
55
|
+
|
|
56
|
+
### 3. Audit & Data
|
|
57
|
+
* **Notarize (Data)**: Write arbitrary text or compressed JSON data on-chain. Ideal for creating immutable audit logs of AI decisions.
|
|
58
|
+
* **Get Event Logs**: Poll a smart contract for specific events (e.g., watching for a `PaymentReceived` event).
|
|
59
|
+
|
|
60
|
+
### 4. Utility
|
|
61
|
+
* **Get Balance**: Check the native CRO balance of the connected wallet.
|
|
62
|
+
|
|
63
|
+
## Usage Examples
|
|
64
|
+
|
|
65
|
+
### AI Agent Paying for an API
|
|
66
|
+
1. **Generate Challenge**: The API (Merchant) generates a payment challenge.
|
|
67
|
+
2. **Pay From Wallet**: The AI Agent (Client) receives the challenge and signs a payment using this node.
|
|
68
|
+
3. **Verify Payment**: The API verifies the payment header before releasing the resource.
|
|
69
|
+
|
|
70
|
+
### Immutable Audit Log
|
|
71
|
+
1. **AI Decision**: Your AI works through a complex reasoning chain.
|
|
72
|
+
2. **Compress**: Summarize the decision to a short string or hash.
|
|
73
|
+
3. **Notarize**: Use the `Notarize` action to write this summary to the Cronos blockchain.
|
|
74
|
+
4. **Verify**: Anyone can later prove the AI made that specific decision at that time by checking the transaction data.
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
MIT
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class CronosWalletCredentialsApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
testedBy: string;
|
|
8
|
+
properties: INodeProperties[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CronosWalletCredentialsApi = void 0;
|
|
4
|
+
class CronosWalletCredentialsApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'cronosWalletCredentialsApi';
|
|
7
|
+
this.displayName = 'Cronos Wallet Credentials API';
|
|
8
|
+
this.documentationUrl = 'https://github.com/cronos-labs/x402';
|
|
9
|
+
this.icon = 'file:cronosX402.svg';
|
|
10
|
+
this.testedBy = 'cronosX402';
|
|
11
|
+
this.properties = [
|
|
12
|
+
{
|
|
13
|
+
displayName: 'Private Key',
|
|
14
|
+
name: 'privateKey',
|
|
15
|
+
type: 'string',
|
|
16
|
+
typeOptions: {
|
|
17
|
+
password: true,
|
|
18
|
+
},
|
|
19
|
+
default: '',
|
|
20
|
+
required: true,
|
|
21
|
+
description: 'The Private Key of the wallet to use for signing payments (starts with 0x...)',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
displayName: 'Network',
|
|
25
|
+
name: 'network',
|
|
26
|
+
type: 'options',
|
|
27
|
+
options: [
|
|
28
|
+
{
|
|
29
|
+
name: 'Cronos Mainnet',
|
|
30
|
+
value: 'mainnet',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Cronos Testnet',
|
|
34
|
+
value: 'testnet',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
default: 'testnet',
|
|
38
|
+
description: 'The Cronos network to connect to',
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.CronosWalletCredentialsApi = CronosWalletCredentialsApi;
|
|
44
|
+
//# sourceMappingURL=CronosWalletCredentialsApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CronosWalletCredentialsApi.credentials.js","sourceRoot":"","sources":["../../credentials/CronosWalletCredentialsApi.credentials.ts"],"names":[],"mappings":";;;AAMA,MAAa,0BAA0B;IAAvC;QACI,SAAI,GAAG,4BAA4B,CAAC;QACpC,gBAAW,GAAG,+BAA+B,CAAC;QAC9C,qBAAgB,GAAG,qCAAqC,CAAC;QAEzD,SAAI,GAAG,qBAAqB,CAAC;QAC7B,aAAQ,GAAG,YAAY,CAAC;QACxB,eAAU,GAAsB;YAC5B;gBACI,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACT,QAAQ,EAAE,IAAI;iBACjB;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,+EAA+E;aAC/F;YACD;gBACI,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,gBAAgB;wBACtB,KAAK,EAAE,SAAS;qBACnB;oBACD;wBACI,IAAI,EAAE,gBAAgB;wBACtB,KAAK,EAAE,SAAS;qBACnB;iBACJ;gBACD,OAAO,EAAE,SAAS;gBAClB,WAAW,EAAE,kCAAkC;aAClD;SACJ,CAAC;IACN,CAAC;CAAA;AArCD,gEAqCC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 120.1 138.8" style="enable-background:new 0 0 120.1 138.8;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:#002D74;}
|
|
7
|
+
.st1{fill:url(#SVGID_1_);}
|
|
8
|
+
.st2{fill:url(#SVGID_00000061444671184501762360000006264132297249298069_);}
|
|
9
|
+
</style>
|
|
10
|
+
<path class="st0" d="M60.1,0L0,34.7v69.4l60.1,34.7l60-34.7V34.7L60.1,0z M102.3,93.8l-42.3,24.4L17.8,93.8V45l42.3-24.4L102.3,45
|
|
11
|
+
V93.8z"/>
|
|
12
|
+
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="90.1166" y1="1.0868" x2="90.1166" y2="70.4884" gradientTransform="matrix(1 0 0 -1 0 139.8898)">
|
|
13
|
+
<stop offset="0" style="stop-color:#002D74"/>
|
|
14
|
+
<stop offset="1" style="stop-color:#002D74;stop-opacity:0"/>
|
|
15
|
+
</linearGradient>
|
|
16
|
+
<path class="st1" d="M60.1,138.8l60-34.7V34.7L60.1,0v20.6L102.3,45v48.9l-42.3,24.4V138.8z"/>
|
|
17
|
+
<linearGradient id="SVGID_00000034064843000503835000000005854543727190432132_" gradientUnits="userSpaceOnUse" x1="30.0233" y1="139.8898" x2="30.0233" y2="70.4884" gradientTransform="matrix(1 0 0 -1 0 139.8898)">
|
|
18
|
+
<stop offset="0" style="stop-color:#002D74"/>
|
|
19
|
+
<stop offset="1" style="stop-color:#002D74;stop-opacity:0"/>
|
|
20
|
+
</linearGradient>
|
|
21
|
+
<path style="fill:url(#SVGID_00000034064843000503835000000005854543727190432132_);" d="M60,0L0,34.7v69.4l60,34.7v-20.6L17.8,93.8
|
|
22
|
+
V44.9L60,20.6V0z"/>
|
|
23
|
+
<path class="st0" d="M88.1,85.6l-28,16.2L32,85.6V53.2L60.1,37l28,16.2L76.4,60l-16.4-9.5L43.7,60v18.9l16.4,9.5l16.4-9.5L88.1,85.6
|
|
24
|
+
z"/>
|
|
25
|
+
</svg>
|