@wtflabs/x402 0.0.1-beta.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.
Files changed (96) hide show
  1. package/README.md +60 -0
  2. package/dist/cjs/client/index.d.ts +64 -0
  3. package/dist/cjs/client/index.js +832 -0
  4. package/dist/cjs/client/index.js.map +1 -0
  5. package/dist/cjs/config-CFBSAuxW.d.ts +10 -0
  6. package/dist/cjs/config-Dfuvno71.d.ts +19 -0
  7. package/dist/cjs/facilitator/index.d.ts +42 -0
  8. package/dist/cjs/facilitator/index.js +2574 -0
  9. package/dist/cjs/facilitator/index.js.map +1 -0
  10. package/dist/cjs/index.d.ts +16 -0
  11. package/dist/cjs/index.js +2974 -0
  12. package/dist/cjs/index.js.map +1 -0
  13. package/dist/cjs/middleware-6_1ApcJn.d.ts +93 -0
  14. package/dist/cjs/middleware-B_ewwsQp.d.ts +93 -0
  15. package/dist/cjs/middleware-Brgsx32F.d.ts +93 -0
  16. package/dist/cjs/middleware-BwfW7mAs.d.ts +93 -0
  17. package/dist/cjs/middleware-CQb61c1k.d.ts +93 -0
  18. package/dist/cjs/middleware-DB9lqy9f.d.ts +93 -0
  19. package/dist/cjs/middleware-DcHctwQV.d.ts +93 -0
  20. package/dist/cjs/middleware-De0jD3Bp.d.ts +93 -0
  21. package/dist/cjs/middleware-HoFOmpgv.d.ts +93 -0
  22. package/dist/cjs/middleware-Y8AiAfYw.d.ts +93 -0
  23. package/dist/cjs/middleware-pnres9YM.d.ts +93 -0
  24. package/dist/cjs/network-FrFmmiyj.d.ts +11 -0
  25. package/dist/cjs/network-RtNddYQk.d.ts +11 -0
  26. package/dist/cjs/paywall/index.d.ts +30 -0
  27. package/dist/cjs/paywall/index.js +131 -0
  28. package/dist/cjs/paywall/index.js.map +1 -0
  29. package/dist/cjs/rpc-BMvnNNHd.d.ts +35 -0
  30. package/dist/cjs/rpc-Ca8eHCWz.d.ts +35 -0
  31. package/dist/cjs/schemes/index.d.ts +533 -0
  32. package/dist/cjs/schemes/index.js +3144 -0
  33. package/dist/cjs/schemes/index.js.map +1 -0
  34. package/dist/cjs/shared/evm/index.d.ts +71 -0
  35. package/dist/cjs/shared/evm/index.js +947 -0
  36. package/dist/cjs/shared/evm/index.js.map +1 -0
  37. package/dist/cjs/shared/index.d.ts +182 -0
  38. package/dist/cjs/shared/index.js +674 -0
  39. package/dist/cjs/shared/index.js.map +1 -0
  40. package/dist/cjs/types/index.d.ts +1515 -0
  41. package/dist/cjs/types/index.js +1645 -0
  42. package/dist/cjs/types/index.js.map +1 -0
  43. package/dist/cjs/verify/index.d.ts +7 -0
  44. package/dist/cjs/verify/index.js +438 -0
  45. package/dist/cjs/verify/index.js.map +1 -0
  46. package/dist/cjs/wallet-BRWfOM5D.d.ts +153 -0
  47. package/dist/cjs/wallet-BTqCm9Zp.d.ts +27 -0
  48. package/dist/cjs/wallet-BYRAGtOB.d.ts +153 -0
  49. package/dist/cjs/wallet-BmEtlgEf.d.ts +48 -0
  50. package/dist/cjs/wallet-CNOAmyZ6.d.ts +48 -0
  51. package/dist/cjs/wallet-CQ0Fe_M5.d.ts +88 -0
  52. package/dist/cjs/wallet-D1SoxFTw.d.ts +48 -0
  53. package/dist/cjs/wallet-SJ-hbjm9.d.ts +153 -0
  54. package/dist/cjs/wallet-SJKJpUgQ.d.ts +167 -0
  55. package/dist/cjs/wallet-ecnda4Aj.d.ts +48 -0
  56. package/dist/cjs/wallet-gP8Qoi-c.d.ts +74 -0
  57. package/dist/cjs/x402Specs-B7InXo2L.d.ts +1065 -0
  58. package/dist/cjs/x402Specs-BLH3j34O.d.ts +1696 -0
  59. package/dist/cjs/x402Specs-C7LipAZg.d.ts +1715 -0
  60. package/dist/cjs/x402Specs-CYq5tSY1.d.ts +1745 -0
  61. package/dist/cjs/x402Specs-CeajqonG.d.ts +1696 -0
  62. package/dist/cjs/x402Specs-qMujgEV5.d.ts +1715 -0
  63. package/dist/cjs/x402Specs-qUBCpcuz.d.ts +1715 -0
  64. package/dist/esm/chunk-34YNR4LY.mjs +106 -0
  65. package/dist/esm/chunk-34YNR4LY.mjs.map +1 -0
  66. package/dist/esm/chunk-57UEJN5U.mjs +1416 -0
  67. package/dist/esm/chunk-57UEJN5U.mjs.map +1 -0
  68. package/dist/esm/chunk-5LTKIVOA.mjs +858 -0
  69. package/dist/esm/chunk-5LTKIVOA.mjs.map +1 -0
  70. package/dist/esm/chunk-AQQR4PXH.mjs +80 -0
  71. package/dist/esm/chunk-AQQR4PXH.mjs.map +1 -0
  72. package/dist/esm/chunk-LGXWNXCO.mjs +76 -0
  73. package/dist/esm/chunk-LGXWNXCO.mjs.map +1 -0
  74. package/dist/esm/chunk-RX2JKK4O.mjs +349 -0
  75. package/dist/esm/chunk-RX2JKK4O.mjs.map +1 -0
  76. package/dist/esm/chunk-UCBE7FDY.mjs +1041 -0
  77. package/dist/esm/chunk-UCBE7FDY.mjs.map +1 -0
  78. package/dist/esm/client/index.mjs +17 -0
  79. package/dist/esm/client/index.mjs.map +1 -0
  80. package/dist/esm/facilitator/index.mjs +14 -0
  81. package/dist/esm/facilitator/index.mjs.map +1 -0
  82. package/dist/esm/index.mjs +28 -0
  83. package/dist/esm/index.mjs.map +1 -0
  84. package/dist/esm/paywall/index.mjs +46 -0
  85. package/dist/esm/paywall/index.mjs.map +1 -0
  86. package/dist/esm/schemes/index.mjs +16 -0
  87. package/dist/esm/schemes/index.mjs.map +1 -0
  88. package/dist/esm/shared/evm/index.mjs +20 -0
  89. package/dist/esm/shared/evm/index.mjs.map +1 -0
  90. package/dist/esm/shared/index.mjs +31 -0
  91. package/dist/esm/shared/index.mjs.map +1 -0
  92. package/dist/esm/types/index.mjs +87 -0
  93. package/dist/esm/types/index.mjs.map +1 -0
  94. package/dist/esm/verify/index.mjs +105 -0
  95. package/dist/esm/verify/index.mjs.map +1 -0
  96. package/package.json +148 -0
