@x402x/extensions 2.3.1 → 2.4.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/dist/index.mjs CHANGED
@@ -179,10 +179,17 @@ function isValidHex(hex) {
179
179
  var NETWORK_ALIASES_V1_TO_V2 = {
180
180
  // V1 human-readable names -> V2 CAIP-2 canonical keys
181
181
  "base-sepolia": "eip155:84532",
182
+ "xlayer-testnet": "eip155:1952",
183
+ // Legacy alias for backward compatibility
182
184
  "x-layer-testnet": "eip155:1952",
185
+ // Canonical alias (must come after legacy to override)
183
186
  "skale-base-sepolia": "eip155:324705682",
187
+ "skale-base": "eip155:1187947933",
184
188
  base: "eip155:8453",
189
+ xlayer: "eip155:196",
190
+ // Legacy alias for backward compatibility
185
191
  "x-layer": "eip155:196",
192
+ // Canonical alias (must come after legacy to override)
186
193
  "bsc-testnet": "eip155:97",
187
194
  bsc: "eip155:56"
188
195
  };
@@ -251,6 +258,14 @@ var DEFAULT_ASSETS = {
251
258
  name: "x402 Wrapped USDT",
252
259
  version: "1"
253
260
  }
261
+ },
262
+ "eip155:1187947933": {
263
+ address: "0x85889c8c714505E0c94b30fcfcF64fE3Ac8FCb20",
264
+ decimals: 6,
265
+ eip712: {
266
+ name: "Bridged USDC (SKALE Bridge)",
267
+ version: "2"
268
+ }
254
269
  }
255
270
  };
256
271
  function getNetworkAlias(network) {
@@ -415,7 +430,7 @@ var networks = {
415
430
  },
416
431
  metadata: {
417
432
  gasModel: "legacy",
418
- nativeToken: "Credits"
433
+ nativeToken: "CREDIT"
419
434
  }
420
435
  },
421
436
  "eip155:97": {
@@ -506,6 +521,28 @@ var networks = {
506
521
  gasModel: "legacy",
507
522
  nativeToken: "BNB"
508
523
  }
524
+ },
525
+ "eip155:1187947933": {
526
+ chainId: 1187947933,
527
+ name: "SKALE on Base",
528
+ type: "mainnet",
529
+ addressExplorerBaseUrl: "https://skale-base-explorer.skalenodes.com/address/",
530
+ txExplorerBaseUrl: "https://skale-base-explorer.skalenodes.com/tx/",
531
+ settlementRouter: "0x1Ae0E196dC18355aF3a19985faf67354213F833D",
532
+ defaultAsset: getDefaultAssetConfig("eip155:1187947933"),
533
+ hooks: {
534
+ transfer: "0x2f05fe5674aE756E25C26855258B4877E9e021Fd"
535
+ },
536
+ demoHooks: {
537
+ nftMint: "0x73fc659Cd5494E69852bE8D9D23FE05Aab14b29B",
538
+ randomNFT: "0x081258287F692D61575387ee2a4075f34dd7Aef7",
539
+ reward: "0xC20634ea518985901e32Fbc1bA27fa673D37601A",
540
+ rewardToken: "0x9Fc2c199170B039f093ABCd54008038F0C0a31d6"
541
+ },
542
+ metadata: {
543
+ gasModel: "legacy",
544
+ nativeToken: "CREDIT"
545
+ }
509
546
  }
510
547
  };
511
548
  function getNetworkConfig(network) {
@@ -550,16 +587,16 @@ var customChains = {
550
587
  324705682: defineChain({
551
588
  id: 324705682,
552
589
  name: "SKALE Nebula Testnet",
553
- nativeCurrency: { name: "sFUEL", symbol: "sFUEL", decimals: 18 },
590
+ nativeCurrency: { name: "CREDIT", symbol: "CREDIT", decimals: 18 },
554
591
  rpcUrls: {
555
592
  default: {
556
- http: ["https://testnet.skalenodes.com/v1/lanky-ill-funny-testnet"]
593
+ http: ["https://base-sepolia-testnet.skalenodes.com/v1/jubilant-horrible-ancha"]
557
594
  }
558
595
  },
559
596
  blockExplorers: {
560
597
  default: {
561
598
  name: "SKALE Explorer",
562
- url: "https://lanky-ill-funny-testnet.explorer.testnet.skalenodes.com"
599
+ url: "https://base-sepolia-testnet-explorer.skalenodes.com"
563
600
  }
564
601
  },
565
602
  testnet: true
@@ -576,6 +613,22 @@ var customChains = {
576
613
  default: { name: "OKLink", url: "https://www.oklink.com/xlayer" }
577
614
  },
578
615
  testnet: false
616
+ }),
617
+ // SKALE Base Mainnet
618
+ 1187947933: defineChain({
619
+ id: 1187947933,
620
+ name: "SKALE Base",
621
+ nativeCurrency: { name: "CREDIT", symbol: "CREDIT", decimals: 18 },
622
+ rpcUrls: {
623
+ default: { http: ["https://skale-base.skalenodes.com/v1/base"] }
624
+ },
625
+ blockExplorers: {
626
+ default: {
627
+ name: "SKALE Explorer",
628
+ url: "https://skale-base-explorer.skalenodes.com"
629
+ }
630
+ },
631
+ testnet: false
579
632
  })
580
633
  };
581
634
  function getChain(network) {
@@ -1077,8 +1130,8 @@ async function verify(facilitatorUrl, paymentPayload, paymentRequirements) {
1077
1130
  body: JSON.stringify({
1078
1131
  paymentPayload,
1079
1132
  paymentRequirements,
1080
- x402Version: paymentPayload.x402Version
1081
- // Include x402Version at top level
1133
+ x402Version: paymentPayload.x402Version ?? 2
1134
+ // Include x402Version at top level, default to 2
1082
1135
  }),
1083
1136
  // Add timeout
1084
1137
  signal: AbortSignal.timeout(1e4)
@@ -1118,8 +1171,8 @@ async function settle(facilitatorUrl, paymentPayload, paymentRequirements, timeo
1118
1171
  body: JSON.stringify({
1119
1172
  paymentPayload,
1120
1173
  paymentRequirements,
1121
- x402Version: paymentPayload.x402Version
1122
- // Include x402Version at top level
1174
+ x402Version: paymentPayload.x402Version ?? 2
1175
+ // Include x402Version at top level, default to 2
1123
1176
  }),
1124
1177
  signal: controller.signal
1125
1178
  });