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