@chainrails/common 0.2.5 → 0.2.6

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.
@@ -1,4 +1,4 @@
1
- const u = {
1
+ const E = {
2
2
  EVM: "EVM",
3
3
  STARKNET: "STARKNET"
4
4
  }, c = {
@@ -20,186 +20,205 @@ const u = {
20
20
  POLYGON: "POLYGON_MAINNET",
21
21
  STARKNET: "STARKNET_MAINNET",
22
22
  STARKNET_TESTNET: "STARKNET_TESTNET"
23
+ }, te = {
24
+ ARBITRUM: "ARBITRUM",
25
+ ARBITRUM_TESTNET: "ARBITRUM_TESTNET",
26
+ AVALANCHE: "AVALANCHE",
27
+ AVALANCHE_TESTNET: "AVALANCHE_TESTNET",
28
+ BASE: "BASE",
29
+ BASE_TESTNET: "BASE_TESTNET",
30
+ BSC: "BSC",
31
+ ETHEREUM: "ETHEREUM",
32
+ ETHEREUM_TESTNET: "ETHEREUM_TESTNET",
33
+ HYPEREVM: "HYPEREVM",
34
+ LISK: "LISK",
35
+ MONAD: "MONAD",
36
+ MONAD_TESTNET: "MONAD_TESTNET",
37
+ OPTIMISM: "OPTIMISM",
38
+ OPTIMISM_TESTNET: "OPTIMISM_TESTNET",
39
+ POLYGON: "POLYGON",
40
+ STARKNET: "STARKNET",
41
+ STARKNET_TESTNET: "STARKNET_TESTNET"
23
42
  }, se = {
24
- type: u.EVM,
43
+ type: E.EVM,
25
44
  chainId: 42161,
26
45
  name: "Arbitrum",
27
46
  cctpDomain: 3,
28
47
  logoURI: "/images/chains/arbitrum.svg",
29
48
  explorer: "https://arbiscan.io"
30
- }, te = {
31
- type: u.EVM,
49
+ }, ne = {
50
+ type: E.EVM,
32
51
  chainId: 421614,
33
52
  name: "Arbitrum Sepolia",
34
53
  cctpDomain: 3,
35
54
  logoURI: "/images/chains/arbitrum.svg",
36
55
  explorer: "https://sepolia.arbiscan.io"
37
- }, ne = {
38
- type: u.EVM,
56
+ }, oe = {
57
+ type: E.EVM,
39
58
  chainId: 43114,
40
59
  name: "Avalanche",
41
60
  cctpDomain: 1,
42
61
  logoURI: "/images/chains/avalanche.svg",
43
62
  explorer: "https://snowtrace.io"
44
- }, oe = {
45
- type: u.EVM,
63
+ }, ie = {
64
+ type: E.EVM,
46
65
  chainId: 43113,
47
66
  name: "Avalanche Fuji",
48
67
  cctpDomain: 1,
49
68
  logoURI: "/images/chains/avalanche.svg",
50
69
  explorer: "https://testnet.snowtrace.io"
51
- }, ie = {
52
- type: u.EVM,
70
+ }, ae = {
71
+ type: E.EVM,
53
72
  chainId: 8453,
54
73
  name: "Base",
55
74
  cctpDomain: 6,
56
75
  logoURI: "/images/chains/base.webp",
57
76
  explorer: "https://basescan.org"
58
- }, ae = {
59
- type: u.EVM,
77
+ }, re = {
78
+ type: E.EVM,
60
79
  chainId: 84532,
61
80
  name: "Base Sepolia",
62
81
  cctpDomain: 6,
63
82
  logoURI: "/images/chains/base.webp",
64
83
  explorer: "https://sepolia.basescan.org"
65
- }, re = {
66
- type: u.EVM,
84
+ }, ce = {
85
+ type: E.EVM,
67
86
  chainId: 56,
68
87
  name: "BNB Chain",
69
88
  cctpDomain: null,
70
89
  logoURI: "/images/chains/bsc.webp",
71
90
  explorer: "https://bscscan.com"
72
- }, os = {
73
- type: u.EVM,
91
+ }, rt = {
92
+ type: E.EVM,
74
93
  chainId: 42220,
75
94
  name: "Celo",
76
95
  cctpDomain: null,
77
96
  logoURI: "/images/chains/celo.svg",
78
97
  explorer: "https://celoscan.io"
79
- }, ce = {
80
- type: u.EVM,
98
+ }, de = {
99
+ type: E.EVM,
81
100
  chainId: 1,
82
101
  name: "Ethereum",
83
102
  cctpDomain: 0,
84
103
  logoURI: "/images/chains/ethereum.svg",
85
104
  explorer: "https://etherscan.io"
86
- }, de = {
87
- type: u.EVM,
105
+ }, le = {
106
+ type: E.EVM,
88
107
  chainId: 11155111,
89
108
  name: "Ethereum Sepolia",
90
109
  cctpDomain: 0,
91
110
  logoURI: "/images/chains/ethereum.svg",
92
111
  explorer: "https://sepolia.etherscan.io"
93
- }, le = {
94
- type: u.EVM,
112
+ }, me = {
113
+ type: E.EVM,
95
114
  chainId: 999,
96
115
  name: "HyperEVM",
97
116
  cctpDomain: 19,
98
117
  logoURI: "/images/chains/hyperevm.webp",
99
118
  explorer: "https://liquidscan.io"
100
- }, is = {
101
- type: u.EVM,
119
+ }, ct = {
120
+ type: E.EVM,
102
121
  chainId: 59144,
103
122
  name: "Linea",
104
123
  cctpDomain: 11,
105
124
  logoURI: "/images/chains/linea.svg",
106
125
  explorer: "https://lineascan.build"
107
- }, me = {
108
- type: u.EVM,
126
+ }, Ee = {
127
+ type: E.EVM,
109
128
  chainId: 1135,
110
129
  name: "Lisk",
111
130
  cctpDomain: null,
112
131
  logoURI: "/images/chains/lisk.png",
113
132
  explorer: "https://blockscout.lisk.com"
114
133
  }, ue = {
115
- type: u.EVM,
134
+ type: E.EVM,
116
135
  chainId: 15,
117
136
  name: "Monad",
118
137
  cctpDomain: 7,
119
138
  logoURI: "/images/chains/monad.png",
120
139
  explorer: "https://monadvision.com"
121
- }, ge = {
122
- type: u.EVM,
140
+ }, Te = {
141
+ type: E.EVM,
123
142
  chainId: 10143,
124
143
  name: "Monad Testnet",
125
144
  cctpDomain: null,
126
145
  logoURI: "/images/chains/monad.png",
127
146
  explorer: "https://testnet.monadvision.com"
128
- }, Ee = {
129
- type: u.EVM,
147
+ }, he = {
148
+ type: E.EVM,
130
149
  chainId: 10,
131
150
  name: "Optimism",
132
151
  cctpDomain: 2,
133
152
  logoURI: "/images/chains/optimism.svg",
134
153
  explorer: "https://optimistic.etherscan.io"
135
- }, he = {
136
- type: u.EVM,
154
+ }, ge = {
155
+ type: E.EVM,
137
156
  chainId: 11155420,
138
157
  name: "Optimism Testnet",
139
158
  cctpDomain: 2,
140
159
  logoURI: "/images/chains/optimism.svg",
141
160
  explorer: "https://testnet-explorer.optimism.io"
142
161
  }, fe = {
143
- type: u.EVM,
162
+ type: E.EVM,
144
163
  chainId: 137,
145
164
  name: "Polygon",
146
165
  cctpDomain: 7,
147
166
  logoURI: "/images/chains/polygon.svg",
148
167
  explorer: "https://polygonscan.com"
149
- }, Te = {
150
- type: u.STARKNET,
168
+ }, pe = {
169
+ type: E.STARKNET,
151
170
  chainId: "0x534e5f4d41494e",
152
171
  // SN_MAIN
153
172
  name: "Starknet",
154
173
  cctpDomain: 25,
155
174
  logoURI: "/images/chains/starknet.svg",
156
175
  explorer: ""
157
- }, pe = {
158
- type: u.STARKNET,
176
+ }, Se = {
177
+ type: E.STARKNET,
159
178
  chainId: "0x534e5f5345504f4c4941",
160
179
  // SN_SEPOLIA
161
180
  name: "Starknet Testnet",
162
181
  cctpDomain: null,
163
182
  logoURI: "/images/chains/starknet.svg",
164
183
  explorer: ""
165
- }, as = {
166
- type: u.EVM,
184
+ }, dt = {
185
+ type: E.EVM,
167
186
  chainId: 130,
168
187
  name: "Unichain",
169
188
  cctpDomain: 10,
170
189
  logoURI: "/images/chains/unichain.webp",
171
190
  explorer: ""
172
- }, rs = {
173
- type: u.EVM,
191
+ }, lt = {
192
+ type: E.EVM,
174
193
  chainId: 480,
175
194
  name: "Worldchain",
176
195
  cctpDomain: 14,
177
196
  logoURI: "/images/chains/worldchain.svg",
178
197
  explorer: ""
179
198
  };
180
- function C(e, { strict: s = !0 } = {}) {
181
- return !e || typeof e != "string" ? !1 : s ? /^0x[0-9a-fA-F]*$/.test(e) : e.startsWith("0x");
199
+ function y(e, { strict: t = !0 } = {}) {
200
+ return !e || typeof e != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(e) : e.startsWith("0x");
182
201
  }
183
- function k(e) {
184
- return C(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
202
+ function x(e) {
203
+ return y(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
185
204
  }
186
- const _ = "2.43.4";
187
- let I = {
188
- getDocsUrl: ({ docsBaseUrl: e, docsPath: s = "", docsSlug: t }) => s ? `${e ?? "https://viem.sh"}${s}${t ? `#${t}` : ""}` : void 0,
189
- version: `viem@${_}`
205
+ const L = "2.43.4";
206
+ let D = {
207
+ getDocsUrl: ({ docsBaseUrl: e, docsPath: t = "", docsSlug: s }) => t ? `${e ?? "https://viem.sh"}${t}${s ? `#${s}` : ""}` : void 0,
208
+ version: `viem@${L}`
190
209
  };
191
- class f extends Error {
192
- constructor(s, t = {}) {
193
- const o = t.cause instanceof f ? t.cause.details : t.cause?.message ? t.cause.message : t.details, i = t.cause instanceof f && t.cause.docsPath || t.docsPath, r = I.getDocsUrl?.({ ...t, docsPath: i }), a = [
194
- s || "An error occurred.",
210
+ class g extends Error {
211
+ constructor(t, s = {}) {
212
+ const o = s.cause instanceof g ? s.cause.details : s.cause?.message ? s.cause.message : s.details, i = s.cause instanceof g && s.cause.docsPath || s.docsPath, r = D.getDocsUrl?.({ ...s, docsPath: i }), a = [
213
+ t || "An error occurred.",
195
214
  "",
196
- ...t.metaMessages ? [...t.metaMessages, ""] : [],
215
+ ...s.metaMessages ? [...s.metaMessages, ""] : [],
197
216
  ...r ? [`Docs: ${r}`] : [],
198
217
  ...o ? [`Details: ${o}`] : [],
199
- ...I.version ? [`Version: ${I.version}`] : []
218
+ ...D.version ? [`Version: ${D.version}`] : []
200
219
  ].join(`
201
220
  `);
202
- super(a, t.cause ? { cause: t.cause } : void 0), Object.defineProperty(this, "details", {
221
+ super(a, s.cause ? { cause: s.cause } : void 0), Object.defineProperty(this, "details", {
203
222
  enumerable: !0,
204
223
  configurable: !0,
205
224
  writable: !0,
@@ -229,93 +248,93 @@ class f extends Error {
229
248
  configurable: !0,
230
249
  writable: !0,
231
250
  value: "BaseError"
232
- }), this.details = o, this.docsPath = i, this.metaMessages = t.metaMessages, this.name = t.name ?? this.name, this.shortMessage = s, this.version = _;
251
+ }), this.details = o, this.docsPath = i, this.metaMessages = s.metaMessages, this.name = s.name ?? this.name, this.shortMessage = t, this.version = L;
233
252
  }
234
- walk(s) {
235
- return L(this, s);
253
+ walk(t) {
254
+ return F(this, t);
236
255
  }
237
256
  }
238
- function L(e, s) {
239
- return s?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause !== void 0 ? L(e.cause, s) : s ? null : e;
257
+ function F(e, t) {
258
+ return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause !== void 0 ? F(e.cause, t) : t ? null : e;
240
259
  }
241
- class $ extends f {
242
- constructor({ size: s, targetSize: t, type: o }) {
243
- super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${s}) exceeds padding size (${t}).`, { name: "SizeExceedsPaddingSizeError" });
260
+ class $ extends g {
261
+ constructor({ size: t, targetSize: s, type: o }) {
262
+ super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${t}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
244
263
  }
245
264
  }
246
- function D(e, { dir: s, size: t = 32 } = {}) {
247
- return typeof e == "string" ? Se(e, { dir: s, size: t }) : be(e, { dir: s, size: t });
265
+ function U(e, { dir: t, size: s = 32 } = {}) {
266
+ return typeof e == "string" ? Ae(e, { dir: t, size: s }) : be(e, { dir: t, size: s });
248
267
  }
249
- function Se(e, { dir: s, size: t = 32 } = {}) {
250
- if (t === null)
268
+ function Ae(e, { dir: t, size: s = 32 } = {}) {
269
+ if (s === null)
251
270
  return e;
252
271
  const o = e.replace("0x", "");
253
- if (o.length > t * 2)
272
+ if (o.length > s * 2)
254
273
  throw new $({
255
274
  size: Math.ceil(o.length / 2),
256
- targetSize: t,
275
+ targetSize: s,
257
276
  type: "hex"
258
277
  });
259
- return `0x${o[s === "right" ? "padEnd" : "padStart"](t * 2, "0")}`;
278
+ return `0x${o[t === "right" ? "padEnd" : "padStart"](s * 2, "0")}`;
260
279
  }
261
- function be(e, { dir: s, size: t = 32 } = {}) {
262
- if (t === null)
280
+ function be(e, { dir: t, size: s = 32 } = {}) {
281
+ if (s === null)
263
282
  return e;
264
- if (e.length > t)
283
+ if (e.length > s)
265
284
  throw new $({
266
285
  size: e.length,
267
- targetSize: t,
286
+ targetSize: s,
268
287
  type: "bytes"
269
288
  });
270
- const o = new Uint8Array(t);
271
- for (let i = 0; i < t; i++) {
272
- const r = s === "right";
273
- o[r ? i : t - i - 1] = e[r ? i : e.length - i - 1];
289
+ const o = new Uint8Array(s);
290
+ for (let i = 0; i < s; i++) {
291
+ const r = t === "right";
292
+ o[r ? i : s - i - 1] = e[r ? i : e.length - i - 1];
274
293
  }
275
294
  return o;
276
295
  }
277
- class Ae extends f {
278
- constructor({ max: s, min: t, signed: o, size: i, value: r }) {
279
- super(`Number "${r}" is not in safe ${i ? `${i * 8}-bit ${o ? "signed" : "unsigned"} ` : ""}integer range ${s ? `(${t} to ${s})` : `(above ${t})`}`, { name: "IntegerOutOfRangeError" });
296
+ class Ie extends g {
297
+ constructor({ max: t, min: s, signed: o, size: i, value: r }) {
298
+ super(`Number "${r}" is not in safe ${i ? `${i * 8}-bit ${o ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${s} to ${t})` : `(above ${s})`}`, { name: "IntegerOutOfRangeError" });
280
299
  }
281
300
  }
282
- class Ue extends f {
283
- constructor({ givenSize: s, maxSize: t }) {
284
- super(`Size cannot exceed ${t} bytes. Given size: ${s} bytes.`, { name: "SizeOverflowError" });
301
+ class Ue extends g {
302
+ constructor({ givenSize: t, maxSize: s }) {
303
+ super(`Size cannot exceed ${s} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
285
304
  }
286
305
  }
287
- function N(e, { size: s }) {
288
- if (k(e) > s)
306
+ function C(e, { size: t }) {
307
+ if (x(e) > t)
289
308
  throw new Ue({
290
- givenSize: k(e),
291
- maxSize: s
309
+ givenSize: x(e),
310
+ maxSize: t
292
311
  });
293
312
  }
294
- function De(e, s = {}) {
295
- const { signed: t, size: o } = s, i = BigInt(e);
313
+ function De(e, t = {}) {
314
+ const { signed: s, size: o } = t, i = BigInt(e);
296
315
  let r;
297
- o ? t ? r = (1n << BigInt(o) * 8n - 1n) - 1n : r = 2n ** (BigInt(o) * 8n) - 1n : typeof e == "number" && (r = BigInt(Number.MAX_SAFE_INTEGER));
298
- const a = typeof r == "bigint" && t ? -r - 1n : 0;
316
+ o ? s ? r = (1n << BigInt(o) * 8n - 1n) - 1n : r = 2n ** (BigInt(o) * 8n) - 1n : typeof e == "number" && (r = BigInt(Number.MAX_SAFE_INTEGER));
317
+ const a = typeof r == "bigint" && s ? -r - 1n : 0;
299
318
  if (r && i > r || i < a) {
300
- const E = typeof e == "bigint" ? "n" : "";
301
- throw new Ae({
302
- max: r ? `${r}${E}` : void 0,
303
- min: `${a}${E}`,
304
- signed: t,
319
+ const T = typeof e == "bigint" ? "n" : "";
320
+ throw new Ie({
321
+ max: r ? `${r}${T}` : void 0,
322
+ min: `${a}${T}`,
323
+ signed: s,
305
324
  size: o,
306
- value: `${e}${E}`
325
+ value: `${e}${T}`
307
326
  });
308
327
  }
309
- const l = `0x${(t && i < 0 ? (1n << BigInt(o * 8)) + BigInt(i) : i).toString(16)}`;
310
- return o ? D(l, { size: o }) : l;
328
+ const l = `0x${(s && i < 0 ? (1n << BigInt(o * 8)) + BigInt(i) : i).toString(16)}`;
329
+ return o ? U(l, { size: o }) : l;
311
330
  }
312
- const Ie = /* @__PURE__ */ new TextEncoder();
313
- function ye(e, s = {}) {
314
- return typeof e == "number" || typeof e == "bigint" ? Ce(e, s) : typeof e == "boolean" ? Re(e, s) : C(e) ? P(e, s) : V(e, s);
331
+ const Re = /* @__PURE__ */ new TextEncoder();
332
+ function Ne(e, t = {}) {
333
+ return typeof e == "number" || typeof e == "bigint" ? Ce(e, t) : typeof e == "boolean" ? ye(e, t) : y(e) ? P(e, t) : V(e, t);
315
334
  }
316
- function Re(e, s = {}) {
317
- const t = new Uint8Array(1);
318
- return t[0] = Number(e), typeof s.size == "number" ? (N(t, { size: s.size }), D(t, { size: s.size })) : t;
335
+ function ye(e, t = {}) {
336
+ const s = new Uint8Array(1);
337
+ return s[0] = Number(e), typeof t.size == "number" ? (C(s, { size: t.size }), U(s, { size: t.size })) : s;
319
338
  }
320
339
  const h = {
321
340
  zero: 48,
@@ -333,154 +352,154 @@ function B(e) {
333
352
  if (e >= h.a && e <= h.f)
334
353
  return e - (h.a - 10);
335
354
  }
336
- function P(e, s = {}) {
337
- let t = e;
338
- s.size && (N(t, { size: s.size }), t = D(t, { dir: "right", size: s.size }));
339
- let o = t.slice(2);
355
+ function P(e, t = {}) {
356
+ let s = e;
357
+ t.size && (C(s, { size: t.size }), s = U(s, { dir: "right", size: t.size }));
358
+ let o = s.slice(2);
340
359
  o.length % 2 && (o = `0${o}`);
341
360
  const i = o.length / 2, r = new Uint8Array(i);
342
361
  for (let a = 0, l = 0; a < i; a++) {
343
- const E = B(o.charCodeAt(l++)), T = B(o.charCodeAt(l++));
344
- if (E === void 0 || T === void 0)
345
- throw new f(`Invalid byte sequence ("${o[l - 2]}${o[l - 1]}" in "${o}").`);
346
- r[a] = E * 16 + T;
362
+ const T = B(o.charCodeAt(l++)), f = B(o.charCodeAt(l++));
363
+ if (T === void 0 || f === void 0)
364
+ throw new g(`Invalid byte sequence ("${o[l - 2]}${o[l - 1]}" in "${o}").`);
365
+ r[a] = T * 16 + f;
347
366
  }
348
367
  return r;
349
368
  }
350
- function Ce(e, s) {
351
- const t = De(e, s);
352
- return P(t);
369
+ function Ce(e, t) {
370
+ const s = De(e, t);
371
+ return P(s);
353
372
  }
354
- function V(e, s = {}) {
355
- const t = Ie.encode(e);
356
- return typeof s.size == "number" ? (N(t, { size: s.size }), D(t, { dir: "right", size: s.size })) : t;
373
+ function V(e, t = {}) {
374
+ const s = Re.encode(e);
375
+ return typeof t.size == "number" ? (C(s, { size: t.size }), U(s, { dir: "right", size: t.size })) : s;
357
376
  }
358
- const A = /* @__PURE__ */ BigInt(2 ** 32 - 1), M = /* @__PURE__ */ BigInt(32);
359
- function Ne(e, s = !1) {
360
- return s ? { h: Number(e & A), l: Number(e >> M & A) } : { h: Number(e >> M & A) | 0, l: Number(e & A) | 0 };
377
+ const b = /* @__PURE__ */ BigInt(2 ** 32 - 1), k = /* @__PURE__ */ BigInt(32);
378
+ function Me(e, t = !1) {
379
+ return t ? { h: Number(e & b), l: Number(e >> k & b) } : { h: Number(e >> k & b) | 0, l: Number(e & b) | 0 };
361
380
  }
362
- function xe(e, s = !1) {
363
- const t = e.length;
364
- let o = new Uint32Array(t), i = new Uint32Array(t);
365
- for (let r = 0; r < t; r++) {
366
- const { h: a, l } = Ne(e[r], s);
381
+ function xe(e, t = !1) {
382
+ const s = e.length;
383
+ let o = new Uint32Array(s), i = new Uint32Array(s);
384
+ for (let r = 0; r < s; r++) {
385
+ const { h: a, l } = Me(e[r], t);
367
386
  [o[r], i[r]] = [a, l];
368
387
  }
369
388
  return [o, i];
370
389
  }
371
- const ke = (e, s, t) => e << t | s >>> 32 - t, Be = (e, s, t) => s << t | e >>> 32 - t, Me = (e, s, t) => s << t - 32 | e >>> 64 - t, we = (e, s, t) => e << t - 32 | s >>> 64 - t;
390
+ const Be = (e, t, s) => e << s | t >>> 32 - s, ke = (e, t, s) => t << s | e >>> 32 - s, we = (e, t, s) => t << s - 32 | e >>> 64 - s, ve = (e, t, s) => e << s - 32 | t >>> 64 - s;
372
391
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
373
- function ve(e) {
392
+ function Oe(e) {
374
393
  return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
375
394
  }
376
395
  function w(e) {
377
396
  if (!Number.isSafeInteger(e) || e < 0)
378
397
  throw new Error("positive integer expected, got " + e);
379
398
  }
380
- function U(e, ...s) {
381
- if (!ve(e))
399
+ function I(e, ...t) {
400
+ if (!Oe(e))
382
401
  throw new Error("Uint8Array expected");
383
- if (s.length > 0 && !s.includes(e.length))
384
- throw new Error("Uint8Array expected of length " + s + ", got length=" + e.length);
402
+ if (t.length > 0 && !t.includes(e.length))
403
+ throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
385
404
  }
386
- function v(e, s = !0) {
405
+ function v(e, t = !0) {
387
406
  if (e.destroyed)
388
407
  throw new Error("Hash instance has been destroyed");
389
- if (s && e.finished)
408
+ if (t && e.finished)
390
409
  throw new Error("Hash#digest() has already been called");
391
410
  }
392
- function Oe(e, s) {
393
- U(e);
394
- const t = s.outputLen;
395
- if (e.length < t)
396
- throw new Error("digestInto() expects output buffer of length at least " + t);
411
+ function He(e, t) {
412
+ I(e);
413
+ const s = t.outputLen;
414
+ if (e.length < s)
415
+ throw new Error("digestInto() expects output buffer of length at least " + s);
397
416
  }
398
- function He(e) {
417
+ function _e(e) {
399
418
  return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
400
419
  }
401
420
  function K(...e) {
402
- for (let s = 0; s < e.length; s++)
403
- e[s].fill(0);
421
+ for (let t = 0; t < e.length; t++)
422
+ e[t].fill(0);
404
423
  }
405
- const Fe = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
406
- function _e(e) {
424
+ const Le = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
425
+ function Fe(e) {
407
426
  return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
408
427
  }
409
- function Le(e) {
410
- for (let s = 0; s < e.length; s++)
411
- e[s] = _e(e[s]);
428
+ function $e(e) {
429
+ for (let t = 0; t < e.length; t++)
430
+ e[t] = Fe(e[t]);
412
431
  return e;
413
432
  }
414
- const O = Fe ? (e) => e : Le;
415
- function $e(e) {
433
+ const O = Le ? (e) => e : $e;
434
+ function Pe(e) {
416
435
  if (typeof e != "string")
417
436
  throw new Error("string expected");
418
437
  return new Uint8Array(new TextEncoder().encode(e));
419
438
  }
420
439
  function z(e) {
421
- return typeof e == "string" && (e = $e(e)), U(e), e;
440
+ return typeof e == "string" && (e = Pe(e)), I(e), e;
422
441
  }
423
- class Pe {
442
+ class Ve {
424
443
  }
425
- function Ve(e) {
426
- const s = (o) => e().update(z(o)).digest(), t = e();
427
- return s.outputLen = t.outputLen, s.blockLen = t.blockLen, s.create = () => e(), s;
444
+ function Ke(e) {
445
+ const t = (o) => e().update(z(o)).digest(), s = e();
446
+ return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = () => e(), t;
428
447
  }
429
- const Ke = BigInt(0), S = BigInt(1), ze = BigInt(2), We = BigInt(7), je = BigInt(256), Ye = BigInt(113), W = [], j = [], Y = [];
430
- for (let e = 0, s = S, t = 1, o = 0; e < 24; e++) {
431
- [t, o] = [o, (2 * t + 3 * o) % 5], W.push(2 * (5 * o + t)), j.push((e + 1) * (e + 2) / 2 % 64);
432
- let i = Ke;
448
+ const ze = BigInt(0), S = BigInt(1), We = BigInt(2), Ye = BigInt(7), je = BigInt(256), Ge = BigInt(113), W = [], Y = [], j = [];
449
+ for (let e = 0, t = S, s = 1, o = 0; e < 24; e++) {
450
+ [s, o] = [o, (2 * s + 3 * o) % 5], W.push(2 * (5 * o + s)), Y.push((e + 1) * (e + 2) / 2 % 64);
451
+ let i = ze;
433
452
  for (let r = 0; r < 7; r++)
434
- s = (s << S ^ (s >> We) * Ye) % je, s & ze && (i ^= S << (S << /* @__PURE__ */ BigInt(r)) - S);
435
- Y.push(i);
453
+ t = (t << S ^ (t >> Ye) * Ge) % je, t & We && (i ^= S << (S << /* @__PURE__ */ BigInt(r)) - S);
454
+ j.push(i);
436
455
  }
437
- const G = xe(Y, !0), Ge = G[0], Xe = G[1], H = (e, s, t) => t > 32 ? Me(e, s, t) : ke(e, s, t), F = (e, s, t) => t > 32 ? we(e, s, t) : Be(e, s, t);
438
- function qe(e, s = 24) {
439
- const t = new Uint32Array(10);
440
- for (let o = 24 - s; o < 24; o++) {
456
+ const G = xe(j, !0), Xe = G[0], qe = G[1], H = (e, t, s) => s > 32 ? we(e, t, s) : Be(e, t, s), _ = (e, t, s) => s > 32 ? ve(e, t, s) : ke(e, t, s);
457
+ function Je(e, t = 24) {
458
+ const s = new Uint32Array(10);
459
+ for (let o = 24 - t; o < 24; o++) {
441
460
  for (let a = 0; a < 10; a++)
442
- t[a] = e[a] ^ e[a + 10] ^ e[a + 20] ^ e[a + 30] ^ e[a + 40];
461
+ s[a] = e[a] ^ e[a + 10] ^ e[a + 20] ^ e[a + 30] ^ e[a + 40];
443
462
  for (let a = 0; a < 10; a += 2) {
444
- const l = (a + 8) % 10, E = (a + 2) % 10, T = t[E], p = t[E + 1], Z = H(T, p, 1) ^ t[l], ee = F(T, p, 1) ^ t[l + 1];
445
- for (let b = 0; b < 50; b += 10)
446
- e[a + b] ^= Z, e[a + b + 1] ^= ee;
463
+ const l = (a + 8) % 10, T = (a + 2) % 10, f = s[T], p = s[T + 1], Z = H(f, p, 1) ^ s[l], ee = _(f, p, 1) ^ s[l + 1];
464
+ for (let A = 0; A < 50; A += 10)
465
+ e[a + A] ^= Z, e[a + A + 1] ^= ee;
447
466
  }
448
467
  let i = e[2], r = e[3];
449
468
  for (let a = 0; a < 24; a++) {
450
- const l = j[a], E = H(i, r, l), T = F(i, r, l), p = W[a];
451
- i = e[p], r = e[p + 1], e[p] = E, e[p + 1] = T;
469
+ const l = Y[a], T = H(i, r, l), f = _(i, r, l), p = W[a];
470
+ i = e[p], r = e[p + 1], e[p] = T, e[p + 1] = f;
452
471
  }
453
472
  for (let a = 0; a < 50; a += 10) {
454
473
  for (let l = 0; l < 10; l++)
455
- t[l] = e[a + l];
474
+ s[l] = e[a + l];
456
475
  for (let l = 0; l < 10; l++)
457
- e[a + l] ^= ~t[(l + 2) % 10] & t[(l + 4) % 10];
476
+ e[a + l] ^= ~s[(l + 2) % 10] & s[(l + 4) % 10];
458
477
  }
459
- e[0] ^= Ge[o], e[1] ^= Xe[o];
478
+ e[0] ^= Xe[o], e[1] ^= qe[o];
460
479
  }
461
- K(t);
480
+ K(s);
462
481
  }
463
- class x extends Pe {
482
+ class M extends Ve {
464
483
  // NOTE: we accept arguments in bytes instead of bits here.
465
- constructor(s, t, o, i = !1, r = 24) {
466
- if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = s, this.suffix = t, this.outputLen = o, this.enableXOF = i, this.rounds = r, w(o), !(0 < s && s < 200))
484
+ constructor(t, s, o, i = !1, r = 24) {
485
+ if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = s, this.outputLen = o, this.enableXOF = i, this.rounds = r, w(o), !(0 < t && t < 200))
467
486
  throw new Error("only keccak-f1600 function is supported");
468
- this.state = new Uint8Array(200), this.state32 = He(this.state);
487
+ this.state = new Uint8Array(200), this.state32 = _e(this.state);
469
488
  }
470
489
  clone() {
471
490
  return this._cloneInto();
472
491
  }
473
492
  keccak() {
474
- O(this.state32), qe(this.state32, this.rounds), O(this.state32), this.posOut = 0, this.pos = 0;
493
+ O(this.state32), Je(this.state32, this.rounds), O(this.state32), this.posOut = 0, this.pos = 0;
475
494
  }
476
- update(s) {
477
- v(this), s = z(s), U(s);
478
- const { blockLen: t, state: o } = this, i = s.length;
495
+ update(t) {
496
+ v(this), t = z(t), I(t);
497
+ const { blockLen: s, state: o } = this, i = t.length;
479
498
  for (let r = 0; r < i; ) {
480
- const a = Math.min(t - this.pos, i - r);
499
+ const a = Math.min(s - this.pos, i - r);
481
500
  for (let l = 0; l < a; l++)
482
- o[this.pos++] ^= s[r++];
483
- this.pos === t && this.keccak();
501
+ o[this.pos++] ^= t[r++];
502
+ this.pos === s && this.keccak();
484
503
  }
485
504
  return this;
486
505
  }
@@ -488,31 +507,31 @@ class x extends Pe {
488
507
  if (this.finished)
489
508
  return;
490
509
  this.finished = !0;
491
- const { state: s, suffix: t, pos: o, blockLen: i } = this;
492
- s[o] ^= t, (t & 128) !== 0 && o === i - 1 && this.keccak(), s[i - 1] ^= 128, this.keccak();
510
+ const { state: t, suffix: s, pos: o, blockLen: i } = this;
511
+ t[o] ^= s, (s & 128) !== 0 && o === i - 1 && this.keccak(), t[i - 1] ^= 128, this.keccak();
493
512
  }
494
- writeInto(s) {
495
- v(this, !1), U(s), this.finish();
496
- const t = this.state, { blockLen: o } = this;
497
- for (let i = 0, r = s.length; i < r; ) {
513
+ writeInto(t) {
514
+ v(this, !1), I(t), this.finish();
515
+ const s = this.state, { blockLen: o } = this;
516
+ for (let i = 0, r = t.length; i < r; ) {
498
517
  this.posOut >= o && this.keccak();
499
518
  const a = Math.min(o - this.posOut, r - i);
500
- s.set(t.subarray(this.posOut, this.posOut + a), i), this.posOut += a, i += a;
519
+ t.set(s.subarray(this.posOut, this.posOut + a), i), this.posOut += a, i += a;
501
520
  }
502
- return s;
521
+ return t;
503
522
  }
504
- xofInto(s) {
523
+ xofInto(t) {
505
524
  if (!this.enableXOF)
506
525
  throw new Error("XOF is not possible for this instance");
507
- return this.writeInto(s);
526
+ return this.writeInto(t);
508
527
  }
509
- xof(s) {
510
- return w(s), this.xofInto(new Uint8Array(s));
528
+ xof(t) {
529
+ return w(t), this.xofInto(new Uint8Array(t));
511
530
  }
512
- digestInto(s) {
513
- if (Oe(s, this), this.finished)
531
+ digestInto(t) {
532
+ if (He(t, this), this.finished)
514
533
  throw new Error("digest() was already called");
515
- return this.writeInto(s), this.destroy(), s;
534
+ return this.writeInto(t), this.destroy(), t;
516
535
  }
517
536
  digest() {
518
537
  return this.digestInto(new Uint8Array(this.outputLen));
@@ -520,18 +539,18 @@ class x extends Pe {
520
539
  destroy() {
521
540
  this.destroyed = !0, K(this.state);
522
541
  }
523
- _cloneInto(s) {
524
- const { blockLen: t, suffix: o, outputLen: i, rounds: r, enableXOF: a } = this;
525
- return s || (s = new x(t, o, i, a, r)), s.state32.set(this.state32), s.pos = this.pos, s.posOut = this.posOut, s.finished = this.finished, s.rounds = r, s.suffix = o, s.outputLen = i, s.enableXOF = a, s.destroyed = this.destroyed, s;
542
+ _cloneInto(t) {
543
+ const { blockLen: s, suffix: o, outputLen: i, rounds: r, enableXOF: a } = this;
544
+ return t || (t = new M(s, o, i, a, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = o, t.outputLen = i, t.enableXOF = a, t.destroyed = this.destroyed, t;
526
545
  }
527
546
  }
528
- const Je = (e, s, t) => Ve(() => new x(s, e, t)), Qe = Je(1, 136, 256 / 8);
529
- function Ze(e, s) {
530
- return Qe(C(e, { strict: !1 }) ? ye(e) : e);
547
+ const Qe = (e, t, s) => Ke(() => new M(t, e, s)), Ze = Qe(1, 136, 256 / 8);
548
+ function et(e, t) {
549
+ return Ze(y(e, { strict: !1 }) ? Ne(e) : e);
531
550
  }
532
- class es extends f {
533
- constructor({ address: s }) {
534
- super(`Address "${s}" is invalid.`, {
551
+ class tt extends g {
552
+ constructor({ address: t }) {
553
+ super(`Address "${t}" is invalid.`, {
535
554
  metaMessages: [
536
555
  "- Address must be a hex value of 20 bytes (40 hex characters).",
537
556
  "- Address must match its checksum counterpart."
@@ -541,48 +560,48 @@ class es extends f {
541
560
  }
542
561
  }
543
562
  class X extends Map {
544
- constructor(s) {
563
+ constructor(t) {
545
564
  super(), Object.defineProperty(this, "maxSize", {
546
565
  enumerable: !0,
547
566
  configurable: !0,
548
567
  writable: !0,
549
568
  value: void 0
550
- }), this.maxSize = s;
569
+ }), this.maxSize = t;
551
570
  }
552
- get(s) {
553
- const t = super.get(s);
554
- return super.has(s) && t !== void 0 && (this.delete(s), super.set(s, t)), t;
571
+ get(t) {
572
+ const s = super.get(t);
573
+ return super.has(t) && s !== void 0 && (this.delete(t), super.set(t, s)), s;
555
574
  }
556
- set(s, t) {
557
- if (super.set(s, t), this.maxSize && this.size > this.maxSize) {
575
+ set(t, s) {
576
+ if (super.set(t, s), this.maxSize && this.size > this.maxSize) {
558
577
  const o = this.keys().next().value;
559
578
  o && this.delete(o);
560
579
  }
561
580
  return this;
562
581
  }
563
582
  }
564
- const y = /* @__PURE__ */ new X(8192);
565
- function q(e, s) {
566
- if (y.has(`${e}.${s}`))
567
- return y.get(`${e}.${s}`);
568
- const t = e.substring(2).toLowerCase(), o = Ze(V(t)), i = t.split("");
583
+ const R = /* @__PURE__ */ new X(8192);
584
+ function q(e, t) {
585
+ if (R.has(`${e}.${t}`))
586
+ return R.get(`${e}.${t}`);
587
+ const s = e.substring(2).toLowerCase(), o = et(V(s)), i = s.split("");
569
588
  for (let a = 0; a < 40; a += 2)
570
589
  o[a >> 1] >> 4 >= 8 && i[a] && (i[a] = i[a].toUpperCase()), (o[a >> 1] & 15) >= 8 && i[a + 1] && (i[a + 1] = i[a + 1].toUpperCase());
571
590
  const r = `0x${i.join("")}`;
572
- return y.set(`${e}.${s}`, r), r;
591
+ return R.set(`${e}.${t}`, r), r;
573
592
  }
574
- function g(e, s) {
575
- if (!ts(e, { strict: !1 }))
576
- throw new es({ address: e });
577
- return q(e, s);
593
+ function u(e, t) {
594
+ if (!nt(e, { strict: !1 }))
595
+ throw new tt({ address: e });
596
+ return q(e, t);
578
597
  }
579
- const ss = /^0x[a-fA-F0-9]{40}$/, R = /* @__PURE__ */ new X(8192);
580
- function ts(e, s) {
581
- const { strict: t = !0 } = s ?? {}, o = `${e}.${t}`;
582
- if (R.has(o))
583
- return R.get(o);
584
- const i = ss.test(e) ? e.toLowerCase() === e ? !0 : t ? q(e) === e : !0 : !1;
585
- return R.set(o, i), i;
598
+ const st = /^0x[a-fA-F0-9]{40}$/, N = /* @__PURE__ */ new X(8192);
599
+ function nt(e, t) {
600
+ const { strict: s = !0 } = t ?? {}, o = `${e}.${s}`;
601
+ if (N.has(o))
602
+ return N.get(o);
603
+ const i = st.test(e) ? e.toLowerCase() === e ? !0 : s ? q(e) === e : !0 : !1;
604
+ return N.set(o, i), i;
586
605
  }
587
606
  const n = {
588
607
  USDC: "USDC",
@@ -595,10 +614,10 @@ const n = {
595
614
  STRK: "STRK",
596
615
  BNB: "BNB",
597
616
  LORDS: "LORDS"
598
- }, cs = n.USDC, d = {
617
+ }, mt = n.USDC, d = {
599
618
  [c.ARBITRUM]: {
600
619
  [n.DAI]: {
601
- address: g("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),
620
+ address: u("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),
602
621
  symbol: n.DAI,
603
622
  name: "Dai Stablecoin",
604
623
  decimals: 18,
@@ -614,7 +633,7 @@ const n = {
614
633
  /* ETH */
615
634
  },
616
635
  [n.USDC]: {
617
- address: g("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
636
+ address: u("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
618
637
  symbol: n.USDC,
619
638
  name: "USD Coin",
620
639
  decimals: 6,
@@ -622,7 +641,7 @@ const n = {
622
641
  /* USDC */
623
642
  },
624
643
  [n.USDT]: {
625
- address: g("0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),
644
+ address: u("0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),
626
645
  symbol: n.USDT,
627
646
  name: "Tether USD",
628
647
  decimals: 6,
@@ -630,7 +649,7 @@ const n = {
630
649
  /* USDT */
631
650
  },
632
651
  [n.WETH]: {
633
- address: g("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),
652
+ address: u("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),
634
653
  symbol: n.WETH,
635
654
  name: "Wrapped Ether",
636
655
  decimals: 18,
@@ -640,7 +659,7 @@ const n = {
640
659
  },
641
660
  [c.ARBITRUM_TESTNET]: {
642
661
  [n.USDC]: {
643
- address: g("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
662
+ address: u("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
644
663
  symbol: n.USDC,
645
664
  name: "USD Coin",
646
665
  fiatISO: "USD",
@@ -659,7 +678,7 @@ const n = {
659
678
  /* DAI */
660
679
  },
661
680
  [n.USDC]: {
662
- address: g("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
681
+ address: u("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
663
682
  symbol: n.USDC,
664
683
  name: "USD Coin",
665
684
  fiatISO: "USD",
@@ -686,7 +705,7 @@ const n = {
686
705
  },
687
706
  [c.AVALANCHE_TESTNET]: {
688
707
  [n.USDC]: {
689
- address: g("0x5425890298aed601595a70AB815c96711a31Bc65"),
708
+ address: u("0x5425890298aed601595a70AB815c96711a31Bc65"),
690
709
  symbol: n.USDC,
691
710
  name: "USD Coin",
692
711
  fiatISO: "USD",
@@ -721,7 +740,7 @@ const n = {
721
740
  /* EURC */
722
741
  },
723
742
  [n.USDC]: {
724
- address: g("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
743
+ address: u("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
725
744
  symbol: n.USDC,
726
745
  name: "USD Coin",
727
746
  fiatISO: "USD",
@@ -730,7 +749,7 @@ const n = {
730
749
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
731
750
  },
732
751
  [n.WETH]: {
733
- address: g("0x4200000000000000000000000000000000000006"),
752
+ address: u("0x4200000000000000000000000000000000000006"),
734
753
  symbol: n.WETH,
735
754
  name: "Wrapped Ether",
736
755
  decimals: 18,
@@ -740,7 +759,7 @@ const n = {
740
759
  },
741
760
  [c.BASE_TESTNET]: {
742
761
  [n.USDC]: {
743
- address: g("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
762
+ address: u("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
744
763
  symbol: n.USDC,
745
764
  name: "USD Coin",
746
765
  fiatISO: "USD",
@@ -783,7 +802,7 @@ const n = {
783
802
  /* ETH */
784
803
  },
785
804
  [n.USDC]: {
786
- address: g("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
805
+ address: u("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
787
806
  symbol: n.USDC,
788
807
  decimals: 18,
789
808
  name: "USD Coin",
@@ -809,7 +828,7 @@ const n = {
809
828
  /* BUSD */
810
829
  },
811
830
  [n.DAI]: {
812
- address: g("0x6B175474E89094C44Da98b954EedeAC495271d0F"),
831
+ address: u("0x6B175474E89094C44Da98b954EedeAC495271d0F"),
813
832
  symbol: n.DAI,
814
833
  name: "Dai Stablecoin",
815
834
  decimals: 18,
@@ -841,7 +860,7 @@ const n = {
841
860
  /* STRK */
842
861
  },
843
862
  [n.USDC]: {
844
- address: g("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
863
+ address: u("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
845
864
  symbol: n.USDC,
846
865
  name: "USD Coin",
847
866
  decimals: 6,
@@ -849,7 +868,7 @@ const n = {
849
868
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
850
869
  },
851
870
  [n.USDT]: {
852
- address: g("0xdAC17F958D2ee523a2206206994597C13D831ec7"),
871
+ address: u("0xdAC17F958D2ee523a2206206994597C13D831ec7"),
853
872
  symbol: n.USDT,
854
873
  name: "Tether USD",
855
874
  decimals: 6,
@@ -857,7 +876,7 @@ const n = {
857
876
  /* USDT */
858
877
  },
859
878
  [n.WETH]: {
860
- address: g("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),
879
+ address: u("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),
861
880
  symbol: n.WETH,
862
881
  name: "Wrapped Ether",
863
882
  decimals: 18,
@@ -867,7 +886,7 @@ const n = {
867
886
  },
868
887
  [c.ETHEREUM_TESTNET]: {
869
888
  [n.USDC]: {
870
- address: g("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
889
+ address: u("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
871
890
  symbol: n.USDC,
872
891
  decimals: 6,
873
892
  name: "USD Coin",
@@ -1061,7 +1080,7 @@ const n = {
1061
1080
  /* USDC */
1062
1081
  }
1063
1082
  }
1064
- }, ds = {
1083
+ }, Et = {
1065
1084
  ARBITRUM: d[c.ARBITRUM],
1066
1085
  ARBITRUM_TESTNET: d[c.ARBITRUM_TESTNET],
1067
1086
  AVALANCHE: d[c.AVALANCHE],
@@ -1072,49 +1091,49 @@ const n = {
1072
1091
  ETHEREUM: d[c.ETHEREUM],
1073
1092
  ETHEREUM_TESTNET: d[c.ETHEREUM_TESTNET],
1074
1093
  STARKNET: d[c.STARKNET]
1075
- }, ls = {
1094
+ }, ut = {
1076
1095
  ARBITRUM_MAINNET: {
1077
1096
  ...se,
1078
1097
  tokens: d[c.ARBITRUM]
1079
1098
  },
1080
1099
  ARBITRUM_TESTNET: {
1081
- ...te,
1100
+ ...ne,
1082
1101
  tokens: d[c.ARBITRUM_TESTNET]
1083
1102
  },
1084
1103
  AVALANCHE_MAINNET: {
1085
- ...ne,
1104
+ ...oe,
1086
1105
  tokens: d[c.AVALANCHE]
1087
1106
  },
1088
1107
  AVALANCHE_TESTNET: {
1089
- ...oe,
1108
+ ...ie,
1090
1109
  tokens: d[c.AVALANCHE_TESTNET]
1091
1110
  },
1092
1111
  BASE_MAINNET: {
1093
- ...ie,
1112
+ ...ae,
1094
1113
  tokens: d[c.BASE]
1095
1114
  },
1096
1115
  BASE_TESTNET: {
1097
- ...ae,
1116
+ ...re,
1098
1117
  tokens: d[c.BASE_TESTNET]
1099
1118
  },
1100
1119
  BSC_MAINNET: {
1101
- ...re,
1120
+ ...ce,
1102
1121
  tokens: d[c.BSC]
1103
1122
  },
1104
1123
  ETHEREUM_MAINNET: {
1105
- ...ce,
1124
+ ...de,
1106
1125
  tokens: d[c.ETHEREUM]
1107
1126
  },
1108
1127
  ETHEREUM_TESTNET: {
1109
- ...de,
1128
+ ...le,
1110
1129
  tokens: d[c.ETHEREUM_TESTNET]
1111
1130
  },
1112
1131
  HYPEREVM_MAINNET: {
1113
- ...le,
1132
+ ...me,
1114
1133
  tokens: d[c.HYPEREVM]
1115
1134
  },
1116
1135
  LISK_MAINNET: {
1117
- ...me,
1136
+ ...Ee,
1118
1137
  tokens: d[c.LISK]
1119
1138
  },
1120
1139
  MONAD_MAINNET: {
@@ -1122,15 +1141,15 @@ const n = {
1122
1141
  tokens: d[c.MONAD]
1123
1142
  },
1124
1143
  MONAD_TESTNET: {
1125
- ...ge,
1144
+ ...Te,
1126
1145
  tokens: d[c.MONAD_TESTNET]
1127
1146
  },
1128
1147
  OPTIMISM_MAINNET: {
1129
- ...Ee,
1148
+ ...he,
1130
1149
  tokens: d[c.OPTIMISM]
1131
1150
  },
1132
1151
  OPTIMISM_TESTNET: {
1133
- ...he,
1152
+ ...ge,
1134
1153
  tokens: d[c.OPTIMISM_TESTNET]
1135
1154
  },
1136
1155
  POLYGON_MAINNET: {
@@ -1138,22 +1157,42 @@ const n = {
1138
1157
  tokens: d[c.POLYGON]
1139
1158
  },
1140
1159
  STARKNET_MAINNET: {
1141
- ...Te,
1160
+ ...pe,
1142
1161
  tokens: d[c.STARKNET]
1143
1162
  },
1144
1163
  STARKNET_TESTNET: {
1145
- ...pe,
1164
+ ...Se,
1146
1165
  tokens: d[c.STARKNET_TESTNET]
1147
1166
  }
1148
- };
1149
- function ms(e, s) {
1150
- if (e.symbol !== s)
1167
+ }, ot = new Set(Object.values(c));
1168
+ function Tt(e) {
1169
+ if (it(e))
1170
+ return e;
1171
+ const t = c[e];
1172
+ if (!t)
1173
+ throw new Error(`Invalid chain: ${e}. Chain must be a valid chain alias or internal chain value from Chains.`);
1174
+ return t;
1175
+ }
1176
+ function ht(e) {
1177
+ for (const [t, s] of Object.entries(c))
1178
+ if (s === e)
1179
+ return t;
1180
+ throw new Error(`Invalid internal chain value: ${e}. Internal chain value must be a valid value from InternalChains.`);
1181
+ }
1182
+ function gt(e) {
1183
+ return e in te;
1184
+ }
1185
+ function it(e) {
1186
+ return ot.has(e);
1187
+ }
1188
+ function ft(e, t) {
1189
+ if (e.symbol !== t)
1151
1190
  throw new Error(
1152
- `Token symbol mismatch: token is ${e.symbol}, tokenSymbol is ${s}. The token symbol must match the tokenSymbol parameter.`
1191
+ `Token symbol mismatch: token is ${e.symbol}, tokenSymbol is ${t}. The token symbol must match the tokenSymbol parameter.`
1153
1192
  );
1154
1193
  }
1155
- function ns(e, s) {
1156
- const t = s.toLowerCase().trim(), o = d[e];
1194
+ function at(e, t) {
1195
+ const s = t.toLowerCase().trim(), o = d[e];
1157
1196
  if (!o)
1158
1197
  throw new Error(
1159
1198
  `Chain not found: ${e}. The chain key must be a valid chain identifier.`
@@ -1161,52 +1200,52 @@ function ns(e, s) {
1161
1200
  let i;
1162
1201
  for (const r in o) {
1163
1202
  const a = o[r];
1164
- if (a && a.address.toLowerCase() === t.toLowerCase()) {
1203
+ if (a && a.address.toLowerCase() === s.toLowerCase()) {
1165
1204
  i = a;
1166
1205
  break;
1167
1206
  }
1168
1207
  }
1169
1208
  if (!i)
1170
1209
  throw new Error(
1171
- `Token address mismatch: address ${s} does not exist on chain ${e}. The token address must be a valid token address on the specified chain.`
1210
+ `Token address mismatch: address ${t} does not exist on chain ${e}. The token address must be a valid token address on the specified chain.`
1172
1211
  );
1173
1212
  return i;
1174
1213
  }
1175
- function us(e, s) {
1176
- if (e.symbol !== s)
1214
+ function pt(e, t) {
1215
+ if (e.symbol !== t)
1177
1216
  throw new Error(
1178
- `Token symbol mismatch: token symbol is "${e.symbol}", expected "${s}". The token symbol must match the expected token symbol.`
1217
+ `Token symbol mismatch: token symbol is "${e.symbol}", expected "${t}". The token symbol must match the expected token symbol.`
1179
1218
  );
1180
1219
  }
1181
- function gs(e, s, t) {
1182
- const o = ns(e, s);
1183
- if (o.symbol !== t)
1220
+ function St(e, t, s) {
1221
+ const o = at(e, t);
1222
+ if (o.symbol !== s)
1184
1223
  throw new Error(
1185
- `Token address and symbol mismatch: address ${s} on chain ${e} corresponds to token "${o.symbol}", but expected "${t}". The token address must correspond to a token with the expected symbol on the specified chain.`
1224
+ `Token address and symbol mismatch: address ${t} on chain ${e} corresponds to token "${o.symbol}", but expected "${s}". The token address must correspond to a token with the expected symbol on the specified chain.`
1186
1225
  );
1187
1226
  return o;
1188
1227
  }
1189
- function J(e, s) {
1190
- return d[e]?.[s];
1228
+ function J(e, t) {
1229
+ return d[e]?.[t];
1191
1230
  }
1192
- function Es(e, s) {
1193
- return J(e, s)?.address;
1231
+ function At(e, t) {
1232
+ return J(e, t)?.address;
1194
1233
  }
1195
- function hs(e, s) {
1196
- return J(e, s)?.decimals;
1234
+ function bt(e, t) {
1235
+ return J(e, t)?.decimals;
1197
1236
  }
1198
1237
  var Q = /* @__PURE__ */ ((e) => (e.PRODUCTION = "production", e.STAGING = "staging", e))(Q || {});
1199
1238
  class m {
1200
- constructor({ api_key: s, env: t, seesion_token: o, props: i }) {
1201
- this.api_key = s || "", this.sessionToken = o || "", this.env = t ?? Q.PRODUCTION, this.props = i;
1239
+ constructor({ api_key: t, env: s, seesion_token: o, props: i }) {
1240
+ this.api_key = t || "", this.sessionToken = o || "", this.env = s ?? Q.PRODUCTION, this.props = i;
1202
1241
  }
1203
- static async config(s) {
1242
+ static async config(t) {
1204
1243
  if (!m.app) {
1205
- if (!s)
1244
+ if (!t)
1206
1245
  throw new Error("Please provide an api_key");
1207
- m.app = new m(s);
1246
+ m.app = new m(t);
1208
1247
  }
1209
- return s && (s.api_key !== void 0 && (m.app.api_key = s.api_key), s.seesion_token !== void 0 && (m.app.sessionToken = s.seesion_token), s.env !== void 0 && (m.app.env = s.env), s.props !== void 0 && (m.app.props = s.props)), m.app;
1248
+ return t && (t.api_key !== void 0 && (m.app.api_key = t.api_key), t.seesion_token !== void 0 && (m.app.sessionToken = t.seesion_token), t.env !== void 0 && (m.app.env = t.env), t.props !== void 0 && (m.app.props = t.props)), m.app;
1210
1249
  }
1211
1250
  static getApiKey() {
1212
1251
  if (!m.app)
@@ -1242,50 +1281,55 @@ class m {
1242
1281
  return "https://api.chainrails.io/api/v1";
1243
1282
  }
1244
1283
  }
1245
- static getPayModalUrl(s) {
1284
+ static getPayModalUrl(t) {
1246
1285
  if (!m.app)
1247
1286
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
1248
- const t = m.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", o = Number(s), i = s && !isNaN(Number(s)) && o > 0 ? "/pay/" : "/deposit/", r = `${s && !isNaN(Number(s)) && o > 0 ? o * 100 : ""}`;
1249
- return t + i + r;
1287
+ const s = m.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", o = Number(t), i = t && !isNaN(Number(t)) && o > 0 ? "/pay/" : "/deposit/", r = `${t && !isNaN(Number(t)) && o > 0 ? o * 100 : ""}`;
1288
+ return s + i + r;
1250
1289
  }
1251
1290
  }
1252
1291
  export {
1253
1292
  n as AmountSymbols,
1254
- u as ChainTypes,
1293
+ E as ChainTypes,
1255
1294
  m as Chainrails,
1256
- c as Chains,
1257
- cs as DEFAULT_AMOUNT_SYMBOL,
1295
+ te as Chains,
1296
+ mt as DEFAULT_AMOUNT_SYMBOL,
1297
+ c as InternalChains,
1258
1298
  d as TOKEN_REGISTRY,
1259
- ds as Tokens,
1260
- ls as allChains,
1299
+ Et as Tokens,
1300
+ ut as allChains,
1261
1301
  se as arbitrum,
1262
- te as arbitrumTestnet,
1263
- ns as assertTokenAddressMatchesChain,
1264
- gs as assertTokenAddressMatchesChainAndSymbol,
1265
- ms as assertTokenMatchesAmountSymbol,
1266
- us as assertTokenSymbolMatches,
1267
- ne as avalanche,
1268
- oe as avalancheTestnet,
1269
- ie as base,
1270
- ae as baseTestnet,
1271
- re as bsc,
1272
- os as celo,
1302
+ ne as arbitrumTestnet,
1303
+ at as assertTokenAddressMatchesChain,
1304
+ St as assertTokenAddressMatchesChainAndSymbol,
1305
+ ft as assertTokenMatchesAmountSymbol,
1306
+ pt as assertTokenSymbolMatches,
1307
+ oe as avalanche,
1308
+ ie as avalancheTestnet,
1309
+ ae as base,
1310
+ re as baseTestnet,
1311
+ ce as bsc,
1312
+ rt as celo,
1273
1313
  Q as environment,
1274
- ce as ethereum,
1275
- de as ethereumTestnet,
1314
+ de as ethereum,
1315
+ le as ethereumTestnet,
1276
1316
  J as getToken,
1277
- Es as getTokenAddress,
1278
- hs as getTokenDecimals,
1279
- le as hyperevm,
1280
- is as linea,
1281
- me as lisk,
1317
+ At as getTokenAddress,
1318
+ bt as getTokenDecimals,
1319
+ me as hyperevm,
1320
+ gt as isChainAlias,
1321
+ it as isInternalChain,
1322
+ ct as linea,
1323
+ Ee as lisk,
1282
1324
  ue as monad,
1283
- ge as monadTestnet,
1284
- Ee as optimism,
1285
- he as optimismTestnet,
1325
+ Te as monadTestnet,
1326
+ he as optimism,
1327
+ ge as optimismTestnet,
1286
1328
  fe as polygon,
1287
- Te as starknet,
1288
- pe as starknetTestnet,
1289
- as as unichain,
1290
- rs as worldchain
1329
+ pe as starknet,
1330
+ Se as starknetTestnet,
1331
+ ht as toChainAlias,
1332
+ Tt as toInternalChain,
1333
+ dt as unichain,
1334
+ lt as worldchain
1291
1335
  };