@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.
Files changed (3) hide show
  1. package/dist/index.cjs +21 -11
  2. package/dist/index.js +21 -11
  3. 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.map((network) => ({
291
- x402Version: 2,
292
- scheme: "exact",
293
- network,
294
- ...group.family === "solana" ? {
295
- extra: {
296
- features: {
297
- xSettlementAccountSupported: true
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.map((network) => ({
269
- x402Version: 2,
270
- scheme: "exact",
271
- network,
272
- ...group.family === "solana" ? {
273
- extra: {
274
- features: {
275
- xSettlementAccountSupported: true
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.0",
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.3.0",
29
- "@x402/evm": "^2.3.0",
30
- "@x402/extensions": "^2.3.0",
31
- "@x402/svm": "2.3.0",
32
- "mppx": "^0.4.11",
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.3.0",
60
- "@x402/evm": "^2.3.0",
61
- "@x402/extensions": "^2.3.0",
62
- "@x402/svm": "2.3.0",
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.4.11",
64
+ "mppx": "^0.5.10",
65
65
  "next": "^15.0.0",
66
66
  "prettier": "^3.8.1",
67
67
  "react": "^19.0.0",