moltspay 0.9.7 → 1.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/README.md +42 -3
- package/dist/cdp/index.js +1 -1
- package/dist/cdp/index.js.map +1 -1
- package/dist/cdp/index.mjs +1 -1
- package/dist/cdp/index.mjs.map +1 -1
- package/dist/chains/index.js +1 -1
- package/dist/chains/index.js.map +1 -1
- package/dist/chains/index.mjs +1 -1
- package/dist/chains/index.mjs.map +1 -1
- package/dist/cli/index.js +5028 -109
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +5019 -96
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/index.d.mts +18 -3
- package/dist/client/index.d.ts +18 -3
- package/dist/client/index.js +89 -10
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +89 -10
- package/dist/client/index.mjs.map +1 -1
- package/dist/facilitators/index.js +1 -1
- package/dist/facilitators/index.js.map +1 -1
- package/dist/facilitators/index.mjs +1 -1
- package/dist/facilitators/index.mjs.map +1 -1
- package/dist/index.js +193 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +193 -36
- package/dist/index.mjs.map +1 -1
- package/dist/server/index.d.mts +25 -5
- package/dist/server/index.d.ts +25 -5
- package/dist/server/index.js +104 -26
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +104 -26
- package/dist/server/index.mjs.map +1 -1
- package/dist/verify/index.js +1 -1
- package/dist/verify/index.js.map +1 -1
- package/dist/verify/index.mjs +1 -1
- package/dist/verify/index.mjs.map +1 -1
- package/dist/wallet/index.js +1 -1
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/index.mjs +1 -1
- package/dist/wallet/index.mjs.map +1 -1
- package/package.json +3 -2
- package/schemas/moltspay.services.schema.json +58 -2
package/README.md
CHANGED
|
@@ -51,7 +51,8 @@ export async function textToVideo({ prompt }) {
|
|
|
51
51
|
{
|
|
52
52
|
"provider": {
|
|
53
53
|
"name": "My Video Service",
|
|
54
|
-
"wallet": "0xYOUR_WALLET_ADDRESS"
|
|
54
|
+
"wallet": "0xYOUR_WALLET_ADDRESS",
|
|
55
|
+
"chains": ["base", "polygon"]
|
|
55
56
|
},
|
|
56
57
|
"services": [{
|
|
57
58
|
"id": "text-to-video",
|
|
@@ -82,7 +83,11 @@ Send USDC to your wallet address. No ETH needed!
|
|
|
82
83
|
|
|
83
84
|
**3. Use paid services:**
|
|
84
85
|
```bash
|
|
86
|
+
# Pay on Base (default)
|
|
85
87
|
npx moltspay pay https://server.com text-to-video --prompt "a cat dancing"
|
|
88
|
+
|
|
89
|
+
# Pay on Polygon
|
|
90
|
+
npx moltspay pay https://server.com text-to-video --chain polygon --prompt "a cat dancing"
|
|
86
91
|
```
|
|
87
92
|
|
|
88
93
|
## How x402 Protocol Works
|
|
@@ -133,7 +138,7 @@ my-skill/
|
|
|
133
138
|
"name": "Service Name",
|
|
134
139
|
"description": "Optional description",
|
|
135
140
|
"wallet": "0x...",
|
|
136
|
-
"
|
|
141
|
+
"chains": ["base", "polygon"]
|
|
137
142
|
},
|
|
138
143
|
"services": [{
|
|
139
144
|
"id": "service-id",
|
|
@@ -152,6 +157,26 @@ my-skill/
|
|
|
152
157
|
}
|
|
153
158
|
```
|
|
154
159
|
|
|
160
|
+
### Multi-Chain Configuration
|
|
161
|
+
|
|
162
|
+
Accept payments on multiple chains by specifying a `chains` array:
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"provider": {
|
|
167
|
+
"wallet": "0x...",
|
|
168
|
+
"chains": ["base", "polygon"]
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Clients can then choose which chain to pay on:
|
|
174
|
+
```bash
|
|
175
|
+
npx moltspay pay https://server.com service-id --chain polygon --prompt "..."
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
If no `--chain` is specified, the client uses the first chain in the provider's list.
|
|
179
|
+
|
|
155
180
|
### Validate Your Config
|
|
156
181
|
|
|
157
182
|
```bash
|
|
@@ -181,11 +206,16 @@ Server does NOT need a private key - the x402 facilitator handles settlement.
|
|
|
181
206
|
```bash
|
|
182
207
|
# === Client Commands ===
|
|
183
208
|
npx moltspay init # Create wallet
|
|
209
|
+
npx moltspay init --chain polygon # Create wallet for Polygon
|
|
184
210
|
npx moltspay status # Check balance
|
|
185
211
|
npx moltspay config # Update limits
|
|
186
212
|
npx moltspay services <url> # List provider's services
|
|
187
213
|
npx moltspay pay <url> <service> # Pay and execute service
|
|
188
214
|
|
|
215
|
+
# === Pay with Chain Selection ===
|
|
216
|
+
npx moltspay pay <url> <service> --chain base # Pay on Base (default)
|
|
217
|
+
npx moltspay pay <url> <service> --chain polygon # Pay on Polygon
|
|
218
|
+
|
|
189
219
|
# === Server Commands ===
|
|
190
220
|
npx moltspay start <skill-dir> # Start server
|
|
191
221
|
npx moltspay stop # Stop server
|
|
@@ -193,7 +223,8 @@ npx moltspay validate <path> # Validate manifest
|
|
|
193
223
|
|
|
194
224
|
# === Options ===
|
|
195
225
|
--port <port> # Server port (default 3000)
|
|
196
|
-
--chain <chain> # Chain: base, polygon
|
|
226
|
+
--chain <chain> # Chain: base, polygon (for pay/init)
|
|
227
|
+
--token <token> # Token: USDC, USDT
|
|
197
228
|
--max-per-tx <amount> # Spending limit per transaction
|
|
198
229
|
--max-per-day <amount> # Daily spending limit
|
|
199
230
|
```
|
|
@@ -248,10 +279,18 @@ Live service at `https://juai8.com/zen7/`
|
|
|
248
279
|
- `text-to-video` - $0.99 USDC - Generate video from text prompt
|
|
249
280
|
- `image-to-video` - $1.49 USDC - Animate a static image
|
|
250
281
|
|
|
282
|
+
**Supported Chains:** Base, Polygon
|
|
283
|
+
|
|
251
284
|
**Try it:**
|
|
252
285
|
```bash
|
|
286
|
+
# List services
|
|
253
287
|
npx moltspay services https://juai8.com/zen7
|
|
288
|
+
|
|
289
|
+
# Pay on Base (default)
|
|
254
290
|
npx moltspay pay https://juai8.com/zen7 text-to-video --prompt "a happy cat"
|
|
291
|
+
|
|
292
|
+
# Pay on Polygon
|
|
293
|
+
npx moltspay pay https://juai8.com/zen7 text-to-video --chain polygon --prompt "a happy cat"
|
|
255
294
|
```
|
|
256
295
|
|
|
257
296
|
## Use Cases
|
package/dist/cdp/index.js
CHANGED
|
@@ -30382,7 +30382,7 @@ var CHAINS = {
|
|
|
30382
30382
|
polygon: {
|
|
30383
30383
|
name: "Polygon",
|
|
30384
30384
|
chainId: 137,
|
|
30385
|
-
rpc: "https://polygon-rpc.com",
|
|
30385
|
+
rpc: "https://polygon-bor-rpc.publicnode.com",
|
|
30386
30386
|
tokens: {
|
|
30387
30387
|
USDC: {
|
|
30388
30388
|
address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
|