n8n-nodes-agnicwallet 1.0.0 → 1.0.1
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 +12 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,44 +86,24 @@ Not yet available. This node must first be approved as a community node by the N
|
|
|
86
86
|
|
|
87
87
|
## Usage
|
|
88
88
|
|
|
89
|
-
### Basic Example:
|
|
89
|
+
### Basic Example: X402 Protected Content
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Simple GET request with automatic payment:
|
|
92
92
|
|
|
93
|
-
- **Method:** `
|
|
94
|
-
- **URL:** `https://
|
|
95
|
-
- **Headers:**
|
|
96
|
-
- Name: `X-AgnicBillo-Key`
|
|
97
|
-
- Value: `agb_qroy8w9rb5lnpcla8ydl`
|
|
98
|
-
- **Body:**
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"model": "gpt-3.5-turbo",
|
|
102
|
-
"messages": [
|
|
103
|
-
{"role": "user", "content": "Hello!"}
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
```
|
|
93
|
+
- **Method:** `GET`
|
|
94
|
+
- **URL:** `https://www.x402.org/protected`
|
|
107
95
|
|
|
108
96
|
**What happens:**
|
|
109
|
-
1. Node makes
|
|
110
|
-
2. Receives `402 Payment Required`
|
|
111
|
-
3. Automatically signs payment with your
|
|
112
|
-
4. Retries with payment proof
|
|
113
|
-
5. Returns
|
|
97
|
+
1. Node makes GET request to protected endpoint
|
|
98
|
+
2. Receives `402 Payment Required` with payment details
|
|
99
|
+
3. Automatically signs payment ($0.01 USDC) with your AgnicWallet
|
|
100
|
+
4. Retries request with payment proof
|
|
101
|
+
5. Returns protected content with payment metadata
|
|
114
102
|
|
|
115
103
|
**Response:**
|
|
116
104
|
```json
|
|
117
105
|
{
|
|
118
|
-
"
|
|
119
|
-
"choices": [
|
|
120
|
-
{
|
|
121
|
-
"message": {
|
|
122
|
-
"role": "assistant",
|
|
123
|
-
"content": "Hello! How can I help you?"
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
],
|
|
106
|
+
"data": "<!DOCTYPE html>...<h1>Protected Content</h1><p>Your payment was successful!...</p>",
|
|
127
107
|
"_agnicWallet": {
|
|
128
108
|
"paymentMade": true,
|
|
129
109
|
"amountPaid": 0.01,
|
|
@@ -132,14 +112,9 @@ Configure the node:
|
|
|
132
112
|
}
|
|
133
113
|
```
|
|
134
114
|
|
|
135
|
-
### Example:
|
|
136
|
-
|
|
137
|
-
Simple GET request with payment:
|
|
138
|
-
|
|
139
|
-
- **Method:** `GET`
|
|
140
|
-
- **URL:** `https://www.x402.org/protected`
|
|
115
|
+
### Advanced Example: ChatGPT with X402
|
|
141
116
|
|
|
142
|
-
|
|
117
|
+
For POST requests with JSON body, see the advanced integration example in the documentation.
|
|
143
118
|
|
|
144
119
|
### Example: Dynamic Content
|
|
145
120
|
|