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