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