@@ -0,0 +1,1645 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/types/index.ts
21
+ var types_exports = {};
22
+ __export(types_exports, {
23
+ ChainIdToNetwork: () => ChainIdToNetwork,
24
+ DiscoveredResourceSchema: () => DiscoveredResourceSchema,
25
+ ErrorReasons: () => ErrorReasons,
26
+ EvmNetworkToChainId: () => EvmNetworkToChainId,
27
+ ExactEvmPayloadAuthorizationSchema: () => ExactEvmPayloadAuthorizationSchema,
28
+ ExactEvmPayloadSchema: () => ExactEvmPayloadSchema,
29
+ ExactSvmPayloadSchema: () => ExactSvmPayloadSchema,
30
+ HTTPRequestStructureSchema: () => HTTPRequestStructureSchema,
31
+ ListDiscoveryResourcesRequestSchema: () => ListDiscoveryResourcesRequestSchema,
32
+ ListDiscoveryResourcesResponseSchema: () => ListDiscoveryResourcesResponseSchema,
33
+ NetworkSchema: () => NetworkSchema,
34
+ PaymentPayloadSchema: () => PaymentPayloadSchema,
35
+ PaymentRequirementsSchema: () => PaymentRequirementsSchema,
36
+ Permit2EvmPayloadAuthorizationSchema: () => Permit2EvmPayloadAuthorizationSchema,
37
+ PermitEvmPayloadAuthorizationSchema: () => PermitEvmPayloadAuthorizationSchema,
38
+ RequestStructureSchema: () => RequestStructureSchema,
39
+ SettleRequestSchema: () => SettleRequestSchema,
40
+ SettleResponseSchema: () => SettleResponseSchema,
41
+ SupportedEVMNetworks: () => SupportedEVMNetworks,
42
+ SupportedPaymentKindSchema: () => SupportedPaymentKindSchema,
43
+ SupportedPaymentKindsResponseSchema: () => SupportedPaymentKindsResponseSchema,
44
+ SupportedSVMNetworks: () => SupportedSVMNetworks,
45
+ SvmNetworkToChainId: () => SvmNetworkToChainId,
46
+ VerifyRequestSchema: () => VerifyRequestSchema,
47
+ VerifyResponseSchema: () => VerifyResponseSchema,
48
+ createConnectedClient: () => createConnectedClient2,
49
+ createSigner: () => createSigner2,
50
+ evm: () => evm_exports,
51
+ facilitatorRequestSchema: () => facilitatorRequestSchema,
52
+ isEvmSignerWallet: () => isEvmSignerWallet,
53
+ isMultiNetworkSigner: () => isMultiNetworkSigner,
54
+ isSvmSignerWallet: () => isSvmSignerWallet,
55
+ moneySchema: () => moneySchema,
56
+ schemes: () => schemes,
57
+ settleResponseFromHeader: () => settleResponseFromHeader,
58
+ settleResponseHeader: () => settleResponseHeader,
59
+ svm: () => svm_exports,
60
+ withChain: () => withChain,
61
+ x402ResponseSchema: () => x402ResponseSchema,
62
+ x402Versions: () => x402Versions
63
+ });
64
+ module.exports = __toCommonJS(types_exports);
65
+
66
+ // src/types/shared/money.ts
67
+ var import_zod = require("zod");
68
+ var moneySchema = import_zod.z.union([import_zod.z.string().transform((x) => x.replace(/[^0-9.-]+/g, "")), import_zod.z.number()]).pipe(import_zod.z.coerce.number().min(1e-4).max(999999999));
69
+
70
+ // src/types/shared/network.ts
71
+ var import_zod2 = require("zod");
72
+ var NetworkSchema = import_zod2.z.enum([
73
+ "base-sepolia",
74
+ "base",
75
+ "avalanche-fuji",
76
+ "avalanche",
77
+ "iotex",
78
+ "solana-devnet",
79
+ "solana",
80
+ "sei",
81
+ "sei-testnet",
82
+ "polygon",
83
+ "polygon-amoy",
84
+ "peaq",
85
+ "bsc",
86
+ "bsc-testnet"
87
+ ]);
88
+ var SupportedEVMNetworks = [
89
+ "base-sepolia",
90
+ "base",
91
+ "avalanche-fuji",
92
+ "avalanche",
93
+ "iotex",
94
+ "sei",
95
+ "sei-testnet",
96
+ "polygon",
97
+ "polygon-amoy",
98
+ "peaq",
99
+ "bsc",
100
+ "bsc-testnet"
101
+ ];
102
+ var EvmNetworkToChainId = /* @__PURE__ */ new Map([
103
+ ["base-sepolia", 84532],
104
+ ["base", 8453],
105
+ ["avalanche-fuji", 43113],
106
+ ["avalanche", 43114],
107
+ ["iotex", 4689],
108
+ ["sei", 1329],
109
+ ["sei-testnet", 1328],
110
+ ["polygon", 137],
111
+ ["polygon-amoy", 80002],
112
+ ["peaq", 3338],
113
+ ["bsc", 56],
114
+ ["bsc-testnet", 97]
115
+ ]);
116
+ var SupportedSVMNetworks = ["solana-devnet", "solana"];
117
+ var SvmNetworkToChainId = /* @__PURE__ */ new Map([
118
+ ["solana-devnet", 103],
119
+ ["solana", 101]
120
+ ]);
121
+ var ChainIdToNetwork = Object.fromEntries(
122
+ [...SupportedEVMNetworks, ...SupportedSVMNetworks].map((network) => [
123
+ EvmNetworkToChainId.get(network),
124
+ network
125
+ ])
126
+ );
127
+
128
+ // src/types/shared/evm/wallet.ts
129
+ var import_viem = require("viem");
130
+ var import_chains = require("viem/chains");
131
+ var import_accounts = require("viem/accounts");
132
+ function createConnectedClient(networkOrConfig, customRpcUrl) {
133
+ const chain = typeof networkOrConfig === "string" ? withChain(networkOrConfig, customRpcUrl) : withChain(networkOrConfig);
134
+ return (0, import_viem.createPublicClient)({
135
+ chain,
136
+ transport: (0, import_viem.http)(customRpcUrl || chain.rpcUrls.default.http[0])
137
+ }).extend(import_viem.publicActions);
138
+ }
139
+ function createClientSepolia() {
140
+ return createConnectedClient("base-sepolia");
141
+ }
142
+ function createClientAvalancheFuji() {
143
+ return createConnectedClient("avalanche-fuji");
144
+ }
145
+ function createSigner(networkOrConfig, privateKey, customRpcUrl) {
146
+ const chain = typeof networkOrConfig === "string" ? withChain(networkOrConfig, customRpcUrl) : withChain(networkOrConfig);
147
+ return (0, import_viem.createWalletClient)({
148
+ chain,
149
+ transport: (0, import_viem.http)(customRpcUrl || chain.rpcUrls.default.http[0]),
150
+ account: (0, import_accounts.privateKeyToAccount)(privateKey)
151
+ }).extend(import_viem.publicActions);
152
+ }
153
+ function createSignerSepolia(privateKey) {
154
+ return createSigner("base-sepolia", privateKey);
155
+ }
156
+ function createSignerAvalancheFuji(privateKey) {
157
+ return createSigner("avalanche-fuji", privateKey);
158
+ }
159
+ function isSignerWallet(wallet) {
160
+ return typeof wallet === "object" && wallet !== null && "chain" in wallet && "transport" in wallet;
161
+ }
162
+ function isAccount(wallet) {
163
+ const w = wallet;
164
+ return typeof wallet === "object" && wallet !== null && typeof w.address === "string" && typeof w.type === "string" && // Check for essential signing capabilities
165
+ typeof w.sign === "function" && typeof w.signMessage === "function" && typeof w.signTypedData === "function" && // Check for transaction signing (required by LocalAccount)
166
+ typeof w.signTransaction === "function";
167
+ }
168
+ function getChainFromNetwork(network) {
169
+ if (!network) {
170
+ throw new Error("NETWORK environment variable is not set");
171
+ }
172
+ switch (network) {
173
+ case "base":
174
+ return import_chains.base;
175
+ case "base-sepolia":
176
+ return import_chains.baseSepolia;
177
+ case "avalanche":
178
+ return import_chains.avalanche;
179
+ case "avalanche-fuji":
180
+ return import_chains.avalancheFuji;
181
+ case "sei":
182
+ return import_chains.sei;
183
+ case "sei-testnet":
184
+ return import_chains.seiTestnet;
185
+ case "polygon":
186
+ return import_chains.polygon;
187
+ case "polygon-amoy":
188
+ return import_chains.polygonAmoy;
189
+ case "peaq":
190
+ return import_chains.peaq;
191
+ case "iotex":
192
+ return import_chains.iotex;
193
+ case "iotex-testnet":
194
+ return import_chains.iotexTestnet;
195
+ case "bsc":
196
+ return import_chains.bsc;
197
+ case "bsc-testnet":
198
+ return import_chains.bscTestnet;
199
+ default:
200
+ throw new Error(`Unsupported network: ${network}`);
201
+ }
202
+ }
203
+ function withChain(config2, customRpcUrl) {
204
+ if (typeof config2 === "object" && "id" in config2 && "name" in config2) {
205
+ if (!customRpcUrl) {
206
+ return config2;
207
+ }
208
+ return {
209
+ ...config2,
210
+ rpcUrls: {
211
+ default: { http: [customRpcUrl] },
212
+ public: { http: [customRpcUrl] }
213
+ }
214
+ };
215
+ }
216
+ if (typeof config2 === "string") {
217
+ const chain = getChainFromNetwork(config2);
218
+ if (!customRpcUrl) {
219
+ return chain;
220
+ }
221
+ return {
222
+ ...chain,
223
+ rpcUrls: {
224
+ default: { http: [customRpcUrl] },
225
+ public: { http: [customRpcUrl] }
226
+ }
227
+ };
228
+ }
229
+ return (0, import_viem.defineChain)({
230
+ id: config2.chainId,
231
+ name: config2.name,
232
+ nativeCurrency: config2.nativeCurrency || {
233
+ name: "Ether",
234
+ symbol: "ETH",
235
+ decimals: 18
236
+ },
237
+ rpcUrls: {
238
+ default: { http: [config2.rpcUrl] },
239
+ public: { http: [config2.rpcUrl] }
240
+ },
241
+ blockExplorers: config2.blockExplorer ? {
242
+ default: {
243
+ name: config2.blockExplorer.name,
244
+ url: config2.blockExplorer.url
245
+ }
246
+ } : void 0
247
+ });
248
+ }
249
+
250
+ // src/shared/svm/wallet.ts
251
+ var import_kit2 = require("@solana/kit");
252
+ var import_base = require("@scure/base");
253
+
254
+ // src/shared/svm/rpc.ts
255
+ var import_kit = require("@solana/kit");
256
+ var DEVNET_RPC_URL = "https://api.devnet.solana.com";
257
+ var MAINNET_RPC_URL = "https://api.mainnet-beta.solana.com";
258
+ function createDevnetRpcClient(url) {
259
+ return (0, import_kit.createSolanaRpc)(
260
+ url ? (0, import_kit.devnet)(url) : (0, import_kit.devnet)(DEVNET_RPC_URL)
261
+ );
262
+ }
263
+ function createMainnetRpcClient(url) {
264
+ return (0, import_kit.createSolanaRpc)(
265
+ url ? (0, import_kit.mainnet)(url) : (0, import_kit.mainnet)(MAINNET_RPC_URL)
266
+ );
267
+ }
268
+ function getRpcClient(network, url) {
269
+ if (network === "solana-devnet") {
270
+ return createDevnetRpcClient(url);
271
+ } else if (network === "solana") {
272
+ return createMainnetRpcClient(url);
273
+ } else {
274
+ throw new Error("Invalid network");
275
+ }
276
+ }
277
+
278
+ // src/shared/svm/wallet.ts
279
+ function createSvmConnectedClient(network) {
280
+ if (!SupportedSVMNetworks.find((n) => n === network)) {
281
+ throw new Error(`Unsupported SVM network: ${network}`);
282
+ }
283
+ return getRpcClient(network);
284
+ }
285
+ async function createSignerFromBase58(privateKey) {
286
+ const bytes = import_base.base58.decode(privateKey);
287
+ if (bytes.length === 64) {
288
+ return await (0, import_kit2.createKeyPairSignerFromBytes)(bytes);
289
+ }
290
+ if (bytes.length === 32) {
291
+ return await (0, import_kit2.createKeyPairSignerFromPrivateKeyBytes)(bytes);
292
+ }
293
+ throw new Error(`Unexpected key length: ${bytes.length}. Expected 32 or 64 bytes.`);
294
+ }
295
+ function isSignerWallet2(wallet) {
296
+ return (0, import_kit2.isKeyPairSigner)(wallet);
297
+ }
298
+
299
+ // src/types/shared/wallet.ts
300
+ function createConnectedClient2(networkOrConfig, customRpcUrl) {
301
+ if (typeof networkOrConfig === "string") {
302
+ if (SupportedEVMNetworks.find((n) => n === networkOrConfig)) {
303
+ return createConnectedClient(networkOrConfig, customRpcUrl);
304
+ }
305
+ if (SupportedSVMNetworks.find((n) => n === networkOrConfig)) {
306
+ return createSvmConnectedClient(networkOrConfig);
307
+ }
308
+ throw new Error(`Unsupported network: ${networkOrConfig}`);
309
+ }
310
+ return createConnectedClient(networkOrConfig, customRpcUrl);
311
+ }
312
+ function createSigner2(networkOrConfig, privateKey, customRpcUrl) {
313
+ if (typeof networkOrConfig === "string") {
314
+ if (SupportedEVMNetworks.find((n) => n === networkOrConfig)) {
315
+ return Promise.resolve(createSigner(networkOrConfig, privateKey, customRpcUrl));
316
+ }
317
+ if (SupportedSVMNetworks.find((n) => n === networkOrConfig)) {
318
+ return createSignerFromBase58(privateKey);
319
+ }
320
+ throw new Error(`Unsupported network: ${networkOrConfig}`);
321
+ }
322
+ return Promise.resolve(createSigner(networkOrConfig, privateKey, customRpcUrl));
323
+ }
324
+ function isEvmSignerWallet(wallet) {
325
+ return isSignerWallet(wallet) || isAccount(wallet);
326
+ }
327
+ function isSvmSignerWallet(wallet) {
328
+ return isSignerWallet2(wallet);
329
+ }
330
+ function isMultiNetworkSigner(wallet) {
331
+ return "evm" in wallet && "svm" in wallet;
332
+ }
333
+
334
+ // src/types/shared/evm/index.ts
335
+ var evm_exports = {};
336
+ __export(evm_exports, {
337
+ PERMIT2_ADDRESS: () => PERMIT2_ADDRESS,
338
+ authorizationPrimaryType: () => authorizationPrimaryType,
339
+ authorizationTypes: () => authorizationTypes,
340
+ config: () => config,
341
+ createClientAvalancheFuji: () => createClientAvalancheFuji,
342
+ createClientSepolia: () => createClientSepolia,
343
+ createConnectedClient: () => createConnectedClient,
344
+ createSigner: () => createSigner,
345
+ createSignerAvalancheFuji: () => createSignerAvalancheFuji,
346
+ createSignerSepolia: () => createSignerSepolia,
347
+ erc20PermitABI: () => erc20PermitABI,
348
+ getChainFromNetwork: () => getChainFromNetwork,
349
+ isAccount: () => isAccount,
350
+ isSignerWallet: () => isSignerWallet,
351
+ permit2ABI: () => permit2ABI,
352
+ permit2PrimaryType: () => permit2PrimaryType,
353
+ permit2Types: () => permit2Types,
354
+ permitPrimaryType: () => permitPrimaryType,
355
+ permitTypes: () => permitTypes,
356
+ usdcABI: () => usdcABI,
357
+ withChain: () => withChain
358
+ });
359
+
360
+ // src/types/shared/evm/config.ts
361
+ var config = {
362
+ "84532": {
363
+ usdcAddress: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
364
+ usdcName: "USDC"
365
+ },
366
+ "8453": {
367
+ usdcAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
368
+ usdcName: "USD Coin"
369
+ },
370
+ "43113": {
371
+ usdcAddress: "0x5425890298aed601595a70AB815c96711a31Bc65",
372
+ usdcName: "USD Coin"
373
+ },
374
+ "43114": {
375
+ usdcAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
376
+ usdcName: "USD Coin"
377
+ },
378
+ "4689": {
379
+ usdcAddress: "0xcdf79194c6c285077a58da47641d4dbe51f63542",
380
+ usdcName: "Bridged USDC"
381
+ },
382
+ // solana devnet
383
+ "103": {
384
+ usdcAddress: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",
385
+ usdcName: "USDC"
386
+ },
387
+ // solana mainnet
388
+ "101": {
389
+ usdcAddress: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
390
+ usdcName: "USDC"
391
+ },
392
+ "1328": {
393
+ usdcAddress: "0x4fcf1784b31630811181f670aea7a7bef803eaed",
394
+ usdcName: "USDC"
395
+ },
396
+ "1329": {
397
+ usdcAddress: "0xe15fc38f6d8c56af07bbcbe3baf5708a2bf42392",
398
+ usdcName: "USDC"
399
+ },
400
+ "137": {
401
+ usdcAddress: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
402
+ usdcName: "USD Coin"
403
+ },
404
+ "80002": {
405
+ usdcAddress: "0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582",
406
+ usdcName: "USDC"
407
+ },
408
+ "3338": {
409
+ usdcAddress: "0xbbA60da06c2c5424f03f7434542280FCAd453d10",
410
+ usdcName: "USDC"
411
+ },
412
+ "56": {
413
+ usdcAddress: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
414
+ usdcName: "USDC"
415
+ },
416
+ "97": {
417
+ usdcAddress: "0x64544969ed7EBf5f083679233325356EbE738930",
418
+ usdcName: "USDC"
419
+ }
420
+ };
421
+
422
+ // src/types/shared/evm/eip3009.ts
423
+ var authorizationTypes = {
424
+ TransferWithAuthorization: [
425
+ { name: "from", type: "address" },
426
+ { name: "to", type: "address" },
427
+ { name: "value", type: "uint256" },
428
+ { name: "validAfter", type: "uint256" },
429
+ { name: "validBefore", type: "uint256" },
430
+ { name: "nonce", type: "bytes32" }
431
+ ]
432
+ };
433
+ var authorizationPrimaryType = "TransferWithAuthorization";
434
+
435
+ // src/types/shared/evm/eip2612.ts
436
+ var permitTypes = {
437
+ Permit: [
438
+ { name: "owner", type: "address" },
439
+ { name: "spender", type: "address" },
440
+ { name: "value", type: "uint256" },
441
+ { name: "nonce", type: "uint256" },
442
+ { name: "deadline", type: "uint256" }
443
+ ]
444
+ };
445
+ var permitPrimaryType = "Permit";
446
+ var erc20PermitABI = [
447
+ {
448
+ inputs: [
449
+ { internalType: "address", name: "owner", type: "address" },
450
+ { internalType: "address", name: "spender", type: "address" },
451
+ { internalType: "uint256", name: "value", type: "uint256" },
452
+ { internalType: "uint256", name: "deadline", type: "uint256" },
453
+ { internalType: "uint8", name: "v", type: "uint8" },
454
+ { internalType: "bytes32", name: "r", type: "bytes32" },
455
+ { internalType: "bytes32", name: "s", type: "bytes32" }
456
+ ],
457
+ name: "permit",
458
+ outputs: [],
459
+ stateMutability: "nonpayable",
460
+ type: "function"
461
+ },
462
+ {
463
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
464
+ name: "nonces",
465
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
466
+ stateMutability: "view",
467
+ type: "function"
468
+ },
469
+ {
470
+ inputs: [],
471
+ name: "name",
472
+ outputs: [{ internalType: "string", name: "", type: "string" }],
473
+ stateMutability: "view",
474
+ type: "function"
475
+ },
476
+ {
477
+ inputs: [],
478
+ name: "DOMAIN_SEPARATOR",
479
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
480
+ stateMutability: "view",
481
+ type: "function"
482
+ },
483
+ {
484
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
485
+ name: "balanceOf",
486
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
487
+ stateMutability: "view",
488
+ type: "function"
489
+ },
490
+ {
491
+ inputs: [
492
+ { internalType: "address", name: "from", type: "address" },
493
+ { internalType: "address", name: "to", type: "address" },
494
+ { internalType: "uint256", name: "amount", type: "uint256" }
495
+ ],
496
+ name: "transferFrom",
497
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
498
+ stateMutability: "nonpayable",
499
+ type: "function"
500
+ },
501
+ {
502
+ inputs: [
503
+ { internalType: "address", name: "owner", type: "address" },
504
+ { internalType: "address", name: "spender", type: "address" }
505
+ ],
506
+ name: "allowance",
507
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
508
+ stateMutability: "view",
509
+ type: "function"
510
+ },
511
+ {
512
+ inputs: [],
513
+ name: "version",
514
+ outputs: [{ internalType: "string", name: "", type: "string" }],
515
+ stateMutability: "view",
516
+ type: "function"
517
+ }
518
+ ];
519
+
520
+ // src/types/shared/evm/permit2.ts
521
+ var PERMIT2_ADDRESS = "0x000000000022D473030F116dDEE9F6B43aC78BA3";
522
+ var permit2Types = {
523
+ PermitTransferFrom: [
524
+ { name: "permitted", type: "TokenPermissions" },
525
+ { name: "spender", type: "address" },
526
+ { name: "nonce", type: "uint256" },
527
+ { name: "deadline", type: "uint256" }
528
+ ],
529
+ TokenPermissions: [
530
+ { name: "token", type: "address" },
531
+ { name: "amount", type: "uint256" }
532
+ ]
533
+ };
534
+ var permit2PrimaryType = "PermitTransferFrom";
535
+ var permit2ABI = [
536
+ {
537
+ inputs: [
538
+ {
539
+ components: [
540
+ {
541
+ components: [
542
+ { internalType: "address", name: "token", type: "address" },
543
+ { internalType: "uint256", name: "amount", type: "uint256" }
544
+ ],
545
+ internalType: "struct ISignatureTransfer.TokenPermissions",
546
+ name: "permitted",
547
+ type: "tuple"
548
+ },
549
+ { internalType: "uint256", name: "nonce", type: "uint256" },
550
+ { internalType: "uint256", name: "deadline", type: "uint256" }
551
+ ],
552
+ internalType: "struct ISignatureTransfer.PermitTransferFrom",
553
+ name: "permit",
554
+ type: "tuple"
555
+ },
556
+ {
557
+ components: [
558
+ { internalType: "address", name: "to", type: "address" },
559
+ { internalType: "uint256", name: "requestedAmount", type: "uint256" }
560
+ ],
561
+ internalType: "struct ISignatureTransfer.SignatureTransferDetails",
562
+ name: "transferDetails",
563
+ type: "tuple"
564
+ },
565
+ { internalType: "address", name: "owner", type: "address" },
566
+ { internalType: "bytes", name: "signature", type: "bytes" }
567
+ ],
568
+ name: "permitTransferFrom",
569
+ outputs: [],
570
+ stateMutability: "nonpayable",
571
+ type: "function"
572
+ },
573
+ {
574
+ inputs: [
575
+ { internalType: "address", name: "owner", type: "address" },
576
+ { internalType: "address", name: "token", type: "address" },
577
+ { internalType: "address", name: "spender", type: "address" }
578
+ ],
579
+ name: "allowance",
580
+ outputs: [
581
+ { internalType: "uint160", name: "amount", type: "uint160" },
582
+ { internalType: "uint48", name: "expiration", type: "uint48" },
583
+ { internalType: "uint48", name: "nonce", type: "uint48" }
584
+ ],
585
+ stateMutability: "view",
586
+ type: "function"
587
+ },
588
+ {
589
+ inputs: [],
590
+ name: "DOMAIN_SEPARATOR",
591
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
592
+ stateMutability: "view",
593
+ type: "function"
594
+ },
595
+ {
596
+ inputs: [
597
+ { internalType: "address", name: "owner", type: "address" },
598
+ { internalType: "uint256", name: "wordPos", type: "uint256" }
599
+ ],
600
+ name: "nonceBitmap",
601
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
602
+ stateMutability: "view",
603
+ type: "function"
604
+ }
605
+ ];
606
+
607
+ // src/types/shared/evm/erc20PermitABI.ts
608
+ var usdcABI = [
609
+ {
610
+ anonymous: false,
611
+ inputs: [
612
+ {
613
+ indexed: true,
614
+ internalType: "address",
615
+ name: "owner",
616
+ type: "address"
617
+ },
618
+ {
619
+ indexed: true,
620
+ internalType: "address",
621
+ name: "spender",
622
+ type: "address"
623
+ },
624
+ {
625
+ indexed: false,
626
+ internalType: "uint256",
627
+ name: "value",
628
+ type: "uint256"
629
+ }
630
+ ],
631
+ name: "Approval",
632
+ type: "event"
633
+ },
634
+ {
635
+ anonymous: false,
636
+ inputs: [
637
+ {
638
+ indexed: true,
639
+ internalType: "address",
640
+ name: "authorizer",
641
+ type: "address"
642
+ },
643
+ {
644
+ indexed: true,
645
+ internalType: "bytes32",
646
+ name: "nonce",
647
+ type: "bytes32"
648
+ }
649
+ ],
650
+ name: "AuthorizationCanceled",
651
+ type: "event"
652
+ },
653
+ {
654
+ anonymous: false,
655
+ inputs: [
656
+ {
657
+ indexed: true,
658
+ internalType: "address",
659
+ name: "authorizer",
660
+ type: "address"
661
+ },
662
+ {
663
+ indexed: true,
664
+ internalType: "bytes32",
665
+ name: "nonce",
666
+ type: "bytes32"
667
+ }
668
+ ],
669
+ name: "AuthorizationUsed",
670
+ type: "event"
671
+ },
672
+ {
673
+ anonymous: false,
674
+ inputs: [
675
+ {
676
+ indexed: true,
677
+ internalType: "address",
678
+ name: "_account",
679
+ type: "address"
680
+ }
681
+ ],
682
+ name: "Blacklisted",
683
+ type: "event"
684
+ },
685
+ {
686
+ anonymous: false,
687
+ inputs: [
688
+ {
689
+ indexed: true,
690
+ internalType: "address",
691
+ name: "newBlacklister",
692
+ type: "address"
693
+ }
694
+ ],
695
+ name: "BlacklisterChanged",
696
+ type: "event"
697
+ },
698
+ {
699
+ anonymous: false,
700
+ inputs: [
701
+ {
702
+ indexed: true,
703
+ internalType: "address",
704
+ name: "burner",
705
+ type: "address"
706
+ },
707
+ {
708
+ indexed: false,
709
+ internalType: "uint256",
710
+ name: "amount",
711
+ type: "uint256"
712
+ }
713
+ ],
714
+ name: "Burn",
715
+ type: "event"
716
+ },
717
+ {
718
+ anonymous: false,
719
+ inputs: [
720
+ {
721
+ indexed: true,
722
+ internalType: "address",
723
+ name: "newMasterMinter",
724
+ type: "address"
725
+ }
726
+ ],
727
+ name: "MasterMinterChanged",
728
+ type: "event"
729
+ },
730
+ {
731
+ anonymous: false,
732
+ inputs: [
733
+ {
734
+ indexed: true,
735
+ internalType: "address",
736
+ name: "minter",
737
+ type: "address"
738
+ },
739
+ { indexed: true, internalType: "address", name: "to", type: "address" },
740
+ {
741
+ indexed: false,
742
+ internalType: "uint256",
743
+ name: "amount",
744
+ type: "uint256"
745
+ }
746
+ ],
747
+ name: "Mint",
748
+ type: "event"
749
+ },
750
+ {
751
+ anonymous: false,
752
+ inputs: [
753
+ {
754
+ indexed: true,
755
+ internalType: "address",
756
+ name: "minter",
757
+ type: "address"
758
+ },
759
+ {
760
+ indexed: false,
761
+ internalType: "uint256",
762
+ name: "minterAllowedAmount",
763
+ type: "uint256"
764
+ }
765
+ ],
766
+ name: "MinterConfigured",
767
+ type: "event"
768
+ },
769
+ {
770
+ anonymous: false,
771
+ inputs: [
772
+ {
773
+ indexed: true,
774
+ internalType: "address",
775
+ name: "oldMinter",
776
+ type: "address"
777
+ }
778
+ ],
779
+ name: "MinterRemoved",
780
+ type: "event"
781
+ },
782
+ {
783
+ anonymous: false,
784
+ inputs: [
785
+ {
786
+ indexed: false,
787
+ internalType: "address",
788
+ name: "previousOwner",
789
+ type: "address"
790
+ },
791
+ {
792
+ indexed: false,
793
+ internalType: "address",
794
+ name: "newOwner",
795
+ type: "address"
796
+ }
797
+ ],
798
+ name: "OwnershipTransferred",
799
+ type: "event"
800
+ },
801
+ { anonymous: false, inputs: [], name: "Pause", type: "event" },
802
+ {
803
+ anonymous: false,
804
+ inputs: [
805
+ {
806
+ indexed: true,
807
+ internalType: "address",
808
+ name: "newAddress",
809
+ type: "address"
810
+ }
811
+ ],
812
+ name: "PauserChanged",
813
+ type: "event"
814
+ },
815
+ {
816
+ anonymous: false,
817
+ inputs: [
818
+ {
819
+ indexed: true,
820
+ internalType: "address",
821
+ name: "newRescuer",
822
+ type: "address"
823
+ }
824
+ ],
825
+ name: "RescuerChanged",
826
+ type: "event"
827
+ },
828
+ {
829
+ anonymous: false,
830
+ inputs: [
831
+ { indexed: true, internalType: "address", name: "from", type: "address" },
832
+ { indexed: true, internalType: "address", name: "to", type: "address" },
833
+ {
834
+ indexed: false,
835
+ internalType: "uint256",
836
+ name: "value",
837
+ type: "uint256"
838
+ }
839
+ ],
840
+ name: "Transfer",
841
+ type: "event"
842
+ },
843
+ {
844
+ anonymous: false,
845
+ inputs: [
846
+ {
847
+ indexed: true,
848
+ internalType: "address",
849
+ name: "_account",
850
+ type: "address"
851
+ }
852
+ ],
853
+ name: "UnBlacklisted",
854
+ type: "event"
855
+ },
856
+ { anonymous: false, inputs: [], name: "Unpause", type: "event" },
857
+ {
858
+ inputs: [],
859
+ name: "CANCEL_AUTHORIZATION_TYPEHASH",
860
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
861
+ stateMutability: "view",
862
+ type: "function"
863
+ },
864
+ {
865
+ inputs: [],
866
+ name: "DOMAIN_SEPARATOR",
867
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
868
+ stateMutability: "view",
869
+ type: "function"
870
+ },
871
+ {
872
+ inputs: [],
873
+ name: "PERMIT_TYPEHASH",
874
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
875
+ stateMutability: "view",
876
+ type: "function"
877
+ },
878
+ {
879
+ inputs: [],
880
+ name: "RECEIVE_WITH_AUTHORIZATION_TYPEHASH",
881
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
882
+ stateMutability: "view",
883
+ type: "function"
884
+ },
885
+ {
886
+ inputs: [],
887
+ name: "TRANSFER_WITH_AUTHORIZATION_TYPEHASH",
888
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
889
+ stateMutability: "view",
890
+ type: "function"
891
+ },
892
+ {
893
+ inputs: [
894
+ { internalType: "address", name: "owner", type: "address" },
895
+ { internalType: "address", name: "spender", type: "address" }
896
+ ],
897
+ name: "allowance",
898
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
899
+ stateMutability: "view",
900
+ type: "function"
901
+ },
902
+ {
903
+ inputs: [
904
+ { internalType: "address", name: "spender", type: "address" },
905
+ { internalType: "uint256", name: "value", type: "uint256" }
906
+ ],
907
+ name: "approve",
908
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
909
+ stateMutability: "nonpayable",
910
+ type: "function"
911
+ },
912
+ {
913
+ inputs: [
914
+ { internalType: "address", name: "authorizer", type: "address" },
915
+ { internalType: "bytes32", name: "nonce", type: "bytes32" }
916
+ ],
917
+ name: "authorizationState",
918
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
919
+ stateMutability: "view",
920
+ type: "function"
921
+ },
922
+ {
923
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
924
+ name: "balanceOf",
925
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
926
+ stateMutability: "view",
927
+ type: "function"
928
+ },
929
+ {
930
+ inputs: [{ internalType: "address", name: "_account", type: "address" }],
931
+ name: "blacklist",
932
+ outputs: [],
933
+ stateMutability: "nonpayable",
934
+ type: "function"
935
+ },
936
+ {
937
+ inputs: [],
938
+ name: "blacklister",
939
+ outputs: [{ internalType: "address", name: "", type: "address" }],
940
+ stateMutability: "view",
941
+ type: "function"
942
+ },
943
+ {
944
+ inputs: [{ internalType: "uint256", name: "_amount", type: "uint256" }],
945
+ name: "burn",
946
+ outputs: [],
947
+ stateMutability: "nonpayable",
948
+ type: "function"
949
+ },
950
+ {
951
+ inputs: [
952
+ { internalType: "address", name: "authorizer", type: "address" },
953
+ { internalType: "bytes32", name: "nonce", type: "bytes32" },
954
+ { internalType: "uint8", name: "v", type: "uint8" },
955
+ { internalType: "bytes32", name: "r", type: "bytes32" },
956
+ { internalType: "bytes32", name: "s", type: "bytes32" }
957
+ ],
958
+ name: "cancelAuthorization",
959
+ outputs: [],
960
+ stateMutability: "nonpayable",
961
+ type: "function"
962
+ },
963
+ {
964
+ inputs: [
965
+ { internalType: "address", name: "authorizer", type: "address" },
966
+ { internalType: "bytes32", name: "nonce", type: "bytes32" },
967
+ { internalType: "bytes", name: "signature", type: "bytes" }
968
+ ],
969
+ name: "cancelAuthorization",
970
+ outputs: [],
971
+ stateMutability: "nonpayable",
972
+ type: "function"
973
+ },
974
+ {
975
+ inputs: [
976
+ { internalType: "address", name: "minter", type: "address" },
977
+ { internalType: "uint256", name: "minterAllowedAmount", type: "uint256" }
978
+ ],
979
+ name: "configureMinter",
980
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
981
+ stateMutability: "nonpayable",
982
+ type: "function"
983
+ },
984
+ {
985
+ inputs: [],
986
+ name: "currency",
987
+ outputs: [{ internalType: "string", name: "", type: "string" }],
988
+ stateMutability: "view",
989
+ type: "function"
990
+ },
991
+ {
992
+ inputs: [],
993
+ name: "decimals",
994
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
995
+ stateMutability: "view",
996
+ type: "function"
997
+ },
998
+ {
999
+ inputs: [
1000
+ { internalType: "address", name: "spender", type: "address" },
1001
+ { internalType: "uint256", name: "decrement", type: "uint256" }
1002
+ ],
1003
+ name: "decreaseAllowance",
1004
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1005
+ stateMutability: "nonpayable",
1006
+ type: "function"
1007
+ },
1008
+ {
1009
+ inputs: [
1010
+ { internalType: "address", name: "spender", type: "address" },
1011
+ { internalType: "uint256", name: "increment", type: "uint256" }
1012
+ ],
1013
+ name: "increaseAllowance",
1014
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1015
+ stateMutability: "nonpayable",
1016
+ type: "function"
1017
+ },
1018
+ {
1019
+ inputs: [
1020
+ { internalType: "string", name: "tokenName", type: "string" },
1021
+ { internalType: "string", name: "tokenSymbol", type: "string" },
1022
+ { internalType: "string", name: "tokenCurrency", type: "string" },
1023
+ { internalType: "uint8", name: "tokenDecimals", type: "uint8" },
1024
+ { internalType: "address", name: "newMasterMinter", type: "address" },
1025
+ { internalType: "address", name: "newPauser", type: "address" },
1026
+ { internalType: "address", name: "newBlacklister", type: "address" },
1027
+ { internalType: "address", name: "newOwner", type: "address" }
1028
+ ],
1029
+ name: "initialize",
1030
+ outputs: [],
1031
+ stateMutability: "nonpayable",
1032
+ type: "function"
1033
+ },
1034
+ {
1035
+ inputs: [{ internalType: "string", name: "newName", type: "string" }],
1036
+ name: "initializeV2",
1037
+ outputs: [],
1038
+ stateMutability: "nonpayable",
1039
+ type: "function"
1040
+ },
1041
+ {
1042
+ inputs: [{ internalType: "address", name: "lostAndFound", type: "address" }],
1043
+ name: "initializeV2_1",
1044
+ outputs: [],
1045
+ stateMutability: "nonpayable",
1046
+ type: "function"
1047
+ },
1048
+ {
1049
+ inputs: [
1050
+ {
1051
+ internalType: "address[]",
1052
+ name: "accountsToBlacklist",
1053
+ type: "address[]"
1054
+ },
1055
+ { internalType: "string", name: "newSymbol", type: "string" }
1056
+ ],
1057
+ name: "initializeV2_2",
1058
+ outputs: [],
1059
+ stateMutability: "nonpayable",
1060
+ type: "function"
1061
+ },
1062
+ {
1063
+ inputs: [{ internalType: "address", name: "_account", type: "address" }],
1064
+ name: "isBlacklisted",
1065
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1066
+ stateMutability: "view",
1067
+ type: "function"
1068
+ },
1069
+ {
1070
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
1071
+ name: "isMinter",
1072
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1073
+ stateMutability: "view",
1074
+ type: "function"
1075
+ },
1076
+ {
1077
+ inputs: [],
1078
+ name: "masterMinter",
1079
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1080
+ stateMutability: "view",
1081
+ type: "function"
1082
+ },
1083
+ {
1084
+ inputs: [
1085
+ { internalType: "address", name: "_to", type: "address" },
1086
+ { internalType: "uint256", name: "_amount", type: "uint256" }
1087
+ ],
1088
+ name: "mint",
1089
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1090
+ stateMutability: "nonpayable",
1091
+ type: "function"
1092
+ },
1093
+ {
1094
+ inputs: [{ internalType: "address", name: "minter", type: "address" }],
1095
+ name: "minterAllowance",
1096
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1097
+ stateMutability: "view",
1098
+ type: "function"
1099
+ },
1100
+ {
1101
+ inputs: [],
1102
+ name: "name",
1103
+ outputs: [{ internalType: "string", name: "", type: "string" }],
1104
+ stateMutability: "view",
1105
+ type: "function"
1106
+ },
1107
+ {
1108
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
1109
+ name: "nonces",
1110
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1111
+ stateMutability: "view",
1112
+ type: "function"
1113
+ },
1114
+ {
1115
+ inputs: [],
1116
+ name: "owner",
1117
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1118
+ stateMutability: "view",
1119
+ type: "function"
1120
+ },
1121
+ {
1122
+ inputs: [],
1123
+ name: "pause",
1124
+ outputs: [],
1125
+ stateMutability: "nonpayable",
1126
+ type: "function"
1127
+ },
1128
+ {
1129
+ inputs: [],
1130
+ name: "paused",
1131
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1132
+ stateMutability: "view",
1133
+ type: "function"
1134
+ },
1135
+ {
1136
+ inputs: [],
1137
+ name: "pauser",
1138
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1139
+ stateMutability: "view",
1140
+ type: "function"
1141
+ },
1142
+ {
1143
+ inputs: [
1144
+ { internalType: "address", name: "owner", type: "address" },
1145
+ { internalType: "address", name: "spender", type: "address" },
1146
+ { internalType: "uint256", name: "value", type: "uint256" },
1147
+ { internalType: "uint256", name: "deadline", type: "uint256" },
1148
+ { internalType: "bytes", name: "signature", type: "bytes" }
1149
+ ],
1150
+ name: "permit",
1151
+ outputs: [],
1152
+ stateMutability: "nonpayable",
1153
+ type: "function"
1154
+ },
1155
+ {
1156
+ inputs: [
1157
+ { internalType: "address", name: "owner", type: "address" },
1158
+ { internalType: "address", name: "spender", type: "address" },
1159
+ { internalType: "uint256", name: "value", type: "uint256" },
1160
+ { internalType: "uint256", name: "deadline", type: "uint256" },
1161
+ { internalType: "uint8", name: "v", type: "uint8" },
1162
+ { internalType: "bytes32", name: "r", type: "bytes32" },
1163
+ { internalType: "bytes32", name: "s", type: "bytes32" }
1164
+ ],
1165
+ name: "permit",
1166
+ outputs: [],
1167
+ stateMutability: "nonpayable",
1168
+ type: "function"
1169
+ },
1170
+ {
1171
+ inputs: [
1172
+ { internalType: "address", name: "from", type: "address" },
1173
+ { internalType: "address", name: "to", type: "address" },
1174
+ { internalType: "uint256", name: "value", type: "uint256" },
1175
+ { internalType: "uint256", name: "validAfter", type: "uint256" },
1176
+ { internalType: "uint256", name: "validBefore", type: "uint256" },
1177
+ { internalType: "bytes32", name: "nonce", type: "bytes32" },
1178
+ { internalType: "bytes", name: "signature", type: "bytes" }
1179
+ ],
1180
+ name: "receiveWithAuthorization",
1181
+ outputs: [],
1182
+ stateMutability: "nonpayable",
1183
+ type: "function"
1184
+ },
1185
+ {
1186
+ inputs: [
1187
+ { internalType: "address", name: "from", type: "address" },
1188
+ { internalType: "address", name: "to", type: "address" },
1189
+ { internalType: "uint256", name: "value", type: "uint256" },
1190
+ { internalType: "uint256", name: "validAfter", type: "uint256" },
1191
+ { internalType: "uint256", name: "validBefore", type: "uint256" },
1192
+ { internalType: "bytes32", name: "nonce", type: "bytes32" },
1193
+ { internalType: "uint8", name: "v", type: "uint8" },
1194
+ { internalType: "bytes32", name: "r", type: "bytes32" },
1195
+ { internalType: "bytes32", name: "s", type: "bytes32" }
1196
+ ],
1197
+ name: "receiveWithAuthorization",
1198
+ outputs: [],
1199
+ stateMutability: "nonpayable",
1200
+ type: "function"
1201
+ },
1202
+ {
1203
+ inputs: [{ internalType: "address", name: "minter", type: "address" }],
1204
+ name: "removeMinter",
1205
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1206
+ stateMutability: "nonpayable",
1207
+ type: "function"
1208
+ },
1209
+ {
1210
+ inputs: [
1211
+ {
1212
+ internalType: "contract IERC20",
1213
+ name: "tokenContract",
1214
+ type: "address"
1215
+ },
1216
+ { internalType: "address", name: "to", type: "address" },
1217
+ { internalType: "uint256", name: "amount", type: "uint256" }
1218
+ ],
1219
+ name: "rescueERC20",
1220
+ outputs: [],
1221
+ stateMutability: "nonpayable",
1222
+ type: "function"
1223
+ },
1224
+ {
1225
+ inputs: [],
1226
+ name: "rescuer",
1227
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1228
+ stateMutability: "view",
1229
+ type: "function"
1230
+ },
1231
+ {
1232
+ inputs: [],
1233
+ name: "symbol",
1234
+ outputs: [{ internalType: "string", name: "", type: "string" }],
1235
+ stateMutability: "view",
1236
+ type: "function"
1237
+ },
1238
+ {
1239
+ inputs: [],
1240
+ name: "totalSupply",
1241
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1242
+ stateMutability: "view",
1243
+ type: "function"
1244
+ },
1245
+ {
1246
+ inputs: [
1247
+ { internalType: "address", name: "to", type: "address" },
1248
+ { internalType: "uint256", name: "value", type: "uint256" }
1249
+ ],
1250
+ name: "transfer",
1251
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1252
+ stateMutability: "nonpayable",
1253
+ type: "function"
1254
+ },
1255
+ {
1256
+ inputs: [
1257
+ { internalType: "address", name: "from", type: "address" },
1258
+ { internalType: "address", name: "to", type: "address" },
1259
+ { internalType: "uint256", name: "value", type: "uint256" }
1260
+ ],
1261
+ name: "transferFrom",
1262
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1263
+ stateMutability: "nonpayable",
1264
+ type: "function"
1265
+ },
1266
+ {
1267
+ inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
1268
+ name: "transferOwnership",
1269
+ outputs: [],
1270
+ stateMutability: "nonpayable",
1271
+ type: "function"
1272
+ },
1273
+ {
1274
+ inputs: [
1275
+ { internalType: "address", name: "from", type: "address" },
1276
+ { internalType: "address", name: "to", type: "address" },
1277
+ { internalType: "uint256", name: "value", type: "uint256" },
1278
+ { internalType: "uint256", name: "validAfter", type: "uint256" },
1279
+ { internalType: "uint256", name: "validBefore", type: "uint256" },
1280
+ { internalType: "bytes32", name: "nonce", type: "bytes32" },
1281
+ { internalType: "bytes", name: "signature", type: "bytes" }
1282
+ ],
1283
+ name: "transferWithAuthorization",
1284
+ outputs: [],
1285
+ stateMutability: "nonpayable",
1286
+ type: "function"
1287
+ },
1288
+ {
1289
+ inputs: [
1290
+ { internalType: "address", name: "from", type: "address" },
1291
+ { internalType: "address", name: "to", type: "address" },
1292
+ { internalType: "uint256", name: "value", type: "uint256" },
1293
+ { internalType: "uint256", name: "validAfter", type: "uint256" },
1294
+ { internalType: "uint256", name: "validBefore", type: "uint256" },
1295
+ { internalType: "bytes32", name: "nonce", type: "bytes32" },
1296
+ { internalType: "uint8", name: "v", type: "uint8" },
1297
+ { internalType: "bytes32", name: "r", type: "bytes32" },
1298
+ { internalType: "bytes32", name: "s", type: "bytes32" }
1299
+ ],
1300
+ name: "transferWithAuthorization",
1301
+ outputs: [],
1302
+ stateMutability: "nonpayable",
1303
+ type: "function"
1304
+ },
1305
+ {
1306
+ inputs: [{ internalType: "address", name: "_account", type: "address" }],
1307
+ name: "unBlacklist",
1308
+ outputs: [],
1309
+ stateMutability: "nonpayable",
1310
+ type: "function"
1311
+ },
1312
+ {
1313
+ inputs: [],
1314
+ name: "unpause",
1315
+ outputs: [],
1316
+ stateMutability: "nonpayable",
1317
+ type: "function"
1318
+ },
1319
+ {
1320
+ inputs: [{ internalType: "address", name: "_newBlacklister", type: "address" }],
1321
+ name: "updateBlacklister",
1322
+ outputs: [],
1323
+ stateMutability: "nonpayable",
1324
+ type: "function"
1325
+ },
1326
+ {
1327
+ inputs: [{ internalType: "address", name: "_newMasterMinter", type: "address" }],
1328
+ name: "updateMasterMinter",
1329
+ outputs: [],
1330
+ stateMutability: "nonpayable",
1331
+ type: "function"
1332
+ },
1333
+ {
1334
+ inputs: [{ internalType: "address", name: "_newPauser", type: "address" }],
1335
+ name: "updatePauser",
1336
+ outputs: [],
1337
+ stateMutability: "nonpayable",
1338
+ type: "function"
1339
+ },
1340
+ {
1341
+ inputs: [{ internalType: "address", name: "newRescuer", type: "address" }],
1342
+ name: "updateRescuer",
1343
+ outputs: [],
1344
+ stateMutability: "nonpayable",
1345
+ type: "function"
1346
+ },
1347
+ {
1348
+ inputs: [],
1349
+ name: "version",
1350
+ outputs: [{ internalType: "string", name: "", type: "string" }],
1351
+ stateMutability: "pure",
1352
+ type: "function"
1353
+ }
1354
+ ];
1355
+
1356
+ // src/types/shared/svm/index.ts
1357
+ var svm_exports = {};
1358
+ __export(svm_exports, {
1359
+ SvmAddressRegex: () => SvmAddressRegex
1360
+ });
1361
+
1362
+ // src/types/shared/svm/regex.ts
1363
+ var SvmAddressRegex = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
1364
+
1365
+ // src/types/verify/x402Specs.ts
1366
+ var import_zod3 = require("zod");
1367
+
1368
+ // src/shared/base64.ts
1369
+ var Base64EncodedRegex = /^[A-Za-z0-9+/]*={0,2}$/;
1370
+ function safeBase64Encode(data) {
1371
+ if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") {
1372
+ return globalThis.btoa(data);
1373
+ }
1374
+ return Buffer.from(data).toString("base64");
1375
+ }
1376
+ function safeBase64Decode(data) {
1377
+ if (typeof globalThis !== "undefined" && typeof globalThis.atob === "function") {
1378
+ return globalThis.atob(data);
1379
+ }
1380
+ return Buffer.from(data, "base64").toString("utf-8");
1381
+ }
1382
+
1383
+ // src/types/verify/x402Specs.ts
1384
+ var EvmMaxAtomicUnits = 40;
1385
+ var EvmAddressRegex = /^0x[0-9a-fA-F]{40}$/;
1386
+ var MixedAddressRegex = /^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$/;
1387
+ var HexEncoded64ByteRegex = /^0x[0-9a-fA-F]{64}$/;
1388
+ var EvmSignatureRegex = /^0x[0-9a-fA-F]+$/;
1389
+ var schemes = ["exact"];
1390
+ var x402Versions = [1];
1391
+ var ErrorReasons = [
1392
+ "insufficient_funds",
1393
+ "invalid_exact_evm_payload_authorization_valid_after",
1394
+ "invalid_exact_evm_payload_authorization_valid_before",
1395
+ "invalid_exact_evm_payload_authorization_value",
1396
+ "invalid_exact_evm_payload_signature",
1397
+ "invalid_exact_evm_payload_recipient_mismatch",
1398
+ "invalid_exact_svm_payload_transaction",
1399
+ "invalid_exact_svm_payload_transaction_amount_mismatch",
1400
+ "invalid_exact_svm_payload_transaction_create_ata_instruction",
1401
+ "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee",
1402
+ "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset",
1403
+ "invalid_exact_svm_payload_transaction_instructions",
1404
+ "invalid_exact_svm_payload_transaction_instructions_length",
1405
+ "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction",
1406
+ "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction",
1407
+ "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high",
1408
+ "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked",
1409
+ "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked",
1410
+ "invalid_exact_svm_payload_transaction_not_a_transfer_instruction",
1411
+ "invalid_exact_svm_payload_transaction_receiver_ata_not_found",
1412
+ "invalid_exact_svm_payload_transaction_sender_ata_not_found",
1413
+ "invalid_exact_svm_payload_transaction_simulation_failed",
1414
+ "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata",
1415
+ "invalid_network",
1416
+ "invalid_payload",
1417
+ "invalid_payment_requirements",
1418
+ "invalid_scheme",
1419
+ "invalid_payment",
1420
+ "payment_expired",
1421
+ "unsupported_scheme",
1422
+ "invalid_x402_version",
1423
+ "invalid_transaction_state",
1424
+ "settle_exact_svm_block_height_exceeded",
1425
+ "settle_exact_svm_transaction_confirmation_timed_out",
1426
+ "unexpected_settle_error",
1427
+ "unexpected_verify_error",
1428
+ // New error reasons for Permit and Permit2
1429
+ "unsupported_authorization_type",
1430
+ "invalid_authorization_type",
1431
+ "invalid_permit_signature",
1432
+ "invalid_permit2_signature",
1433
+ "permit_expired",
1434
+ "permit2_expired",
1435
+ "permit2_not_approved",
1436
+ "invalid_token_address",
1437
+ "invalid_spender_address",
1438
+ "token_mismatch",
1439
+ "insufficient_payment_amount",
1440
+ "transaction_failed",
1441
+ "settlement_failed"
1442
+ ];
1443
+ var isInteger = (value) => Number.isInteger(Number(value)) && Number(value) >= 0;
1444
+ var hasMaxLength = (maxLength) => (value) => value.length <= maxLength;
1445
+ var EvmOrSvmAddress = import_zod3.z.string().regex(EvmAddressRegex).or(import_zod3.z.string().regex(SvmAddressRegex));
1446
+ var mixedAddressOrSvmAddress = import_zod3.z.string().regex(MixedAddressRegex).or(import_zod3.z.string().regex(SvmAddressRegex));
1447
+ var PaymentRequirementsSchema = import_zod3.z.object({
1448
+ scheme: import_zod3.z.enum(schemes),
1449
+ network: NetworkSchema,
1450
+ maxAmountRequired: import_zod3.z.string().refine(isInteger),
1451
+ resource: import_zod3.z.string().url(),
1452
+ description: import_zod3.z.string(),
1453
+ mimeType: import_zod3.z.string(),
1454
+ outputSchema: import_zod3.z.record(import_zod3.z.any()).optional(),
1455
+ payTo: EvmOrSvmAddress,
1456
+ maxTimeoutSeconds: import_zod3.z.number().int(),
1457
+ asset: mixedAddressOrSvmAddress,
1458
+ paymentType: import_zod3.z.enum(["eip3009", "permit", "permit2"]).optional(),
1459
+ extra: import_zod3.z.record(import_zod3.z.any()).optional()
1460
+ });
1461
+ var ExactEvmPayloadAuthorizationSchema = import_zod3.z.object({
1462
+ from: import_zod3.z.string().regex(EvmAddressRegex),
1463
+ to: import_zod3.z.string().regex(EvmAddressRegex),
1464
+ value: import_zod3.z.string().refine(isInteger).refine(hasMaxLength(EvmMaxAtomicUnits)),
1465
+ validAfter: import_zod3.z.string().refine(isInteger),
1466
+ validBefore: import_zod3.z.string().refine(isInteger),
1467
+ nonce: import_zod3.z.string().regex(HexEncoded64ByteRegex)
1468
+ });
1469
+ var PermitEvmPayloadAuthorizationSchema = import_zod3.z.object({
1470
+ owner: import_zod3.z.string().regex(EvmAddressRegex),
1471
+ spender: import_zod3.z.string().regex(EvmAddressRegex),
1472
+ value: import_zod3.z.string().refine(isInteger).refine(hasMaxLength(EvmMaxAtomicUnits)),
1473
+ deadline: import_zod3.z.string().refine(isInteger),
1474
+ nonce: import_zod3.z.string().refine(isInteger)
1475
+ });
1476
+ var Permit2EvmPayloadAuthorizationSchema = import_zod3.z.object({
1477
+ owner: import_zod3.z.string().regex(EvmAddressRegex),
1478
+ spender: import_zod3.z.string().regex(EvmAddressRegex),
1479
+ token: import_zod3.z.string().regex(EvmAddressRegex),
1480
+ amount: import_zod3.z.string().refine(isInteger).refine(hasMaxLength(EvmMaxAtomicUnits)),
1481
+ deadline: import_zod3.z.string().refine(isInteger),
1482
+ nonce: import_zod3.z.string().refine(isInteger)
1483
+ });
1484
+ var ExactEvmPayloadSchema = import_zod3.z.discriminatedUnion("authorizationType", [
1485
+ import_zod3.z.object({
1486
+ authorizationType: import_zod3.z.literal("eip3009"),
1487
+ signature: import_zod3.z.string().regex(EvmSignatureRegex),
1488
+ authorization: ExactEvmPayloadAuthorizationSchema
1489
+ }),
1490
+ import_zod3.z.object({
1491
+ authorizationType: import_zod3.z.literal("permit"),
1492
+ signature: import_zod3.z.string().regex(EvmSignatureRegex),
1493
+ authorization: PermitEvmPayloadAuthorizationSchema
1494
+ }),
1495
+ import_zod3.z.object({
1496
+ authorizationType: import_zod3.z.literal("permit2"),
1497
+ signature: import_zod3.z.string().regex(EvmSignatureRegex),
1498
+ authorization: Permit2EvmPayloadAuthorizationSchema
1499
+ })
1500
+ ]);
1501
+ var ExactSvmPayloadSchema = import_zod3.z.object({
1502
+ transaction: import_zod3.z.string().regex(Base64EncodedRegex)
1503
+ });
1504
+ var PaymentPayloadSchema = import_zod3.z.object({
1505
+ x402Version: import_zod3.z.number().refine((val) => x402Versions.includes(val)),
1506
+ scheme: import_zod3.z.enum(schemes),
1507
+ network: NetworkSchema,
1508
+ payload: import_zod3.z.union([ExactEvmPayloadSchema, ExactSvmPayloadSchema])
1509
+ });
1510
+ var x402ResponseSchema = import_zod3.z.object({
1511
+ x402Version: import_zod3.z.number().refine((val) => x402Versions.includes(val)),
1512
+ error: import_zod3.z.enum(ErrorReasons).optional(),
1513
+ accepts: import_zod3.z.array(PaymentRequirementsSchema).optional(),
1514
+ payer: import_zod3.z.string().regex(MixedAddressRegex).optional()
1515
+ });
1516
+ var HTTPVerbsSchema = import_zod3.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"]);
1517
+ var HTTPRequestStructureSchema = import_zod3.z.object({
1518
+ type: import_zod3.z.literal("http"),
1519
+ method: HTTPVerbsSchema,
1520
+ queryParams: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.string()).optional(),
1521
+ bodyType: import_zod3.z.enum(["json", "form-data", "multipart-form-data", "text", "binary"]).optional(),
1522
+ bodyFields: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.any()).optional(),
1523
+ headerFields: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.any()).optional()
1524
+ });
1525
+ var RequestStructureSchema = import_zod3.z.discriminatedUnion("type", [
1526
+ HTTPRequestStructureSchema
1527
+ // MCPRequestStructureSchema,
1528
+ // OpenAPIRequestStructureSchema,
1529
+ ]);
1530
+ var DiscoveredResourceSchema = import_zod3.z.object({
1531
+ resource: import_zod3.z.string(),
1532
+ type: import_zod3.z.enum(["http"]),
1533
+ x402Version: import_zod3.z.number().refine((val) => x402Versions.includes(val)),
1534
+ accepts: import_zod3.z.array(PaymentRequirementsSchema),
1535
+ lastUpdated: import_zod3.z.date(),
1536
+ metadata: import_zod3.z.record(import_zod3.z.any()).optional()
1537
+ });
1538
+ var SettleRequestSchema = import_zod3.z.object({
1539
+ paymentPayload: PaymentPayloadSchema,
1540
+ paymentRequirements: PaymentRequirementsSchema
1541
+ });
1542
+ var VerifyRequestSchema = import_zod3.z.object({
1543
+ paymentPayload: PaymentPayloadSchema,
1544
+ paymentRequirements: PaymentRequirementsSchema
1545
+ });
1546
+ var VerifyResponseSchema = import_zod3.z.object({
1547
+ isValid: import_zod3.z.boolean(),
1548
+ invalidReason: import_zod3.z.enum(ErrorReasons).optional(),
1549
+ payer: EvmOrSvmAddress.optional()
1550
+ });
1551
+ var SettleResponseSchema = import_zod3.z.object({
1552
+ success: import_zod3.z.boolean(),
1553
+ errorReason: import_zod3.z.enum(ErrorReasons).optional(),
1554
+ payer: EvmOrSvmAddress.optional(),
1555
+ transaction: import_zod3.z.string().regex(MixedAddressRegex),
1556
+ network: NetworkSchema
1557
+ });
1558
+ var ListDiscoveryResourcesRequestSchema = import_zod3.z.object({
1559
+ type: import_zod3.z.string().optional(),
1560
+ limit: import_zod3.z.number().optional(),
1561
+ offset: import_zod3.z.number().optional()
1562
+ });
1563
+ var ListDiscoveryResourcesResponseSchema = import_zod3.z.object({
1564
+ x402Version: import_zod3.z.number().refine((val) => x402Versions.includes(val)),
1565
+ items: import_zod3.z.array(DiscoveredResourceSchema),
1566
+ pagination: import_zod3.z.object({
1567
+ limit: import_zod3.z.number(),
1568
+ offset: import_zod3.z.number(),
1569
+ total: import_zod3.z.number()
1570
+ })
1571
+ });
1572
+ var SupportedPaymentKindSchema = import_zod3.z.object({
1573
+ x402Version: import_zod3.z.number().refine((val) => x402Versions.includes(val)),
1574
+ scheme: import_zod3.z.enum(schemes),
1575
+ network: NetworkSchema,
1576
+ extra: import_zod3.z.record(import_zod3.z.any()).optional()
1577
+ });
1578
+ var SupportedPaymentKindsResponseSchema = import_zod3.z.object({
1579
+ kinds: import_zod3.z.array(SupportedPaymentKindSchema)
1580
+ });
1581
+
1582
+ // src/types/verify/facilitator.ts
1583
+ var import_zod4 = require("zod");
1584
+
1585
+ // src/shared/svm/transaction.ts
1586
+ var import_kit3 = require("@solana/kit");
1587
+ var import_token = require("@solana-program/token");
1588
+ var import_token_2022 = require("@solana-program/token-2022");
1589
+
1590
+ // src/types/verify/facilitator.ts
1591
+ var facilitatorRequestSchema = import_zod4.z.object({
1592
+ paymentHeader: import_zod4.z.string(),
1593
+ paymentRequirements: PaymentRequirementsSchema
1594
+ });
1595
+ function settleResponseHeader(response) {
1596
+ return safeBase64Encode(JSON.stringify(response));
1597
+ }
1598
+ function settleResponseFromHeader(header) {
1599
+ const decoded = safeBase64Decode(header);
1600
+ return JSON.parse(decoded);
1601
+ }
1602
+ // Annotate the CommonJS export names for ESM import in node:
1603
+ 0 && (module.exports = {
1604
+ ChainIdToNetwork,
1605
+ DiscoveredResourceSchema,
1606
+ ErrorReasons,
1607
+ EvmNetworkToChainId,
1608
+ ExactEvmPayloadAuthorizationSchema,
1609
+ ExactEvmPayloadSchema,
1610
+ ExactSvmPayloadSchema,
1611
+ HTTPRequestStructureSchema,
1612
+ ListDiscoveryResourcesRequestSchema,
1613
+ ListDiscoveryResourcesResponseSchema,
1614
+ NetworkSchema,
1615
+ PaymentPayloadSchema,
1616
+ PaymentRequirementsSchema,
1617
+ Permit2EvmPayloadAuthorizationSchema,
1618
+ PermitEvmPayloadAuthorizationSchema,
1619
+ RequestStructureSchema,
1620
+ SettleRequestSchema,
1621
+ SettleResponseSchema,
1622
+ SupportedEVMNetworks,
1623
+ SupportedPaymentKindSchema,
1624
+ SupportedPaymentKindsResponseSchema,
1625
+ SupportedSVMNetworks,
1626
+ SvmNetworkToChainId,
1627
+ VerifyRequestSchema,
1628
+ VerifyResponseSchema,
1629
+ createConnectedClient,
1630
+ createSigner,
1631
+ evm,
1632
+ facilitatorRequestSchema,
1633
+ isEvmSignerWallet,
1634
+ isMultiNetworkSigner,
1635
+ isSvmSignerWallet,
1636
+ moneySchema,
1637
+ schemes,
1638
+ settleResponseFromHeader,
1639
+ settleResponseHeader,
1640
+ svm,
1641
+ withChain,
1642
+ x402ResponseSchema,
1643
+ x402Versions
1644
+ });
1645
+ //# sourceMappingURL=index.js.map