@agentcash/router 1.3.0 → 1.3.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/dist/index.cjs +21 -11
- package/dist/index.js +21 -11
- package/package.json +11 -11
package/dist/index.cjs
CHANGED
|
@@ -258,6 +258,10 @@ async function createX402Server(config) {
|
|
|
258
258
|
);
|
|
259
259
|
if (evmNetworks.length > 0) {
|
|
260
260
|
registerExactEvmScheme(server, { networks: evmNetworks });
|
|
261
|
+
const { UptoEvmScheme } = await import("@x402/evm/upto/server");
|
|
262
|
+
for (const network of evmNetworks) {
|
|
263
|
+
server.register(network, new UptoEvmScheme());
|
|
264
|
+
}
|
|
261
265
|
}
|
|
262
266
|
if (svmNetworks.length > 0) {
|
|
263
267
|
const { registerExactSvmScheme } = await import("@x402/svm/exact/server");
|
|
@@ -287,18 +291,24 @@ function createFacilitatorClients(facilitatorsByNetwork, HTTPFacilitatorClient)
|
|
|
287
291
|
const groups = getResolvedX402FacilitatorGroups(facilitatorsByNetwork);
|
|
288
292
|
return groups.map((group) => {
|
|
289
293
|
const inner = new HTTPFacilitatorClient(group.config);
|
|
290
|
-
const kinds = group.networks.
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
294
|
+
const kinds = group.networks.flatMap((network) => {
|
|
295
|
+
const exactKind = {
|
|
296
|
+
x402Version: 2,
|
|
297
|
+
scheme: "exact",
|
|
298
|
+
network,
|
|
299
|
+
...group.family === "solana" ? {
|
|
300
|
+
extra: {
|
|
301
|
+
features: {
|
|
302
|
+
xSettlementAccountSupported: true
|
|
303
|
+
}
|
|
298
304
|
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
305
|
+
} : {}
|
|
306
|
+
};
|
|
307
|
+
if (group.family === "evm") {
|
|
308
|
+
return [exactKind, { x402Version: 2, scheme: "upto", network }];
|
|
309
|
+
}
|
|
310
|
+
return [exactKind];
|
|
311
|
+
});
|
|
302
312
|
return cachedClient(inner, kinds);
|
|
303
313
|
});
|
|
304
314
|
}
|
package/dist/index.js
CHANGED
|
@@ -236,6 +236,10 @@ async function createX402Server(config) {
|
|
|
236
236
|
);
|
|
237
237
|
if (evmNetworks.length > 0) {
|
|
238
238
|
registerExactEvmScheme(server, { networks: evmNetworks });
|
|
239
|
+
const { UptoEvmScheme } = await import("@x402/evm/upto/server");
|
|
240
|
+
for (const network of evmNetworks) {
|
|
241
|
+
server.register(network, new UptoEvmScheme());
|
|
242
|
+
}
|
|
239
243
|
}
|
|
240
244
|
if (svmNetworks.length > 0) {
|
|
241
245
|
const { registerExactSvmScheme } = await import("@x402/svm/exact/server");
|
|
@@ -265,18 +269,24 @@ function createFacilitatorClients(facilitatorsByNetwork, HTTPFacilitatorClient)
|
|
|
265
269
|
const groups = getResolvedX402FacilitatorGroups(facilitatorsByNetwork);
|
|
266
270
|
return groups.map((group) => {
|
|
267
271
|
const inner = new HTTPFacilitatorClient(group.config);
|
|
268
|
-
const kinds = group.networks.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
272
|
+
const kinds = group.networks.flatMap((network) => {
|
|
273
|
+
const exactKind = {
|
|
274
|
+
x402Version: 2,
|
|
275
|
+
scheme: "exact",
|
|
276
|
+
network,
|
|
277
|
+
...group.family === "solana" ? {
|
|
278
|
+
extra: {
|
|
279
|
+
features: {
|
|
280
|
+
xSettlementAccountSupported: true
|
|
281
|
+
}
|
|
276
282
|
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
283
|
+
} : {}
|
|
284
|
+
};
|
|
285
|
+
if (group.family === "evm") {
|
|
286
|
+
return [exactKind, { x402Version: 2, scheme: "upto", network }];
|
|
287
|
+
}
|
|
288
|
+
return [exactKind];
|
|
289
|
+
});
|
|
280
290
|
return cachedClient(inner, kinds);
|
|
281
291
|
});
|
|
282
292
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentcash/router",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Unified route builder for Next.js App Router APIs with x402, MPP, SIWX, and API key auth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
],
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@coinbase/x402": "^2.1.0",
|
|
28
|
-
"@x402/core": "^2.
|
|
29
|
-
"@x402/evm": "^2.
|
|
30
|
-
"@x402/extensions": "^2.
|
|
31
|
-
"@x402/svm": "2.
|
|
32
|
-
"mppx": "^0.
|
|
28
|
+
"@x402/core": "^2.9.0",
|
|
29
|
+
"@x402/evm": "^2.9.0",
|
|
30
|
+
"@x402/extensions": "^2.9.0",
|
|
31
|
+
"@x402/svm": "^2.9.0",
|
|
32
|
+
"mppx": "^0.5.10",
|
|
33
33
|
"next": ">=15.0.0",
|
|
34
34
|
"zod": "^4.0.0",
|
|
35
35
|
"zod-openapi": "^5.0.0"
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
"@solana/spl-token": "^0.4.14",
|
|
57
57
|
"@solana/web3.js": "^1.98.4",
|
|
58
58
|
"@types/node": "^22.0.0",
|
|
59
|
-
"@x402/core": "^2.
|
|
60
|
-
"@x402/evm": "^2.
|
|
61
|
-
"@x402/extensions": "^2.
|
|
62
|
-
"@x402/svm": "2.
|
|
59
|
+
"@x402/core": "^2.9.0",
|
|
60
|
+
"@x402/evm": "^2.9.0",
|
|
61
|
+
"@x402/extensions": "^2.9.0",
|
|
62
|
+
"@x402/svm": "^2.9.0",
|
|
63
63
|
"eslint": "^10.0.0",
|
|
64
|
-
"mppx": "^0.
|
|
64
|
+
"mppx": "^0.5.10",
|
|
65
65
|
"next": "^15.0.0",
|
|
66
66
|
"prettier": "^3.8.1",
|
|
67
67
|
"react": "^19.0.0",
|