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