@chainrails/sdk 0.3.0 → 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.
- package/dist/chainrails-sdk.es.js +468 -464
- package/dist/chainrails-sdk.es.mjs +468 -464
- package/dist/chainrails-sdk.umd.js +2 -2
- package/dist/src/Auth/index.d.ts.map +1 -1
- package/dist/src/Auth/types.d.ts +2 -2
- package/dist/src/Auth/types.d.ts.map +1 -1
- package/dist/src/Router/index.d.ts +1 -1
- package/dist/src/Router/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +5 -5
- package/dist/src/types.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",
|
|
@@ -38,29 +38,29 @@ const c = {
|
|
|
38
38
|
STARKNET: "STARKNET",
|
|
39
39
|
STARKNET_TESTNET: "STARKNET_TESTNET"
|
|
40
40
|
};
|
|
41
|
-
function
|
|
41
|
+
function w(s, { strict: e = !0 } = {}) {
|
|
42
42
|
return !s || typeof s != "string" ? !1 : e ? /^0x[0-9a-fA-F]*$/.test(s) : s.startsWith("0x");
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
44
|
+
function x(s) {
|
|
45
|
+
return w(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
|
-
class
|
|
53
|
-
constructor(e,
|
|
54
|
-
const a =
|
|
52
|
+
class E extends Error {
|
|
53
|
+
constructor(e, n = {}) {
|
|
54
|
+
const a = n.cause instanceof E ? n.cause.details : n.cause?.message ? n.cause.message : n.details, o = n.cause instanceof E && 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,95 +90,95 @@ 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 E {
|
|
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 E {
|
|
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 E {
|
|
144
|
+
constructor({ givenSize: e, maxSize: n }) {
|
|
145
|
+
super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`, { name: "SizeOverflowError" });
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
if (
|
|
150
|
-
throw new
|
|
151
|
-
givenSize:
|
|
148
|
+
function B(s, { size: e }) {
|
|
149
|
+
if (x(s) > e)
|
|
150
|
+
throw new ce({
|
|
151
|
+
givenSize: x(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
|
-
const
|
|
162
|
-
throw new
|
|
163
|
-
max: r ? `${r}${
|
|
164
|
-
min: `${i}${
|
|
165
|
-
signed:
|
|
161
|
+
const m = typeof s == "bigint" ? "n" : "";
|
|
162
|
+
throw new re({
|
|
163
|
+
max: r ? `${r}${m}` : void 0,
|
|
164
|
+
min: `${i}${m}`,
|
|
165
|
+
signed: n,
|
|
166
166
|
size: a,
|
|
167
|
-
value: `${s}${
|
|
167
|
+
value: `${s}${m}`
|
|
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
|
-
return t[0] = Number(s), typeof e.size == "number" ? (k(t, { size: e.size }), U(t, { size: e.size })) : t;
|
|
175
|
+
return typeof s == "number" || typeof s == "bigint" ? fe(s, e) : typeof s == "boolean" ? ge(s, e) : w(s) ? W(s, e) : V(s, e);
|
|
180
176
|
}
|
|
181
|
-
|
|
177
|
+
function ge(s, e = {}) {
|
|
178
|
+
const n = new Uint8Array(1);
|
|
179
|
+
return n[0] = Number(s), typeof e.size == "number" ? (B(n, { size: e.size }), U(n, { size: e.size })) : n;
|
|
180
|
+
}
|
|
181
|
+
const T = {
|
|
182
182
|
zero: 48,
|
|
183
183
|
nine: 57,
|
|
184
184
|
A: 65,
|
|
@@ -187,51 +187,51 @@ const f = {
|
|
|
187
187
|
f: 102
|
|
188
188
|
};
|
|
189
189
|
function M(s) {
|
|
190
|
-
if (s >=
|
|
191
|
-
return s -
|
|
192
|
-
if (s >=
|
|
193
|
-
return s - (
|
|
194
|
-
if (s >=
|
|
195
|
-
return s - (
|
|
190
|
+
if (s >= T.zero && s <= T.nine)
|
|
191
|
+
return s - T.zero;
|
|
192
|
+
if (s >= T.A && s <= T.F)
|
|
193
|
+
return s - (T.A - 10);
|
|
194
|
+
if (s >= T.a && s <= T.f)
|
|
195
|
+
return s - (T.a - 10);
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
let
|
|
199
|
-
e.size && (
|
|
200
|
-
let a =
|
|
197
|
+
function W(s, e = {}) {
|
|
198
|
+
let n = s;
|
|
199
|
+
e.size && (B(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++) {
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
206
|
-
throw new
|
|
207
|
-
r[i] =
|
|
204
|
+
const m = M(a.charCodeAt(d++)), S = M(a.charCodeAt(d++));
|
|
205
|
+
if (m === void 0 || S === void 0)
|
|
206
|
+
throw new E(`Invalid byte sequence ("${a[d - 2]}${a[d - 1]}" in "${a}").`);
|
|
207
|
+
r[i] = m * 16 + S;
|
|
208
208
|
}
|
|
209
209
|
return r;
|
|
210
210
|
}
|
|
211
|
-
function
|
|
212
|
-
const
|
|
213
|
-
return
|
|
211
|
+
function fe(s, e) {
|
|
212
|
+
const n = de(s, e);
|
|
213
|
+
return W(n);
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
const
|
|
217
|
-
return typeof e.size == "number" ? (
|
|
215
|
+
function V(s, e = {}) {
|
|
216
|
+
const n = le.encode(s);
|
|
217
|
+
return typeof e.size == "number" ? (B(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
220
|
function he(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
223
|
function me(s, e = !1) {
|
|
224
|
-
const
|
|
225
|
-
let a = new Uint32Array(
|
|
226
|
-
for (let r = 0; r <
|
|
224
|
+
const n = s.length;
|
|
225
|
+
let a = new Uint32Array(n), o = new Uint32Array(n);
|
|
226
|
+
for (let r = 0; r < n; r++) {
|
|
227
227
|
const { h: i, l: d } = he(s[r], e);
|
|
228
228
|
[a[r], o[r]] = [i, d];
|
|
229
229
|
}
|
|
230
230
|
return [a, o];
|
|
231
231
|
}
|
|
232
|
-
const
|
|
232
|
+
const Te = (s, e, n) => s << n | e >>> 32 - n, Ee = (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 ke {
|
|
285
285
|
}
|
|
286
286
|
function Re(s) {
|
|
287
|
-
const e = (a) => s().update(
|
|
288
|
-
return e.outputLen =
|
|
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 ve = BigInt(0), C = BigInt(1), we = BigInt(2), Be = BigInt(7), Ne = BigInt(256), xe = 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 = ve;
|
|
294
294
|
for (let r = 0; r < 7; r++)
|
|
295
|
-
e = (e << C ^ (e >>
|
|
296
|
-
|
|
295
|
+
e = (e << C ^ (e >> Be) * xe) % Ne, e & we && (o ^= C << (C << /* @__PURE__ */ BigInt(r)) - C);
|
|
296
|
+
Q.push(o);
|
|
297
297
|
}
|
|
298
|
-
const
|
|
299
|
-
function
|
|
300
|
-
const
|
|
298
|
+
const J = me(Q, !0), Me = J[0], Oe = J[1], P = (s, e, n) => n > 32 ? Se(s, e, n) : Te(s, e, n), z = (s, e, n) => n > 32 ? pe(s, e, n) : Ee(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,
|
|
305
|
+
const d = (i + 8) % 10, m = (i + 2) % 10, S = n[m], p = n[m + 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 =
|
|
312
|
-
o = s[p], r = s[p + 1], s[p] =
|
|
311
|
+
const d = X[i], m = P(o, r, d), S = z(o, r, d), p = q[i];
|
|
312
|
+
o = s[p], r = s[p + 1], s[p] = m, 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
|
|
324
|
+
class N extends ke {
|
|
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
|
|
385
|
+
const { blockLen: n, suffix: a, outputLen: o, rounds: r, enableXOF: i } = this;
|
|
386
|
+
return e || (e = new N(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) => Re(() => new N(e, s, n)), $e = He(1, 136, 256 / 8);
|
|
390
390
|
function Pe(s, e) {
|
|
391
|
-
return
|
|
391
|
+
return $e(w(s, { strict: !1 }) ? ue(s) : s);
|
|
392
392
|
}
|
|
393
|
-
class
|
|
393
|
+
class ze extends E {
|
|
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
|
-
function
|
|
436
|
-
if (!
|
|
437
|
-
throw new
|
|
438
|
-
return
|
|
435
|
+
function g(s, e) {
|
|
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:
|
|
443
|
-
if (
|
|
444
|
-
return
|
|
445
|
-
const o =
|
|
446
|
-
return
|
|
440
|
+
const Le = /^0x[a-fA-F0-9]{40}$/, k = /* @__PURE__ */ new Z(8192);
|
|
441
|
+
function _e(s, e) {
|
|
442
|
+
const { strict: n = !0 } = e ?? {}, a = `${s}.${n}`;
|
|
443
|
+
if (k.has(a))
|
|
444
|
+
return k.get(a);
|
|
445
|
+
const o = Le.test(s) ? s.toLowerCase() === s ? !0 : n ? ee(s) === s : !0 : !1;
|
|
446
|
+
return k.set(a, o), o;
|
|
447
447
|
}
|
|
448
|
-
const
|
|
448
|
+
const t = {
|
|
449
449
|
USDC: "USDC",
|
|
450
450
|
USDT: "USDT",
|
|
451
451
|
DAI: "DAI",
|
|
@@ -457,498 +457,507 @@ const n = {
|
|
|
457
457
|
BNB: "BNB",
|
|
458
458
|
LORDS: "LORDS"
|
|
459
459
|
};
|
|
460
|
-
|
|
461
|
-
const
|
|
460
|
+
t.USDC;
|
|
461
|
+
const h = {
|
|
462
462
|
[c.ARBITRUM]: {
|
|
463
|
-
[
|
|
464
|
-
address:
|
|
465
|
-
symbol:
|
|
463
|
+
[t.DAI]: {
|
|
464
|
+
address: g("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),
|
|
465
|
+
symbol: t.DAI,
|
|
466
466
|
name: "Dai Stablecoin",
|
|
467
467
|
decimals: 18,
|
|
468
|
-
logoURI: "/images/tokens/dai.png"
|
|
469
|
-
|
|
468
|
+
logoURI: "/images/tokens/dai.png",
|
|
469
|
+
nativeToken: !1
|
|
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
|
-
logoURI: "/images/chains/ethereum.svg"
|
|
477
|
-
|
|
476
|
+
logoURI: "/images/chains/ethereum.svg",
|
|
477
|
+
nativeToken: !0
|
|
478
478
|
},
|
|
479
|
-
[
|
|
480
|
-
address:
|
|
481
|
-
symbol:
|
|
479
|
+
[t.USDC]: {
|
|
480
|
+
address: g("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
|
|
481
|
+
symbol: t.USDC,
|
|
482
482
|
name: "USD Coin",
|
|
483
483
|
decimals: 6,
|
|
484
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
485
|
-
|
|
484
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
485
|
+
nativeToken: !1
|
|
486
486
|
},
|
|
487
|
-
[
|
|
488
|
-
address:
|
|
489
|
-
symbol:
|
|
487
|
+
[t.USDT]: {
|
|
488
|
+
address: g("0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),
|
|
489
|
+
symbol: t.USDT,
|
|
490
490
|
name: "Tether USD",
|
|
491
491
|
decimals: 6,
|
|
492
|
-
logoURI: "/images/tokens/usdt.png"
|
|
493
|
-
|
|
492
|
+
logoURI: "/images/tokens/usdt.png",
|
|
493
|
+
nativeToken: !1
|
|
494
494
|
},
|
|
495
|
-
[
|
|
496
|
-
address:
|
|
497
|
-
symbol:
|
|
495
|
+
[t.WETH]: {
|
|
496
|
+
address: g("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),
|
|
497
|
+
symbol: t.WETH,
|
|
498
498
|
name: "Wrapped Ether",
|
|
499
499
|
decimals: 18,
|
|
500
|
-
logoURI: "/images/tokens/weth.png"
|
|
501
|
-
|
|
500
|
+
logoURI: "/images/tokens/weth.png",
|
|
501
|
+
nativeToken: !1
|
|
502
502
|
}
|
|
503
503
|
},
|
|
504
504
|
[c.ARBITRUM_TESTNET]: {
|
|
505
|
-
[
|
|
506
|
-
address:
|
|
507
|
-
symbol:
|
|
505
|
+
[t.USDC]: {
|
|
506
|
+
address: g("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
|
|
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
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
512
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
513
|
+
nativeToken: !1
|
|
513
514
|
}
|
|
514
515
|
},
|
|
515
516
|
[c.AVALANCHE]: {
|
|
516
|
-
[
|
|
517
|
+
[t.DAI]: {
|
|
517
518
|
address: "0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",
|
|
518
|
-
symbol:
|
|
519
|
+
symbol: t.DAI,
|
|
519
520
|
name: "Dai Stablecoin",
|
|
520
521
|
decimals: 18,
|
|
521
|
-
logoURI: "/images/tokens/dai.png"
|
|
522
|
-
|
|
522
|
+
logoURI: "/images/tokens/dai.png",
|
|
523
|
+
nativeToken: !1
|
|
523
524
|
},
|
|
524
|
-
[
|
|
525
|
-
address:
|
|
526
|
-
symbol:
|
|
525
|
+
[t.USDC]: {
|
|
526
|
+
address: g("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
|
|
527
|
+
symbol: t.USDC,
|
|
527
528
|
name: "USD Coin",
|
|
528
529
|
fiatISO: "USD",
|
|
529
530
|
decimals: 6,
|
|
530
531
|
logoURI: "/images/tokens/usdc.svg",
|
|
531
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
532
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
533
|
+
nativeToken: !1
|
|
532
534
|
},
|
|
533
|
-
[
|
|
535
|
+
[t.USDT]: {
|
|
534
536
|
address: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",
|
|
535
|
-
symbol:
|
|
537
|
+
symbol: t.USDT,
|
|
536
538
|
name: "Tether USD",
|
|
537
539
|
decimals: 6,
|
|
538
|
-
logoURI: "/images/tokens/usdt.png"
|
|
539
|
-
|
|
540
|
+
logoURI: "/images/tokens/usdt.png",
|
|
541
|
+
nativeToken: !1
|
|
540
542
|
},
|
|
541
|
-
[
|
|
543
|
+
[t.WETH]: {
|
|
542
544
|
address: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",
|
|
543
|
-
symbol:
|
|
545
|
+
symbol: t.WETH,
|
|
544
546
|
name: "Wrapped Ether",
|
|
545
547
|
decimals: 18,
|
|
546
|
-
logoURI: "/images/tokens/weth.png"
|
|
547
|
-
|
|
548
|
+
logoURI: "/images/tokens/weth.png",
|
|
549
|
+
nativeToken: !1
|
|
548
550
|
}
|
|
549
551
|
},
|
|
550
552
|
[c.AVALANCHE_TESTNET]: {
|
|
551
|
-
[
|
|
552
|
-
address:
|
|
553
|
-
symbol:
|
|
553
|
+
[t.USDC]: {
|
|
554
|
+
address: g("0x5425890298aed601595a70AB815c96711a31Bc65"),
|
|
555
|
+
symbol: t.USDC,
|
|
554
556
|
name: "USD Coin",
|
|
555
557
|
fiatISO: "USD",
|
|
556
558
|
decimals: 6,
|
|
557
559
|
logoURI: "/images/tokens/usdc.svg",
|
|
558
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
560
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
561
|
+
nativeToken: !1
|
|
559
562
|
}
|
|
560
563
|
},
|
|
561
564
|
[c.BASE]: {
|
|
562
|
-
[
|
|
565
|
+
[t.DAI]: {
|
|
563
566
|
address: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",
|
|
564
|
-
symbol:
|
|
567
|
+
symbol: t.DAI,
|
|
565
568
|
name: "Dai Stablecoin",
|
|
566
569
|
decimals: 18,
|
|
567
|
-
logoURI: "/images/tokens/dai.png"
|
|
568
|
-
|
|
570
|
+
logoURI: "/images/tokens/dai.png",
|
|
571
|
+
nativeToken: !1
|
|
569
572
|
},
|
|
570
|
-
[
|
|
573
|
+
[t.ETH]: {
|
|
571
574
|
address: "0x0000000000000000000000000000000000000000",
|
|
572
|
-
symbol:
|
|
575
|
+
symbol: t.ETH,
|
|
573
576
|
name: "Ethereum",
|
|
574
577
|
decimals: 18,
|
|
575
|
-
logoURI: "/images/chains/ethereum.svg"
|
|
576
|
-
|
|
578
|
+
logoURI: "/images/chains/ethereum.svg",
|
|
579
|
+
nativeToken: !0
|
|
577
580
|
},
|
|
578
|
-
[
|
|
581
|
+
[t.EURC]: {
|
|
579
582
|
address: "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42",
|
|
580
|
-
symbol:
|
|
583
|
+
symbol: t.EURC,
|
|
581
584
|
name: "Euro Coin",
|
|
582
585
|
decimals: 6,
|
|
583
|
-
logoURI: "/images/tokens/eurc.png"
|
|
584
|
-
|
|
586
|
+
logoURI: "/images/tokens/eurc.png",
|
|
587
|
+
nativeToken: !1
|
|
585
588
|
},
|
|
586
|
-
[
|
|
587
|
-
address:
|
|
588
|
-
symbol:
|
|
589
|
+
[t.USDC]: {
|
|
590
|
+
address: g("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
|
|
591
|
+
symbol: t.USDC,
|
|
589
592
|
name: "USD Coin",
|
|
590
593
|
fiatISO: "USD",
|
|
591
594
|
decimals: 6,
|
|
592
595
|
logoURI: "/images/tokens/usdc.svg",
|
|
593
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
596
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
597
|
+
nativeToken: !1
|
|
594
598
|
},
|
|
595
|
-
[
|
|
596
|
-
address:
|
|
597
|
-
symbol:
|
|
599
|
+
[t.WETH]: {
|
|
600
|
+
address: g("0x4200000000000000000000000000000000000006"),
|
|
601
|
+
symbol: t.WETH,
|
|
598
602
|
name: "Wrapped Ether",
|
|
599
603
|
decimals: 18,
|
|
600
|
-
logoURI: "/images/tokens/weth.png"
|
|
601
|
-
|
|
604
|
+
logoURI: "/images/tokens/weth.png",
|
|
605
|
+
nativeToken: !1
|
|
602
606
|
}
|
|
603
607
|
},
|
|
604
608
|
[c.BASE_TESTNET]: {
|
|
605
|
-
[
|
|
606
|
-
address:
|
|
607
|
-
symbol:
|
|
609
|
+
[t.USDC]: {
|
|
610
|
+
address: g("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
|
|
611
|
+
symbol: t.USDC,
|
|
608
612
|
name: "USD Coin",
|
|
609
613
|
fiatISO: "USD",
|
|
610
614
|
decimals: 6,
|
|
611
615
|
logoURI: "/images/tokens/usdc.svg",
|
|
612
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
616
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
617
|
+
nativeToken: !1
|
|
613
618
|
}
|
|
614
619
|
},
|
|
615
620
|
[c.BSC]: {
|
|
616
|
-
[
|
|
621
|
+
[t.BNB]: {
|
|
617
622
|
address: "0x0000000000000000000000000000000000000000",
|
|
618
|
-
symbol:
|
|
623
|
+
symbol: t.BNB,
|
|
619
624
|
name: "BNB",
|
|
620
625
|
decimals: 18,
|
|
621
|
-
logoURI: "/images/chains/bsc.webp"
|
|
622
|
-
|
|
626
|
+
logoURI: "/images/chains/bsc.webp",
|
|
627
|
+
nativeToken: !0
|
|
623
628
|
},
|
|
624
|
-
[
|
|
629
|
+
[t.BUSD]: {
|
|
625
630
|
address: "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
|
|
626
|
-
symbol:
|
|
631
|
+
symbol: t.BUSD,
|
|
627
632
|
name: "Binance USD",
|
|
628
633
|
decimals: 18,
|
|
629
|
-
logoURI: "/images/tokens/busd.png"
|
|
630
|
-
|
|
634
|
+
logoURI: "/images/tokens/busd.png",
|
|
635
|
+
nativeToken: !1
|
|
631
636
|
},
|
|
632
|
-
[
|
|
637
|
+
[t.DAI]: {
|
|
633
638
|
address: "0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",
|
|
634
|
-
symbol:
|
|
639
|
+
symbol: t.DAI,
|
|
635
640
|
name: "Dai Stablecoin",
|
|
636
641
|
decimals: 18,
|
|
637
|
-
logoURI: "/images/tokens/dai.png"
|
|
638
|
-
|
|
642
|
+
logoURI: "/images/tokens/dai.png",
|
|
643
|
+
nativeToken: !1
|
|
639
644
|
},
|
|
640
|
-
[
|
|
645
|
+
[t.ETH]: {
|
|
641
646
|
address: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8",
|
|
642
|
-
symbol:
|
|
647
|
+
symbol: t.ETH,
|
|
643
648
|
name: "Ethereum",
|
|
644
649
|
decimals: 18,
|
|
645
|
-
logoURI: "/images/chains/ethereum.svg"
|
|
646
|
-
|
|
650
|
+
logoURI: "/images/chains/ethereum.svg",
|
|
651
|
+
nativeToken: !1
|
|
647
652
|
},
|
|
648
|
-
[
|
|
649
|
-
address:
|
|
650
|
-
symbol:
|
|
653
|
+
[t.USDC]: {
|
|
654
|
+
address: g("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
|
|
655
|
+
symbol: t.USDC,
|
|
651
656
|
decimals: 18,
|
|
652
657
|
name: "USD Coin",
|
|
653
658
|
logoURI: "/images/tokens/usdc.svg",
|
|
654
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
659
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
660
|
+
nativeToken: !1
|
|
655
661
|
},
|
|
656
|
-
[
|
|
662
|
+
[t.USDT]: {
|
|
657
663
|
address: "0x55d398326f99059fF775485246999027B3197955",
|
|
658
|
-
symbol:
|
|
664
|
+
symbol: t.USDT,
|
|
659
665
|
name: "Tether USD",
|
|
660
666
|
decimals: 18,
|
|
661
|
-
logoURI: "/images/tokens/usdt.png"
|
|
662
|
-
|
|
667
|
+
logoURI: "/images/tokens/usdt.png",
|
|
668
|
+
nativeToken: !1
|
|
663
669
|
}
|
|
664
670
|
},
|
|
665
671
|
[c.ETHEREUM]: {
|
|
666
|
-
[
|
|
672
|
+
[t.BUSD]: {
|
|
667
673
|
address: "0x4Fabb145d64652a948d72533023f6E7A623C7C53",
|
|
668
|
-
symbol:
|
|
674
|
+
symbol: t.BUSD,
|
|
669
675
|
name: "Binance USD",
|
|
670
676
|
decimals: 18,
|
|
671
|
-
logoURI: "/images/tokens/busd.png"
|
|
672
|
-
|
|
677
|
+
logoURI: "/images/tokens/busd.png",
|
|
678
|
+
nativeToken: !1
|
|
673
679
|
},
|
|
674
|
-
[
|
|
675
|
-
address:
|
|
676
|
-
symbol:
|
|
680
|
+
[t.DAI]: {
|
|
681
|
+
address: g("0x6B175474E89094C44Da98b954EedeAC495271d0F"),
|
|
682
|
+
symbol: t.DAI,
|
|
677
683
|
name: "Dai Stablecoin",
|
|
678
684
|
decimals: 18,
|
|
679
|
-
logoURI: "/images/tokens/dai.png"
|
|
680
|
-
|
|
685
|
+
logoURI: "/images/tokens/dai.png",
|
|
686
|
+
nativeToken: !1
|
|
681
687
|
},
|
|
682
|
-
[
|
|
688
|
+
[t.ETH]: {
|
|
683
689
|
address: "0x0000000000000000000000000000000000000000",
|
|
684
|
-
symbol:
|
|
690
|
+
symbol: t.ETH,
|
|
685
691
|
name: "Ethereum",
|
|
686
692
|
decimals: 18,
|
|
687
|
-
logoURI: "/images/chains/ethereum.svg"
|
|
688
|
-
|
|
693
|
+
logoURI: "/images/chains/ethereum.svg",
|
|
694
|
+
nativeToken: !0
|
|
689
695
|
},
|
|
690
|
-
[
|
|
696
|
+
[t.EURC]: {
|
|
691
697
|
address: "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
|
|
692
|
-
symbol:
|
|
698
|
+
symbol: t.EURC,
|
|
693
699
|
name: "Euro Coin",
|
|
694
700
|
decimals: 6,
|
|
695
|
-
logoURI: "/images/tokens/eurc.png"
|
|
696
|
-
|
|
701
|
+
logoURI: "/images/tokens/eurc.png",
|
|
702
|
+
nativeToken: !1
|
|
697
703
|
},
|
|
698
|
-
[
|
|
704
|
+
[t.STRK]: {
|
|
699
705
|
address: "0xCa14007Eff0dB1f8135f4C25B34De49AB0d42766",
|
|
700
|
-
symbol:
|
|
706
|
+
symbol: t.STRK,
|
|
701
707
|
name: "Starknet Token",
|
|
702
708
|
decimals: 18,
|
|
703
|
-
logoURI: "/images/chains/starknet.svg"
|
|
704
|
-
|
|
709
|
+
logoURI: "/images/chains/starknet.svg",
|
|
710
|
+
nativeToken: !1
|
|
705
711
|
},
|
|
706
|
-
[
|
|
707
|
-
address:
|
|
708
|
-
symbol:
|
|
712
|
+
[t.USDC]: {
|
|
713
|
+
address: g("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
|
|
714
|
+
symbol: t.USDC,
|
|
709
715
|
name: "USD Coin",
|
|
710
716
|
decimals: 6,
|
|
711
717
|
logoURI: "/images/tokens/usdc.svg",
|
|
712
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
718
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
719
|
+
nativeToken: !1
|
|
713
720
|
},
|
|
714
|
-
[
|
|
715
|
-
address:
|
|
716
|
-
symbol:
|
|
721
|
+
[t.USDT]: {
|
|
722
|
+
address: g("0xdAC17F958D2ee523a2206206994597C13D831ec7"),
|
|
723
|
+
symbol: t.USDT,
|
|
717
724
|
name: "Tether USD",
|
|
718
725
|
decimals: 6,
|
|
719
|
-
logoURI: "/images/tokens/usdt.png"
|
|
720
|
-
|
|
726
|
+
logoURI: "/images/tokens/usdt.png",
|
|
727
|
+
nativeToken: !1
|
|
721
728
|
},
|
|
722
|
-
[
|
|
723
|
-
address:
|
|
724
|
-
symbol:
|
|
729
|
+
[t.WETH]: {
|
|
730
|
+
address: g("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),
|
|
731
|
+
symbol: t.WETH,
|
|
725
732
|
name: "Wrapped Ether",
|
|
726
733
|
decimals: 18,
|
|
727
|
-
logoURI: "/images/tokens/weth.png"
|
|
728
|
-
|
|
734
|
+
logoURI: "/images/tokens/weth.png",
|
|
735
|
+
nativeToken: !1
|
|
729
736
|
}
|
|
730
737
|
},
|
|
731
738
|
[c.ETHEREUM_TESTNET]: {
|
|
732
|
-
[
|
|
733
|
-
address:
|
|
734
|
-
symbol:
|
|
739
|
+
[t.USDC]: {
|
|
740
|
+
address: g("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
|
|
741
|
+
symbol: t.USDC,
|
|
735
742
|
decimals: 6,
|
|
736
743
|
name: "USD Coin",
|
|
737
744
|
logoURI: "/images/tokens/usdc.svg",
|
|
738
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
745
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
746
|
+
nativeToken: !1
|
|
739
747
|
}
|
|
740
748
|
},
|
|
741
749
|
[c.HYPEREVM]: {
|
|
742
|
-
[
|
|
750
|
+
[t.USDC]: {
|
|
743
751
|
address: "0xb88339CB7199b77E23DB6E890353E22632Ba630f",
|
|
744
|
-
symbol:
|
|
752
|
+
symbol: t.USDC,
|
|
745
753
|
name: "USD Coin",
|
|
746
754
|
decimals: 6,
|
|
747
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
748
|
-
|
|
755
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
756
|
+
nativeToken: !1
|
|
749
757
|
}
|
|
750
758
|
},
|
|
751
759
|
[c.LISK]: {
|
|
752
|
-
[
|
|
760
|
+
[t.USDC]: {
|
|
753
761
|
address: "0xF242275d3a6527d877f2c927a82D9b057609cc71",
|
|
754
|
-
symbol:
|
|
762
|
+
symbol: t.USDC,
|
|
755
763
|
name: "USD Coin",
|
|
756
764
|
decimals: 6,
|
|
757
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
758
|
-
|
|
765
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
766
|
+
nativeToken: !1
|
|
759
767
|
}
|
|
760
768
|
},
|
|
761
769
|
[c.MONAD]: {
|
|
762
|
-
[
|
|
770
|
+
[t.USDC]: {
|
|
763
771
|
address: "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
|
|
764
|
-
symbol:
|
|
772
|
+
symbol: t.USDC,
|
|
765
773
|
name: "USD Coin",
|
|
766
774
|
decimals: 6,
|
|
767
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
768
|
-
|
|
775
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
776
|
+
nativeToken: !1
|
|
769
777
|
}
|
|
770
778
|
},
|
|
771
779
|
[c.MONAD_TESTNET]: {
|
|
772
|
-
[
|
|
780
|
+
[t.USDC]: {
|
|
773
781
|
address: "0x534b2f3A21130d7a60830c2Df862319e593943A3",
|
|
774
|
-
symbol:
|
|
782
|
+
symbol: t.USDC,
|
|
775
783
|
name: "USD Coin",
|
|
776
784
|
decimals: 6,
|
|
777
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
778
|
-
|
|
785
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
786
|
+
nativeToken: !1
|
|
779
787
|
}
|
|
780
788
|
},
|
|
781
789
|
[c.OPTIMISM]: {
|
|
782
|
-
[
|
|
790
|
+
[t.DAI]: {
|
|
783
791
|
address: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
|
|
784
|
-
symbol:
|
|
792
|
+
symbol: t.DAI,
|
|
785
793
|
name: "Dai Stablecoin",
|
|
786
794
|
decimals: 18,
|
|
787
|
-
logoURI: "/images/tokens/dai.png"
|
|
788
|
-
|
|
795
|
+
logoURI: "/images/tokens/dai.png",
|
|
796
|
+
nativeToken: !1
|
|
789
797
|
},
|
|
790
|
-
[
|
|
798
|
+
[t.ETH]: {
|
|
791
799
|
address: "0x0000000000000000000000000000000000000000",
|
|
792
|
-
symbol:
|
|
800
|
+
symbol: t.ETH,
|
|
793
801
|
name: "Ethereum",
|
|
794
802
|
decimals: 18,
|
|
795
|
-
logoURI: "/images/chains/ethereum.svg"
|
|
796
|
-
|
|
803
|
+
logoURI: "/images/chains/ethereum.svg",
|
|
804
|
+
nativeToken: !0
|
|
797
805
|
},
|
|
798
|
-
[
|
|
806
|
+
[t.USDC]: {
|
|
799
807
|
address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
800
|
-
symbol:
|
|
808
|
+
symbol: t.USDC,
|
|
801
809
|
name: "USD Coin",
|
|
802
810
|
decimals: 6,
|
|
803
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
804
|
-
|
|
811
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
812
|
+
nativeToken: !1
|
|
805
813
|
},
|
|
806
|
-
[
|
|
814
|
+
[t.USDT]: {
|
|
807
815
|
address: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
|
|
808
|
-
symbol:
|
|
816
|
+
symbol: t.USDT,
|
|
809
817
|
name: "Tether USD",
|
|
810
818
|
decimals: 6,
|
|
811
|
-
logoURI: "/images/tokens/usdt.png"
|
|
812
|
-
|
|
819
|
+
logoURI: "/images/tokens/usdt.png",
|
|
820
|
+
nativeToken: !1
|
|
813
821
|
},
|
|
814
|
-
[
|
|
822
|
+
[t.WETH]: {
|
|
815
823
|
address: "0x4200000000000000000000000000000000000006",
|
|
816
|
-
symbol:
|
|
824
|
+
symbol: t.WETH,
|
|
817
825
|
name: "Wrapped Ether",
|
|
818
826
|
decimals: 18,
|
|
819
|
-
logoURI: "/images/tokens/weth.png"
|
|
820
|
-
|
|
827
|
+
logoURI: "/images/tokens/weth.png",
|
|
828
|
+
nativeToken: !1
|
|
821
829
|
}
|
|
822
830
|
},
|
|
823
831
|
[c.OPTIMISM_TESTNET]: {
|
|
824
|
-
[
|
|
832
|
+
[t.USDC]: {
|
|
825
833
|
address: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7",
|
|
826
|
-
symbol:
|
|
834
|
+
symbol: t.USDC,
|
|
827
835
|
name: "USD Coin",
|
|
828
836
|
decimals: 6,
|
|
829
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
830
|
-
|
|
837
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
838
|
+
nativeToken: !1
|
|
831
839
|
}
|
|
832
840
|
},
|
|
833
841
|
[c.POLYGON]: {
|
|
834
|
-
[
|
|
842
|
+
[t.DAI]: {
|
|
835
843
|
address: "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
|
|
836
|
-
symbol:
|
|
844
|
+
symbol: t.DAI,
|
|
837
845
|
name: "Dai Stablecoin",
|
|
838
846
|
decimals: 18,
|
|
839
|
-
logoURI: "/images/tokens/dai.png"
|
|
840
|
-
|
|
847
|
+
logoURI: "/images/tokens/dai.png",
|
|
848
|
+
nativeToken: !1
|
|
841
849
|
},
|
|
842
|
-
[
|
|
850
|
+
[t.USDC]: {
|
|
843
851
|
address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
|
|
844
|
-
symbol:
|
|
852
|
+
symbol: t.USDC,
|
|
845
853
|
name: "USD Coin",
|
|
846
854
|
decimals: 6,
|
|
847
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
848
|
-
|
|
855
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
856
|
+
nativeToken: !1
|
|
849
857
|
},
|
|
850
|
-
[
|
|
858
|
+
[t.USDT]: {
|
|
851
859
|
address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
|
|
852
|
-
symbol:
|
|
860
|
+
symbol: t.USDT,
|
|
853
861
|
name: "Tether USD",
|
|
854
862
|
decimals: 6,
|
|
855
|
-
logoURI: "/images/tokens/usdt.png"
|
|
856
|
-
|
|
863
|
+
logoURI: "/images/tokens/usdt.png",
|
|
864
|
+
nativeToken: !1
|
|
857
865
|
},
|
|
858
|
-
[
|
|
866
|
+
[t.WETH]: {
|
|
859
867
|
address: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
|
|
860
|
-
symbol:
|
|
868
|
+
symbol: t.WETH,
|
|
861
869
|
name: "Wrapped Ether",
|
|
862
870
|
decimals: 18,
|
|
863
|
-
logoURI: "/images/tokens/weth.png"
|
|
864
|
-
|
|
871
|
+
logoURI: "/images/tokens/weth.png",
|
|
872
|
+
nativeToken: !1
|
|
865
873
|
}
|
|
866
874
|
},
|
|
867
875
|
[c.STARKNET]: {
|
|
868
|
-
[
|
|
876
|
+
[t.DAI]: {
|
|
869
877
|
address: "0x05574eb6b8789a91466f902c380d978e472db68170ff82a5b650b95a58ddf4ad",
|
|
870
|
-
symbol:
|
|
878
|
+
symbol: t.DAI,
|
|
871
879
|
name: "Dai Stablecoin",
|
|
872
880
|
decimals: 18,
|
|
873
|
-
logoURI: "/images/tokens/dai.png"
|
|
874
|
-
|
|
881
|
+
logoURI: "/images/tokens/dai.png",
|
|
882
|
+
nativeToken: !1
|
|
875
883
|
},
|
|
876
|
-
[
|
|
884
|
+
[t.ETH]: {
|
|
877
885
|
address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
|
|
878
|
-
symbol:
|
|
886
|
+
symbol: t.ETH,
|
|
879
887
|
name: "Ethereum",
|
|
880
888
|
decimals: 18,
|
|
881
|
-
logoURI: "/images/chains/ethereum.svg"
|
|
882
|
-
|
|
889
|
+
logoURI: "/images/chains/ethereum.svg",
|
|
890
|
+
nativeToken: !1
|
|
883
891
|
},
|
|
884
|
-
[
|
|
892
|
+
[t.LORDS]: {
|
|
885
893
|
address: "0x0124aeb495b947201f5faC96fD1138E326AD86195B98df6DEc9009158A533B49",
|
|
886
|
-
symbol:
|
|
894
|
+
symbol: t.LORDS,
|
|
887
895
|
name: "LORDS Token",
|
|
888
896
|
decimals: 18,
|
|
889
|
-
logoURI: "/images/tokens/lords.png"
|
|
890
|
-
|
|
897
|
+
logoURI: "/images/tokens/lords.png",
|
|
898
|
+
nativeToken: !1
|
|
891
899
|
},
|
|
892
|
-
[
|
|
900
|
+
[t.STRK]: {
|
|
893
901
|
address: "0x04718f5a0Fc34cC1AF16A1cdee98fFB20C31f5cD61D6Ab07201858f4287c938D",
|
|
894
|
-
symbol:
|
|
902
|
+
symbol: t.STRK,
|
|
895
903
|
name: "Starknet Token",
|
|
896
904
|
decimals: 18,
|
|
897
|
-
logoURI: "/images/chains/starknet.svg"
|
|
898
|
-
|
|
905
|
+
logoURI: "/images/chains/starknet.svg",
|
|
906
|
+
nativeToken: !1
|
|
899
907
|
},
|
|
900
|
-
[
|
|
908
|
+
[t.USDC]: {
|
|
901
909
|
address: "0x033068F6539f8e6e6b131e6B2B814e6c34A5224bC66947c47DaB9dFeE93b35fb",
|
|
902
|
-
symbol:
|
|
910
|
+
symbol: t.USDC,
|
|
903
911
|
name: "USD Coin",
|
|
904
912
|
decimals: 6,
|
|
905
913
|
logoURI: "/images/tokens/usdc.svg",
|
|
906
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
914
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
915
|
+
nativeToken: !1
|
|
907
916
|
},
|
|
908
|
-
[
|
|
917
|
+
[t.USDT]: {
|
|
909
918
|
address: "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",
|
|
910
|
-
symbol:
|
|
919
|
+
symbol: t.USDT,
|
|
911
920
|
name: "Tether USD",
|
|
912
921
|
decimals: 6,
|
|
913
|
-
logoURI: "/images/tokens/usdt.png"
|
|
914
|
-
|
|
922
|
+
logoURI: "/images/tokens/usdt.png",
|
|
923
|
+
nativeToken: !1
|
|
915
924
|
}
|
|
916
925
|
},
|
|
917
926
|
[c.STARKNET_TESTNET]: {
|
|
918
|
-
[
|
|
927
|
+
[t.USDC]: {
|
|
919
928
|
address: "0x0512feAc6339Ff7889822cb5aA2a86C848e9D392bB0E3E237C008674feeD8343",
|
|
920
|
-
symbol:
|
|
929
|
+
symbol: t.USDC,
|
|
921
930
|
name: "USD Coin",
|
|
922
931
|
decimals: 6,
|
|
923
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
924
|
-
|
|
932
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
933
|
+
nativeToken: !1
|
|
925
934
|
}
|
|
926
935
|
}
|
|
927
|
-
},
|
|
928
|
-
ARBITRUM:
|
|
929
|
-
ARBITRUM_TESTNET:
|
|
930
|
-
AVALANCHE:
|
|
931
|
-
AVALANCHE_TESTNET:
|
|
932
|
-
BASE:
|
|
933
|
-
BASE_TESTNET:
|
|
934
|
-
BSC:
|
|
935
|
-
ETHEREUM:
|
|
936
|
-
ETHEREUM_TESTNET:
|
|
937
|
-
STARKNET:
|
|
938
|
-
},
|
|
939
|
-
function
|
|
940
|
-
if (
|
|
936
|
+
}, ns = {
|
|
937
|
+
ARBITRUM: h[c.ARBITRUM],
|
|
938
|
+
ARBITRUM_TESTNET: h[c.ARBITRUM_TESTNET],
|
|
939
|
+
AVALANCHE: h[c.AVALANCHE],
|
|
940
|
+
AVALANCHE_TESTNET: h[c.AVALANCHE_TESTNET],
|
|
941
|
+
BASE: h[c.BASE],
|
|
942
|
+
BASE_TESTNET: h[c.BASE_TESTNET],
|
|
943
|
+
BSC: h[c.BSC],
|
|
944
|
+
ETHEREUM: h[c.ETHEREUM],
|
|
945
|
+
ETHEREUM_TESTNET: h[c.ETHEREUM_TESTNET],
|
|
946
|
+
STARKNET: h[c.STARKNET]
|
|
947
|
+
}, je = new Set(Object.values(c));
|
|
948
|
+
function f(s) {
|
|
949
|
+
if (Ke(s))
|
|
941
950
|
return s;
|
|
942
951
|
const e = c[s];
|
|
943
952
|
if (!e)
|
|
944
953
|
throw new Error(`Invalid chain: ${s}. Chain must be a valid chain alias or internal chain value from Chains.`);
|
|
945
954
|
return e;
|
|
946
955
|
}
|
|
947
|
-
function
|
|
948
|
-
return
|
|
956
|
+
function Ke(s) {
|
|
957
|
+
return je.has(s);
|
|
949
958
|
}
|
|
950
|
-
function
|
|
951
|
-
const
|
|
959
|
+
function We(s, e) {
|
|
960
|
+
const n = e.toLowerCase().trim(), a = h[s];
|
|
952
961
|
if (!a)
|
|
953
962
|
throw new Error(
|
|
954
963
|
`Chain not found: ${s}. The chain key must be a valid chain identifier.`
|
|
@@ -956,7 +965,7 @@ function Ke(s, e) {
|
|
|
956
965
|
let o;
|
|
957
966
|
for (const r in a) {
|
|
958
967
|
const i = a[r];
|
|
959
|
-
if (i && i.address.toLowerCase() ===
|
|
968
|
+
if (i && i.address.toLowerCase() === n.toLowerCase()) {
|
|
960
969
|
o = i;
|
|
961
970
|
break;
|
|
962
971
|
}
|
|
@@ -967,24 +976,24 @@ function Ke(s, e) {
|
|
|
967
976
|
);
|
|
968
977
|
return o;
|
|
969
978
|
}
|
|
970
|
-
function
|
|
971
|
-
const a =
|
|
972
|
-
if (a.symbol !==
|
|
979
|
+
function R(s, e, n) {
|
|
980
|
+
const a = We(s, e);
|
|
981
|
+
if (a.symbol !== n)
|
|
973
982
|
throw new Error(
|
|
974
|
-
`Token address and symbol mismatch: address ${e} on chain ${s} corresponds to token "${a.symbol}", but expected "${
|
|
983
|
+
`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
984
|
);
|
|
976
985
|
return a;
|
|
977
986
|
}
|
|
978
|
-
function We(s, e) {
|
|
979
|
-
return m[s]?.[e];
|
|
980
|
-
}
|
|
981
987
|
function Ve(s, e) {
|
|
982
|
-
return
|
|
988
|
+
return h[s]?.[e];
|
|
989
|
+
}
|
|
990
|
+
function L(s, e) {
|
|
991
|
+
return Ve(s, e)?.address;
|
|
983
992
|
}
|
|
984
|
-
var
|
|
993
|
+
var se = /* @__PURE__ */ ((s) => (s.PRODUCTION = "production", s.STAGING = "staging", s))(se || {});
|
|
985
994
|
class l {
|
|
986
|
-
constructor({ api_key: e, env:
|
|
987
|
-
this.api_key = e || "", this.sessionToken = a || "", this.env =
|
|
995
|
+
constructor({ api_key: e, env: n, seesion_token: a, props: o }) {
|
|
996
|
+
this.api_key = e || "", this.sessionToken = a || "", this.env = n ?? se.PRODUCTION, this.props = o;
|
|
988
997
|
}
|
|
989
998
|
static async config(e) {
|
|
990
999
|
if (!l.app) {
|
|
@@ -1031,13 +1040,13 @@ class l {
|
|
|
1031
1040
|
static getPayModalUrl(e) {
|
|
1032
1041
|
if (!l.app)
|
|
1033
1042
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1034
|
-
const
|
|
1035
|
-
return
|
|
1043
|
+
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 : ""}`;
|
|
1044
|
+
return n + o + r;
|
|
1036
1045
|
}
|
|
1037
1046
|
}
|
|
1038
|
-
let
|
|
1047
|
+
let v = null;
|
|
1039
1048
|
function Ye() {
|
|
1040
|
-
|
|
1049
|
+
v = ae.create({
|
|
1041
1050
|
prefixUrl: l.getBaseUrl(),
|
|
1042
1051
|
headers: {
|
|
1043
1052
|
"Content-Type": "application/json"
|
|
@@ -1049,7 +1058,7 @@ function Ye() {
|
|
|
1049
1058
|
s.headers.set("Authorization", `Bearer ${e}`);
|
|
1050
1059
|
}
|
|
1051
1060
|
],
|
|
1052
|
-
afterResponse: [(s, e,
|
|
1061
|
+
afterResponse: [(s, e, n) => n]
|
|
1053
1062
|
},
|
|
1054
1063
|
retry: {
|
|
1055
1064
|
limit: 2
|
|
@@ -1057,7 +1066,7 @@ function Ye() {
|
|
|
1057
1066
|
});
|
|
1058
1067
|
}
|
|
1059
1068
|
function u() {
|
|
1060
|
-
return
|
|
1069
|
+
return v || Ye(), v;
|
|
1061
1070
|
}
|
|
1062
1071
|
class Ge {
|
|
1063
1072
|
async getById(e) {
|
|
@@ -1076,23 +1085,23 @@ class Ge {
|
|
|
1076
1085
|
return await u().get("intents", { searchParams: e }).json();
|
|
1077
1086
|
}
|
|
1078
1087
|
async create(e) {
|
|
1079
|
-
const
|
|
1088
|
+
const n = f(e.source_chain), a = f(e.destination_chain);
|
|
1080
1089
|
return await u().post("intents", {
|
|
1081
1090
|
json: {
|
|
1082
1091
|
...e,
|
|
1083
|
-
source_chain:
|
|
1092
|
+
source_chain: n,
|
|
1084
1093
|
destination_chain: a
|
|
1085
1094
|
}
|
|
1086
1095
|
}).json();
|
|
1087
1096
|
}
|
|
1088
1097
|
async createForSession(e) {
|
|
1089
|
-
const
|
|
1098
|
+
const n = f(e.sourceChain);
|
|
1090
1099
|
return await u().post("modal/sessions/intents", {
|
|
1091
|
-
json: { ...e, sourceChain:
|
|
1100
|
+
json: { ...e, sourceChain: n }
|
|
1092
1101
|
}).json();
|
|
1093
1102
|
}
|
|
1094
|
-
async update(e,
|
|
1095
|
-
return await u().post("intents", { json:
|
|
1103
|
+
async update(e, n) {
|
|
1104
|
+
return await u().post("intents", { json: n }).json();
|
|
1096
1105
|
}
|
|
1097
1106
|
async triggerProcessing(e) {
|
|
1098
1107
|
return await u().post(`intents/${e}/trigger-processing`).json();
|
|
@@ -1103,44 +1112,44 @@ class Ge {
|
|
|
1103
1112
|
}
|
|
1104
1113
|
class qe {
|
|
1105
1114
|
async getFromSpecificBridge(e) {
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
const a =
|
|
1115
|
+
const n = f(e.sourceChain);
|
|
1116
|
+
R(n, e.tokenIn, e.amountSymbol);
|
|
1117
|
+
const a = f(e.destinationChain);
|
|
1109
1118
|
return await u().get("quotes/single", {
|
|
1110
1119
|
searchParams: {
|
|
1111
1120
|
...e,
|
|
1112
|
-
sourceChain:
|
|
1121
|
+
sourceChain: n,
|
|
1113
1122
|
destinationChain: a
|
|
1114
1123
|
}
|
|
1115
1124
|
}).json();
|
|
1116
1125
|
}
|
|
1117
1126
|
async getFromAllBridges(e) {
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1120
|
-
const a =
|
|
1127
|
+
const n = f(e.sourceChain);
|
|
1128
|
+
R(n, e.tokenIn, e.amountSymbol);
|
|
1129
|
+
const a = f(e.destinationChain);
|
|
1121
1130
|
return await u().get("quotes/multiple", {
|
|
1122
1131
|
searchParams: {
|
|
1123
1132
|
...e,
|
|
1124
|
-
sourceChain:
|
|
1133
|
+
sourceChain: n,
|
|
1125
1134
|
destinationChain: a
|
|
1126
1135
|
}
|
|
1127
1136
|
}).json();
|
|
1128
1137
|
}
|
|
1129
1138
|
async getBestAcrossBridges(e) {
|
|
1130
|
-
const
|
|
1131
|
-
|
|
1132
|
-
const a =
|
|
1139
|
+
const n = f(e.sourceChain);
|
|
1140
|
+
R(n, e.tokenIn, e.amountSymbol);
|
|
1141
|
+
const a = f(e.destinationChain);
|
|
1133
1142
|
return await u().get("quotes/best", { searchParams: {
|
|
1134
1143
|
...e,
|
|
1135
|
-
sourceChain:
|
|
1144
|
+
sourceChain: n,
|
|
1136
1145
|
destinationChain: a
|
|
1137
1146
|
} }).json();
|
|
1138
1147
|
}
|
|
1139
1148
|
async getAll(e) {
|
|
1140
|
-
const
|
|
1149
|
+
const n = f(e.destinationChain);
|
|
1141
1150
|
return await u().get("quotes/multi-source", { searchParams: {
|
|
1142
1151
|
...e,
|
|
1143
|
-
destinationChain:
|
|
1152
|
+
destinationChain: n
|
|
1144
1153
|
} }).json();
|
|
1145
1154
|
}
|
|
1146
1155
|
async getAllForSession(e) {
|
|
@@ -1149,11 +1158,11 @@ class qe {
|
|
|
1149
1158
|
}
|
|
1150
1159
|
class Xe {
|
|
1151
1160
|
async getOptimalRoutes(e) {
|
|
1152
|
-
const
|
|
1161
|
+
const n = f(e.sourceChain), a = f(e.destinationChain);
|
|
1153
1162
|
return await u().get("router/optimal-route", {
|
|
1154
1163
|
searchParams: {
|
|
1155
1164
|
...e,
|
|
1156
|
-
sourceChain:
|
|
1165
|
+
sourceChain: n,
|
|
1157
1166
|
destinationChain: a
|
|
1158
1167
|
}
|
|
1159
1168
|
}).json();
|
|
@@ -1162,20 +1171,15 @@ class Xe {
|
|
|
1162
1171
|
return await u().get("router/supported-bridges/all").json();
|
|
1163
1172
|
}
|
|
1164
1173
|
async getSupportedBridges(e) {
|
|
1165
|
-
const
|
|
1174
|
+
const n = f(e.sourceChain), a = f(e.destinationChain);
|
|
1166
1175
|
return await u().get("router/supported-bridges/route", { searchParams: {
|
|
1167
1176
|
...e,
|
|
1168
|
-
sourceChain:
|
|
1177
|
+
sourceChain: n,
|
|
1169
1178
|
destinationChain: a
|
|
1170
1179
|
} }).json();
|
|
1171
1180
|
}
|
|
1172
|
-
async getSupportedRoutes(e
|
|
1173
|
-
|
|
1174
|
-
return await u().get("router/supported-routes/bridge/" + e, { searchParams: {
|
|
1175
|
-
...t,
|
|
1176
|
-
sourceChain: a,
|
|
1177
|
-
destinationChain: o
|
|
1178
|
-
} }).json();
|
|
1181
|
+
async getSupportedRoutes(e) {
|
|
1182
|
+
return await u().get("router/supported-routes/bridge/" + e).json();
|
|
1179
1183
|
}
|
|
1180
1184
|
}
|
|
1181
1185
|
class Qe {
|
|
@@ -1196,19 +1200,19 @@ class Je {
|
|
|
1196
1200
|
}
|
|
1197
1201
|
class Ze {
|
|
1198
1202
|
async getSessionToken(e) {
|
|
1199
|
-
const
|
|
1203
|
+
const n = f(e.destinationChain);
|
|
1204
|
+
let a = L(n, e.token);
|
|
1205
|
+
a || (console.error(`${e.token} on ${e.destinationChain} is currently unsupported, defaulting to usdc`), a = L(n, "USDC"));
|
|
1206
|
+
const o = {
|
|
1200
1207
|
recipient: e.recipient,
|
|
1201
|
-
tokenOut:
|
|
1202
|
-
|
|
1203
|
-
e.token
|
|
1204
|
-
),
|
|
1205
|
-
destinationChain: t,
|
|
1208
|
+
tokenOut: a,
|
|
1209
|
+
destinationChain: n,
|
|
1206
1210
|
amount: e.amount
|
|
1207
1211
|
};
|
|
1208
|
-
return u().post("modal/sessions", { json:
|
|
1212
|
+
return u().post("modal/sessions", { json: o }).json().then((r) => ({ ...r, amount: o.amount }));
|
|
1209
1213
|
}
|
|
1210
1214
|
}
|
|
1211
|
-
const
|
|
1215
|
+
const ts = {
|
|
1212
1216
|
ACROSS: "ACROSS",
|
|
1213
1217
|
CCTP: "CCTP",
|
|
1214
1218
|
GATEWAY: "GATEWAY",
|
|
@@ -1222,11 +1226,11 @@ const ns = {
|
|
|
1222
1226
|
auth: new Ze()
|
|
1223
1227
|
};
|
|
1224
1228
|
export {
|
|
1225
|
-
|
|
1226
|
-
|
|
1229
|
+
t as AmountSymbols,
|
|
1230
|
+
ts as Bridges,
|
|
1227
1231
|
l as Chainrails,
|
|
1228
1232
|
ss as Chains,
|
|
1229
|
-
|
|
1233
|
+
ns as Tokens,
|
|
1230
1234
|
as as crapi,
|
|
1231
|
-
|
|
1235
|
+
se as environment
|
|
1232
1236
|
};
|