sf-x402x 0.6.6-patch.3

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