@chainrails/common 0.2.6 → 0.3.1
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.
|
@@ -144,14 +144,14 @@ const E = {
|
|
|
144
144
|
cctpDomain: null,
|
|
145
145
|
logoURI: "/images/chains/monad.png",
|
|
146
146
|
explorer: "https://testnet.monadvision.com"
|
|
147
|
-
},
|
|
147
|
+
}, ge = {
|
|
148
148
|
type: E.EVM,
|
|
149
149
|
chainId: 10,
|
|
150
150
|
name: "Optimism",
|
|
151
151
|
cctpDomain: 2,
|
|
152
152
|
logoURI: "/images/chains/optimism.svg",
|
|
153
153
|
explorer: "https://optimistic.etherscan.io"
|
|
154
|
-
},
|
|
154
|
+
}, he = {
|
|
155
155
|
type: E.EVM,
|
|
156
156
|
chainId: 11155420,
|
|
157
157
|
name: "Optimism Testnet",
|
|
@@ -196,20 +196,20 @@ const E = {
|
|
|
196
196
|
logoURI: "/images/chains/worldchain.svg",
|
|
197
197
|
explorer: ""
|
|
198
198
|
};
|
|
199
|
-
function
|
|
199
|
+
function N(e, { strict: t = !0 } = {}) {
|
|
200
200
|
return !e || typeof e != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(e) : e.startsWith("0x");
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
return
|
|
202
|
+
function M(e) {
|
|
203
|
+
return N(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
|
|
204
204
|
}
|
|
205
205
|
const L = "2.43.4";
|
|
206
206
|
let D = {
|
|
207
207
|
getDocsUrl: ({ docsBaseUrl: e, docsPath: t = "", docsSlug: s }) => t ? `${e ?? "https://viem.sh"}${t}${s ? `#${s}` : ""}` : void 0,
|
|
208
208
|
version: `viem@${L}`
|
|
209
209
|
};
|
|
210
|
-
class
|
|
210
|
+
class h extends Error {
|
|
211
211
|
constructor(t, s = {}) {
|
|
212
|
-
const o = s.cause instanceof
|
|
212
|
+
const o = s.cause instanceof h ? s.cause.details : s.cause?.message ? s.cause.message : s.details, i = s.cause instanceof h && s.cause.docsPath || s.docsPath, r = D.getDocsUrl?.({ ...s, docsPath: i }), a = [
|
|
213
213
|
t || "An error occurred.",
|
|
214
214
|
"",
|
|
215
215
|
...s.metaMessages ? [...s.metaMessages, ""] : [],
|
|
@@ -257,7 +257,7 @@ class g extends Error {
|
|
|
257
257
|
function F(e, t) {
|
|
258
258
|
return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause !== void 0 ? F(e.cause, t) : t ? null : e;
|
|
259
259
|
}
|
|
260
|
-
class $ extends
|
|
260
|
+
class $ extends h {
|
|
261
261
|
constructor({ size: t, targetSize: s, type: o }) {
|
|
262
262
|
super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${t}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
263
263
|
}
|
|
@@ -293,20 +293,20 @@ function be(e, { dir: t, size: s = 32 } = {}) {
|
|
|
293
293
|
}
|
|
294
294
|
return o;
|
|
295
295
|
}
|
|
296
|
-
class Ie extends
|
|
296
|
+
class Ie extends h {
|
|
297
297
|
constructor({ max: t, min: s, signed: o, size: i, value: r }) {
|
|
298
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" });
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
class Ue extends
|
|
301
|
+
class Ue extends h {
|
|
302
302
|
constructor({ givenSize: t, maxSize: s }) {
|
|
303
303
|
super(`Size cannot exceed ${s} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
function C(e, { size: t }) {
|
|
307
|
-
if (
|
|
307
|
+
if (M(e) > t)
|
|
308
308
|
throw new Ue({
|
|
309
|
-
givenSize:
|
|
309
|
+
givenSize: M(e),
|
|
310
310
|
maxSize: t
|
|
311
311
|
});
|
|
312
312
|
}
|
|
@@ -329,14 +329,14 @@ function De(e, t = {}) {
|
|
|
329
329
|
return o ? U(l, { size: o }) : l;
|
|
330
330
|
}
|
|
331
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);
|
|
334
|
-
}
|
|
335
332
|
function ye(e, t = {}) {
|
|
333
|
+
return typeof e == "number" || typeof e == "bigint" ? Ce(e, t) : typeof e == "boolean" ? Ne(e, t) : N(e) ? P(e, t) : V(e, t);
|
|
334
|
+
}
|
|
335
|
+
function Ne(e, t = {}) {
|
|
336
336
|
const s = new Uint8Array(1);
|
|
337
337
|
return s[0] = Number(e), typeof t.size == "number" ? (C(s, { size: t.size }), U(s, { size: t.size })) : s;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
339
|
+
const g = {
|
|
340
340
|
zero: 48,
|
|
341
341
|
nine: 57,
|
|
342
342
|
A: 65,
|
|
@@ -344,13 +344,13 @@ const h = {
|
|
|
344
344
|
a: 97,
|
|
345
345
|
f: 102
|
|
346
346
|
};
|
|
347
|
-
function
|
|
348
|
-
if (e >=
|
|
349
|
-
return e -
|
|
350
|
-
if (e >=
|
|
351
|
-
return e - (
|
|
352
|
-
if (e >=
|
|
353
|
-
return e - (
|
|
347
|
+
function k(e) {
|
|
348
|
+
if (e >= g.zero && e <= g.nine)
|
|
349
|
+
return e - g.zero;
|
|
350
|
+
if (e >= g.A && e <= g.F)
|
|
351
|
+
return e - (g.A - 10);
|
|
352
|
+
if (e >= g.a && e <= g.f)
|
|
353
|
+
return e - (g.a - 10);
|
|
354
354
|
}
|
|
355
355
|
function P(e, t = {}) {
|
|
356
356
|
let s = e;
|
|
@@ -359,9 +359,9 @@ function P(e, t = {}) {
|
|
|
359
359
|
o.length % 2 && (o = `0${o}`);
|
|
360
360
|
const i = o.length / 2, r = new Uint8Array(i);
|
|
361
361
|
for (let a = 0, l = 0; a < i; a++) {
|
|
362
|
-
const T =
|
|
362
|
+
const T = k(o.charCodeAt(l++)), f = k(o.charCodeAt(l++));
|
|
363
363
|
if (T === void 0 || f === void 0)
|
|
364
|
-
throw new
|
|
364
|
+
throw new h(`Invalid byte sequence ("${o[l - 2]}${o[l - 1]}" in "${o}").`);
|
|
365
365
|
r[a] = T * 16 + f;
|
|
366
366
|
}
|
|
367
367
|
return r;
|
|
@@ -374,20 +374,20 @@ function V(e, t = {}) {
|
|
|
374
374
|
const s = Re.encode(e);
|
|
375
375
|
return typeof t.size == "number" ? (C(s, { size: t.size }), U(s, { dir: "right", size: t.size })) : s;
|
|
376
376
|
}
|
|
377
|
-
const b = /* @__PURE__ */ BigInt(2 ** 32 - 1),
|
|
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 };
|
|
380
|
-
}
|
|
377
|
+
const b = /* @__PURE__ */ BigInt(2 ** 32 - 1), B = /* @__PURE__ */ BigInt(32);
|
|
381
378
|
function xe(e, t = !1) {
|
|
379
|
+
return t ? { h: Number(e & b), l: Number(e >> B & b) } : { h: Number(e >> B & b) | 0, l: Number(e & b) | 0 };
|
|
380
|
+
}
|
|
381
|
+
function Me(e, t = !1) {
|
|
382
382
|
const s = e.length;
|
|
383
383
|
let o = new Uint32Array(s), i = new Uint32Array(s);
|
|
384
384
|
for (let r = 0; r < s; r++) {
|
|
385
|
-
const { h: a, l } =
|
|
385
|
+
const { h: a, l } = xe(e[r], t);
|
|
386
386
|
[o[r], i[r]] = [a, l];
|
|
387
387
|
}
|
|
388
388
|
return [o, i];
|
|
389
389
|
}
|
|
390
|
-
const
|
|
390
|
+
const ke = (e, t, s) => e << s | t >>> 32 - s, Be = (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;
|
|
391
391
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
392
392
|
function Oe(e) {
|
|
393
393
|
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
@@ -453,7 +453,7 @@ for (let e = 0, t = S, s = 1, o = 0; e < 24; e++) {
|
|
|
453
453
|
t = (t << S ^ (t >> Ye) * Ge) % je, t & We && (i ^= S << (S << /* @__PURE__ */ BigInt(r)) - S);
|
|
454
454
|
j.push(i);
|
|
455
455
|
}
|
|
456
|
-
const G =
|
|
456
|
+
const G = Me(j, !0), Xe = G[0], qe = G[1], H = (e, t, s) => s > 32 ? we(e, t, s) : ke(e, t, s), _ = (e, t, s) => s > 32 ? ve(e, t, s) : Be(e, t, s);
|
|
457
457
|
function Je(e, t = 24) {
|
|
458
458
|
const s = new Uint32Array(10);
|
|
459
459
|
for (let o = 24 - t; o < 24; o++) {
|
|
@@ -479,7 +479,7 @@ function Je(e, t = 24) {
|
|
|
479
479
|
}
|
|
480
480
|
K(s);
|
|
481
481
|
}
|
|
482
|
-
class
|
|
482
|
+
class x extends Ve {
|
|
483
483
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
484
484
|
constructor(t, s, o, i = !1, r = 24) {
|
|
485
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))
|
|
@@ -541,14 +541,14 @@ class M extends Ve {
|
|
|
541
541
|
}
|
|
542
542
|
_cloneInto(t) {
|
|
543
543
|
const { blockLen: s, suffix: o, outputLen: i, rounds: r, enableXOF: a } = this;
|
|
544
|
-
return t || (t = new
|
|
544
|
+
return t || (t = new x(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;
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
const Qe = (e, t, s) => Ke(() => new
|
|
547
|
+
const Qe = (e, t, s) => Ke(() => new x(t, e, s)), Ze = Qe(1, 136, 256 / 8);
|
|
548
548
|
function et(e, t) {
|
|
549
|
-
return Ze(
|
|
549
|
+
return Ze(N(e, { strict: !1 }) ? ye(e) : e);
|
|
550
550
|
}
|
|
551
|
-
class tt extends
|
|
551
|
+
class tt extends h {
|
|
552
552
|
constructor({ address: t }) {
|
|
553
553
|
super(`Address "${t}" is invalid.`, {
|
|
554
554
|
metaMessages: [
|
|
@@ -595,13 +595,13 @@ function u(e, t) {
|
|
|
595
595
|
throw new tt({ address: e });
|
|
596
596
|
return q(e, t);
|
|
597
597
|
}
|
|
598
|
-
const st = /^0x[a-fA-F0-9]{40}$/,
|
|
598
|
+
const st = /^0x[a-fA-F0-9]{40}$/, y = /* @__PURE__ */ new X(8192);
|
|
599
599
|
function nt(e, t) {
|
|
600
600
|
const { strict: s = !0 } = t ?? {}, o = `${e}.${s}`;
|
|
601
|
-
if (
|
|
602
|
-
return
|
|
601
|
+
if (y.has(o))
|
|
602
|
+
return y.get(o);
|
|
603
603
|
const i = st.test(e) ? e.toLowerCase() === e ? !0 : s ? q(e) === e : !0 : !1;
|
|
604
|
-
return
|
|
604
|
+
return y.set(o, i), i;
|
|
605
605
|
}
|
|
606
606
|
const n = {
|
|
607
607
|
USDC: "USDC",
|
|
@@ -667,6 +667,13 @@ const n = {
|
|
|
667
667
|
logoURI: "/images/tokens/usdc.svg",
|
|
668
668
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
669
669
|
}
|
|
670
|
+
// [AmountSymbols.WETH]: {
|
|
671
|
+
// address: getAddress("0x980B62Da83eFf3D4576C647993b0c1D7faf17c73"),
|
|
672
|
+
// symbol: AmountSymbols.WETH,
|
|
673
|
+
// name: "Wrapped Ether",
|
|
674
|
+
// decimals: 18,
|
|
675
|
+
// logoURI: TokenLogo.WETH,
|
|
676
|
+
// },
|
|
670
677
|
},
|
|
671
678
|
[c.AVALANCHE]: {
|
|
672
679
|
[n.DAI]: {
|
|
@@ -713,6 +720,13 @@ const n = {
|
|
|
713
720
|
logoURI: "/images/tokens/usdc.svg",
|
|
714
721
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
715
722
|
}
|
|
723
|
+
// [AmountSymbols.WETH]: {
|
|
724
|
+
// address: getAddress("0xd00ae08403B9bbb9124bB305C09058E32C39A48c"),
|
|
725
|
+
// symbol: AmountSymbols.WETH,
|
|
726
|
+
// name: "Wrapped Ether",
|
|
727
|
+
// decimals: 18,
|
|
728
|
+
// logoURI: TokenLogo.WETH,
|
|
729
|
+
// },
|
|
716
730
|
},
|
|
717
731
|
[c.BASE]: {
|
|
718
732
|
[n.DAI]: {
|
|
@@ -767,6 +781,13 @@ const n = {
|
|
|
767
781
|
logoURI: "/images/tokens/usdc.svg",
|
|
768
782
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
769
783
|
}
|
|
784
|
+
// [AmountSymbols.WETH]: {
|
|
785
|
+
// address: getAddress("0x4200000000000000000000000000000000000006"),
|
|
786
|
+
// symbol: AmountSymbols.WETH,
|
|
787
|
+
// name: "Wrapped Ether",
|
|
788
|
+
// decimals: 18,
|
|
789
|
+
// logoURI: TokenLogo.WETH,
|
|
790
|
+
// },
|
|
770
791
|
},
|
|
771
792
|
[c.BSC]: {
|
|
772
793
|
[n.BNB]: {
|
|
@@ -816,6 +837,14 @@ const n = {
|
|
|
816
837
|
decimals: 18,
|
|
817
838
|
logoURI: "/images/tokens/usdt.png"
|
|
818
839
|
/* USDT */
|
|
840
|
+
},
|
|
841
|
+
[n.WETH]: {
|
|
842
|
+
address: "0x4db5a66e937a9f4473fa95b1caf1d1e1d62e29ea",
|
|
843
|
+
symbol: n.WETH,
|
|
844
|
+
name: "Wrapped Ether",
|
|
845
|
+
decimals: 18,
|
|
846
|
+
logoURI: "/images/tokens/weth.png"
|
|
847
|
+
/* WETH */
|
|
819
848
|
}
|
|
820
849
|
},
|
|
821
850
|
[c.ETHEREUM]: {
|
|
@@ -893,6 +922,13 @@ const n = {
|
|
|
893
922
|
logoURI: "/images/tokens/usdc.svg",
|
|
894
923
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
895
924
|
}
|
|
925
|
+
// [AmountSymbols.WETH]: {
|
|
926
|
+
// address: getAddress("0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14"),
|
|
927
|
+
// symbol: AmountSymbols.WETH,
|
|
928
|
+
// name: 'Wrapped Ether',
|
|
929
|
+
// decimals: 18,
|
|
930
|
+
// logoURI: TokenLogo.WETH,
|
|
931
|
+
// },
|
|
896
932
|
},
|
|
897
933
|
[c.HYPEREVM]: {
|
|
898
934
|
[n.USDC]: {
|
|
@@ -903,6 +939,13 @@ const n = {
|
|
|
903
939
|
logoURI: "/images/tokens/usdc.svg"
|
|
904
940
|
/* USDC */
|
|
905
941
|
}
|
|
942
|
+
// [AmountSymbols.WETH]: {
|
|
943
|
+
// address: '0x4200000000000000000000000000000000000006',
|
|
944
|
+
// symbol: AmountSymbols.WETH,
|
|
945
|
+
// name: 'Wrapped Ether',
|
|
946
|
+
// decimals: 18,
|
|
947
|
+
// logoURI: TokenLogo.WETH,
|
|
948
|
+
// },
|
|
906
949
|
},
|
|
907
950
|
[c.LISK]: {
|
|
908
951
|
[n.USDC]: {
|
|
@@ -913,6 +956,13 @@ const n = {
|
|
|
913
956
|
logoURI: "/images/tokens/usdc.svg"
|
|
914
957
|
/* USDC */
|
|
915
958
|
}
|
|
959
|
+
// [AmountSymbols.WETH]: {
|
|
960
|
+
// address: '0x4200000000000000000000000000000000000006',
|
|
961
|
+
// symbol: AmountSymbols.WETH,
|
|
962
|
+
// name: 'Wrapped Ether',
|
|
963
|
+
// decimals: 18,
|
|
964
|
+
// logoURI: TokenLogo.WETH,
|
|
965
|
+
// },
|
|
916
966
|
},
|
|
917
967
|
[c.MONAD]: {
|
|
918
968
|
[n.USDC]: {
|
|
@@ -923,6 +973,13 @@ const n = {
|
|
|
923
973
|
logoURI: "/images/tokens/usdc.svg"
|
|
924
974
|
/* USDC */
|
|
925
975
|
}
|
|
976
|
+
// [AmountSymbols.WETH]: {
|
|
977
|
+
// address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
978
|
+
// symbol: AmountSymbols.WETH,
|
|
979
|
+
// name: 'Wrapped Ether',
|
|
980
|
+
// decimals: 18,
|
|
981
|
+
// logoURI: TokenLogo.WETH,
|
|
982
|
+
// },
|
|
926
983
|
},
|
|
927
984
|
[c.MONAD_TESTNET]: {
|
|
928
985
|
[n.USDC]: {
|
|
@@ -933,6 +990,13 @@ const n = {
|
|
|
933
990
|
logoURI: "/images/tokens/usdc.svg"
|
|
934
991
|
/* USDC */
|
|
935
992
|
}
|
|
993
|
+
// [AmountSymbols.WETH]: {
|
|
994
|
+
// address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
995
|
+
// symbol: AmountSymbols.WETH,
|
|
996
|
+
// name: 'Wrapped Ether',
|
|
997
|
+
// decimals: 18,
|
|
998
|
+
// logoURI: TokenLogo.WETH,
|
|
999
|
+
// },
|
|
936
1000
|
},
|
|
937
1001
|
[c.OPTIMISM]: {
|
|
938
1002
|
[n.DAI]: {
|
|
@@ -985,6 +1049,13 @@ const n = {
|
|
|
985
1049
|
logoURI: "/images/tokens/usdc.svg"
|
|
986
1050
|
/* USDC */
|
|
987
1051
|
}
|
|
1052
|
+
// [AmountSymbols.WETH]: {
|
|
1053
|
+
// address: '0x4200000000000000000000000000000000000006',
|
|
1054
|
+
// symbol: AmountSymbols.WETH,
|
|
1055
|
+
// name: 'Wrapped Ether',
|
|
1056
|
+
// decimals: 18,
|
|
1057
|
+
// logoURI: TokenLogo.WETH,
|
|
1058
|
+
// },
|
|
988
1059
|
},
|
|
989
1060
|
[c.POLYGON]: {
|
|
990
1061
|
[n.DAI]: {
|
|
@@ -1069,6 +1140,8 @@ const n = {
|
|
|
1069
1140
|
logoURI: "/images/tokens/usdt.png"
|
|
1070
1141
|
/* USDT */
|
|
1071
1142
|
}
|
|
1143
|
+
// [AmountSymbols.WETH]: {
|
|
1144
|
+
// },
|
|
1072
1145
|
},
|
|
1073
1146
|
[c.STARKNET_TESTNET]: {
|
|
1074
1147
|
[n.USDC]: {
|
|
@@ -1145,11 +1218,11 @@ const n = {
|
|
|
1145
1218
|
tokens: d[c.MONAD_TESTNET]
|
|
1146
1219
|
},
|
|
1147
1220
|
OPTIMISM_MAINNET: {
|
|
1148
|
-
...
|
|
1221
|
+
...ge,
|
|
1149
1222
|
tokens: d[c.OPTIMISM]
|
|
1150
1223
|
},
|
|
1151
1224
|
OPTIMISM_TESTNET: {
|
|
1152
|
-
...
|
|
1225
|
+
...he,
|
|
1153
1226
|
tokens: d[c.OPTIMISM_TESTNET]
|
|
1154
1227
|
},
|
|
1155
1228
|
POLYGON_MAINNET: {
|
|
@@ -1173,13 +1246,13 @@ function Tt(e) {
|
|
|
1173
1246
|
throw new Error(`Invalid chain: ${e}. Chain must be a valid chain alias or internal chain value from Chains.`);
|
|
1174
1247
|
return t;
|
|
1175
1248
|
}
|
|
1176
|
-
function
|
|
1249
|
+
function gt(e) {
|
|
1177
1250
|
for (const [t, s] of Object.entries(c))
|
|
1178
1251
|
if (s === e)
|
|
1179
1252
|
return t;
|
|
1180
1253
|
throw new Error(`Invalid internal chain value: ${e}. Internal chain value must be a valid value from InternalChains.`);
|
|
1181
1254
|
}
|
|
1182
|
-
function
|
|
1255
|
+
function ht(e) {
|
|
1183
1256
|
return e in te;
|
|
1184
1257
|
}
|
|
1185
1258
|
function it(e) {
|
|
@@ -1317,18 +1390,18 @@ export {
|
|
|
1317
1390
|
At as getTokenAddress,
|
|
1318
1391
|
bt as getTokenDecimals,
|
|
1319
1392
|
me as hyperevm,
|
|
1320
|
-
|
|
1393
|
+
ht as isChainAlias,
|
|
1321
1394
|
it as isInternalChain,
|
|
1322
1395
|
ct as linea,
|
|
1323
1396
|
Ee as lisk,
|
|
1324
1397
|
ue as monad,
|
|
1325
1398
|
Te as monadTestnet,
|
|
1326
|
-
|
|
1327
|
-
|
|
1399
|
+
ge as optimism,
|
|
1400
|
+
he as optimismTestnet,
|
|
1328
1401
|
fe as polygon,
|
|
1329
1402
|
pe as starknet,
|
|
1330
1403
|
Se as starknetTestnet,
|
|
1331
|
-
|
|
1404
|
+
gt as toChainAlias,
|
|
1332
1405
|
Tt as toInternalChain,
|
|
1333
1406
|
dt as unichain,
|
|
1334
1407
|
lt as worldchain
|
|
@@ -144,14 +144,14 @@ const E = {
|
|
|
144
144
|
cctpDomain: null,
|
|
145
145
|
logoURI: "/images/chains/monad.png",
|
|
146
146
|
explorer: "https://testnet.monadvision.com"
|
|
147
|
-
},
|
|
147
|
+
}, ge = {
|
|
148
148
|
type: E.EVM,
|
|
149
149
|
chainId: 10,
|
|
150
150
|
name: "Optimism",
|
|
151
151
|
cctpDomain: 2,
|
|
152
152
|
logoURI: "/images/chains/optimism.svg",
|
|
153
153
|
explorer: "https://optimistic.etherscan.io"
|
|
154
|
-
},
|
|
154
|
+
}, he = {
|
|
155
155
|
type: E.EVM,
|
|
156
156
|
chainId: 11155420,
|
|
157
157
|
name: "Optimism Testnet",
|
|
@@ -196,20 +196,20 @@ const E = {
|
|
|
196
196
|
logoURI: "/images/chains/worldchain.svg",
|
|
197
197
|
explorer: ""
|
|
198
198
|
};
|
|
199
|
-
function
|
|
199
|
+
function N(e, { strict: t = !0 } = {}) {
|
|
200
200
|
return !e || typeof e != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(e) : e.startsWith("0x");
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
return
|
|
202
|
+
function M(e) {
|
|
203
|
+
return N(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
|
|
204
204
|
}
|
|
205
205
|
const L = "2.43.4";
|
|
206
206
|
let D = {
|
|
207
207
|
getDocsUrl: ({ docsBaseUrl: e, docsPath: t = "", docsSlug: s }) => t ? `${e ?? "https://viem.sh"}${t}${s ? `#${s}` : ""}` : void 0,
|
|
208
208
|
version: `viem@${L}`
|
|
209
209
|
};
|
|
210
|
-
class
|
|
210
|
+
class h extends Error {
|
|
211
211
|
constructor(t, s = {}) {
|
|
212
|
-
const o = s.cause instanceof
|
|
212
|
+
const o = s.cause instanceof h ? s.cause.details : s.cause?.message ? s.cause.message : s.details, i = s.cause instanceof h && s.cause.docsPath || s.docsPath, r = D.getDocsUrl?.({ ...s, docsPath: i }), a = [
|
|
213
213
|
t || "An error occurred.",
|
|
214
214
|
"",
|
|
215
215
|
...s.metaMessages ? [...s.metaMessages, ""] : [],
|
|
@@ -257,7 +257,7 @@ class g extends Error {
|
|
|
257
257
|
function F(e, t) {
|
|
258
258
|
return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause !== void 0 ? F(e.cause, t) : t ? null : e;
|
|
259
259
|
}
|
|
260
|
-
class $ extends
|
|
260
|
+
class $ extends h {
|
|
261
261
|
constructor({ size: t, targetSize: s, type: o }) {
|
|
262
262
|
super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${t}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
263
263
|
}
|
|
@@ -293,20 +293,20 @@ function be(e, { dir: t, size: s = 32 } = {}) {
|
|
|
293
293
|
}
|
|
294
294
|
return o;
|
|
295
295
|
}
|
|
296
|
-
class Ie extends
|
|
296
|
+
class Ie extends h {
|
|
297
297
|
constructor({ max: t, min: s, signed: o, size: i, value: r }) {
|
|
298
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" });
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
class Ue extends
|
|
301
|
+
class Ue extends h {
|
|
302
302
|
constructor({ givenSize: t, maxSize: s }) {
|
|
303
303
|
super(`Size cannot exceed ${s} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
function C(e, { size: t }) {
|
|
307
|
-
if (
|
|
307
|
+
if (M(e) > t)
|
|
308
308
|
throw new Ue({
|
|
309
|
-
givenSize:
|
|
309
|
+
givenSize: M(e),
|
|
310
310
|
maxSize: t
|
|
311
311
|
});
|
|
312
312
|
}
|
|
@@ -329,14 +329,14 @@ function De(e, t = {}) {
|
|
|
329
329
|
return o ? U(l, { size: o }) : l;
|
|
330
330
|
}
|
|
331
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);
|
|
334
|
-
}
|
|
335
332
|
function ye(e, t = {}) {
|
|
333
|
+
return typeof e == "number" || typeof e == "bigint" ? Ce(e, t) : typeof e == "boolean" ? Ne(e, t) : N(e) ? P(e, t) : V(e, t);
|
|
334
|
+
}
|
|
335
|
+
function Ne(e, t = {}) {
|
|
336
336
|
const s = new Uint8Array(1);
|
|
337
337
|
return s[0] = Number(e), typeof t.size == "number" ? (C(s, { size: t.size }), U(s, { size: t.size })) : s;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
339
|
+
const g = {
|
|
340
340
|
zero: 48,
|
|
341
341
|
nine: 57,
|
|
342
342
|
A: 65,
|
|
@@ -344,13 +344,13 @@ const h = {
|
|
|
344
344
|
a: 97,
|
|
345
345
|
f: 102
|
|
346
346
|
};
|
|
347
|
-
function
|
|
348
|
-
if (e >=
|
|
349
|
-
return e -
|
|
350
|
-
if (e >=
|
|
351
|
-
return e - (
|
|
352
|
-
if (e >=
|
|
353
|
-
return e - (
|
|
347
|
+
function k(e) {
|
|
348
|
+
if (e >= g.zero && e <= g.nine)
|
|
349
|
+
return e - g.zero;
|
|
350
|
+
if (e >= g.A && e <= g.F)
|
|
351
|
+
return e - (g.A - 10);
|
|
352
|
+
if (e >= g.a && e <= g.f)
|
|
353
|
+
return e - (g.a - 10);
|
|
354
354
|
}
|
|
355
355
|
function P(e, t = {}) {
|
|
356
356
|
let s = e;
|
|
@@ -359,9 +359,9 @@ function P(e, t = {}) {
|
|
|
359
359
|
o.length % 2 && (o = `0${o}`);
|
|
360
360
|
const i = o.length / 2, r = new Uint8Array(i);
|
|
361
361
|
for (let a = 0, l = 0; a < i; a++) {
|
|
362
|
-
const T =
|
|
362
|
+
const T = k(o.charCodeAt(l++)), f = k(o.charCodeAt(l++));
|
|
363
363
|
if (T === void 0 || f === void 0)
|
|
364
|
-
throw new
|
|
364
|
+
throw new h(`Invalid byte sequence ("${o[l - 2]}${o[l - 1]}" in "${o}").`);
|
|
365
365
|
r[a] = T * 16 + f;
|
|
366
366
|
}
|
|
367
367
|
return r;
|
|
@@ -374,20 +374,20 @@ function V(e, t = {}) {
|
|
|
374
374
|
const s = Re.encode(e);
|
|
375
375
|
return typeof t.size == "number" ? (C(s, { size: t.size }), U(s, { dir: "right", size: t.size })) : s;
|
|
376
376
|
}
|
|
377
|
-
const b = /* @__PURE__ */ BigInt(2 ** 32 - 1),
|
|
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 };
|
|
380
|
-
}
|
|
377
|
+
const b = /* @__PURE__ */ BigInt(2 ** 32 - 1), B = /* @__PURE__ */ BigInt(32);
|
|
381
378
|
function xe(e, t = !1) {
|
|
379
|
+
return t ? { h: Number(e & b), l: Number(e >> B & b) } : { h: Number(e >> B & b) | 0, l: Number(e & b) | 0 };
|
|
380
|
+
}
|
|
381
|
+
function Me(e, t = !1) {
|
|
382
382
|
const s = e.length;
|
|
383
383
|
let o = new Uint32Array(s), i = new Uint32Array(s);
|
|
384
384
|
for (let r = 0; r < s; r++) {
|
|
385
|
-
const { h: a, l } =
|
|
385
|
+
const { h: a, l } = xe(e[r], t);
|
|
386
386
|
[o[r], i[r]] = [a, l];
|
|
387
387
|
}
|
|
388
388
|
return [o, i];
|
|
389
389
|
}
|
|
390
|
-
const
|
|
390
|
+
const ke = (e, t, s) => e << s | t >>> 32 - s, Be = (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;
|
|
391
391
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
392
392
|
function Oe(e) {
|
|
393
393
|
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
@@ -453,7 +453,7 @@ for (let e = 0, t = S, s = 1, o = 0; e < 24; e++) {
|
|
|
453
453
|
t = (t << S ^ (t >> Ye) * Ge) % je, t & We && (i ^= S << (S << /* @__PURE__ */ BigInt(r)) - S);
|
|
454
454
|
j.push(i);
|
|
455
455
|
}
|
|
456
|
-
const G =
|
|
456
|
+
const G = Me(j, !0), Xe = G[0], qe = G[1], H = (e, t, s) => s > 32 ? we(e, t, s) : ke(e, t, s), _ = (e, t, s) => s > 32 ? ve(e, t, s) : Be(e, t, s);
|
|
457
457
|
function Je(e, t = 24) {
|
|
458
458
|
const s = new Uint32Array(10);
|
|
459
459
|
for (let o = 24 - t; o < 24; o++) {
|
|
@@ -479,7 +479,7 @@ function Je(e, t = 24) {
|
|
|
479
479
|
}
|
|
480
480
|
K(s);
|
|
481
481
|
}
|
|
482
|
-
class
|
|
482
|
+
class x extends Ve {
|
|
483
483
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
484
484
|
constructor(t, s, o, i = !1, r = 24) {
|
|
485
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))
|
|
@@ -541,14 +541,14 @@ class M extends Ve {
|
|
|
541
541
|
}
|
|
542
542
|
_cloneInto(t) {
|
|
543
543
|
const { blockLen: s, suffix: o, outputLen: i, rounds: r, enableXOF: a } = this;
|
|
544
|
-
return t || (t = new
|
|
544
|
+
return t || (t = new x(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;
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
const Qe = (e, t, s) => Ke(() => new
|
|
547
|
+
const Qe = (e, t, s) => Ke(() => new x(t, e, s)), Ze = Qe(1, 136, 256 / 8);
|
|
548
548
|
function et(e, t) {
|
|
549
|
-
return Ze(
|
|
549
|
+
return Ze(N(e, { strict: !1 }) ? ye(e) : e);
|
|
550
550
|
}
|
|
551
|
-
class tt extends
|
|
551
|
+
class tt extends h {
|
|
552
552
|
constructor({ address: t }) {
|
|
553
553
|
super(`Address "${t}" is invalid.`, {
|
|
554
554
|
metaMessages: [
|
|
@@ -595,13 +595,13 @@ function u(e, t) {
|
|
|
595
595
|
throw new tt({ address: e });
|
|
596
596
|
return q(e, t);
|
|
597
597
|
}
|
|
598
|
-
const st = /^0x[a-fA-F0-9]{40}$/,
|
|
598
|
+
const st = /^0x[a-fA-F0-9]{40}$/, y = /* @__PURE__ */ new X(8192);
|
|
599
599
|
function nt(e, t) {
|
|
600
600
|
const { strict: s = !0 } = t ?? {}, o = `${e}.${s}`;
|
|
601
|
-
if (
|
|
602
|
-
return
|
|
601
|
+
if (y.has(o))
|
|
602
|
+
return y.get(o);
|
|
603
603
|
const i = st.test(e) ? e.toLowerCase() === e ? !0 : s ? q(e) === e : !0 : !1;
|
|
604
|
-
return
|
|
604
|
+
return y.set(o, i), i;
|
|
605
605
|
}
|
|
606
606
|
const n = {
|
|
607
607
|
USDC: "USDC",
|
|
@@ -667,6 +667,13 @@ const n = {
|
|
|
667
667
|
logoURI: "/images/tokens/usdc.svg",
|
|
668
668
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
669
669
|
}
|
|
670
|
+
// [AmountSymbols.WETH]: {
|
|
671
|
+
// address: getAddress("0x980B62Da83eFf3D4576C647993b0c1D7faf17c73"),
|
|
672
|
+
// symbol: AmountSymbols.WETH,
|
|
673
|
+
// name: "Wrapped Ether",
|
|
674
|
+
// decimals: 18,
|
|
675
|
+
// logoURI: TokenLogo.WETH,
|
|
676
|
+
// },
|
|
670
677
|
},
|
|
671
678
|
[c.AVALANCHE]: {
|
|
672
679
|
[n.DAI]: {
|
|
@@ -713,6 +720,13 @@ const n = {
|
|
|
713
720
|
logoURI: "/images/tokens/usdc.svg",
|
|
714
721
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
715
722
|
}
|
|
723
|
+
// [AmountSymbols.WETH]: {
|
|
724
|
+
// address: getAddress("0xd00ae08403B9bbb9124bB305C09058E32C39A48c"),
|
|
725
|
+
// symbol: AmountSymbols.WETH,
|
|
726
|
+
// name: "Wrapped Ether",
|
|
727
|
+
// decimals: 18,
|
|
728
|
+
// logoURI: TokenLogo.WETH,
|
|
729
|
+
// },
|
|
716
730
|
},
|
|
717
731
|
[c.BASE]: {
|
|
718
732
|
[n.DAI]: {
|
|
@@ -767,6 +781,13 @@ const n = {
|
|
|
767
781
|
logoURI: "/images/tokens/usdc.svg",
|
|
768
782
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
769
783
|
}
|
|
784
|
+
// [AmountSymbols.WETH]: {
|
|
785
|
+
// address: getAddress("0x4200000000000000000000000000000000000006"),
|
|
786
|
+
// symbol: AmountSymbols.WETH,
|
|
787
|
+
// name: "Wrapped Ether",
|
|
788
|
+
// decimals: 18,
|
|
789
|
+
// logoURI: TokenLogo.WETH,
|
|
790
|
+
// },
|
|
770
791
|
},
|
|
771
792
|
[c.BSC]: {
|
|
772
793
|
[n.BNB]: {
|
|
@@ -816,6 +837,14 @@ const n = {
|
|
|
816
837
|
decimals: 18,
|
|
817
838
|
logoURI: "/images/tokens/usdt.png"
|
|
818
839
|
/* USDT */
|
|
840
|
+
},
|
|
841
|
+
[n.WETH]: {
|
|
842
|
+
address: "0x4db5a66e937a9f4473fa95b1caf1d1e1d62e29ea",
|
|
843
|
+
symbol: n.WETH,
|
|
844
|
+
name: "Wrapped Ether",
|
|
845
|
+
decimals: 18,
|
|
846
|
+
logoURI: "/images/tokens/weth.png"
|
|
847
|
+
/* WETH */
|
|
819
848
|
}
|
|
820
849
|
},
|
|
821
850
|
[c.ETHEREUM]: {
|
|
@@ -893,6 +922,13 @@ const n = {
|
|
|
893
922
|
logoURI: "/images/tokens/usdc.svg",
|
|
894
923
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
895
924
|
}
|
|
925
|
+
// [AmountSymbols.WETH]: {
|
|
926
|
+
// address: getAddress("0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14"),
|
|
927
|
+
// symbol: AmountSymbols.WETH,
|
|
928
|
+
// name: 'Wrapped Ether',
|
|
929
|
+
// decimals: 18,
|
|
930
|
+
// logoURI: TokenLogo.WETH,
|
|
931
|
+
// },
|
|
896
932
|
},
|
|
897
933
|
[c.HYPEREVM]: {
|
|
898
934
|
[n.USDC]: {
|
|
@@ -903,6 +939,13 @@ const n = {
|
|
|
903
939
|
logoURI: "/images/tokens/usdc.svg"
|
|
904
940
|
/* USDC */
|
|
905
941
|
}
|
|
942
|
+
// [AmountSymbols.WETH]: {
|
|
943
|
+
// address: '0x4200000000000000000000000000000000000006',
|
|
944
|
+
// symbol: AmountSymbols.WETH,
|
|
945
|
+
// name: 'Wrapped Ether',
|
|
946
|
+
// decimals: 18,
|
|
947
|
+
// logoURI: TokenLogo.WETH,
|
|
948
|
+
// },
|
|
906
949
|
},
|
|
907
950
|
[c.LISK]: {
|
|
908
951
|
[n.USDC]: {
|
|
@@ -913,6 +956,13 @@ const n = {
|
|
|
913
956
|
logoURI: "/images/tokens/usdc.svg"
|
|
914
957
|
/* USDC */
|
|
915
958
|
}
|
|
959
|
+
// [AmountSymbols.WETH]: {
|
|
960
|
+
// address: '0x4200000000000000000000000000000000000006',
|
|
961
|
+
// symbol: AmountSymbols.WETH,
|
|
962
|
+
// name: 'Wrapped Ether',
|
|
963
|
+
// decimals: 18,
|
|
964
|
+
// logoURI: TokenLogo.WETH,
|
|
965
|
+
// },
|
|
916
966
|
},
|
|
917
967
|
[c.MONAD]: {
|
|
918
968
|
[n.USDC]: {
|
|
@@ -923,6 +973,13 @@ const n = {
|
|
|
923
973
|
logoURI: "/images/tokens/usdc.svg"
|
|
924
974
|
/* USDC */
|
|
925
975
|
}
|
|
976
|
+
// [AmountSymbols.WETH]: {
|
|
977
|
+
// address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
978
|
+
// symbol: AmountSymbols.WETH,
|
|
979
|
+
// name: 'Wrapped Ether',
|
|
980
|
+
// decimals: 18,
|
|
981
|
+
// logoURI: TokenLogo.WETH,
|
|
982
|
+
// },
|
|
926
983
|
},
|
|
927
984
|
[c.MONAD_TESTNET]: {
|
|
928
985
|
[n.USDC]: {
|
|
@@ -933,6 +990,13 @@ const n = {
|
|
|
933
990
|
logoURI: "/images/tokens/usdc.svg"
|
|
934
991
|
/* USDC */
|
|
935
992
|
}
|
|
993
|
+
// [AmountSymbols.WETH]: {
|
|
994
|
+
// address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
995
|
+
// symbol: AmountSymbols.WETH,
|
|
996
|
+
// name: 'Wrapped Ether',
|
|
997
|
+
// decimals: 18,
|
|
998
|
+
// logoURI: TokenLogo.WETH,
|
|
999
|
+
// },
|
|
936
1000
|
},
|
|
937
1001
|
[c.OPTIMISM]: {
|
|
938
1002
|
[n.DAI]: {
|
|
@@ -985,6 +1049,13 @@ const n = {
|
|
|
985
1049
|
logoURI: "/images/tokens/usdc.svg"
|
|
986
1050
|
/* USDC */
|
|
987
1051
|
}
|
|
1052
|
+
// [AmountSymbols.WETH]: {
|
|
1053
|
+
// address: '0x4200000000000000000000000000000000000006',
|
|
1054
|
+
// symbol: AmountSymbols.WETH,
|
|
1055
|
+
// name: 'Wrapped Ether',
|
|
1056
|
+
// decimals: 18,
|
|
1057
|
+
// logoURI: TokenLogo.WETH,
|
|
1058
|
+
// },
|
|
988
1059
|
},
|
|
989
1060
|
[c.POLYGON]: {
|
|
990
1061
|
[n.DAI]: {
|
|
@@ -1069,6 +1140,8 @@ const n = {
|
|
|
1069
1140
|
logoURI: "/images/tokens/usdt.png"
|
|
1070
1141
|
/* USDT */
|
|
1071
1142
|
}
|
|
1143
|
+
// [AmountSymbols.WETH]: {
|
|
1144
|
+
// },
|
|
1072
1145
|
},
|
|
1073
1146
|
[c.STARKNET_TESTNET]: {
|
|
1074
1147
|
[n.USDC]: {
|
|
@@ -1145,11 +1218,11 @@ const n = {
|
|
|
1145
1218
|
tokens: d[c.MONAD_TESTNET]
|
|
1146
1219
|
},
|
|
1147
1220
|
OPTIMISM_MAINNET: {
|
|
1148
|
-
...
|
|
1221
|
+
...ge,
|
|
1149
1222
|
tokens: d[c.OPTIMISM]
|
|
1150
1223
|
},
|
|
1151
1224
|
OPTIMISM_TESTNET: {
|
|
1152
|
-
...
|
|
1225
|
+
...he,
|
|
1153
1226
|
tokens: d[c.OPTIMISM_TESTNET]
|
|
1154
1227
|
},
|
|
1155
1228
|
POLYGON_MAINNET: {
|
|
@@ -1173,13 +1246,13 @@ function Tt(e) {
|
|
|
1173
1246
|
throw new Error(`Invalid chain: ${e}. Chain must be a valid chain alias or internal chain value from Chains.`);
|
|
1174
1247
|
return t;
|
|
1175
1248
|
}
|
|
1176
|
-
function
|
|
1249
|
+
function gt(e) {
|
|
1177
1250
|
for (const [t, s] of Object.entries(c))
|
|
1178
1251
|
if (s === e)
|
|
1179
1252
|
return t;
|
|
1180
1253
|
throw new Error(`Invalid internal chain value: ${e}. Internal chain value must be a valid value from InternalChains.`);
|
|
1181
1254
|
}
|
|
1182
|
-
function
|
|
1255
|
+
function ht(e) {
|
|
1183
1256
|
return e in te;
|
|
1184
1257
|
}
|
|
1185
1258
|
function it(e) {
|
|
@@ -1317,18 +1390,18 @@ export {
|
|
|
1317
1390
|
At as getTokenAddress,
|
|
1318
1391
|
bt as getTokenDecimals,
|
|
1319
1392
|
me as hyperevm,
|
|
1320
|
-
|
|
1393
|
+
ht as isChainAlias,
|
|
1321
1394
|
it as isInternalChain,
|
|
1322
1395
|
ct as linea,
|
|
1323
1396
|
Ee as lisk,
|
|
1324
1397
|
ue as monad,
|
|
1325
1398
|
Te as monadTestnet,
|
|
1326
|
-
|
|
1327
|
-
|
|
1399
|
+
ge as optimism,
|
|
1400
|
+
he as optimismTestnet,
|
|
1328
1401
|
fe as polygon,
|
|
1329
1402
|
pe as starknet,
|
|
1330
1403
|
Se as starknetTestnet,
|
|
1331
|
-
|
|
1404
|
+
gt as toChainAlias,
|
|
1332
1405
|
Tt as toInternalChain,
|
|
1333
1406
|
dt as unichain,
|
|
1334
1407
|
lt as worldchain
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(d,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(d=typeof globalThis<"u"?globalThis:d||self,E(d.Chainrails={}))})(this,(function(d){"use strict";const E={EVM:"EVM",STARKNET:"STARKNET"},c={ARBITRUM:"ARBITRUM_MAINNET",ARBITRUM_TESTNET:"ARBITRUM_TESTNET",AVALANCHE:"AVALANCHE_MAINNET",AVALANCHE_TESTNET:"AVALANCHE_TESTNET",BASE:"BASE_MAINNET",BASE_TESTNET:"BASE_TESTNET",BSC:"BSC_MAINNET",ETHEREUM:"ETHEREUM_MAINNET",ETHEREUM_TESTNET:"ETHEREUM_TESTNET",HYPEREVM:"HYPEREVM_MAINNET",LISK:"LISK_MAINNET",MONAD:"MONAD_MAINNET",MONAD_TESTNET:"MONAD_TESTNET",OPTIMISM:"OPTIMISM_MAINNET",OPTIMISM_TESTNET:"OPTIMISM_TESTNET",POLYGON:"POLYGON_MAINNET",STARKNET:"STARKNET_MAINNET",STARKNET_TESTNET:"STARKNET_TESTNET"},x={ARBITRUM:"ARBITRUM",ARBITRUM_TESTNET:"ARBITRUM_TESTNET",AVALANCHE:"AVALANCHE",AVALANCHE_TESTNET:"AVALANCHE_TESTNET",BASE:"BASE",BASE_TESTNET:"BASE_TESTNET",BSC:"BSC",ETHEREUM:"ETHEREUM",ETHEREUM_TESTNET:"ETHEREUM_TESTNET",HYPEREVM:"HYPEREVM",LISK:"LISK",MONAD:"MONAD",MONAD_TESTNET:"MONAD_TESTNET",OPTIMISM:"OPTIMISM",OPTIMISM_TESTNET:"OPTIMISM_TESTNET",POLYGON:"POLYGON",STARKNET:"STARKNET",STARKNET_TESTNET:"STARKNET_TESTNET"},v={type:E.EVM,chainId:42161,name:"Arbitrum",cctpDomain:3,logoURI:"/images/chains/arbitrum.svg",explorer:"https://arbiscan.io"},O={type:E.EVM,chainId:421614,name:"Arbitrum Sepolia",cctpDomain:3,logoURI:"/images/chains/arbitrum.svg",explorer:"https://sepolia.arbiscan.io"},H={type:E.EVM,chainId:43114,name:"Avalanche",cctpDomain:1,logoURI:"/images/chains/avalanche.svg",explorer:"https://snowtrace.io"},_={type:E.EVM,chainId:43113,name:"Avalanche Fuji",cctpDomain:1,logoURI:"/images/chains/avalanche.svg",explorer:"https://testnet.snowtrace.io"},L={type:E.EVM,chainId:8453,name:"Base",cctpDomain:6,logoURI:"/images/chains/base.webp",explorer:"https://basescan.org"},F={type:E.EVM,chainId:84532,name:"Base Sepolia",cctpDomain:6,logoURI:"/images/chains/base.webp",explorer:"https://sepolia.basescan.org"},$={type:E.EVM,chainId:56,name:"BNB Chain",cctpDomain:null,logoURI:"/images/chains/bsc.webp",explorer:"https://bscscan.com"},be={type:E.EVM,chainId:42220,name:"Celo",cctpDomain:null,logoURI:"/images/chains/celo.svg",explorer:"https://celoscan.io"},P={type:E.EVM,chainId:1,name:"Ethereum",cctpDomain:0,logoURI:"/images/chains/ethereum.svg",explorer:"https://etherscan.io"},V={type:E.EVM,chainId:11155111,name:"Ethereum Sepolia",cctpDomain:0,logoURI:"/images/chains/ethereum.svg",explorer:"https://sepolia.etherscan.io"},K={type:E.EVM,chainId:999,name:"HyperEVM",cctpDomain:19,logoURI:"/images/chains/hyperevm.webp",explorer:"https://liquidscan.io"},Ie={type:E.EVM,chainId:59144,name:"Linea",cctpDomain:11,logoURI:"/images/chains/linea.svg",explorer:"https://lineascan.build"},z={type:E.EVM,chainId:1135,name:"Lisk",cctpDomain:null,logoURI:"/images/chains/lisk.png",explorer:"https://blockscout.lisk.com"},W={type:E.EVM,chainId:15,name:"Monad",cctpDomain:7,logoURI:"/images/chains/monad.png",explorer:"https://monadvision.com"},Y={type:E.EVM,chainId:10143,name:"Monad Testnet",cctpDomain:null,logoURI:"/images/chains/monad.png",explorer:"https://testnet.monadvision.com"},j={type:E.EVM,chainId:10,name:"Optimism",cctpDomain:2,logoURI:"/images/chains/optimism.svg",explorer:"https://optimistic.etherscan.io"},G={type:E.EVM,chainId:11155420,name:"Optimism Testnet",cctpDomain:2,logoURI:"/images/chains/optimism.svg",explorer:"https://testnet-explorer.optimism.io"},X={type:E.EVM,chainId:137,name:"Polygon",cctpDomain:7,logoURI:"/images/chains/polygon.svg",explorer:"https://polygonscan.com"},q={type:E.STARKNET,chainId:"0x534e5f4d41494e",name:"Starknet",cctpDomain:25,logoURI:"/images/chains/starknet.svg",explorer:""},J={type:E.STARKNET,chainId:"0x534e5f5345504f4c4941",name:"Starknet Testnet",cctpDomain:null,logoURI:"/images/chains/starknet.svg",explorer:""},Ue={type:E.EVM,chainId:130,name:"Unichain",cctpDomain:10,logoURI:"/images/chains/unichain.webp",explorer:""},De={type:E.EVM,chainId:480,name:"Worldchain",cctpDomain:14,logoURI:"/images/chains/worldchain.svg",explorer:""};function
|
|
2
|
-
`);super(a,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=o,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Z}walk(t){return ee(this,t)}}function ee(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?ee(e.cause,t):t?null:e}class te extends g{constructor({size:t,targetSize:n,type:o}){super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function b(e,{dir:t,size:n=32}={}){return typeof e=="string"?Ce(e,{dir:t,size:n}):ye(e,{dir:t,size:n})}function Ce(e,{dir:t,size:n=32}={}){if(n===null)return e;const o=e.replace("0x","");if(o.length>n*2)throw new te({size:Math.ceil(o.length/2),targetSize:n,type:"hex"});return`0x${o[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function ye(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new te({size:e.length,targetSize:n,type:"bytes"});const o=new Uint8Array(n);for(let i=0;i<n;i++){const r=t==="right";o[r?i:n-i-1]=e[r?i:e.length-i-1]}return o}class Re extends g{constructor({max:t,min:n,signed:o,size:i,value:r}){super(`Number "${r}" is not in safe ${i?`${i*8}-bit ${o?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class Ne extends g{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function R(e,{size:t}){if(Q(e)>t)throw new Ne({givenSize:Q(e),maxSize:t})}function Me(e,t={}){const{signed:n,size:o}=t,i=BigInt(e);let r;o?n?r=(1n<<BigInt(o)*8n-1n)-1n:r=2n**(BigInt(o)*8n)-1n:typeof e=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof r=="bigint"&&n?-r-1n:0;if(r&&i>r||i<a){const h=typeof e=="bigint"?"n":"";throw new Re({max:r?`${r}${h}`:void 0,min:`${a}${h}`,signed:n,size:o,value:`${e}${h}`})}const m=`0x${(n&&i<0?(1n<<BigInt(o*8))+BigInt(i):i).toString(16)}`;return o?b(m,{size:o}):m}const ke=new TextEncoder;function Be(e,t={}){return typeof e=="number"||typeof e=="bigint"?xe(e,t):typeof e=="boolean"?we(e,t):C(e)?se(e,t):oe(e,t)}function we(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(R(n,{size:t.size}),b(n,{size:t.size})):n}const f={zero:48,nine:57,A:65,F:70,a:97,f:102};function ne(e){if(e>=f.zero&&e<=f.nine)return e-f.zero;if(e>=f.A&&e<=f.F)return e-(f.A-10);if(e>=f.a&&e<=f.f)return e-(f.a-10)}function se(e,t={}){let n=e;t.size&&(R(n,{size:t.size}),n=b(n,{dir:"right",size:t.size}));let o=n.slice(2);o.length%2&&(o=`0${o}`);const i=o.length/2,r=new Uint8Array(i);for(let a=0,m=0;a<i;a++){const h=ne(o.charCodeAt(m++)),S=ne(o.charCodeAt(m++));if(h===void 0||S===void 0)throw new g(`Invalid byte sequence ("${o[m-2]}${o[m-1]}" in "${o}").`);r[a]=h*16+S}return r}function xe(e,t){const n=Me(e,t);return se(n)}function oe(e,t={}){const n=ke.encode(e);return typeof t.size=="number"?(R(n,{size:t.size}),b(n,{dir:"right",size:t.size})):n}const I=BigInt(2**32-1),ie=BigInt(32);function ve(e,t=!1){return t?{h:Number(e&I),l:Number(e>>ie&I)}:{h:Number(e>>ie&I)|0,l:Number(e&I)|0}}function Oe(e,t=!1){const n=e.length;let o=new Uint32Array(n),i=new Uint32Array(n);for(let r=0;r<n;r++){const{h:a,l:m}=ve(e[r],t);[o[r],i[r]]=[a,m]}return[o,i]}const He=(e,t,n)=>e<<n|t>>>32-n,_e=(e,t,n)=>t<<n|e>>>32-n,Le=(e,t,n)=>t<<n-32|e>>>64-n,Fe=(e,t,n)=>e<<n-32|t>>>64-n;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $e(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ae(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function U(e,...t){if(!$e(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function re(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Pe(e,t){U(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Ve(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ce(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const Ke=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function ze(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function We(e){for(let t=0;t<e.length;t++)e[t]=ze(e[t]);return e}const de=Ke?e=>e:We;function Ye(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function le(e){return typeof e=="string"&&(e=Ye(e)),U(e),e}class je{}function Ge(e){const t=o=>e().update(le(o)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const Xe=BigInt(0),A=BigInt(1),qe=BigInt(2),Je=BigInt(7),Qe=BigInt(256),Ze=BigInt(113),me=[],Ee=[],Te=[];for(let e=0,t=A,n=1,o=0;e<24;e++){[n,o]=[o,(2*n+3*o)%5],me.push(2*(5*o+n)),Ee.push((e+1)*(e+2)/2%64);let i=Xe;for(let r=0;r<7;r++)t=(t<<A^(t>>Je)*Ze)%Qe,t&qe&&(i^=A<<(A<<BigInt(r))-A);Te.push(i)}const ue=Oe(Te,!0),et=ue[0],tt=ue[1],he=(e,t,n)=>n>32?Le(e,t,n):He(e,t,n),fe=(e,t,n)=>n>32?Fe(e,t,n):_e(e,t,n);function nt(e,t=24){const n=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let a=0;a<10;a++)n[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const m=(a+8)%10,h=(a+2)%10,S=n[h],p=n[h+1],bt=he(S,p,1)^n[m],It=fe(S,p,1)^n[m+1];for(let D=0;D<50;D+=10)e[a+D]^=bt,e[a+D+1]^=It}let i=e[2],r=e[3];for(let a=0;a<24;a++){const m=Ee[a],h=he(i,r,m),S=fe(i,r,m),p=me[a];i=e[p],r=e[p+1],e[p]=h,e[p+1]=S}for(let a=0;a<50;a+=10){for(let m=0;m<10;m++)n[m]=e[a+m];for(let m=0;m<10;m++)e[a+m]^=~n[(m+2)%10]&n[(m+4)%10]}e[0]^=et[o],e[1]^=tt[o]}ce(n)}class N extends je{constructor(t,n,o,i=!1,r=24){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=o,this.enableXOF=i,this.rounds=r,ae(o),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Ve(this.state)}clone(){return this._cloneInto()}keccak(){de(this.state32),nt(this.state32,this.rounds),de(this.state32),this.posOut=0,this.pos=0}update(t){re(this),t=le(t),U(t);const{blockLen:n,state:o}=this,i=t.length;for(let r=0;r<i;){const a=Math.min(n-this.pos,i-r);for(let m=0;m<a;m++)o[this.pos++]^=t[r++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:o,blockLen:i}=this;t[o]^=n,(n&128)!==0&&o===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){re(this,!1),U(t),this.finish();const n=this.state,{blockLen:o}=this;for(let i=0,r=t.length;i<r;){this.posOut>=o&&this.keccak();const a=Math.min(o-this.posOut,r-i);t.set(n.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return ae(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Pe(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,ce(this.state)}_cloneInto(t){const{blockLen:n,suffix:o,outputLen:i,rounds:r,enableXOF:a}=this;return t||(t=new N(n,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}}const st=(e,t,n)=>Ge(()=>new N(t,e,n)),ot=st(1,136,256/8);function it(e,t){return ot(C(e,{strict:!1})?Be(e):e)}class at extends g{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class ge extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const o=this.keys().next().value;o&&this.delete(o)}return this}}const M=new ge(8192);function Se(e,t){if(M.has(`${e}.${t}`))return M.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),o=it(oe(n)),i=n.split("");for(let a=0;a<40;a+=2)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());const r=`0x${i.join("")}`;return M.set(`${e}.${t}`,r),r}function u(e,t){if(!ct(e,{strict:!1}))throw new at({address:e});return Se(e,t)}const rt=/^0x[a-fA-F0-9]{40}$/,k=new ge(8192);function ct(e,t){const{strict:n=!0}=t??{},o=`${e}.${n}`;if(k.has(o))return k.get(o);const i=rt.test(e)?e.toLowerCase()===e?!0:n?Se(e)===e:!0:!1;return k.set(o,i),i}const s={USDC:"USDC",USDT:"USDT",DAI:"DAI",BUSD:"BUSD",EURC:"EURC",ETH:"ETH",WETH:"WETH",STRK:"STRK",BNB:"BNB",LORDS:"LORDS"},dt=s.USDC,l={[c.ARBITRUM]:{[s.DAI]:{address:u("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.ETH]:{address:"0x0000000000000000000000000000000000000000",symbol:s.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[s.USDC]:{address:u("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"},[s.USDT]:{address:u("0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),symbol:s.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[s.WETH]:{address:u("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.ARBITRUM_TESTNET]:{[s.USDC]:{address:u("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),symbol:s.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"}},[c.AVALANCHE]:{[s.DAI]:{address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.USDC]:{address:u("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),symbol:s.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[s.USDT]:{address:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",symbol:s.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[s.WETH]:{address:"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.AVALANCHE_TESTNET]:{[s.USDC]:{address:u("0x5425890298aed601595a70AB815c96711a31Bc65"),symbol:s.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"}},[c.BASE]:{[s.DAI]:{address:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.ETH]:{address:"0x0000000000000000000000000000000000000000",symbol:s.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[s.EURC]:{address:"0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42",symbol:s.EURC,name:"Euro Coin",decimals:6,logoURI:"/images/tokens/eurc.png"},[s.USDC]:{address:u("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),symbol:s.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[s.WETH]:{address:u("0x4200000000000000000000000000000000000006"),symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.BASE_TESTNET]:{[s.USDC]:{address:u("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),symbol:s.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"}},[c.BSC]:{[s.BNB]:{address:"0x0000000000000000000000000000000000000000",symbol:s.BNB,name:"BNB",decimals:18,logoURI:"/images/chains/bsc.webp"},[s.BUSD]:{address:"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",symbol:s.BUSD,name:"Binance USD",decimals:18,logoURI:"/images/tokens/busd.png"},[s.DAI]:{address:"0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.ETH]:{address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",symbol:s.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[s.USDC]:{address:u("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),symbol:s.USDC,decimals:18,name:"USD Coin",logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[s.USDT]:{address:"0x55d398326f99059fF775485246999027B3197955",symbol:s.USDT,name:"Tether USD",decimals:18,logoURI:"/images/tokens/usdt.png"}},[c.ETHEREUM]:{[s.BUSD]:{address:"0x4Fabb145d64652a948d72533023f6E7A623C7C53",symbol:s.BUSD,name:"Binance USD",decimals:18,logoURI:"/images/tokens/busd.png"},[s.DAI]:{address:u("0x6B175474E89094C44Da98b954EedeAC495271d0F"),symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.ETH]:{address:"0x0000000000000000000000000000000000000000",symbol:s.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[s.EURC]:{address:"0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",symbol:s.EURC,name:"Euro Coin",decimals:6,logoURI:"/images/tokens/eurc.png"},[s.STRK]:{address:"0xCa14007Eff0dB1f8135f4C25B34De49AB0d42766",symbol:s.STRK,name:"Starknet Token",decimals:18,logoURI:"/images/chains/starknet.svg"},[s.USDC]:{address:u("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[s.USDT]:{address:u("0xdAC17F958D2ee523a2206206994597C13D831ec7"),symbol:s.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[s.WETH]:{address:u("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.ETHEREUM_TESTNET]:{[s.USDC]:{address:u("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),symbol:s.USDC,decimals:6,name:"USD Coin",logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"}},[c.HYPEREVM]:{[s.USDC]:{address:"0xb88339CB7199b77E23DB6E890353E22632Ba630f",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.LISK]:{[s.USDC]:{address:"0xF242275d3a6527d877f2c927a82D9b057609cc71",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.MONAD]:{[s.USDC]:{address:"0x754704Bc059F8C67012fEd69BC8A327a5aafb603",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.MONAD_TESTNET]:{[s.USDC]:{address:"0x534b2f3A21130d7a60830c2Df862319e593943A3",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.OPTIMISM]:{[s.DAI]:{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.ETH]:{address:"0x0000000000000000000000000000000000000000",symbol:s.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[s.USDC]:{address:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"},[s.USDT]:{address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",symbol:s.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[s.WETH]:{address:"0x4200000000000000000000000000000000000006",symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.OPTIMISM_TESTNET]:{[s.USDC]:{address:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.POLYGON]:{[s.DAI]:{address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.USDC]:{address:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"},[s.USDT]:{address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",symbol:s.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[s.WETH]:{address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.STARKNET]:{[s.DAI]:{address:"0x05574eb6b8789a91466f902c380d978e472db68170ff82a5b650b95a58ddf4ad",symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.ETH]:{address:"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",symbol:s.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[s.LORDS]:{address:"0x0124aeb495b947201f5faC96fD1138E326AD86195B98df6DEc9009158A533B49",symbol:s.LORDS,name:"LORDS Token",decimals:18,logoURI:"/images/tokens/lords.png"},[s.STRK]:{address:"0x04718f5a0Fc34cC1AF16A1cdee98fFB20C31f5cD61D6Ab07201858f4287c938D",symbol:s.STRK,name:"Starknet Token",decimals:18,logoURI:"/images/chains/starknet.svg"},[s.USDC]:{address:"0x033068F6539f8e6e6b131e6B2B814e6c34A5224bC66947c47DaB9dFeE93b35fb",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[s.USDT]:{address:"0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",symbol:s.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"}},[c.STARKNET_TESTNET]:{[s.USDC]:{address:"0x0512feAc6339Ff7889822cb5aA2a86C848e9D392bB0E3E237C008674feeD8343",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}}},lt={ARBITRUM:l[c.ARBITRUM],ARBITRUM_TESTNET:l[c.ARBITRUM_TESTNET],AVALANCHE:l[c.AVALANCHE],AVALANCHE_TESTNET:l[c.AVALANCHE_TESTNET],BASE:l[c.BASE],BASE_TESTNET:l[c.BASE_TESTNET],BSC:l[c.BSC],ETHEREUM:l[c.ETHEREUM],ETHEREUM_TESTNET:l[c.ETHEREUM_TESTNET],STARKNET:l[c.STARKNET]},mt={ARBITRUM_MAINNET:{...v,tokens:l[c.ARBITRUM]},ARBITRUM_TESTNET:{...O,tokens:l[c.ARBITRUM_TESTNET]},AVALANCHE_MAINNET:{...H,tokens:l[c.AVALANCHE]},AVALANCHE_TESTNET:{..._,tokens:l[c.AVALANCHE_TESTNET]},BASE_MAINNET:{...L,tokens:l[c.BASE]},BASE_TESTNET:{...F,tokens:l[c.BASE_TESTNET]},BSC_MAINNET:{...$,tokens:l[c.BSC]},ETHEREUM_MAINNET:{...P,tokens:l[c.ETHEREUM]},ETHEREUM_TESTNET:{...V,tokens:l[c.ETHEREUM_TESTNET]},HYPEREVM_MAINNET:{...K,tokens:l[c.HYPEREVM]},LISK_MAINNET:{...z,tokens:l[c.LISK]},MONAD_MAINNET:{...W,tokens:l[c.MONAD]},MONAD_TESTNET:{...Y,tokens:l[c.MONAD_TESTNET]},OPTIMISM_MAINNET:{...j,tokens:l[c.OPTIMISM]},OPTIMISM_TESTNET:{...G,tokens:l[c.OPTIMISM_TESTNET]},POLYGON_MAINNET:{...X,tokens:l[c.POLYGON]},STARKNET_MAINNET:{...q,tokens:l[c.STARKNET]},STARKNET_TESTNET:{...J,tokens:l[c.STARKNET_TESTNET]}},Et=new Set(Object.values(c));function Tt(e){if(pe(e))return e;const t=c[e];if(!t)throw new Error(`Invalid chain: ${e}. Chain must be a valid chain alias or internal chain value from Chains.`);return t}function ut(e){for(const[t,n]of Object.entries(c))if(n===e)return t;throw new Error(`Invalid internal chain value: ${e}. Internal chain value must be a valid value from InternalChains.`)}function ht(e){return e in x}function pe(e){return Et.has(e)}function ft(e,t){if(e.symbol!==t)throw new Error(`Token symbol mismatch: token is ${e.symbol}, tokenSymbol is ${t}. The token symbol must match the tokenSymbol parameter.`)}function Ae(e,t){const n=t.toLowerCase().trim(),o=l[e];if(!o)throw new Error(`Chain not found: ${e}. The chain key must be a valid chain identifier.`);let i;for(const r in o){const a=o[r];if(a&&a.address.toLowerCase()===n.toLowerCase()){i=a;break}}if(!i)throw new Error(`Token address mismatch: address ${t} does not exist on chain ${e}. The token address must be a valid token address on the specified chain.`);return i}function gt(e,t){if(e.symbol!==t)throw new Error(`Token symbol mismatch: token symbol is "${e.symbol}", expected "${t}". The token symbol must match the expected token symbol.`)}function St(e,t,n){const o=Ae(e,t);if(o.symbol!==n)throw new Error(`Token address and symbol mismatch: address ${t} on chain ${e} corresponds to token "${o.symbol}", but expected "${n}". The token address must correspond to a token with the expected symbol on the specified chain.`);return o}function B(e,t){return l[e]?.[t]}function pt(e,t){return B(e,t)?.address}function At(e,t){return B(e,t)?.decimals}var w=(e=>(e.PRODUCTION="production",e.STAGING="staging",e))(w||{});class T{constructor({api_key:t,env:n,seesion_token:o,props:i}){this.api_key=t||"",this.sessionToken=o||"",this.env=n??w.PRODUCTION,this.props=i}static async config(t){if(!T.app){if(!t)throw new Error("Please provide an api_key");T.app=new T(t)}return t&&(t.api_key!==void 0&&(T.app.api_key=t.api_key),t.seesion_token!==void 0&&(T.app.sessionToken=t.seesion_token),t.env!==void 0&&(T.app.env=t.env),t.props!==void 0&&(T.app.props=t.props)),T.app}static getApiKey(){if(!T.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return T.app.api_key}static getSessionToken(){if(!T.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return T.app.sessionToken}static getProps(){if(!T.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return T.app.props}static getEnv(){if(!T.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return T.app.env==="internal"?"staging":T.app.env}static getBaseUrl(){if(!T.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");switch(T.app.env){case"production":return"https://api.chainrails.io/api/v1";case"staging":return"https://dev.chainrails.io/api/v1";case"internal":return"https://dev.chainrails.io/api/v1";default:return"https://api.chainrails.io/api/v1"}}static getPayModalUrl(t){if(!T.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");const n=T.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:""}`;return n+i+r}}d.AmountSymbols=s,d.ChainTypes=E,d.Chainrails=T,d.Chains=x,d.DEFAULT_AMOUNT_SYMBOL=dt,d.InternalChains=c,d.TOKEN_REGISTRY=l,d.Tokens=lt,d.allChains=mt,d.arbitrum=v,d.arbitrumTestnet=O,d.assertTokenAddressMatchesChain=Ae,d.assertTokenAddressMatchesChainAndSymbol=St,d.assertTokenMatchesAmountSymbol=ft,d.assertTokenSymbolMatches=gt,d.avalanche=H,d.avalancheTestnet=_,d.base=L,d.baseTestnet=F,d.bsc=$,d.celo=be,d.environment=w,d.ethereum=P,d.ethereumTestnet=V,d.getToken=B,d.getTokenAddress=pt,d.getTokenDecimals=At,d.hyperevm=K,d.isChainAlias=ht,d.isInternalChain=pe,d.linea=Ie,d.lisk=z,d.monad=W,d.monadTestnet=Y,d.optimism=j,d.optimismTestnet=G,d.polygon=X,d.starknet=q,d.starknetTestnet=J,d.toChainAlias=ut,d.toInternalChain=Tt,d.unichain=Ue,d.worldchain=De,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(d,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(d=typeof globalThis<"u"?globalThis:d||self,E(d.Chainrails={}))})(this,(function(d){"use strict";const E={EVM:"EVM",STARKNET:"STARKNET"},c={ARBITRUM:"ARBITRUM_MAINNET",ARBITRUM_TESTNET:"ARBITRUM_TESTNET",AVALANCHE:"AVALANCHE_MAINNET",AVALANCHE_TESTNET:"AVALANCHE_TESTNET",BASE:"BASE_MAINNET",BASE_TESTNET:"BASE_TESTNET",BSC:"BSC_MAINNET",ETHEREUM:"ETHEREUM_MAINNET",ETHEREUM_TESTNET:"ETHEREUM_TESTNET",HYPEREVM:"HYPEREVM_MAINNET",LISK:"LISK_MAINNET",MONAD:"MONAD_MAINNET",MONAD_TESTNET:"MONAD_TESTNET",OPTIMISM:"OPTIMISM_MAINNET",OPTIMISM_TESTNET:"OPTIMISM_TESTNET",POLYGON:"POLYGON_MAINNET",STARKNET:"STARKNET_MAINNET",STARKNET_TESTNET:"STARKNET_TESTNET"},x={ARBITRUM:"ARBITRUM",ARBITRUM_TESTNET:"ARBITRUM_TESTNET",AVALANCHE:"AVALANCHE",AVALANCHE_TESTNET:"AVALANCHE_TESTNET",BASE:"BASE",BASE_TESTNET:"BASE_TESTNET",BSC:"BSC",ETHEREUM:"ETHEREUM",ETHEREUM_TESTNET:"ETHEREUM_TESTNET",HYPEREVM:"HYPEREVM",LISK:"LISK",MONAD:"MONAD",MONAD_TESTNET:"MONAD_TESTNET",OPTIMISM:"OPTIMISM",OPTIMISM_TESTNET:"OPTIMISM_TESTNET",POLYGON:"POLYGON",STARKNET:"STARKNET",STARKNET_TESTNET:"STARKNET_TESTNET"},v={type:E.EVM,chainId:42161,name:"Arbitrum",cctpDomain:3,logoURI:"/images/chains/arbitrum.svg",explorer:"https://arbiscan.io"},O={type:E.EVM,chainId:421614,name:"Arbitrum Sepolia",cctpDomain:3,logoURI:"/images/chains/arbitrum.svg",explorer:"https://sepolia.arbiscan.io"},H={type:E.EVM,chainId:43114,name:"Avalanche",cctpDomain:1,logoURI:"/images/chains/avalanche.svg",explorer:"https://snowtrace.io"},_={type:E.EVM,chainId:43113,name:"Avalanche Fuji",cctpDomain:1,logoURI:"/images/chains/avalanche.svg",explorer:"https://testnet.snowtrace.io"},L={type:E.EVM,chainId:8453,name:"Base",cctpDomain:6,logoURI:"/images/chains/base.webp",explorer:"https://basescan.org"},F={type:E.EVM,chainId:84532,name:"Base Sepolia",cctpDomain:6,logoURI:"/images/chains/base.webp",explorer:"https://sepolia.basescan.org"},$={type:E.EVM,chainId:56,name:"BNB Chain",cctpDomain:null,logoURI:"/images/chains/bsc.webp",explorer:"https://bscscan.com"},be={type:E.EVM,chainId:42220,name:"Celo",cctpDomain:null,logoURI:"/images/chains/celo.svg",explorer:"https://celoscan.io"},P={type:E.EVM,chainId:1,name:"Ethereum",cctpDomain:0,logoURI:"/images/chains/ethereum.svg",explorer:"https://etherscan.io"},V={type:E.EVM,chainId:11155111,name:"Ethereum Sepolia",cctpDomain:0,logoURI:"/images/chains/ethereum.svg",explorer:"https://sepolia.etherscan.io"},K={type:E.EVM,chainId:999,name:"HyperEVM",cctpDomain:19,logoURI:"/images/chains/hyperevm.webp",explorer:"https://liquidscan.io"},Ie={type:E.EVM,chainId:59144,name:"Linea",cctpDomain:11,logoURI:"/images/chains/linea.svg",explorer:"https://lineascan.build"},z={type:E.EVM,chainId:1135,name:"Lisk",cctpDomain:null,logoURI:"/images/chains/lisk.png",explorer:"https://blockscout.lisk.com"},W={type:E.EVM,chainId:15,name:"Monad",cctpDomain:7,logoURI:"/images/chains/monad.png",explorer:"https://monadvision.com"},Y={type:E.EVM,chainId:10143,name:"Monad Testnet",cctpDomain:null,logoURI:"/images/chains/monad.png",explorer:"https://testnet.monadvision.com"},j={type:E.EVM,chainId:10,name:"Optimism",cctpDomain:2,logoURI:"/images/chains/optimism.svg",explorer:"https://optimistic.etherscan.io"},G={type:E.EVM,chainId:11155420,name:"Optimism Testnet",cctpDomain:2,logoURI:"/images/chains/optimism.svg",explorer:"https://testnet-explorer.optimism.io"},X={type:E.EVM,chainId:137,name:"Polygon",cctpDomain:7,logoURI:"/images/chains/polygon.svg",explorer:"https://polygonscan.com"},q={type:E.STARKNET,chainId:"0x534e5f4d41494e",name:"Starknet",cctpDomain:25,logoURI:"/images/chains/starknet.svg",explorer:""},J={type:E.STARKNET,chainId:"0x534e5f5345504f4c4941",name:"Starknet Testnet",cctpDomain:null,logoURI:"/images/chains/starknet.svg",explorer:""},Ue={type:E.EVM,chainId:130,name:"Unichain",cctpDomain:10,logoURI:"/images/chains/unichain.webp",explorer:""},De={type:E.EVM,chainId:480,name:"Worldchain",cctpDomain:14,logoURI:"/images/chains/worldchain.svg",explorer:""};function y(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Q(e){return y(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const Z="2.43.4";let C={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Z}`};class g extends Error{constructor(t,n={}){const o=n.cause instanceof g?n.cause.details:n.cause?.message?n.cause.message:n.details,i=n.cause instanceof g&&n.cause.docsPath||n.docsPath,r=C.getDocsUrl?.({...n,docsPath:i}),a=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...r?[`Docs: ${r}`]:[],...o?[`Details: ${o}`]:[],...C.version?[`Version: ${C.version}`]:[]].join(`
|
|
2
|
+
`);super(a,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=o,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Z}walk(t){return ee(this,t)}}function ee(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?ee(e.cause,t):t?null:e}class te extends g{constructor({size:t,targetSize:n,type:o}){super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function b(e,{dir:t,size:n=32}={}){return typeof e=="string"?ye(e,{dir:t,size:n}):Ce(e,{dir:t,size:n})}function ye(e,{dir:t,size:n=32}={}){if(n===null)return e;const o=e.replace("0x","");if(o.length>n*2)throw new te({size:Math.ceil(o.length/2),targetSize:n,type:"hex"});return`0x${o[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Ce(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new te({size:e.length,targetSize:n,type:"bytes"});const o=new Uint8Array(n);for(let i=0;i<n;i++){const r=t==="right";o[r?i:n-i-1]=e[r?i:e.length-i-1]}return o}class Re extends g{constructor({max:t,min:n,signed:o,size:i,value:r}){super(`Number "${r}" is not in safe ${i?`${i*8}-bit ${o?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class Ne extends g{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function R(e,{size:t}){if(Q(e)>t)throw new Ne({givenSize:Q(e),maxSize:t})}function Me(e,t={}){const{signed:n,size:o}=t,i=BigInt(e);let r;o?n?r=(1n<<BigInt(o)*8n-1n)-1n:r=2n**(BigInt(o)*8n)-1n:typeof e=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof r=="bigint"&&n?-r-1n:0;if(r&&i>r||i<a){const h=typeof e=="bigint"?"n":"";throw new Re({max:r?`${r}${h}`:void 0,min:`${a}${h}`,signed:n,size:o,value:`${e}${h}`})}const m=`0x${(n&&i<0?(1n<<BigInt(o*8))+BigInt(i):i).toString(16)}`;return o?b(m,{size:o}):m}const ke=new TextEncoder;function Be(e,t={}){return typeof e=="number"||typeof e=="bigint"?xe(e,t):typeof e=="boolean"?we(e,t):y(e)?se(e,t):oe(e,t)}function we(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(R(n,{size:t.size}),b(n,{size:t.size})):n}const f={zero:48,nine:57,A:65,F:70,a:97,f:102};function ne(e){if(e>=f.zero&&e<=f.nine)return e-f.zero;if(e>=f.A&&e<=f.F)return e-(f.A-10);if(e>=f.a&&e<=f.f)return e-(f.a-10)}function se(e,t={}){let n=e;t.size&&(R(n,{size:t.size}),n=b(n,{dir:"right",size:t.size}));let o=n.slice(2);o.length%2&&(o=`0${o}`);const i=o.length/2,r=new Uint8Array(i);for(let a=0,m=0;a<i;a++){const h=ne(o.charCodeAt(m++)),p=ne(o.charCodeAt(m++));if(h===void 0||p===void 0)throw new g(`Invalid byte sequence ("${o[m-2]}${o[m-1]}" in "${o}").`);r[a]=h*16+p}return r}function xe(e,t){const n=Me(e,t);return se(n)}function oe(e,t={}){const n=ke.encode(e);return typeof t.size=="number"?(R(n,{size:t.size}),b(n,{dir:"right",size:t.size})):n}const I=BigInt(2**32-1),ie=BigInt(32);function ve(e,t=!1){return t?{h:Number(e&I),l:Number(e>>ie&I)}:{h:Number(e>>ie&I)|0,l:Number(e&I)|0}}function Oe(e,t=!1){const n=e.length;let o=new Uint32Array(n),i=new Uint32Array(n);for(let r=0;r<n;r++){const{h:a,l:m}=ve(e[r],t);[o[r],i[r]]=[a,m]}return[o,i]}const He=(e,t,n)=>e<<n|t>>>32-n,_e=(e,t,n)=>t<<n|e>>>32-n,Le=(e,t,n)=>t<<n-32|e>>>64-n,Fe=(e,t,n)=>e<<n-32|t>>>64-n;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $e(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ae(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function U(e,...t){if(!$e(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function re(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Pe(e,t){U(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Ve(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ce(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const Ke=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function ze(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function We(e){for(let t=0;t<e.length;t++)e[t]=ze(e[t]);return e}const de=Ke?e=>e:We;function Ye(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function le(e){return typeof e=="string"&&(e=Ye(e)),U(e),e}class je{}function Ge(e){const t=o=>e().update(le(o)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const Xe=BigInt(0),A=BigInt(1),qe=BigInt(2),Je=BigInt(7),Qe=BigInt(256),Ze=BigInt(113),me=[],Ee=[],Te=[];for(let e=0,t=A,n=1,o=0;e<24;e++){[n,o]=[o,(2*n+3*o)%5],me.push(2*(5*o+n)),Ee.push((e+1)*(e+2)/2%64);let i=Xe;for(let r=0;r<7;r++)t=(t<<A^(t>>Je)*Ze)%Qe,t&qe&&(i^=A<<(A<<BigInt(r))-A);Te.push(i)}const ue=Oe(Te,!0),et=ue[0],tt=ue[1],he=(e,t,n)=>n>32?Le(e,t,n):He(e,t,n),fe=(e,t,n)=>n>32?Fe(e,t,n):_e(e,t,n);function nt(e,t=24){const n=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let a=0;a<10;a++)n[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const m=(a+8)%10,h=(a+2)%10,p=n[h],S=n[h+1],bt=he(p,S,1)^n[m],It=fe(p,S,1)^n[m+1];for(let D=0;D<50;D+=10)e[a+D]^=bt,e[a+D+1]^=It}let i=e[2],r=e[3];for(let a=0;a<24;a++){const m=Ee[a],h=he(i,r,m),p=fe(i,r,m),S=me[a];i=e[S],r=e[S+1],e[S]=h,e[S+1]=p}for(let a=0;a<50;a+=10){for(let m=0;m<10;m++)n[m]=e[a+m];for(let m=0;m<10;m++)e[a+m]^=~n[(m+2)%10]&n[(m+4)%10]}e[0]^=et[o],e[1]^=tt[o]}ce(n)}class N extends je{constructor(t,n,o,i=!1,r=24){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=o,this.enableXOF=i,this.rounds=r,ae(o),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Ve(this.state)}clone(){return this._cloneInto()}keccak(){de(this.state32),nt(this.state32,this.rounds),de(this.state32),this.posOut=0,this.pos=0}update(t){re(this),t=le(t),U(t);const{blockLen:n,state:o}=this,i=t.length;for(let r=0;r<i;){const a=Math.min(n-this.pos,i-r);for(let m=0;m<a;m++)o[this.pos++]^=t[r++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:o,blockLen:i}=this;t[o]^=n,(n&128)!==0&&o===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){re(this,!1),U(t),this.finish();const n=this.state,{blockLen:o}=this;for(let i=0,r=t.length;i<r;){this.posOut>=o&&this.keccak();const a=Math.min(o-this.posOut,r-i);t.set(n.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return ae(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Pe(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,ce(this.state)}_cloneInto(t){const{blockLen:n,suffix:o,outputLen:i,rounds:r,enableXOF:a}=this;return t||(t=new N(n,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}}const st=(e,t,n)=>Ge(()=>new N(t,e,n)),ot=st(1,136,256/8);function it(e,t){return ot(y(e,{strict:!1})?Be(e):e)}class at extends g{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class ge extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const o=this.keys().next().value;o&&this.delete(o)}return this}}const M=new ge(8192);function pe(e,t){if(M.has(`${e}.${t}`))return M.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),o=it(oe(n)),i=n.split("");for(let a=0;a<40;a+=2)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());const r=`0x${i.join("")}`;return M.set(`${e}.${t}`,r),r}function u(e,t){if(!ct(e,{strict:!1}))throw new at({address:e});return pe(e,t)}const rt=/^0x[a-fA-F0-9]{40}$/,k=new ge(8192);function ct(e,t){const{strict:n=!0}=t??{},o=`${e}.${n}`;if(k.has(o))return k.get(o);const i=rt.test(e)?e.toLowerCase()===e?!0:n?pe(e)===e:!0:!1;return k.set(o,i),i}const s={USDC:"USDC",USDT:"USDT",DAI:"DAI",BUSD:"BUSD",EURC:"EURC",ETH:"ETH",WETH:"WETH",STRK:"STRK",BNB:"BNB",LORDS:"LORDS"},dt=s.USDC,l={[c.ARBITRUM]:{[s.DAI]:{address:u("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.ETH]:{address:"0x0000000000000000000000000000000000000000",symbol:s.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[s.USDC]:{address:u("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"},[s.USDT]:{address:u("0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),symbol:s.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[s.WETH]:{address:u("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.ARBITRUM_TESTNET]:{[s.USDC]:{address:u("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),symbol:s.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"}},[c.AVALANCHE]:{[s.DAI]:{address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.USDC]:{address:u("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),symbol:s.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[s.USDT]:{address:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",symbol:s.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[s.WETH]:{address:"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.AVALANCHE_TESTNET]:{[s.USDC]:{address:u("0x5425890298aed601595a70AB815c96711a31Bc65"),symbol:s.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"}},[c.BASE]:{[s.DAI]:{address:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.ETH]:{address:"0x0000000000000000000000000000000000000000",symbol:s.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[s.EURC]:{address:"0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42",symbol:s.EURC,name:"Euro Coin",decimals:6,logoURI:"/images/tokens/eurc.png"},[s.USDC]:{address:u("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),symbol:s.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[s.WETH]:{address:u("0x4200000000000000000000000000000000000006"),symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.BASE_TESTNET]:{[s.USDC]:{address:u("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),symbol:s.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"}},[c.BSC]:{[s.BNB]:{address:"0x0000000000000000000000000000000000000000",symbol:s.BNB,name:"BNB",decimals:18,logoURI:"/images/chains/bsc.webp"},[s.BUSD]:{address:"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",symbol:s.BUSD,name:"Binance USD",decimals:18,logoURI:"/images/tokens/busd.png"},[s.DAI]:{address:"0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.ETH]:{address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",symbol:s.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[s.USDC]:{address:u("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),symbol:s.USDC,decimals:18,name:"USD Coin",logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[s.USDT]:{address:"0x55d398326f99059fF775485246999027B3197955",symbol:s.USDT,name:"Tether USD",decimals:18,logoURI:"/images/tokens/usdt.png"},[s.WETH]:{address:"0x4db5a66e937a9f4473fa95b1caf1d1e1d62e29ea",symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.ETHEREUM]:{[s.BUSD]:{address:"0x4Fabb145d64652a948d72533023f6E7A623C7C53",symbol:s.BUSD,name:"Binance USD",decimals:18,logoURI:"/images/tokens/busd.png"},[s.DAI]:{address:u("0x6B175474E89094C44Da98b954EedeAC495271d0F"),symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.ETH]:{address:"0x0000000000000000000000000000000000000000",symbol:s.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[s.EURC]:{address:"0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",symbol:s.EURC,name:"Euro Coin",decimals:6,logoURI:"/images/tokens/eurc.png"},[s.STRK]:{address:"0xCa14007Eff0dB1f8135f4C25B34De49AB0d42766",symbol:s.STRK,name:"Starknet Token",decimals:18,logoURI:"/images/chains/starknet.svg"},[s.USDC]:{address:u("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[s.USDT]:{address:u("0xdAC17F958D2ee523a2206206994597C13D831ec7"),symbol:s.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[s.WETH]:{address:u("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.ETHEREUM_TESTNET]:{[s.USDC]:{address:u("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),symbol:s.USDC,decimals:6,name:"USD Coin",logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"}},[c.HYPEREVM]:{[s.USDC]:{address:"0xb88339CB7199b77E23DB6E890353E22632Ba630f",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.LISK]:{[s.USDC]:{address:"0xF242275d3a6527d877f2c927a82D9b057609cc71",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.MONAD]:{[s.USDC]:{address:"0x754704Bc059F8C67012fEd69BC8A327a5aafb603",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.MONAD_TESTNET]:{[s.USDC]:{address:"0x534b2f3A21130d7a60830c2Df862319e593943A3",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.OPTIMISM]:{[s.DAI]:{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.ETH]:{address:"0x0000000000000000000000000000000000000000",symbol:s.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[s.USDC]:{address:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"},[s.USDT]:{address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",symbol:s.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[s.WETH]:{address:"0x4200000000000000000000000000000000000006",symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.OPTIMISM_TESTNET]:{[s.USDC]:{address:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.POLYGON]:{[s.DAI]:{address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.USDC]:{address:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"},[s.USDT]:{address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",symbol:s.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[s.WETH]:{address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",symbol:s.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.STARKNET]:{[s.DAI]:{address:"0x05574eb6b8789a91466f902c380d978e472db68170ff82a5b650b95a58ddf4ad",symbol:s.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[s.ETH]:{address:"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",symbol:s.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[s.LORDS]:{address:"0x0124aeb495b947201f5faC96fD1138E326AD86195B98df6DEc9009158A533B49",symbol:s.LORDS,name:"LORDS Token",decimals:18,logoURI:"/images/tokens/lords.png"},[s.STRK]:{address:"0x04718f5a0Fc34cC1AF16A1cdee98fFB20C31f5cD61D6Ab07201858f4287c938D",symbol:s.STRK,name:"Starknet Token",decimals:18,logoURI:"/images/chains/starknet.svg"},[s.USDC]:{address:"0x033068F6539f8e6e6b131e6B2B814e6c34A5224bC66947c47DaB9dFeE93b35fb",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[s.USDT]:{address:"0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",symbol:s.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"}},[c.STARKNET_TESTNET]:{[s.USDC]:{address:"0x0512feAc6339Ff7889822cb5aA2a86C848e9D392bB0E3E237C008674feeD8343",symbol:s.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}}},lt={ARBITRUM:l[c.ARBITRUM],ARBITRUM_TESTNET:l[c.ARBITRUM_TESTNET],AVALANCHE:l[c.AVALANCHE],AVALANCHE_TESTNET:l[c.AVALANCHE_TESTNET],BASE:l[c.BASE],BASE_TESTNET:l[c.BASE_TESTNET],BSC:l[c.BSC],ETHEREUM:l[c.ETHEREUM],ETHEREUM_TESTNET:l[c.ETHEREUM_TESTNET],STARKNET:l[c.STARKNET]},mt={ARBITRUM_MAINNET:{...v,tokens:l[c.ARBITRUM]},ARBITRUM_TESTNET:{...O,tokens:l[c.ARBITRUM_TESTNET]},AVALANCHE_MAINNET:{...H,tokens:l[c.AVALANCHE]},AVALANCHE_TESTNET:{..._,tokens:l[c.AVALANCHE_TESTNET]},BASE_MAINNET:{...L,tokens:l[c.BASE]},BASE_TESTNET:{...F,tokens:l[c.BASE_TESTNET]},BSC_MAINNET:{...$,tokens:l[c.BSC]},ETHEREUM_MAINNET:{...P,tokens:l[c.ETHEREUM]},ETHEREUM_TESTNET:{...V,tokens:l[c.ETHEREUM_TESTNET]},HYPEREVM_MAINNET:{...K,tokens:l[c.HYPEREVM]},LISK_MAINNET:{...z,tokens:l[c.LISK]},MONAD_MAINNET:{...W,tokens:l[c.MONAD]},MONAD_TESTNET:{...Y,tokens:l[c.MONAD_TESTNET]},OPTIMISM_MAINNET:{...j,tokens:l[c.OPTIMISM]},OPTIMISM_TESTNET:{...G,tokens:l[c.OPTIMISM_TESTNET]},POLYGON_MAINNET:{...X,tokens:l[c.POLYGON]},STARKNET_MAINNET:{...q,tokens:l[c.STARKNET]},STARKNET_TESTNET:{...J,tokens:l[c.STARKNET_TESTNET]}},Et=new Set(Object.values(c));function Tt(e){if(Se(e))return e;const t=c[e];if(!t)throw new Error(`Invalid chain: ${e}. Chain must be a valid chain alias or internal chain value from Chains.`);return t}function ut(e){for(const[t,n]of Object.entries(c))if(n===e)return t;throw new Error(`Invalid internal chain value: ${e}. Internal chain value must be a valid value from InternalChains.`)}function ht(e){return e in x}function Se(e){return Et.has(e)}function ft(e,t){if(e.symbol!==t)throw new Error(`Token symbol mismatch: token is ${e.symbol}, tokenSymbol is ${t}. The token symbol must match the tokenSymbol parameter.`)}function Ae(e,t){const n=t.toLowerCase().trim(),o=l[e];if(!o)throw new Error(`Chain not found: ${e}. The chain key must be a valid chain identifier.`);let i;for(const r in o){const a=o[r];if(a&&a.address.toLowerCase()===n.toLowerCase()){i=a;break}}if(!i)throw new Error(`Token address mismatch: address ${t} does not exist on chain ${e}. The token address must be a valid token address on the specified chain.`);return i}function gt(e,t){if(e.symbol!==t)throw new Error(`Token symbol mismatch: token symbol is "${e.symbol}", expected "${t}". The token symbol must match the expected token symbol.`)}function pt(e,t,n){const o=Ae(e,t);if(o.symbol!==n)throw new Error(`Token address and symbol mismatch: address ${t} on chain ${e} corresponds to token "${o.symbol}", but expected "${n}". The token address must correspond to a token with the expected symbol on the specified chain.`);return o}function B(e,t){return l[e]?.[t]}function St(e,t){return B(e,t)?.address}function At(e,t){return B(e,t)?.decimals}var w=(e=>(e.PRODUCTION="production",e.STAGING="staging",e))(w||{});class T{constructor({api_key:t,env:n,seesion_token:o,props:i}){this.api_key=t||"",this.sessionToken=o||"",this.env=n??w.PRODUCTION,this.props=i}static async config(t){if(!T.app){if(!t)throw new Error("Please provide an api_key");T.app=new T(t)}return t&&(t.api_key!==void 0&&(T.app.api_key=t.api_key),t.seesion_token!==void 0&&(T.app.sessionToken=t.seesion_token),t.env!==void 0&&(T.app.env=t.env),t.props!==void 0&&(T.app.props=t.props)),T.app}static getApiKey(){if(!T.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return T.app.api_key}static getSessionToken(){if(!T.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return T.app.sessionToken}static getProps(){if(!T.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return T.app.props}static getEnv(){if(!T.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return T.app.env==="internal"?"staging":T.app.env}static getBaseUrl(){if(!T.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");switch(T.app.env){case"production":return"https://api.chainrails.io/api/v1";case"staging":return"https://dev.chainrails.io/api/v1";case"internal":return"https://dev.chainrails.io/api/v1";default:return"https://api.chainrails.io/api/v1"}}static getPayModalUrl(t){if(!T.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");const n=T.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:""}`;return n+i+r}}d.AmountSymbols=s,d.ChainTypes=E,d.Chainrails=T,d.Chains=x,d.DEFAULT_AMOUNT_SYMBOL=dt,d.InternalChains=c,d.TOKEN_REGISTRY=l,d.Tokens=lt,d.allChains=mt,d.arbitrum=v,d.arbitrumTestnet=O,d.assertTokenAddressMatchesChain=Ae,d.assertTokenAddressMatchesChainAndSymbol=pt,d.assertTokenMatchesAmountSymbol=ft,d.assertTokenSymbolMatches=gt,d.avalanche=H,d.avalancheTestnet=_,d.base=L,d.baseTestnet=F,d.bsc=$,d.celo=be,d.environment=w,d.ethereum=P,d.ethereumTestnet=V,d.getToken=B,d.getTokenAddress=St,d.getTokenDecimals=At,d.hyperevm=K,d.isChainAlias=ht,d.isInternalChain=Se,d.linea=Ie,d.lisk=z,d.monad=W,d.monadTestnet=Y,d.optimism=j,d.optimismTestnet=G,d.polygon=X,d.starknet=q,d.starknetTestnet=J,d.toChainAlias=ut,d.toInternalChain=Tt,d.unichain=Ue,d.worldchain=De,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/tokens/registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,oBAAY,SAAS;IACnB,GAAG,gCAAgC;IACnC,IAAI,4BAA4B;IAChC,IAAI,4BAA4B;IAChC,GAAG,2BAA2B;IAC9B,GAAG,2BAA2B;IAC9B,KAAK,6BAA6B;IAClC,IAAI,gCAAgC;IACpC,IAAI,4BAA4B;IAChC,IAAI,4BAA4B;IAChC,IAAI,4BAA4B;IAChC,GAAG,4BAA4B;CAChC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/tokens/registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,oBAAY,SAAS;IACnB,GAAG,gCAAgC;IACnC,IAAI,4BAA4B;IAChC,IAAI,4BAA4B;IAChC,GAAG,2BAA2B;IAC9B,GAAG,2BAA2B;IAC9B,KAAK,6BAA6B;IAClC,IAAI,gCAAgC;IACpC,IAAI,4BAA4B;IAChC,IAAI,4BAA4B;IAChC,IAAI,4BAA4B;IAChC,GAAG,4BAA4B;CAChC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,aA8enB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;CAWT,CAAC"}
|