@chainrails/common 0.2.3 → 0.2.5

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,89 +1,205 @@
1
- var l = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(l || {});
2
- const V = {
3
- type: "evm",
1
+ const u = {
2
+ EVM: "EVM",
3
+ STARKNET: "STARKNET"
4
+ }, c = {
5
+ ARBITRUM: "ARBITRUM_MAINNET",
6
+ ARBITRUM_TESTNET: "ARBITRUM_TESTNET",
7
+ AVALANCHE: "AVALANCHE_MAINNET",
8
+ AVALANCHE_TESTNET: "AVALANCHE_TESTNET",
9
+ BASE: "BASE_MAINNET",
10
+ BASE_TESTNET: "BASE_TESTNET",
11
+ BSC: "BSC_MAINNET",
12
+ ETHEREUM: "ETHEREUM_MAINNET",
13
+ ETHEREUM_TESTNET: "ETHEREUM_TESTNET",
14
+ HYPEREVM: "HYPEREVM_MAINNET",
15
+ LISK: "LISK_MAINNET",
16
+ MONAD: "MONAD_MAINNET",
17
+ MONAD_TESTNET: "MONAD_TESTNET",
18
+ OPTIMISM: "OPTIMISM_MAINNET",
19
+ OPTIMISM_TESTNET: "OPTIMISM_TESTNET",
20
+ POLYGON: "POLYGON_MAINNET",
21
+ STARKNET: "STARKNET_MAINNET",
22
+ STARKNET_TESTNET: "STARKNET_TESTNET"
23
+ }, se = {
24
+ type: u.EVM,
4
25
  chainId: 42161,
5
26
  name: "Arbitrum",
6
27
  cctpDomain: 3,
7
- logoURI: "/images/chains/arbitrum.svg"
8
- }, X = {
9
- type: "evm",
28
+ logoURI: "/images/chains/arbitrum.svg",
29
+ explorer: "https://arbiscan.io"
30
+ }, te = {
31
+ type: u.EVM,
10
32
  chainId: 421614,
11
33
  name: "Arbitrum Sepolia",
12
34
  cctpDomain: 3,
13
- logoURI: "/images/chains/arbitrum.svg"
14
- }, G = {
15
- type: "evm",
35
+ logoURI: "/images/chains/arbitrum.svg",
36
+ explorer: "https://sepolia.arbiscan.io"
37
+ }, ne = {
38
+ type: u.EVM,
39
+ chainId: 43114,
40
+ name: "Avalanche",
41
+ cctpDomain: 1,
42
+ logoURI: "/images/chains/avalanche.svg",
43
+ explorer: "https://snowtrace.io"
44
+ }, oe = {
45
+ type: u.EVM,
46
+ chainId: 43113,
47
+ name: "Avalanche Fuji",
48
+ cctpDomain: 1,
49
+ logoURI: "/images/chains/avalanche.svg",
50
+ explorer: "https://testnet.snowtrace.io"
51
+ }, ie = {
52
+ type: u.EVM,
16
53
  chainId: 8453,
17
54
  name: "Base",
18
55
  cctpDomain: 6,
19
- logoURI: "/images/chains/base.webp"
20
- }, q = {
21
- type: "evm",
56
+ logoURI: "/images/chains/base.webp",
57
+ explorer: "https://basescan.org"
58
+ }, ae = {
59
+ type: u.EVM,
22
60
  chainId: 84532,
23
61
  name: "Base Sepolia",
24
62
  cctpDomain: 6,
25
- logoURI: "/images/chains/base.webp"
26
- }, W = {
27
- type: "evm",
63
+ logoURI: "/images/chains/base.webp",
64
+ explorer: "https://sepolia.basescan.org"
65
+ }, re = {
66
+ type: u.EVM,
28
67
  chainId: 56,
29
68
  name: "BNB Chain",
30
69
  cctpDomain: null,
31
- logoURI: "/images/chains/bsc.webp"
32
- }, J = {
33
- type: "evm",
70
+ logoURI: "/images/chains/bsc.webp",
71
+ explorer: "https://bscscan.com"
72
+ }, os = {
73
+ type: u.EVM,
74
+ chainId: 42220,
75
+ name: "Celo",
76
+ cctpDomain: null,
77
+ logoURI: "/images/chains/celo.svg",
78
+ explorer: "https://celoscan.io"
79
+ }, ce = {
80
+ type: u.EVM,
34
81
  chainId: 1,
35
82
  name: "Ethereum",
36
83
  cctpDomain: 0,
37
- logoURI: "/images/chains/ethereum.svg"
38
- }, Q = {
39
- type: "evm",
84
+ logoURI: "/images/chains/ethereum.svg",
85
+ explorer: "https://etherscan.io"
86
+ }, de = {
87
+ type: u.EVM,
40
88
  chainId: 11155111,
41
89
  name: "Ethereum Sepolia",
42
90
  cctpDomain: 0,
43
- logoURI: "/images/chains/ethereum.svg"
44
- }, Y = {
45
- type: "evm",
46
- chainId: 43114,
47
- name: "Avalanche",
48
- cctpDomain: 1,
49
- logoURI: "/images/chains/avalanche.svg"
50
- }, Z = {
51
- type: "evm",
52
- chainId: 43113,
53
- name: "Avalanche Fuji",
54
- cctpDomain: 1,
55
- logoURI: "/images/chains/avalanche.svg"
56
- }, ee = {
57
- type: "starknet",
91
+ logoURI: "/images/chains/ethereum.svg",
92
+ explorer: "https://sepolia.etherscan.io"
93
+ }, le = {
94
+ type: u.EVM,
95
+ chainId: 999,
96
+ name: "HyperEVM",
97
+ cctpDomain: 19,
98
+ logoURI: "/images/chains/hyperevm.webp",
99
+ explorer: "https://liquidscan.io"
100
+ }, is = {
101
+ type: u.EVM,
102
+ chainId: 59144,
103
+ name: "Linea",
104
+ cctpDomain: 11,
105
+ logoURI: "/images/chains/linea.svg",
106
+ explorer: "https://lineascan.build"
107
+ }, me = {
108
+ type: u.EVM,
109
+ chainId: 1135,
110
+ name: "Lisk",
111
+ cctpDomain: null,
112
+ logoURI: "/images/chains/lisk.png",
113
+ explorer: "https://blockscout.lisk.com"
114
+ }, ue = {
115
+ type: u.EVM,
116
+ chainId: 15,
117
+ name: "Monad",
118
+ cctpDomain: 7,
119
+ logoURI: "/images/chains/monad.png",
120
+ explorer: "https://monadvision.com"
121
+ }, ge = {
122
+ type: u.EVM,
123
+ chainId: 10143,
124
+ name: "Monad Testnet",
125
+ cctpDomain: null,
126
+ logoURI: "/images/chains/monad.png",
127
+ explorer: "https://testnet.monadvision.com"
128
+ }, Ee = {
129
+ type: u.EVM,
130
+ chainId: 10,
131
+ name: "Optimism",
132
+ cctpDomain: 2,
133
+ logoURI: "/images/chains/optimism.svg",
134
+ explorer: "https://optimistic.etherscan.io"
135
+ }, he = {
136
+ type: u.EVM,
137
+ chainId: 11155420,
138
+ name: "Optimism Testnet",
139
+ cctpDomain: 2,
140
+ logoURI: "/images/chains/optimism.svg",
141
+ explorer: "https://testnet-explorer.optimism.io"
142
+ }, fe = {
143
+ type: u.EVM,
144
+ chainId: 137,
145
+ name: "Polygon",
146
+ cctpDomain: 7,
147
+ logoURI: "/images/chains/polygon.svg",
148
+ explorer: "https://polygonscan.com"
149
+ }, Te = {
150
+ type: u.STARKNET,
58
151
  chainId: "0x534e5f4d41494e",
59
152
  // SN_MAIN
60
153
  name: "Starknet",
154
+ cctpDomain: 25,
155
+ logoURI: "/images/chains/starknet.svg",
156
+ explorer: ""
157
+ }, pe = {
158
+ type: u.STARKNET,
159
+ chainId: "0x534e5f5345504f4c4941",
160
+ // SN_SEPOLIA
161
+ name: "Starknet Testnet",
61
162
  cctpDomain: null,
62
- logoURI: "/images/chains/starknet.svg"
163
+ logoURI: "/images/chains/starknet.svg",
164
+ explorer: ""
165
+ }, as = {
166
+ type: u.EVM,
167
+ chainId: 130,
168
+ name: "Unichain",
169
+ cctpDomain: 10,
170
+ logoURI: "/images/chains/unichain.webp",
171
+ explorer: ""
172
+ }, rs = {
173
+ type: u.EVM,
174
+ chainId: 480,
175
+ name: "Worldchain",
176
+ cctpDomain: 14,
177
+ logoURI: "/images/chains/worldchain.svg",
178
+ explorer: ""
63
179
  };
64
- function $(e, { strict: t = !0 } = {}) {
65
- return !e || typeof e != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(e) : e.startsWith("0x");
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");
66
182
  }
67
- function z(e) {
68
- return $(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
183
+ function k(e) {
184
+ return C(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
69
185
  }
70
- const te = "2.43.4";
71
- let y = {
72
- getDocsUrl: ({ docsBaseUrl: e, docsPath: t = "", docsSlug: n }) => t ? `${e ?? "https://viem.sh"}${t}${n ? `#${n}` : ""}` : void 0,
73
- version: `viem@${te}`
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@${_}`
74
190
  };
75
191
  class f extends Error {
76
- constructor(t, n = {}) {
77
- const s = n.cause instanceof f ? n.cause.details : n.cause?.message ? n.cause.message : n.details, o = n.cause instanceof f && n.cause.docsPath || n.docsPath, r = y.getDocsUrl?.({ ...n, docsPath: o }), i = [
78
- t || "An error occurred.",
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.",
79
195
  "",
80
- ...n.metaMessages ? [...n.metaMessages, ""] : [],
196
+ ...t.metaMessages ? [...t.metaMessages, ""] : [],
81
197
  ...r ? [`Docs: ${r}`] : [],
82
- ...s ? [`Details: ${s}`] : [],
83
- ...y.version ? [`Version: ${y.version}`] : []
198
+ ...o ? [`Details: ${o}`] : [],
199
+ ...I.version ? [`Version: ${I.version}`] : []
84
200
  ].join(`
85
201
  `);
86
- super(i, n.cause ? { cause: n.cause } : void 0), Object.defineProperty(this, "details", {
202
+ super(a, t.cause ? { cause: t.cause } : void 0), Object.defineProperty(this, "details", {
87
203
  enumerable: !0,
88
204
  configurable: !0,
89
205
  writable: !0,
@@ -113,93 +229,93 @@ class f extends Error {
113
229
  configurable: !0,
114
230
  writable: !0,
115
231
  value: "BaseError"
116
- }), this.details = s, this.docsPath = o, this.metaMessages = n.metaMessages, this.name = n.name ?? this.name, this.shortMessage = t, this.version = te;
232
+ }), this.details = o, this.docsPath = i, this.metaMessages = t.metaMessages, this.name = t.name ?? this.name, this.shortMessage = s, this.version = _;
117
233
  }
118
- walk(t) {
119
- return ne(this, t);
234
+ walk(s) {
235
+ return L(this, s);
120
236
  }
121
237
  }
122
- function ne(e, t) {
123
- return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause !== void 0 ? ne(e.cause, t) : t ? null : e;
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;
124
240
  }
125
- class se extends f {
126
- constructor({ size: t, targetSize: n, type: s }) {
127
- super(`${s.charAt(0).toUpperCase()}${s.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`, { name: "SizeExceedsPaddingSizeError" });
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" });
128
244
  }
129
245
  }
130
- function S(e, { dir: t, size: n = 32 } = {}) {
131
- return typeof e == "string" ? be(e, { dir: t, size: n }) : Ie(e, { dir: t, size: n });
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 });
132
248
  }
133
- function be(e, { dir: t, size: n = 32 } = {}) {
134
- if (n === null)
249
+ function Se(e, { dir: s, size: t = 32 } = {}) {
250
+ if (t === null)
135
251
  return e;
136
- const s = e.replace("0x", "");
137
- if (s.length > n * 2)
138
- throw new se({
139
- size: Math.ceil(s.length / 2),
140
- targetSize: n,
252
+ const o = e.replace("0x", "");
253
+ if (o.length > t * 2)
254
+ throw new $({
255
+ size: Math.ceil(o.length / 2),
256
+ targetSize: t,
141
257
  type: "hex"
142
258
  });
143
- return `0x${s[t === "right" ? "padEnd" : "padStart"](n * 2, "0")}`;
259
+ return `0x${o[s === "right" ? "padEnd" : "padStart"](t * 2, "0")}`;
144
260
  }
145
- function Ie(e, { dir: t, size: n = 32 } = {}) {
146
- if (n === null)
261
+ function be(e, { dir: s, size: t = 32 } = {}) {
262
+ if (t === null)
147
263
  return e;
148
- if (e.length > n)
149
- throw new se({
264
+ if (e.length > t)
265
+ throw new $({
150
266
  size: e.length,
151
- targetSize: n,
267
+ targetSize: t,
152
268
  type: "bytes"
153
269
  });
154
- const s = new Uint8Array(n);
155
- for (let o = 0; o < n; o++) {
156
- const r = t === "right";
157
- s[r ? o : n - o - 1] = e[r ? o : e.length - o - 1];
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];
158
274
  }
159
- return s;
275
+ return o;
160
276
  }
161
- class Ee extends f {
162
- constructor({ max: t, min: n, signed: s, size: o, value: r }) {
163
- super(`Number "${r}" is not in safe ${o ? `${o * 8}-bit ${s ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${n} to ${t})` : `(above ${n})`}`, { name: "IntegerOutOfRangeError" });
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" });
164
280
  }
165
281
  }
166
- class Se extends f {
167
- constructor({ givenSize: t, maxSize: n }) {
168
- super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
282
+ class Ue extends f {
283
+ constructor({ givenSize: s, maxSize: t }) {
284
+ super(`Size cannot exceed ${t} bytes. Given size: ${s} bytes.`, { name: "SizeOverflowError" });
169
285
  }
170
286
  }
171
- function M(e, { size: t }) {
172
- if (z(e) > t)
173
- throw new Se({
174
- givenSize: z(e),
175
- maxSize: t
287
+ function N(e, { size: s }) {
288
+ if (k(e) > s)
289
+ throw new Ue({
290
+ givenSize: k(e),
291
+ maxSize: s
176
292
  });
177
293
  }
178
- function ye(e, t = {}) {
179
- const { signed: n, size: s } = t, o = BigInt(e);
294
+ function De(e, s = {}) {
295
+ const { signed: t, size: o } = s, i = BigInt(e);
180
296
  let r;
181
- s ? n ? r = (1n << BigInt(s) * 8n - 1n) - 1n : r = 2n ** (BigInt(s) * 8n) - 1n : typeof e == "number" && (r = BigInt(Number.MAX_SAFE_INTEGER));
182
- const i = typeof r == "bigint" && n ? -r - 1n : 0;
183
- if (r && o > r || o < i) {
184
- const u = typeof e == "bigint" ? "n" : "";
185
- throw new Ee({
186
- max: r ? `${r}${u}` : void 0,
187
- min: `${i}${u}`,
188
- signed: n,
189
- size: s,
190
- value: `${e}${u}`
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;
299
+ 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,
305
+ size: o,
306
+ value: `${e}${E}`
191
307
  });
192
308
  }
193
- const c = `0x${(n && o < 0 ? (1n << BigInt(s * 8)) + BigInt(o) : o).toString(16)}`;
194
- return s ? S(c, { size: s }) : c;
309
+ const l = `0x${(t && i < 0 ? (1n << BigInt(o * 8)) + BigInt(i) : i).toString(16)}`;
310
+ return o ? D(l, { size: o }) : l;
195
311
  }
196
- const Ae = /* @__PURE__ */ new TextEncoder();
197
- function Ue(e, t = {}) {
198
- return typeof e == "number" || typeof e == "bigint" ? xe(e, t) : typeof e == "boolean" ? Te(e, t) : $(e) ? oe(e, t) : ie(e, t);
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);
199
315
  }
200
- function Te(e, t = {}) {
201
- const n = new Uint8Array(1);
202
- return n[0] = Number(e), typeof t.size == "number" ? (M(n, { size: t.size }), S(n, { size: t.size })) : n;
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;
203
319
  }
204
320
  const h = {
205
321
  zero: 48,
@@ -209,7 +325,7 @@ const h = {
209
325
  a: 97,
210
326
  f: 102
211
327
  };
212
- function L(e) {
328
+ function B(e) {
213
329
  if (e >= h.zero && e <= h.nine)
214
330
  return e - h.zero;
215
331
  if (e >= h.A && e <= h.F)
@@ -217,154 +333,154 @@ function L(e) {
217
333
  if (e >= h.a && e <= h.f)
218
334
  return e - (h.a - 10);
219
335
  }
220
- function oe(e, t = {}) {
221
- let n = e;
222
- t.size && (M(n, { size: t.size }), n = S(n, { dir: "right", size: t.size }));
223
- let s = n.slice(2);
224
- s.length % 2 && (s = `0${s}`);
225
- const o = s.length / 2, r = new Uint8Array(o);
226
- for (let i = 0, c = 0; i < o; i++) {
227
- const u = L(s.charCodeAt(c++)), p = L(s.charCodeAt(c++));
228
- if (u === void 0 || p === void 0)
229
- throw new f(`Invalid byte sequence ("${s[c - 2]}${s[c - 1]}" in "${s}").`);
230
- r[i] = u * 16 + p;
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);
340
+ o.length % 2 && (o = `0${o}`);
341
+ const i = o.length / 2, r = new Uint8Array(i);
342
+ 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;
231
347
  }
232
348
  return r;
233
349
  }
234
- function xe(e, t) {
235
- const n = ye(e, t);
236
- return oe(n);
350
+ function Ce(e, s) {
351
+ const t = De(e, s);
352
+ return P(t);
237
353
  }
238
- function ie(e, t = {}) {
239
- const n = Ae.encode(e);
240
- return typeof t.size == "number" ? (M(n, { size: t.size }), S(n, { dir: "right", size: t.size })) : n;
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;
241
357
  }
242
- const I = /* @__PURE__ */ BigInt(2 ** 32 - 1), H = /* @__PURE__ */ BigInt(32);
243
- function we(e, t = !1) {
244
- return t ? { h: Number(e & I), l: Number(e >> H & I) } : { h: Number(e >> H & I) | 0, l: Number(e & I) | 0 };
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 };
245
361
  }
246
- function De(e, t = !1) {
247
- const n = e.length;
248
- let s = new Uint32Array(n), o = new Uint32Array(n);
249
- for (let r = 0; r < n; r++) {
250
- const { h: i, l: c } = we(e[r], t);
251
- [s[r], o[r]] = [i, c];
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);
367
+ [o[r], i[r]] = [a, l];
252
368
  }
253
- return [s, o];
369
+ return [o, i];
254
370
  }
255
- const Ce = (e, t, n) => e << n | t >>> 32 - n, ve = (e, t, n) => t << n | e >>> 32 - n, Ne = (e, t, n) => t << n - 32 | e >>> 64 - n, Be = (e, t, n) => e << n - 32 | t >>> 64 - n;
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;
256
372
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
257
- function ke(e) {
373
+ function ve(e) {
258
374
  return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
259
375
  }
260
- function P(e) {
376
+ function w(e) {
261
377
  if (!Number.isSafeInteger(e) || e < 0)
262
378
  throw new Error("positive integer expected, got " + e);
263
379
  }
264
- function E(e, ...t) {
265
- if (!ke(e))
380
+ function U(e, ...s) {
381
+ if (!ve(e))
266
382
  throw new Error("Uint8Array expected");
267
- if (t.length > 0 && !t.includes(e.length))
268
- throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
383
+ if (s.length > 0 && !s.includes(e.length))
384
+ throw new Error("Uint8Array expected of length " + s + ", got length=" + e.length);
269
385
  }
270
- function _(e, t = !0) {
386
+ function v(e, s = !0) {
271
387
  if (e.destroyed)
272
388
  throw new Error("Hash instance has been destroyed");
273
- if (t && e.finished)
389
+ if (s && e.finished)
274
390
  throw new Error("Hash#digest() has already been called");
275
391
  }
276
- function Re(e, t) {
277
- E(e);
278
- const n = t.outputLen;
279
- if (e.length < n)
280
- throw new Error("digestInto() expects output buffer of length at least " + n);
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);
281
397
  }
282
- function $e(e) {
398
+ function He(e) {
283
399
  return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
284
400
  }
285
- function re(...e) {
286
- for (let t = 0; t < e.length; t++)
287
- e[t].fill(0);
401
+ function K(...e) {
402
+ for (let s = 0; s < e.length; s++)
403
+ e[s].fill(0);
288
404
  }
289
- const Me = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
290
- function Oe(e) {
405
+ const Fe = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
406
+ function _e(e) {
291
407
  return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
292
408
  }
293
- function ze(e) {
294
- for (let t = 0; t < e.length; t++)
295
- e[t] = Oe(e[t]);
409
+ function Le(e) {
410
+ for (let s = 0; s < e.length; s++)
411
+ e[s] = _e(e[s]);
296
412
  return e;
297
413
  }
298
- const F = Me ? (e) => e : ze;
299
- function Le(e) {
414
+ const O = Fe ? (e) => e : Le;
415
+ function $e(e) {
300
416
  if (typeof e != "string")
301
417
  throw new Error("string expected");
302
418
  return new Uint8Array(new TextEncoder().encode(e));
303
419
  }
304
- function ce(e) {
305
- return typeof e == "string" && (e = Le(e)), E(e), e;
420
+ function z(e) {
421
+ return typeof e == "string" && (e = $e(e)), U(e), e;
306
422
  }
307
- class He {
423
+ class Pe {
308
424
  }
309
- function Pe(e) {
310
- const t = (s) => e().update(ce(s)).digest(), n = e();
311
- return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
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;
312
428
  }
313
- const _e = BigInt(0), m = BigInt(1), Fe = BigInt(2), Ke = BigInt(7), je = BigInt(256), Ve = BigInt(113), ae = [], ue = [], le = [];
314
- for (let e = 0, t = m, n = 1, s = 0; e < 24; e++) {
315
- [n, s] = [s, (2 * n + 3 * s) % 5], ae.push(2 * (5 * s + n)), ue.push((e + 1) * (e + 2) / 2 % 64);
316
- let o = _e;
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;
317
433
  for (let r = 0; r < 7; r++)
318
- t = (t << m ^ (t >> Ke) * Ve) % je, t & Fe && (o ^= m << (m << /* @__PURE__ */ BigInt(r)) - m);
319
- le.push(o);
320
- }
321
- const he = De(le, !0), Xe = he[0], Ge = he[1], K = (e, t, n) => n > 32 ? Ne(e, t, n) : Ce(e, t, n), j = (e, t, n) => n > 32 ? Be(e, t, n) : ve(e, t, n);
322
- function qe(e, t = 24) {
323
- const n = new Uint32Array(10);
324
- for (let s = 24 - t; s < 24; s++) {
325
- for (let i = 0; i < 10; i++)
326
- n[i] = e[i] ^ e[i + 10] ^ e[i + 20] ^ e[i + 30] ^ e[i + 40];
327
- for (let i = 0; i < 10; i += 2) {
328
- const c = (i + 8) % 10, u = (i + 2) % 10, p = n[u], g = n[u + 1], ge = K(p, g, 1) ^ n[c], me = j(p, g, 1) ^ n[c + 1];
434
+ s = (s << S ^ (s >> We) * Ye) % je, s & ze && (i ^= S << (S << /* @__PURE__ */ BigInt(r)) - S);
435
+ Y.push(i);
436
+ }
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++) {
441
+ for (let a = 0; a < 10; a++)
442
+ t[a] = e[a] ^ e[a + 10] ^ e[a + 20] ^ e[a + 30] ^ e[a + 40];
443
+ 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];
329
445
  for (let b = 0; b < 50; b += 10)
330
- e[i + b] ^= ge, e[i + b + 1] ^= me;
446
+ e[a + b] ^= Z, e[a + b + 1] ^= ee;
331
447
  }
332
- let o = e[2], r = e[3];
333
- for (let i = 0; i < 24; i++) {
334
- const c = ue[i], u = K(o, r, c), p = j(o, r, c), g = ae[i];
335
- o = e[g], r = e[g + 1], e[g] = u, e[g + 1] = p;
448
+ let i = e[2], r = e[3];
449
+ 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;
336
452
  }
337
- for (let i = 0; i < 50; i += 10) {
338
- for (let c = 0; c < 10; c++)
339
- n[c] = e[i + c];
340
- for (let c = 0; c < 10; c++)
341
- e[i + c] ^= ~n[(c + 2) % 10] & n[(c + 4) % 10];
453
+ for (let a = 0; a < 50; a += 10) {
454
+ for (let l = 0; l < 10; l++)
455
+ t[l] = e[a + l];
456
+ for (let l = 0; l < 10; l++)
457
+ e[a + l] ^= ~t[(l + 2) % 10] & t[(l + 4) % 10];
342
458
  }
343
- e[0] ^= Xe[s], e[1] ^= Ge[s];
459
+ e[0] ^= Ge[o], e[1] ^= Xe[o];
344
460
  }
345
- re(n);
461
+ K(t);
346
462
  }
347
- class O extends He {
463
+ class x extends Pe {
348
464
  // NOTE: we accept arguments in bytes instead of bits here.
349
- constructor(t, n, s, o = !1, r = 24) {
350
- if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = n, this.outputLen = s, this.enableXOF = o, this.rounds = r, P(s), !(0 < t && t < 200))
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))
351
467
  throw new Error("only keccak-f1600 function is supported");
352
- this.state = new Uint8Array(200), this.state32 = $e(this.state);
468
+ this.state = new Uint8Array(200), this.state32 = He(this.state);
353
469
  }
354
470
  clone() {
355
471
  return this._cloneInto();
356
472
  }
357
473
  keccak() {
358
- F(this.state32), qe(this.state32, this.rounds), F(this.state32), this.posOut = 0, this.pos = 0;
359
- }
360
- update(t) {
361
- _(this), t = ce(t), E(t);
362
- const { blockLen: n, state: s } = this, o = t.length;
363
- for (let r = 0; r < o; ) {
364
- const i = Math.min(n - this.pos, o - r);
365
- for (let c = 0; c < i; c++)
366
- s[this.pos++] ^= t[r++];
367
- this.pos === n && this.keccak();
474
+ O(this.state32), qe(this.state32, this.rounds), O(this.state32), this.posOut = 0, this.pos = 0;
475
+ }
476
+ update(s) {
477
+ v(this), s = z(s), U(s);
478
+ const { blockLen: t, state: o } = this, i = s.length;
479
+ for (let r = 0; r < i; ) {
480
+ const a = Math.min(t - this.pos, i - r);
481
+ for (let l = 0; l < a; l++)
482
+ o[this.pos++] ^= s[r++];
483
+ this.pos === t && this.keccak();
368
484
  }
369
485
  return this;
370
486
  }
@@ -372,50 +488,50 @@ class O extends He {
372
488
  if (this.finished)
373
489
  return;
374
490
  this.finished = !0;
375
- const { state: t, suffix: n, pos: s, blockLen: o } = this;
376
- t[s] ^= n, (n & 128) !== 0 && s === o - 1 && this.keccak(), t[o - 1] ^= 128, this.keccak();
377
- }
378
- writeInto(t) {
379
- _(this, !1), E(t), this.finish();
380
- const n = this.state, { blockLen: s } = this;
381
- for (let o = 0, r = t.length; o < r; ) {
382
- this.posOut >= s && this.keccak();
383
- const i = Math.min(s - this.posOut, r - o);
384
- t.set(n.subarray(this.posOut, this.posOut + i), o), this.posOut += i, o += i;
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();
493
+ }
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; ) {
498
+ this.posOut >= o && this.keccak();
499
+ 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;
385
501
  }
386
- return t;
502
+ return s;
387
503
  }
388
- xofInto(t) {
504
+ xofInto(s) {
389
505
  if (!this.enableXOF)
390
506
  throw new Error("XOF is not possible for this instance");
391
- return this.writeInto(t);
507
+ return this.writeInto(s);
392
508
  }
393
- xof(t) {
394
- return P(t), this.xofInto(new Uint8Array(t));
509
+ xof(s) {
510
+ return w(s), this.xofInto(new Uint8Array(s));
395
511
  }
396
- digestInto(t) {
397
- if (Re(t, this), this.finished)
512
+ digestInto(s) {
513
+ if (Oe(s, this), this.finished)
398
514
  throw new Error("digest() was already called");
399
- return this.writeInto(t), this.destroy(), t;
515
+ return this.writeInto(s), this.destroy(), s;
400
516
  }
401
517
  digest() {
402
518
  return this.digestInto(new Uint8Array(this.outputLen));
403
519
  }
404
520
  destroy() {
405
- this.destroyed = !0, re(this.state);
521
+ this.destroyed = !0, K(this.state);
406
522
  }
407
- _cloneInto(t) {
408
- const { blockLen: n, suffix: s, outputLen: o, rounds: r, enableXOF: i } = this;
409
- return t || (t = new O(n, s, o, i, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = s, t.outputLen = o, t.enableXOF = i, t.destroyed = this.destroyed, t;
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;
410
526
  }
411
527
  }
412
- const We = (e, t, n) => Pe(() => new O(t, e, n)), Je = We(1, 136, 256 / 8);
413
- function Qe(e, t) {
414
- return Je($(e, { strict: !1 }) ? Ue(e) : e);
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);
415
531
  }
416
- class Ye extends f {
417
- constructor({ address: t }) {
418
- super(`Address "${t}" is invalid.`, {
532
+ class es extends f {
533
+ constructor({ address: s }) {
534
+ super(`Address "${s}" is invalid.`, {
419
535
  metaMessages: [
420
536
  "- Address must be a hex value of 20 bytes (40 hex characters).",
421
537
  "- Address must match its checksum counterpart."
@@ -424,257 +540,698 @@ class Ye extends f {
424
540
  });
425
541
  }
426
542
  }
427
- class de extends Map {
428
- constructor(t) {
543
+ class X extends Map {
544
+ constructor(s) {
429
545
  super(), Object.defineProperty(this, "maxSize", {
430
546
  enumerable: !0,
431
547
  configurable: !0,
432
548
  writable: !0,
433
549
  value: void 0
434
- }), this.maxSize = t;
550
+ }), this.maxSize = s;
435
551
  }
436
- get(t) {
437
- const n = super.get(t);
438
- return super.has(t) && n !== void 0 && (this.delete(t), super.set(t, n)), n;
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;
439
555
  }
440
- set(t, n) {
441
- if (super.set(t, n), this.maxSize && this.size > this.maxSize) {
442
- const s = this.keys().next().value;
443
- s && this.delete(s);
556
+ set(s, t) {
557
+ if (super.set(s, t), this.maxSize && this.size > this.maxSize) {
558
+ const o = this.keys().next().value;
559
+ o && this.delete(o);
444
560
  }
445
561
  return this;
446
562
  }
447
563
  }
448
- const A = /* @__PURE__ */ new de(8192);
449
- function fe(e, t) {
450
- if (A.has(`${e}.${t}`))
451
- return A.get(`${e}.${t}`);
452
- const n = e.substring(2).toLowerCase(), s = Qe(ie(n)), o = n.split("");
453
- for (let i = 0; i < 40; i += 2)
454
- s[i >> 1] >> 4 >= 8 && o[i] && (o[i] = o[i].toUpperCase()), (s[i >> 1] & 15) >= 8 && o[i + 1] && (o[i + 1] = o[i + 1].toUpperCase());
455
- const r = `0x${o.join("")}`;
456
- return A.set(`${e}.${t}`, r), r;
457
- }
458
- function d(e, t) {
459
- if (!et(e, { strict: !1 }))
460
- throw new Ye({ address: e });
461
- return fe(e, t);
462
- }
463
- const Ze = /^0x[a-fA-F0-9]{40}$/, U = /* @__PURE__ */ new de(8192);
464
- function et(e, t) {
465
- const { strict: n = !0 } = t ?? {}, s = `${e}.${n}`;
466
- if (U.has(s))
467
- return U.get(s);
468
- const o = Ze.test(e) ? e.toLowerCase() === e ? !0 : n ? fe(e) === e : !0 : !1;
469
- return U.set(s, o), o;
470
- }
471
- const T = {
472
- chainId: X.chainId,
473
- address: d("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
474
- symbol: "USDC",
475
- fiatISO: "USD",
476
- decimals: 6,
477
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
478
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
479
- }, x = {
480
- chainId: V.chainId,
481
- address: d("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
482
- symbol: "USDC",
483
- name: "USD Coin",
484
- decimals: 6,
485
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png"
486
- /* USDC */
487
- }, w = {
488
- chainId: Z.chainId,
489
- address: d("0x5425890298aed601595a70ab815c96711a31bc65"),
490
- symbol: "USDC",
491
- fiatISO: "USD",
492
- decimals: 6,
493
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
494
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
495
- }, D = {
496
- chainId: Y.chainId,
497
- address: d("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
498
- symbol: "USDC",
499
- fiatISO: "USD",
500
- decimals: 6,
501
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
502
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
503
- }, C = {
504
- chainId: q.chainId,
505
- address: d("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
506
- symbol: "USDC",
507
- fiatISO: "USD",
508
- decimals: 6,
509
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
510
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
511
- }, v = {
512
- chainId: G.chainId,
513
- address: d("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
514
- symbol: "USDC",
515
- fiatISO: "USD",
516
- decimals: 6,
517
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
518
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
519
- }, N = {
520
- chainId: W.chainId,
521
- address: d("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
522
- symbol: "USDC",
523
- decimals: 18,
524
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
525
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
526
- }, B = {
527
- chainId: Q.chainId,
528
- address: d("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
529
- symbol: "USDC",
530
- decimals: 6,
531
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
532
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
533
- }, k = {
534
- chainId: J.chainId,
535
- address: d("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
536
- symbol: "USDC",
537
- decimals: 6,
538
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
539
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
540
- }, tt = {
541
- chainId: ee.chainId,
542
- address: "0x053C91253BC9682c04929cA02ED00b3E423f6710D2ee7e0D5EBB06F3eCF368A8",
543
- symbol: "USDC",
544
- decimals: 6,
545
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
546
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
547
- }, nt = {
548
- [T.chainId]: T,
549
- [x.chainId]: x,
550
- [w.chainId]: w,
551
- [D.chainId]: D,
552
- [C.chainId]: C,
553
- [v.chainId]: v,
554
- [B.chainId]: B,
555
- [k.chainId]: k,
556
- [N.chainId]: N
557
- }, R = {
558
- ARBITRUM_MAINNET: {
559
- ...V,
560
- tokens: {
561
- [l.USDC]: x
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("");
569
+ for (let a = 0; a < 40; a += 2)
570
+ 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
+ const r = `0x${i.join("")}`;
572
+ return y.set(`${e}.${s}`, r), r;
573
+ }
574
+ function g(e, s) {
575
+ if (!ts(e, { strict: !1 }))
576
+ throw new es({ address: e });
577
+ return q(e, s);
578
+ }
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;
586
+ }
587
+ const n = {
588
+ USDC: "USDC",
589
+ USDT: "USDT",
590
+ DAI: "DAI",
591
+ BUSD: "BUSD",
592
+ EURC: "EURC",
593
+ ETH: "ETH",
594
+ WETH: "WETH",
595
+ STRK: "STRK",
596
+ BNB: "BNB",
597
+ LORDS: "LORDS"
598
+ }, cs = n.USDC, d = {
599
+ [c.ARBITRUM]: {
600
+ [n.DAI]: {
601
+ address: g("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),
602
+ symbol: n.DAI,
603
+ name: "Dai Stablecoin",
604
+ decimals: 18,
605
+ logoURI: "/images/tokens/dai.png"
606
+ /* DAI */
562
607
  },
563
- explorer: "https://arbiscan.io"
608
+ [n.ETH]: {
609
+ address: "0x0000000000000000000000000000000000000000",
610
+ symbol: n.ETH,
611
+ name: "Ethereum",
612
+ decimals: 18,
613
+ logoURI: "/images/chains/ethereum.svg"
614
+ /* ETH */
615
+ },
616
+ [n.USDC]: {
617
+ address: g("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
618
+ symbol: n.USDC,
619
+ name: "USD Coin",
620
+ decimals: 6,
621
+ logoURI: "/images/tokens/usdc.svg"
622
+ /* USDC */
623
+ },
624
+ [n.USDT]: {
625
+ address: g("0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),
626
+ symbol: n.USDT,
627
+ name: "Tether USD",
628
+ decimals: 6,
629
+ logoURI: "/images/tokens/usdt.png"
630
+ /* USDT */
631
+ },
632
+ [n.WETH]: {
633
+ address: g("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),
634
+ symbol: n.WETH,
635
+ name: "Wrapped Ether",
636
+ decimals: 18,
637
+ logoURI: "/images/tokens/weth.png"
638
+ /* WETH */
639
+ }
564
640
  },
565
- ARBITRUM_TESTNET: {
566
- ...X,
567
- explorer: "https://sepolia.arbiscan.io",
568
- tokens: {
569
- [l.USDC]: T
641
+ [c.ARBITRUM_TESTNET]: {
642
+ [n.USDC]: {
643
+ address: g("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
644
+ symbol: n.USDC,
645
+ name: "USD Coin",
646
+ fiatISO: "USD",
647
+ decimals: 6,
648
+ logoURI: "/images/tokens/usdc.svg",
649
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
570
650
  }
571
651
  },
572
- AVALANCHE_MAINNET: {
573
- ...Y,
574
- tokens: {
575
- [l.USDC]: D
652
+ [c.AVALANCHE]: {
653
+ [n.DAI]: {
654
+ address: "0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",
655
+ symbol: n.DAI,
656
+ name: "Dai Stablecoin",
657
+ decimals: 18,
658
+ logoURI: "/images/tokens/dai.png"
659
+ /* DAI */
660
+ },
661
+ [n.USDC]: {
662
+ address: g("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
663
+ symbol: n.USDC,
664
+ name: "USD Coin",
665
+ fiatISO: "USD",
666
+ decimals: 6,
667
+ logoURI: "/images/tokens/usdc.svg",
668
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
669
+ },
670
+ [n.USDT]: {
671
+ address: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",
672
+ symbol: n.USDT,
673
+ name: "Tether USD",
674
+ decimals: 6,
675
+ logoURI: "/images/tokens/usdt.png"
676
+ /* USDT */
576
677
  },
577
- explorer: "https://snowtrace.io"
678
+ [n.WETH]: {
679
+ address: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",
680
+ symbol: n.WETH,
681
+ name: "Wrapped Ether",
682
+ decimals: 18,
683
+ logoURI: "/images/tokens/weth.png"
684
+ /* WETH */
685
+ }
578
686
  },
579
- AVALANCHE_TESTNET: {
580
- ...Z,
581
- tokens: {
582
- [l.USDC]: w
687
+ [c.AVALANCHE_TESTNET]: {
688
+ [n.USDC]: {
689
+ address: g("0x5425890298aed601595a70AB815c96711a31Bc65"),
690
+ symbol: n.USDC,
691
+ name: "USD Coin",
692
+ fiatISO: "USD",
693
+ decimals: 6,
694
+ logoURI: "/images/tokens/usdc.svg",
695
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
696
+ }
697
+ },
698
+ [c.BASE]: {
699
+ [n.DAI]: {
700
+ address: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",
701
+ symbol: n.DAI,
702
+ name: "Dai Stablecoin",
703
+ decimals: 18,
704
+ logoURI: "/images/tokens/dai.png"
705
+ /* DAI */
583
706
  },
584
- explorer: "https://testnet.snowtrace.io"
707
+ [n.ETH]: {
708
+ address: "0x0000000000000000000000000000000000000000",
709
+ symbol: n.ETH,
710
+ name: "Ethereum",
711
+ decimals: 18,
712
+ logoURI: "/images/chains/ethereum.svg"
713
+ /* ETH */
714
+ },
715
+ [n.EURC]: {
716
+ address: "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42",
717
+ symbol: n.EURC,
718
+ name: "Euro Coin",
719
+ decimals: 6,
720
+ logoURI: "/images/tokens/eurc.png"
721
+ /* EURC */
722
+ },
723
+ [n.USDC]: {
724
+ address: g("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
725
+ symbol: n.USDC,
726
+ name: "USD Coin",
727
+ fiatISO: "USD",
728
+ decimals: 6,
729
+ logoURI: "/images/tokens/usdc.svg",
730
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
731
+ },
732
+ [n.WETH]: {
733
+ address: g("0x4200000000000000000000000000000000000006"),
734
+ symbol: n.WETH,
735
+ name: "Wrapped Ether",
736
+ decimals: 18,
737
+ logoURI: "/images/tokens/weth.png"
738
+ /* WETH */
739
+ }
585
740
  },
586
- BASE_MAINNET: {
587
- ...G,
588
- tokens: {
589
- [l.USDC]: v
741
+ [c.BASE_TESTNET]: {
742
+ [n.USDC]: {
743
+ address: g("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
744
+ symbol: n.USDC,
745
+ name: "USD Coin",
746
+ fiatISO: "USD",
747
+ decimals: 6,
748
+ logoURI: "/images/tokens/usdc.svg",
749
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
750
+ }
751
+ },
752
+ [c.BSC]: {
753
+ [n.BNB]: {
754
+ address: "0x0000000000000000000000000000000000000000",
755
+ symbol: n.BNB,
756
+ name: "BNB",
757
+ decimals: 18,
758
+ logoURI: "/images/chains/bsc.webp"
759
+ /* BNB */
760
+ },
761
+ [n.BUSD]: {
762
+ address: "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
763
+ symbol: n.BUSD,
764
+ name: "Binance USD",
765
+ decimals: 18,
766
+ logoURI: "/images/tokens/busd.png"
767
+ /* BUSD */
590
768
  },
591
- explorer: "https://basescan.org"
769
+ [n.DAI]: {
770
+ address: "0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",
771
+ symbol: n.DAI,
772
+ name: "Dai Stablecoin",
773
+ decimals: 18,
774
+ logoURI: "/images/tokens/dai.png"
775
+ /* DAI */
776
+ },
777
+ [n.ETH]: {
778
+ address: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8",
779
+ symbol: n.ETH,
780
+ name: "Ethereum",
781
+ decimals: 18,
782
+ logoURI: "/images/chains/ethereum.svg"
783
+ /* ETH */
784
+ },
785
+ [n.USDC]: {
786
+ address: g("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
787
+ symbol: n.USDC,
788
+ decimals: 18,
789
+ name: "USD Coin",
790
+ logoURI: "/images/tokens/usdc.svg",
791
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
792
+ },
793
+ [n.USDT]: {
794
+ address: "0x55d398326f99059fF775485246999027B3197955",
795
+ symbol: n.USDT,
796
+ name: "Tether USD",
797
+ decimals: 18,
798
+ logoURI: "/images/tokens/usdt.png"
799
+ /* USDT */
800
+ }
592
801
  },
593
- BASE_TESTNET: {
594
- ...q,
595
- tokens: {
596
- [l.USDC]: C
802
+ [c.ETHEREUM]: {
803
+ [n.BUSD]: {
804
+ address: "0x4Fabb145d64652a948d72533023f6E7A623C7C53",
805
+ symbol: n.BUSD,
806
+ name: "Binance USD",
807
+ decimals: 18,
808
+ logoURI: "/images/tokens/busd.png"
809
+ /* BUSD */
810
+ },
811
+ [n.DAI]: {
812
+ address: g("0x6B175474E89094C44Da98b954EedeAC495271d0F"),
813
+ symbol: n.DAI,
814
+ name: "Dai Stablecoin",
815
+ decimals: 18,
816
+ logoURI: "/images/tokens/dai.png"
817
+ /* DAI */
818
+ },
819
+ [n.ETH]: {
820
+ address: "0x0000000000000000000000000000000000000000",
821
+ symbol: n.ETH,
822
+ name: "Ethereum",
823
+ decimals: 18,
824
+ logoURI: "/images/chains/ethereum.svg"
825
+ /* ETH */
826
+ },
827
+ [n.EURC]: {
828
+ address: "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
829
+ symbol: n.EURC,
830
+ name: "Euro Coin",
831
+ decimals: 6,
832
+ logoURI: "/images/tokens/eurc.png"
833
+ /* EURC */
597
834
  },
598
- explorer: "https://sepolia.basescan.org"
835
+ [n.STRK]: {
836
+ address: "0xCa14007Eff0dB1f8135f4C25B34De49AB0d42766",
837
+ symbol: n.STRK,
838
+ name: "Starknet Token",
839
+ decimals: 18,
840
+ logoURI: "/images/chains/starknet.svg"
841
+ /* STRK */
842
+ },
843
+ [n.USDC]: {
844
+ address: g("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
845
+ symbol: n.USDC,
846
+ name: "USD Coin",
847
+ decimals: 6,
848
+ logoURI: "/images/tokens/usdc.svg",
849
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
850
+ },
851
+ [n.USDT]: {
852
+ address: g("0xdAC17F958D2ee523a2206206994597C13D831ec7"),
853
+ symbol: n.USDT,
854
+ name: "Tether USD",
855
+ decimals: 6,
856
+ logoURI: "/images/tokens/usdt.png"
857
+ /* USDT */
858
+ },
859
+ [n.WETH]: {
860
+ address: g("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),
861
+ symbol: n.WETH,
862
+ name: "Wrapped Ether",
863
+ decimals: 18,
864
+ logoURI: "/images/tokens/weth.png"
865
+ /* WETH */
866
+ }
599
867
  },
600
- BSC_MAINNET: {
601
- ...W,
602
- tokens: {
603
- [l.USDC]: N
868
+ [c.ETHEREUM_TESTNET]: {
869
+ [n.USDC]: {
870
+ address: g("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
871
+ symbol: n.USDC,
872
+ decimals: 6,
873
+ name: "USD Coin",
874
+ logoURI: "/images/tokens/usdc.svg",
875
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
876
+ }
877
+ },
878
+ [c.HYPEREVM]: {
879
+ [n.USDC]: {
880
+ address: "0xb88339CB7199b77E23DB6E890353E22632Ba630f",
881
+ symbol: n.USDC,
882
+ name: "USD Coin",
883
+ decimals: 6,
884
+ logoURI: "/images/tokens/usdc.svg"
885
+ /* USDC */
886
+ }
887
+ },
888
+ [c.LISK]: {
889
+ [n.USDC]: {
890
+ address: "0xF242275d3a6527d877f2c927a82D9b057609cc71",
891
+ symbol: n.USDC,
892
+ name: "USD Coin",
893
+ decimals: 6,
894
+ logoURI: "/images/tokens/usdc.svg"
895
+ /* USDC */
896
+ }
897
+ },
898
+ [c.MONAD]: {
899
+ [n.USDC]: {
900
+ address: "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
901
+ symbol: n.USDC,
902
+ name: "USD Coin",
903
+ decimals: 6,
904
+ logoURI: "/images/tokens/usdc.svg"
905
+ /* USDC */
906
+ }
907
+ },
908
+ [c.MONAD_TESTNET]: {
909
+ [n.USDC]: {
910
+ address: "0x534b2f3A21130d7a60830c2Df862319e593943A3",
911
+ symbol: n.USDC,
912
+ name: "USD Coin",
913
+ decimals: 6,
914
+ logoURI: "/images/tokens/usdc.svg"
915
+ /* USDC */
916
+ }
917
+ },
918
+ [c.OPTIMISM]: {
919
+ [n.DAI]: {
920
+ address: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
921
+ symbol: n.DAI,
922
+ name: "Dai Stablecoin",
923
+ decimals: 18,
924
+ logoURI: "/images/tokens/dai.png"
925
+ /* DAI */
604
926
  },
605
- explorer: "https://bscscan.com"
927
+ [n.ETH]: {
928
+ address: "0x0000000000000000000000000000000000000000",
929
+ symbol: n.ETH,
930
+ name: "Ethereum",
931
+ decimals: 18,
932
+ logoURI: "/images/chains/ethereum.svg"
933
+ /* ETH */
934
+ },
935
+ [n.USDC]: {
936
+ address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
937
+ symbol: n.USDC,
938
+ name: "USD Coin",
939
+ decimals: 6,
940
+ logoURI: "/images/tokens/usdc.svg"
941
+ /* USDC */
942
+ },
943
+ [n.USDT]: {
944
+ address: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
945
+ symbol: n.USDT,
946
+ name: "Tether USD",
947
+ decimals: 6,
948
+ logoURI: "/images/tokens/usdt.png"
949
+ /* USDT */
950
+ },
951
+ [n.WETH]: {
952
+ address: "0x4200000000000000000000000000000000000006",
953
+ symbol: n.WETH,
954
+ name: "Wrapped Ether",
955
+ decimals: 18,
956
+ logoURI: "/images/tokens/weth.png"
957
+ /* WETH */
958
+ }
606
959
  },
607
- ETHEREUM_MAINNET: {
608
- ...J,
609
- tokens: {
610
- [l.USDC]: k
960
+ [c.OPTIMISM_TESTNET]: {
961
+ [n.USDC]: {
962
+ address: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7",
963
+ symbol: n.USDC,
964
+ name: "USD Coin",
965
+ decimals: 6,
966
+ logoURI: "/images/tokens/usdc.svg"
967
+ /* USDC */
968
+ }
969
+ },
970
+ [c.POLYGON]: {
971
+ [n.DAI]: {
972
+ address: "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
973
+ symbol: n.DAI,
974
+ name: "Dai Stablecoin",
975
+ decimals: 18,
976
+ logoURI: "/images/tokens/dai.png"
977
+ /* DAI */
978
+ },
979
+ [n.USDC]: {
980
+ address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
981
+ symbol: n.USDC,
982
+ name: "USD Coin",
983
+ decimals: 6,
984
+ logoURI: "/images/tokens/usdc.svg"
985
+ /* USDC */
611
986
  },
612
- explorer: "https://etherscan.io"
987
+ [n.USDT]: {
988
+ address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
989
+ symbol: n.USDT,
990
+ name: "Tether USD",
991
+ decimals: 6,
992
+ logoURI: "/images/tokens/usdt.png"
993
+ /* USDT */
994
+ },
995
+ [n.WETH]: {
996
+ address: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
997
+ symbol: n.WETH,
998
+ name: "Wrapped Ether",
999
+ decimals: 18,
1000
+ logoURI: "/images/tokens/weth.png"
1001
+ /* WETH */
1002
+ }
613
1003
  },
614
- ETHEREUM_TESTNET: {
615
- ...Q,
616
- tokens: {
617
- [l.USDC]: B
1004
+ [c.STARKNET]: {
1005
+ [n.DAI]: {
1006
+ address: "0x05574eb6b8789a91466f902c380d978e472db68170ff82a5b650b95a58ddf4ad",
1007
+ symbol: n.DAI,
1008
+ name: "Dai Stablecoin",
1009
+ decimals: 18,
1010
+ logoURI: "/images/tokens/dai.png"
1011
+ /* DAI */
1012
+ },
1013
+ [n.ETH]: {
1014
+ address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
1015
+ symbol: n.ETH,
1016
+ name: "Ethereum",
1017
+ decimals: 18,
1018
+ logoURI: "/images/chains/ethereum.svg"
1019
+ /* ETH */
618
1020
  },
619
- explorer: "https://sepolia.etherscan.io"
1021
+ [n.LORDS]: {
1022
+ address: "0x0124aeb495b947201f5faC96fD1138E326AD86195B98df6DEc9009158A533B49",
1023
+ symbol: n.LORDS,
1024
+ name: "LORDS Token",
1025
+ decimals: 18,
1026
+ logoURI: "/images/tokens/lords.png"
1027
+ /* LORDS */
1028
+ },
1029
+ [n.STRK]: {
1030
+ address: "0x04718f5a0Fc34cC1AF16A1cdee98fFB20C31f5cD61D6Ab07201858f4287c938D",
1031
+ symbol: n.STRK,
1032
+ name: "Starknet Token",
1033
+ decimals: 18,
1034
+ logoURI: "/images/chains/starknet.svg"
1035
+ /* STRK */
1036
+ },
1037
+ [n.USDC]: {
1038
+ address: "0x033068F6539f8e6e6b131e6B2B814e6c34A5224bC66947c47DaB9dFeE93b35fb",
1039
+ symbol: n.USDC,
1040
+ name: "USD Coin",
1041
+ decimals: 6,
1042
+ logoURI: "/images/tokens/usdc.svg",
1043
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1044
+ },
1045
+ [n.USDT]: {
1046
+ address: "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",
1047
+ symbol: n.USDT,
1048
+ name: "Tether USD",
1049
+ decimals: 6,
1050
+ logoURI: "/images/tokens/usdt.png"
1051
+ /* USDT */
1052
+ }
1053
+ },
1054
+ [c.STARKNET_TESTNET]: {
1055
+ [n.USDC]: {
1056
+ address: "0x0512feAc6339Ff7889822cb5aA2a86C848e9D392bB0E3E237C008674feeD8343",
1057
+ symbol: n.USDC,
1058
+ name: "USD Coin",
1059
+ decimals: 6,
1060
+ logoURI: "/images/tokens/usdc.svg"
1061
+ /* USDC */
1062
+ }
1063
+ }
1064
+ }, ds = {
1065
+ ARBITRUM: d[c.ARBITRUM],
1066
+ ARBITRUM_TESTNET: d[c.ARBITRUM_TESTNET],
1067
+ AVALANCHE: d[c.AVALANCHE],
1068
+ AVALANCHE_TESTNET: d[c.AVALANCHE_TESTNET],
1069
+ BASE: d[c.BASE],
1070
+ BASE_TESTNET: d[c.BASE_TESTNET],
1071
+ BSC: d[c.BSC],
1072
+ ETHEREUM: d[c.ETHEREUM],
1073
+ ETHEREUM_TESTNET: d[c.ETHEREUM_TESTNET],
1074
+ STARKNET: d[c.STARKNET]
1075
+ }, ls = {
1076
+ ARBITRUM_MAINNET: {
1077
+ ...se,
1078
+ tokens: d[c.ARBITRUM]
1079
+ },
1080
+ ARBITRUM_TESTNET: {
1081
+ ...te,
1082
+ tokens: d[c.ARBITRUM_TESTNET]
1083
+ },
1084
+ AVALANCHE_MAINNET: {
1085
+ ...ne,
1086
+ tokens: d[c.AVALANCHE]
1087
+ },
1088
+ AVALANCHE_TESTNET: {
1089
+ ...oe,
1090
+ tokens: d[c.AVALANCHE_TESTNET]
1091
+ },
1092
+ BASE_MAINNET: {
1093
+ ...ie,
1094
+ tokens: d[c.BASE]
1095
+ },
1096
+ BASE_TESTNET: {
1097
+ ...ae,
1098
+ tokens: d[c.BASE_TESTNET]
1099
+ },
1100
+ BSC_MAINNET: {
1101
+ ...re,
1102
+ tokens: d[c.BSC]
1103
+ },
1104
+ ETHEREUM_MAINNET: {
1105
+ ...ce,
1106
+ tokens: d[c.ETHEREUM]
1107
+ },
1108
+ ETHEREUM_TESTNET: {
1109
+ ...de,
1110
+ tokens: d[c.ETHEREUM_TESTNET]
1111
+ },
1112
+ HYPEREVM_MAINNET: {
1113
+ ...le,
1114
+ tokens: d[c.HYPEREVM]
1115
+ },
1116
+ LISK_MAINNET: {
1117
+ ...me,
1118
+ tokens: d[c.LISK]
1119
+ },
1120
+ MONAD_MAINNET: {
1121
+ ...ue,
1122
+ tokens: d[c.MONAD]
1123
+ },
1124
+ MONAD_TESTNET: {
1125
+ ...ge,
1126
+ tokens: d[c.MONAD_TESTNET]
1127
+ },
1128
+ OPTIMISM_MAINNET: {
1129
+ ...Ee,
1130
+ tokens: d[c.OPTIMISM]
1131
+ },
1132
+ OPTIMISM_TESTNET: {
1133
+ ...he,
1134
+ tokens: d[c.OPTIMISM_TESTNET]
1135
+ },
1136
+ POLYGON_MAINNET: {
1137
+ ...fe,
1138
+ tokens: d[c.POLYGON]
620
1139
  },
621
1140
  STARKNET_MAINNET: {
622
- ...ee,
623
- tokens: {
624
- [l.USDC]: tt
625
- },
626
- explorer: ""
1141
+ ...Te,
1142
+ tokens: d[c.STARKNET]
1143
+ },
1144
+ STARKNET_TESTNET: {
1145
+ ...pe,
1146
+ tokens: d[c.STARKNET_TESTNET]
627
1147
  }
628
1148
  };
629
- var st = /* @__PURE__ */ ((e) => (e.ARBITRUM = "ARBITRUM_MAINNET", e.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", e.AVALANCHE = "AVALANCHE_MAINNET", e.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", e.BASE = "BASE_MAINNET", e.BASE_TESTNET = "BASE_TESTNET", e.BSC = "BSC_MAINNET", e.ETHEREUM = "ETHEREUM_MAINNET", e.ETHEREUM_TESTNET = "ETHEREUM_TESTNET", e.STARKNET = "STARKNET_MAINNET", e))(st || {}), ot = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(ot || {});
630
- function rt(e) {
631
- return nt[R[e || ""].chainId]?.decimals || 6;
632
- }
633
- const it = (e) => {
634
- const t = e?.trim().toUpperCase();
635
- if (R[t])
636
- return R[t];
637
- };
638
- function ct(e, t) {
639
- return it(e)?.tokens[t]?.address;
1149
+ function ms(e, s) {
1150
+ if (e.symbol !== s)
1151
+ throw new Error(
1152
+ `Token symbol mismatch: token is ${e.symbol}, tokenSymbol is ${s}. The token symbol must match the tokenSymbol parameter.`
1153
+ );
1154
+ }
1155
+ function ns(e, s) {
1156
+ const t = s.toLowerCase().trim(), o = d[e];
1157
+ if (!o)
1158
+ throw new Error(
1159
+ `Chain not found: ${e}. The chain key must be a valid chain identifier.`
1160
+ );
1161
+ let i;
1162
+ for (const r in o) {
1163
+ const a = o[r];
1164
+ if (a && a.address.toLowerCase() === t.toLowerCase()) {
1165
+ i = a;
1166
+ break;
1167
+ }
1168
+ }
1169
+ if (!i)
1170
+ 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.`
1172
+ );
1173
+ return i;
1174
+ }
1175
+ function us(e, s) {
1176
+ if (e.symbol !== s)
1177
+ throw new Error(
1178
+ `Token symbol mismatch: token symbol is "${e.symbol}", expected "${s}". The token symbol must match the expected token symbol.`
1179
+ );
1180
+ }
1181
+ function gs(e, s, t) {
1182
+ const o = ns(e, s);
1183
+ if (o.symbol !== t)
1184
+ 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.`
1186
+ );
1187
+ return o;
1188
+ }
1189
+ function J(e, s) {
1190
+ return d[e]?.[s];
1191
+ }
1192
+ function Es(e, s) {
1193
+ return J(e, s)?.address;
1194
+ }
1195
+ function hs(e, s) {
1196
+ return J(e, s)?.decimals;
640
1197
  }
641
- var pe = /* @__PURE__ */ ((e) => (e.PRODUCTION = "production", e.STAGING = "staging", e))(pe || {});
642
- class a {
643
- constructor({ api_key: t, env: n, seesion_token: s, props: o }) {
644
- this.api_key = t || "", this.sessionToken = s || "", this.env = n ?? pe.PRODUCTION, this.props = o;
1198
+ var Q = /* @__PURE__ */ ((e) => (e.PRODUCTION = "production", e.STAGING = "staging", e))(Q || {});
1199
+ 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;
645
1202
  }
646
- static async config(t) {
647
- if (!a.app) {
648
- if (!t)
1203
+ static async config(s) {
1204
+ if (!m.app) {
1205
+ if (!s)
649
1206
  throw new Error("Please provide an api_key");
650
- a.app = new a(t);
1207
+ m.app = new m(s);
651
1208
  }
652
- return t && (t.api_key !== void 0 && (a.app.api_key = t.api_key), t.seesion_token !== void 0 && (a.app.sessionToken = t.seesion_token), t.env !== void 0 && (a.app.env = t.env), t.props !== void 0 && (a.app.props = t.props)), a.app;
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;
653
1210
  }
654
1211
  static getApiKey() {
655
- if (!a.app)
1212
+ if (!m.app)
656
1213
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
657
- return a.app.api_key;
1214
+ return m.app.api_key;
658
1215
  }
659
1216
  static getSessionToken() {
660
- if (!a.app)
1217
+ if (!m.app)
661
1218
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
662
- return a.app.sessionToken;
1219
+ return m.app.sessionToken;
663
1220
  }
664
1221
  static getProps() {
665
- if (!a.app)
1222
+ if (!m.app)
666
1223
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
667
- return a.app.props;
1224
+ return m.app.props;
668
1225
  }
669
1226
  static getEnv() {
670
- if (!a.app)
1227
+ if (!m.app)
671
1228
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
672
- return a.app.env === "internal" ? "staging" : a.app.env;
1229
+ return m.app.env === "internal" ? "staging" : m.app.env;
673
1230
  }
674
1231
  static getBaseUrl() {
675
- if (!a.app)
1232
+ if (!m.app)
676
1233
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
677
- switch (a.app.env) {
1234
+ switch (m.app.env) {
678
1235
  case "production":
679
1236
  return "https://api.chainrails.io/api/v1";
680
1237
  case "staging":
@@ -685,20 +1242,50 @@ class a {
685
1242
  return "https://api.chainrails.io/api/v1";
686
1243
  }
687
1244
  }
688
- static getPayModalUrl(t) {
689
- if (!a.app)
1245
+ static getPayModalUrl(s) {
1246
+ if (!m.app)
690
1247
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
691
- const n = a.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", s = Number(t), o = t && !isNaN(Number(t)) && s > 0 ? "/pay/" : "/deposit/", r = `${t && !isNaN(Number(t)) && s > 0 ? s * 100 : ""}`;
692
- return n + o + r;
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;
693
1250
  }
694
1251
  }
695
1252
  export {
696
- a as Chainrails,
697
- R as allChains,
698
- st as chains,
699
- pe as environment,
700
- it as getChainByChainEnum,
701
- ct as getTokenAddress,
702
- rt as getTokenDecimals,
703
- ot as tokens
1253
+ n as AmountSymbols,
1254
+ u as ChainTypes,
1255
+ m as Chainrails,
1256
+ c as Chains,
1257
+ cs as DEFAULT_AMOUNT_SYMBOL,
1258
+ d as TOKEN_REGISTRY,
1259
+ ds as Tokens,
1260
+ ls as allChains,
1261
+ 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,
1273
+ Q as environment,
1274
+ ce as ethereum,
1275
+ de as ethereumTestnet,
1276
+ J as getToken,
1277
+ Es as getTokenAddress,
1278
+ hs as getTokenDecimals,
1279
+ le as hyperevm,
1280
+ is as linea,
1281
+ me as lisk,
1282
+ ue as monad,
1283
+ ge as monadTestnet,
1284
+ Ee as optimism,
1285
+ he as optimismTestnet,
1286
+ fe as polygon,
1287
+ Te as starknet,
1288
+ pe as starknetTestnet,
1289
+ as as unichain,
1290
+ rs as worldchain
704
1291
  };