@cartridge/controller 0.13.10-alpha.1 → 0.13.10
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/.turbo/turbo-build$colon$deps.log +14 -14
- package/dist/iframe/keychain.d.ts +1 -1
- package/dist/{index-B46sSAxE.js → index-C7KGk-LM.js} +473 -198
- package/dist/index-C7KGk-LM.js.map +1 -0
- package/dist/index.js +783 -769
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/session.js +4 -4
- package/dist/stats.html +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/utils.d.ts +0 -1
- package/dist/wallets/ethereum-base.d.ts +5 -1
- package/dist/wallets/metamask/index.d.ts +1 -0
- package/dist/wallets/phantom-evm/index.d.ts +1 -0
- package/package.json +3 -4
- package/src/controller.ts +3 -3
- package/src/iframe/keychain.ts +5 -0
- package/src/types.ts +2 -0
- package/src/utils.ts +0 -8
- package/src/wallets/ethereum-base.ts +35 -48
- package/src/wallets/metamask/index.ts +6 -0
- package/src/wallets/phantom-evm/index.ts +4 -0
- package/dist/index-B46sSAxE.js.map +0 -1
- package/dist/telegram/backend.d.ts +0 -30
- package/dist/telegram/provider.d.ts +0 -24
- package/src/telegram/backend.ts +0 -43
- package/src/telegram/provider.ts +0 -148
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { shortString as
|
|
2
|
-
const
|
|
3
|
-
version:
|
|
4
|
-
},
|
|
1
|
+
import { shortString as b, constants as _, CallData as j, addAddressPadding as T, getChecksumAddress as f, hash as y, typedData as I, TypedDataRevision as N } from "starknet";
|
|
2
|
+
const Q = "0.13.10", E = {
|
|
3
|
+
version: Q
|
|
4
|
+
}, h = [
|
|
5
5
|
"metamask",
|
|
6
6
|
"rabby",
|
|
7
7
|
"phantom-evm"
|
|
8
|
-
],
|
|
8
|
+
], C = [
|
|
9
9
|
"argent",
|
|
10
10
|
"braavos",
|
|
11
11
|
"phantom",
|
|
12
12
|
"base"
|
|
13
|
-
],
|
|
14
|
-
...
|
|
15
|
-
...
|
|
13
|
+
], k = [
|
|
14
|
+
...h,
|
|
15
|
+
...C
|
|
16
16
|
], D = [
|
|
17
17
|
"google",
|
|
18
18
|
"webauthn",
|
|
@@ -21,13 +21,13 @@ const E = "0.13.10-alpha.1", Q = {
|
|
|
21
21
|
"password"
|
|
22
22
|
], G = [
|
|
23
23
|
...D,
|
|
24
|
-
...
|
|
24
|
+
...k
|
|
25
25
|
], V = [
|
|
26
26
|
...D,
|
|
27
|
-
...
|
|
27
|
+
...h
|
|
28
28
|
];
|
|
29
|
-
var Y = /* @__PURE__ */ ((
|
|
30
|
-
const
|
|
29
|
+
var Y = /* @__PURE__ */ ((a) => (a.SUCCESS = "SUCCESS", a.NOT_CONNECTED = "NOT_CONNECTED", a.ERROR = "ERROR", a.CANCELED = "CANCELED", a.USER_INTERACTION_REQUIRED = "USER_INTERACTION_REQUIRED", a))(Y || {}), w = /* @__PURE__ */ ((a) => (a.PAYMASTER = "PAYMASTER", a.CREDITS = "CREDITS", a))(w || {});
|
|
30
|
+
const S = /* @__PURE__ */ new Set([
|
|
31
31
|
"contracts",
|
|
32
32
|
"messages",
|
|
33
33
|
"target",
|
|
@@ -38,65 +38,65 @@ const O = /* @__PURE__ */ new Set([
|
|
|
38
38
|
"domain",
|
|
39
39
|
"primaryType"
|
|
40
40
|
]);
|
|
41
|
-
function
|
|
42
|
-
if (!
|
|
43
|
-
throw new Error(`Invalid property name: ${
|
|
41
|
+
function O(a) {
|
|
42
|
+
if (!S.has(a))
|
|
43
|
+
throw new Error(`Invalid property name: ${a}`);
|
|
44
44
|
}
|
|
45
|
-
function c(
|
|
46
|
-
return
|
|
45
|
+
function c(a, e) {
|
|
46
|
+
return O(e), a[e];
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
48
|
+
function F(a) {
|
|
49
|
+
return g(a).map((e) => ({
|
|
50
50
|
entrypoint: e.entrypoint,
|
|
51
51
|
contractAddress: T(e.contractAddress),
|
|
52
|
-
calldata:
|
|
52
|
+
calldata: j.toHex(e.calldata)
|
|
53
53
|
}));
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
const s =
|
|
57
|
-
if (
|
|
58
|
-
return
|
|
55
|
+
function $(a, e) {
|
|
56
|
+
const s = b.decodeShortString(e), d = a.chains?.[s];
|
|
57
|
+
if (d?.policies)
|
|
58
|
+
return R(d.policies);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return Array.isArray(
|
|
60
|
+
function R(a) {
|
|
61
|
+
return Array.isArray(a) ? a.reduce(
|
|
62
62
|
(e, s) => {
|
|
63
63
|
if (c(s, "target")) {
|
|
64
|
-
const
|
|
64
|
+
const t = f(
|
|
65
65
|
c(s, "target")
|
|
66
|
-
),
|
|
66
|
+
), d = c(s, "method"), o = c(
|
|
67
67
|
e,
|
|
68
68
|
"contracts"
|
|
69
|
-
),
|
|
70
|
-
name:
|
|
71
|
-
entrypoint:
|
|
69
|
+
), r = {
|
|
70
|
+
name: L(d),
|
|
71
|
+
entrypoint: d,
|
|
72
72
|
description: c(s, "description")
|
|
73
73
|
};
|
|
74
|
-
if (
|
|
75
|
-
const
|
|
76
|
-
o[
|
|
77
|
-
methods: [...
|
|
74
|
+
if (t in o) {
|
|
75
|
+
const l = g(o[t].methods);
|
|
76
|
+
o[t] = {
|
|
77
|
+
methods: [...l, r]
|
|
78
78
|
};
|
|
79
79
|
} else
|
|
80
|
-
o[
|
|
81
|
-
methods: [
|
|
80
|
+
o[t] = {
|
|
81
|
+
methods: [r]
|
|
82
82
|
};
|
|
83
83
|
} else
|
|
84
84
|
c(e, "messages").push(s);
|
|
85
85
|
return e;
|
|
86
86
|
},
|
|
87
87
|
{ contracts: {}, messages: [] }
|
|
88
|
-
) :
|
|
88
|
+
) : a;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function J(a) {
|
|
91
91
|
return [
|
|
92
|
-
...Object.entries(
|
|
93
|
-
([e, { methods: s }]) =>
|
|
94
|
-
if (
|
|
95
|
-
if ("spender" in
|
|
92
|
+
...Object.entries(a.contracts ?? {}).sort(([e], [s]) => e.toLowerCase().localeCompare(s.toLowerCase())).flatMap(
|
|
93
|
+
([e, { methods: s }]) => g(s).slice().sort((t, d) => t.entrypoint.localeCompare(d.entrypoint)).map((t) => {
|
|
94
|
+
if (t.entrypoint === "approve") {
|
|
95
|
+
if ("spender" in t && "amount" in t && t.spender && t.amount)
|
|
96
96
|
return {
|
|
97
97
|
target: f(e),
|
|
98
|
-
spender:
|
|
99
|
-
amount: String(
|
|
98
|
+
spender: t.spender,
|
|
99
|
+
amount: String(t.amount)
|
|
100
100
|
};
|
|
101
101
|
console.warn(
|
|
102
102
|
`[DEPRECATED] Approve method without spender and amount fields will be rejected in future versions. Please update your preset or policies to include both 'spender' and 'amount' fields for approve calls on contract ${e}. Example: { entrypoint: "approve", spender: "0x...", amount: "0x..." }`
|
|
@@ -104,24 +104,24 @@ function X(t) {
|
|
|
104
104
|
}
|
|
105
105
|
return {
|
|
106
106
|
target: f(e),
|
|
107
|
-
method: y.getSelectorFromName(
|
|
108
|
-
authorized: !!
|
|
107
|
+
method: y.getSelectorFromName(t.entrypoint),
|
|
108
|
+
authorized: !!t.authorized
|
|
109
109
|
};
|
|
110
110
|
})
|
|
111
111
|
),
|
|
112
|
-
...(
|
|
113
|
-
const s =
|
|
112
|
+
...(a.messages ?? []).map((e) => {
|
|
113
|
+
const s = I.getStructHash(
|
|
114
114
|
e.types,
|
|
115
115
|
"StarknetDomain",
|
|
116
116
|
e.domain,
|
|
117
|
-
|
|
118
|
-
),
|
|
117
|
+
N.ACTIVE
|
|
118
|
+
), t = I.getTypeHash(
|
|
119
119
|
e.types,
|
|
120
120
|
e.primaryType,
|
|
121
|
-
|
|
121
|
+
N.ACTIVE
|
|
122
122
|
);
|
|
123
123
|
return {
|
|
124
|
-
scope_hash: y.computePoseidonHash(s,
|
|
124
|
+
scope_hash: y.computePoseidonHash(s, t),
|
|
125
125
|
authorized: !!e.authorized
|
|
126
126
|
};
|
|
127
127
|
}).sort(
|
|
@@ -129,74 +129,71 @@ function X(t) {
|
|
|
129
129
|
)
|
|
130
130
|
];
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
return Array.isArray(
|
|
132
|
+
function g(a) {
|
|
133
|
+
return Array.isArray(a) ? a : [a];
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
return
|
|
135
|
+
function L(a) {
|
|
136
|
+
return a.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/_/g, " ").toLowerCase().replace(/^\w/, (e) => e.toUpperCase());
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
const e =
|
|
140
|
-
if (!(
|
|
138
|
+
function X(a) {
|
|
139
|
+
const e = a.pathname.split("/");
|
|
140
|
+
if (!(a.hostname === "api.cartridge.gg")) {
|
|
141
141
|
if (typeof XMLHttpRequest > "u")
|
|
142
142
|
return console.warn(
|
|
143
|
-
`Cannot make synchronous HTTP call in Node.js environment for ${
|
|
144
|
-
),
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
const
|
|
143
|
+
`Cannot make synchronous HTTP call in Node.js environment for ${a.toString()}`
|
|
144
|
+
), b.encodeShortString("LOCALHOST");
|
|
145
|
+
const t = new XMLHttpRequest();
|
|
146
|
+
t.open("POST", a.toString(), !1), t.setRequestHeader("Content-Type", "application/json");
|
|
147
|
+
const d = JSON.stringify({
|
|
148
148
|
jsonrpc: "2.0",
|
|
149
149
|
method: "starknet_chainId",
|
|
150
150
|
params: [],
|
|
151
151
|
id: 1
|
|
152
152
|
});
|
|
153
153
|
try {
|
|
154
|
-
if (
|
|
155
|
-
const o = JSON.parse(
|
|
154
|
+
if (t.send(d), t.status === 200) {
|
|
155
|
+
const o = JSON.parse(t.responseText);
|
|
156
156
|
if (o.result)
|
|
157
157
|
return o.result;
|
|
158
158
|
}
|
|
159
159
|
throw new Error(
|
|
160
|
-
`Failed to get chain ID from ${
|
|
160
|
+
`Failed to get chain ID from ${a.toString()}: ${t.status} ${t.statusText}`
|
|
161
161
|
);
|
|
162
162
|
} catch (o) {
|
|
163
|
-
throw new Error(`Failed to connect to ${
|
|
163
|
+
throw new Error(`Failed to connect to ${a.toString()}: ${o}`);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
if (e.includes("starknet")) {
|
|
167
167
|
if (e.includes("mainnet"))
|
|
168
|
-
return
|
|
168
|
+
return _.StarknetChainId.SN_MAIN;
|
|
169
169
|
if (e.includes("sepolia"))
|
|
170
|
-
return
|
|
170
|
+
return _.StarknetChainId.SN_SEPOLIA;
|
|
171
171
|
} else if (e.length >= 3) {
|
|
172
|
-
const
|
|
172
|
+
const t = e[2];
|
|
173
173
|
if (e.includes("katana"))
|
|
174
|
-
return
|
|
175
|
-
`WP_${
|
|
174
|
+
return b.encodeShortString(
|
|
175
|
+
`WP_${t.toUpperCase().replace(/-/g, "_")}`
|
|
176
176
|
);
|
|
177
177
|
if (e.includes("mainnet"))
|
|
178
|
-
return
|
|
179
|
-
`GG_${
|
|
178
|
+
return b.encodeShortString(
|
|
179
|
+
`GG_${t.toUpperCase().replace(/-/g, "_")}`
|
|
180
180
|
);
|
|
181
181
|
}
|
|
182
|
-
throw new Error(`Chain ${
|
|
183
|
-
}
|
|
184
|
-
function K() {
|
|
185
|
-
return window.matchMedia("(max-width: 768px)").matches || "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
182
|
+
throw new Error(`Chain ${a.toString()} not supported`);
|
|
186
183
|
}
|
|
187
|
-
function
|
|
184
|
+
function K(a) {
|
|
188
185
|
try {
|
|
189
|
-
const e = new URL(
|
|
186
|
+
const e = new URL(a, window.location.origin);
|
|
190
187
|
if (e.protocol === "http:" || e.protocol === "https:")
|
|
191
188
|
return e.href;
|
|
192
189
|
} catch {
|
|
193
190
|
}
|
|
194
191
|
return "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
|
195
192
|
}
|
|
196
|
-
const
|
|
197
|
-
class
|
|
193
|
+
const q = "https://x.cartridge.gg", ee = "https://api.cartridge.gg", ae = "startapp";
|
|
194
|
+
class M extends Error {
|
|
198
195
|
constructor() {
|
|
199
|
-
super("Not ready to connect"), Object.setPrototypeOf(this,
|
|
196
|
+
super("Not ready to connect"), Object.setPrototypeOf(this, M.prototype);
|
|
200
197
|
}
|
|
201
198
|
}
|
|
202
199
|
class m extends Error {
|
|
@@ -209,35 +206,35 @@ class A extends m {
|
|
|
209
206
|
super(`Invalid credentials provided for type: ${e}`), this.name = "InvalidCredentialsError", Object.setPrototypeOf(this, A.prototype);
|
|
210
207
|
}
|
|
211
208
|
}
|
|
212
|
-
class
|
|
209
|
+
class x extends Error {
|
|
213
210
|
constructor(e) {
|
|
214
|
-
super(`Operation "${e}" is not supported in headless mode`), this.name = "HeadlessModeNotSupportedError", Object.setPrototypeOf(this,
|
|
211
|
+
super(`Operation "${e}" is not supported in headless mode`), this.name = "HeadlessModeNotSupportedError", Object.setPrototypeOf(this, x.prototype);
|
|
215
212
|
}
|
|
216
213
|
}
|
|
217
|
-
const
|
|
214
|
+
const v = {
|
|
218
215
|
ACCOUNTS: "accounts"
|
|
219
|
-
},
|
|
220
|
-
function
|
|
216
|
+
}, P = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwIiBoZWlnaHQ9IjgwMCIgdmlld0JveD0iMCAwIDgwMCA4MDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfNTExMl83ODIpIj4KPHBhdGggZD0iTTQ2OS4yMzYgNzBDNDgyLjM5IDcwIDQ5My4wNTMgODAuNjYzIDQ5My4wNTMgOTMuODE2NFYxNDcuMTQ3TDUxNS4zMzggMTQ3LjE0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kQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMjUgMCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd181MTEyXzc4MiIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd181MTEyXzc4MiIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K";
|
|
217
|
+
function B() {
|
|
221
218
|
}
|
|
222
|
-
class
|
|
219
|
+
class U {
|
|
223
220
|
m_lastPromise = Promise.resolve();
|
|
224
221
|
/**
|
|
225
222
|
* Acquire lock
|
|
226
223
|
* @param [bypass=false] option to skip lock acquisition
|
|
227
224
|
*/
|
|
228
225
|
async obtain(e = !1) {
|
|
229
|
-
let s =
|
|
226
|
+
let s = B;
|
|
230
227
|
if (e) return s;
|
|
231
|
-
const
|
|
232
|
-
return this.m_lastPromise = new Promise((
|
|
228
|
+
const t = this.m_lastPromise;
|
|
229
|
+
return this.m_lastPromise = new Promise((d) => s = d), await t, s;
|
|
233
230
|
}
|
|
234
231
|
}
|
|
235
|
-
const H = new
|
|
236
|
-
class
|
|
232
|
+
const H = new U();
|
|
233
|
+
class te {
|
|
237
234
|
id = "controller";
|
|
238
235
|
name = "Controller";
|
|
239
|
-
version =
|
|
240
|
-
icon =
|
|
236
|
+
version = E.version;
|
|
237
|
+
icon = P;
|
|
241
238
|
account;
|
|
242
239
|
subscriptions = [];
|
|
243
240
|
_probePromise = null;
|
|
@@ -250,8 +247,8 @@ class oe {
|
|
|
250
247
|
return await new Promise(async (s) => {
|
|
251
248
|
try {
|
|
252
249
|
this._probePromise = this.probe();
|
|
253
|
-
const
|
|
254
|
-
s(
|
|
250
|
+
const t = await this._probePromise;
|
|
251
|
+
s(t);
|
|
255
252
|
} finally {
|
|
256
253
|
this._probePromise = null;
|
|
257
254
|
}
|
|
@@ -262,12 +259,12 @@ class oe {
|
|
|
262
259
|
request = async (e) => {
|
|
263
260
|
switch (e.type) {
|
|
264
261
|
case "wallet_getPermissions":
|
|
265
|
-
return await this.safeProbe(), this.account ? [
|
|
262
|
+
return await this.safeProbe(), this.account ? [v.ACCOUNTS] : [];
|
|
266
263
|
case "wallet_requestAccounts": {
|
|
267
264
|
if (this.account)
|
|
268
265
|
return [this.account.address];
|
|
269
|
-
const
|
|
270
|
-
return this.account = await this.safeProbe(), !this.account && !
|
|
266
|
+
const t = e.params && e.params.silent_mode;
|
|
267
|
+
return this.account = await this.safeProbe(), !this.account && !t && (this.account = await this.connect()), this.account ? [this.account.address] : [];
|
|
271
268
|
}
|
|
272
269
|
case "wallet_watchAsset":
|
|
273
270
|
throw {
|
|
@@ -276,12 +273,12 @@ class oe {
|
|
|
276
273
|
data: "wallet_watchAsset not implemented"
|
|
277
274
|
};
|
|
278
275
|
case "wallet_addStarknetChain": {
|
|
279
|
-
let
|
|
280
|
-
return this.addStarknetChain(
|
|
276
|
+
let t = e.params;
|
|
277
|
+
return this.addStarknetChain(t);
|
|
281
278
|
}
|
|
282
279
|
case "wallet_switchStarknetChain": {
|
|
283
|
-
let
|
|
284
|
-
return this.switchStarknetChain(
|
|
280
|
+
let t = e.params;
|
|
281
|
+
return this.switchStarknetChain(t.chainId);
|
|
285
282
|
}
|
|
286
283
|
case "wallet_requestChainId":
|
|
287
284
|
if (!this.account)
|
|
@@ -306,10 +303,10 @@ class oe {
|
|
|
306
303
|
};
|
|
307
304
|
let s = e.params;
|
|
308
305
|
return await this.account.execute(
|
|
309
|
-
s.calls.map((
|
|
310
|
-
contractAddress:
|
|
311
|
-
entrypoint:
|
|
312
|
-
calldata:
|
|
306
|
+
s.calls.map((t) => ({
|
|
307
|
+
contractAddress: t.contract_address,
|
|
308
|
+
entrypoint: t.entry_point,
|
|
309
|
+
calldata: t.calldata
|
|
313
310
|
}))
|
|
314
311
|
);
|
|
315
312
|
case "wallet_addDeclareTransaction":
|
|
@@ -347,10 +344,10 @@ class oe {
|
|
|
347
344
|
off = (e, s) => {
|
|
348
345
|
if (e !== "accountsChanged" && e !== "networkChanged")
|
|
349
346
|
throw new Error(`Unknown event: ${e}`);
|
|
350
|
-
const
|
|
351
|
-
(
|
|
347
|
+
const t = this.subscriptions.findIndex(
|
|
348
|
+
(d) => d.type === e && d.handler === s
|
|
352
349
|
);
|
|
353
|
-
|
|
350
|
+
t >= 0 && this.subscriptions.splice(t, 1);
|
|
354
351
|
};
|
|
355
352
|
emitNetworkChanged(e) {
|
|
356
353
|
this.subscriptions.filter((s) => s.type === "networkChanged").forEach((s) => {
|
|
@@ -363,22 +360,22 @@ class oe {
|
|
|
363
360
|
});
|
|
364
361
|
}
|
|
365
362
|
}
|
|
366
|
-
function
|
|
363
|
+
function oe(a) {
|
|
367
364
|
return {
|
|
368
365
|
verified: !1,
|
|
369
|
-
contracts:
|
|
370
|
-
Object.entries(
|
|
366
|
+
contracts: a.contracts ? Object.fromEntries(
|
|
367
|
+
Object.entries(a.contracts).map(([e, s]) => [
|
|
371
368
|
e,
|
|
372
369
|
{
|
|
373
370
|
...s,
|
|
374
|
-
methods: s.methods.map((
|
|
375
|
-
...
|
|
371
|
+
methods: s.methods.map((t) => ({
|
|
372
|
+
...t,
|
|
376
373
|
authorized: !0
|
|
377
374
|
}))
|
|
378
375
|
}
|
|
379
376
|
])
|
|
380
377
|
) : void 0,
|
|
381
|
-
messages:
|
|
378
|
+
messages: a.messages?.map((e) => ({
|
|
382
379
|
...e,
|
|
383
380
|
authorized: !0
|
|
384
381
|
}))
|
|
@@ -408,7 +405,7 @@ var W = [
|
|
|
408
405
|
symbol: "USDC",
|
|
409
406
|
decimals: 6,
|
|
410
407
|
l2_token_address: "0x033068f6539f8e6e6b131e6b2b814e6c34a5224bc66947c47dab9dfee93b35fb",
|
|
411
|
-
sort_order:
|
|
408
|
+
sort_order: 8,
|
|
412
409
|
total_supply: null,
|
|
413
410
|
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/e5aaa970-a998-47e8-bd43-4a3b56b87200/logo"
|
|
414
411
|
},
|
|
@@ -427,7 +424,7 @@ var W = [
|
|
|
427
424
|
symbol: "USDT",
|
|
428
425
|
decimals: 6,
|
|
429
426
|
l2_token_address: "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",
|
|
430
|
-
sort_order:
|
|
427
|
+
sort_order: 6,
|
|
431
428
|
total_supply: null,
|
|
432
429
|
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/c8a721d1-07c3-46e4-ab4e-523977c30b00/logo"
|
|
433
430
|
},
|
|
@@ -455,7 +452,7 @@ var W = [
|
|
|
455
452
|
symbol: "DAI",
|
|
456
453
|
decimals: 18,
|
|
457
454
|
l2_token_address: "0x05574eb6b8789a91466f902c380d978e472db68170ff82a5b650b95a58ddf4ad",
|
|
458
|
-
sort_order:
|
|
455
|
+
sort_order: 5,
|
|
459
456
|
total_supply: null,
|
|
460
457
|
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/919e761b-56f7-4f53-32aa-5e066f7f6200/logo"
|
|
461
458
|
},
|
|
@@ -492,7 +489,7 @@ var W = [
|
|
|
492
489
|
decimals: 18,
|
|
493
490
|
l2_token_address: "0x0124aeb495b947201f5fac96fd1138e326ad86195b98df6dec9009158a533b49",
|
|
494
491
|
sort_order: 1,
|
|
495
|
-
total_supply:
|
|
492
|
+
total_supply: null,
|
|
496
493
|
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/a3bfe959-50c4-4f89-0aef-b19207d82a00/logo"
|
|
497
494
|
},
|
|
498
495
|
{
|
|
@@ -565,12 +562,12 @@ var W = [
|
|
|
565
562
|
disabled: !0
|
|
566
563
|
},
|
|
567
564
|
{
|
|
568
|
-
name: "
|
|
565
|
+
name: "Starknet Token",
|
|
569
566
|
symbol: "STRK",
|
|
570
567
|
decimals: 18,
|
|
571
568
|
l2_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
|
|
572
569
|
sort_order: 2,
|
|
573
|
-
total_supply:
|
|
570
|
+
total_supply: null,
|
|
574
571
|
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/1b126320-367c-48ed-cf5a-ba7580e49600/logo"
|
|
575
572
|
},
|
|
576
573
|
{
|
|
@@ -587,8 +584,8 @@ var W = [
|
|
|
587
584
|
symbol: "EKUBO",
|
|
588
585
|
decimals: 18,
|
|
589
586
|
l2_token_address: "0x075afe6402ad5a5c20dd25e10ec3b3986acaa647b77e4ae24b0cbc9a54a27a87",
|
|
590
|
-
sort_order:
|
|
591
|
-
total_supply:
|
|
587
|
+
sort_order: 2,
|
|
588
|
+
total_supply: null,
|
|
592
589
|
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/634d9c36-2f0b-4781-93e6-72d701b5af00/logo"
|
|
593
590
|
},
|
|
594
591
|
{
|
|
@@ -623,11 +620,11 @@ var W = [
|
|
|
623
620
|
name: "Cash",
|
|
624
621
|
symbol: "CASH",
|
|
625
622
|
decimals: 18,
|
|
626
|
-
l2_token_address: "
|
|
627
|
-
sort_order:
|
|
623
|
+
l2_token_address: "0x0498edfaf50ca5855666a700c25dd629d577eb9afccdf3b5977aec79aee55ada",
|
|
624
|
+
sort_order: 4,
|
|
628
625
|
total_supply: null,
|
|
629
|
-
|
|
630
|
-
|
|
626
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/6bd6d156-f509-4b51-5dfc-3ee566143600/logo",
|
|
627
|
+
hidden: !1
|
|
631
628
|
},
|
|
632
629
|
{
|
|
633
630
|
name: "Nums",
|
|
@@ -961,8 +958,8 @@ var W = [
|
|
|
961
958
|
name: "Survivor",
|
|
962
959
|
symbol: "SURVIVOR",
|
|
963
960
|
decimals: 18,
|
|
964
|
-
l2_token_address: "
|
|
965
|
-
sort_order:
|
|
961
|
+
l2_token_address: "0x042dd777885ad2c116be96d4d634abc90a26a790ffb5871e037dd5ae7d2ec86b",
|
|
962
|
+
sort_order: 2,
|
|
966
963
|
total_supply: null,
|
|
967
964
|
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/399cb277-f675-4efe-97fb-fac94a236a00/logo"
|
|
968
965
|
},
|
|
@@ -974,109 +971,387 @@ var W = [
|
|
|
974
971
|
sort_order: 1,
|
|
975
972
|
total_supply: null,
|
|
976
973
|
logo_url: " https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/f96b51e2-e978-42e2-c67a-e84159015000/logo"
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
name: "Standard Weighted Adalian Yield",
|
|
977
|
+
symbol: "SWAY",
|
|
978
|
+
decimals: 6,
|
|
979
|
+
l2_token_address: "0x004878d1148318a31829523ee9c6a5ee563af6cd87f90a30809e5b0d27db8a9b",
|
|
980
|
+
sort_order: 1,
|
|
981
|
+
total_supply: null,
|
|
982
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/dd43c15d-80bf-4298-7620-abc12d474f00/logo"
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
name: "Corpse",
|
|
986
|
+
symbol: "CORPSE",
|
|
987
|
+
decimals: 18,
|
|
988
|
+
l2_token_address: "0x0103eafe79f8631932530cc687dfcdeb013c883a82619ebf81be393e2953a87a",
|
|
989
|
+
sort_order: 2,
|
|
990
|
+
total_supply: null,
|
|
991
|
+
logo_url: "https://lootsurvivor.io/images/corpse-token.png"
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
name: "Extra Life",
|
|
995
|
+
symbol: "XLIFE",
|
|
996
|
+
decimals: 18,
|
|
997
|
+
l2_token_address: "0x016dea82a6588ca9fb7200125fa05631b1c1735a313e24afe9c90301e441a796",
|
|
998
|
+
sort_order: 2,
|
|
999
|
+
total_supply: null,
|
|
1000
|
+
logo_url: "https://lootsurvivor.io/images/life-potion.png"
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
name: "Attack",
|
|
1004
|
+
symbol: "ATTACK",
|
|
1005
|
+
decimals: 18,
|
|
1006
|
+
l2_token_address: "0x016f9def00daef9f1874dd932b081096f50aec2fe61df31a81bc5707a7522443",
|
|
1007
|
+
sort_order: 2,
|
|
1008
|
+
total_supply: null,
|
|
1009
|
+
logo_url: "https://lootsurvivor.io/images/attack-potion.png"
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
name: "Skull",
|
|
1013
|
+
symbol: "SKULL",
|
|
1014
|
+
decimals: 18,
|
|
1015
|
+
l2_token_address: "0x01c3c8284d7eed443b42f47e764032a56eaf50a9079d67993b633930e3689814",
|
|
1016
|
+
sort_order: 2,
|
|
1017
|
+
total_supply: null,
|
|
1018
|
+
logo_url: "https://lootsurvivor.io/images/skull-token.png"
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
name: "LayerZero",
|
|
1022
|
+
symbol: "ZRO",
|
|
1023
|
+
decimals: 18,
|
|
1024
|
+
l2_token_address: "0x01e77aec81ef65db5fb788a5a04fd9d23f6f4c860eb2fb0e99ace5c45b021071",
|
|
1025
|
+
sort_order: 0,
|
|
1026
|
+
total_supply: null,
|
|
1027
|
+
logo_url: "https://assets.coingecko.com/coins/images/28206/standard/ftxG9_TJ_400x400.jpeg"
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
name: "Shiba Inu",
|
|
1031
|
+
symbol: "SHIB",
|
|
1032
|
+
decimals: 18,
|
|
1033
|
+
l2_token_address: "0x02119755fad7cbf637d80cae5d3e8e12487befe6653ddd04432a73f6f569f46b",
|
|
1034
|
+
sort_order: 0,
|
|
1035
|
+
total_supply: null,
|
|
1036
|
+
logo_url: "https://assets.coingecko.com/coins/images/11939/standard/shiba.png"
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
name: "Endur xSTRK",
|
|
1040
|
+
symbol: "xSTRK",
|
|
1041
|
+
decimals: 18,
|
|
1042
|
+
l2_token_address: "0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a",
|
|
1043
|
+
sort_order: 1,
|
|
1044
|
+
total_supply: null,
|
|
1045
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/c1f44170-c1b0-4531-3d3b-5f0bacfe1300/logo"
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
name: "Revive",
|
|
1049
|
+
symbol: "REVIVE",
|
|
1050
|
+
decimals: 18,
|
|
1051
|
+
l2_token_address: "0x029023e0a455d19d6887bc13727356070089527b79e6feb562ffe1afd6711dbe",
|
|
1052
|
+
sort_order: 2,
|
|
1053
|
+
total_supply: null,
|
|
1054
|
+
logo_url: "https://lootsurvivor.io/images/revive-potion.png"
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
name: "Yield BTC.B",
|
|
1058
|
+
symbol: "YBTC.B",
|
|
1059
|
+
decimals: 8,
|
|
1060
|
+
l2_token_address: "0x02cab84694e1be6af2ce65b1ae28a76009e8ec99ec4bc17047386abf20cbb688",
|
|
1061
|
+
sort_order: 0,
|
|
1062
|
+
total_supply: null,
|
|
1063
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/21264f6b-bd3e-4bef-b54d-78d268dcce00/logo"
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
name: "Aave Token",
|
|
1067
|
+
symbol: "AAVE",
|
|
1068
|
+
decimals: 18,
|
|
1069
|
+
l2_token_address: "0x02f5eb9a4f77b6c7c83488418e77329d31eb43219745959948a0fce9580905d9",
|
|
1070
|
+
sort_order: 0,
|
|
1071
|
+
total_supply: null,
|
|
1072
|
+
logo_url: "https://assets.coingecko.com/coins/images/12645/standard/aave-token-round.png?1720472354"
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
name: "Uncap USD",
|
|
1076
|
+
symbol: "USDU",
|
|
1077
|
+
decimals: 18,
|
|
1078
|
+
l2_token_address: "0x02f94539f80158f9a48a7acf3747718dfbec9b6f639e2742c1fb44ae7ab5aa04",
|
|
1079
|
+
sort_order: 4,
|
|
1080
|
+
total_supply: null,
|
|
1081
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/1cf94983-68e7-42e3-61c4-081d61d57700/logo"
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
name: "Arbitrum",
|
|
1085
|
+
symbol: "ARB",
|
|
1086
|
+
decimals: 18,
|
|
1087
|
+
l2_token_address: "0x03070d5cbd310edc0b2cfe8b11d132e67718b16c7fbfd536ee74ec54a4307ba2",
|
|
1088
|
+
sort_order: 0,
|
|
1089
|
+
total_supply: null,
|
|
1090
|
+
logo_url: "https://assets.coingecko.com/coins/images/16547/standard/arb.jpg"
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
name: "Lombard Staked Bitcoin",
|
|
1094
|
+
symbol: "LBTC",
|
|
1095
|
+
decimals: 8,
|
|
1096
|
+
l2_token_address: "0x036834a40984312f7f7de8d31e3f6305b325389eaeea5b1c0664b2fb936461a4",
|
|
1097
|
+
sort_order: 0,
|
|
1098
|
+
total_supply: null,
|
|
1099
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/d57a3c6e-83fc-47c6-2a2b-df3a9c216100/logo"
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
name: "Jupiter",
|
|
1103
|
+
symbol: "JUP",
|
|
1104
|
+
decimals: 6,
|
|
1105
|
+
l2_token_address: "0x03a292bd498266ac4b05d93cc2df5cd7883c0684faabff182ab568d566a3c151",
|
|
1106
|
+
sort_order: 0,
|
|
1107
|
+
total_supply: null,
|
|
1108
|
+
logo_url: "https://assets.coingecko.com/coins/images/34188/standard/jup.png"
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
name: "DOG GO TO THE MOON",
|
|
1112
|
+
symbol: "DOG",
|
|
1113
|
+
decimals: 5,
|
|
1114
|
+
l2_token_address: "0x040e81cfeb176bfdbc5047bbc55eb471cfab20a6b221f38d8fda134e1bfffca4",
|
|
1115
|
+
sort_order: 2,
|
|
1116
|
+
total_supply: null,
|
|
1117
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/43bf2a37-d5a4-40e3-45a6-2488108b0c00/logo"
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
name: "Endur xtBTC",
|
|
1121
|
+
symbol: "xtBTC",
|
|
1122
|
+
decimals: 18,
|
|
1123
|
+
l2_token_address: "0x043a35c1425a0125ef8c171f1a75c6f31ef8648edcc8324b55ce1917db3f9b91",
|
|
1124
|
+
sort_order: 0,
|
|
1125
|
+
total_supply: null,
|
|
1126
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/b9ad718c-d6bb-45d5-d1f9-a8ae911efb00/logo"
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
name: "Dungeon Ticket",
|
|
1130
|
+
symbol: "DTICKET",
|
|
1131
|
+
decimals: 18,
|
|
1132
|
+
l2_token_address: "0x0452810188c4cb3aebd63711a3b445755bc0d6c4f27b923fdd99b1a118858136",
|
|
1133
|
+
sort_order: 1,
|
|
1134
|
+
total_supply: null,
|
|
1135
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/f96b51e2-e978-42e2-c67a-e84159015000/logo"
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
name: "FBTC",
|
|
1139
|
+
symbol: "FBTC",
|
|
1140
|
+
decimals: 8,
|
|
1141
|
+
l2_token_address: "0x046e4e83fe6a22f243f73d0f2e4cdbc4e9ebd868050e9f7e9cbd90f1436d8b44",
|
|
1142
|
+
sort_order: 0,
|
|
1143
|
+
total_supply: null,
|
|
1144
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/3b069b84-9881-47c9-d51b-d43259f80200/logo"
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
name: "AUSD0",
|
|
1148
|
+
symbol: "AUSD0",
|
|
1149
|
+
decimals: 6,
|
|
1150
|
+
l2_token_address: "0x04887629c229b4ee8e82f3db4cddeb1b2c0f084d46f229672623bd1282df5931",
|
|
1151
|
+
sort_order: 4,
|
|
1152
|
+
total_supply: null,
|
|
1153
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/88b2405d-cff2-4cae-db42-2965fc3f9400/logo"
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
name: "Poison",
|
|
1157
|
+
symbol: "POISON",
|
|
1158
|
+
decimals: 18,
|
|
1159
|
+
l2_token_address: "0x049eaed2a1ba2f2eb6ac2661ffd2d79231cdd7d5293d9448df49c5986c9897ae",
|
|
1160
|
+
sort_order: 2,
|
|
1161
|
+
total_supply: null,
|
|
1162
|
+
logo_url: "https://lootsurvivor.io/images/poison-potion.png"
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
name: "Midas Re7 Yield",
|
|
1166
|
+
symbol: "mRe7YIELD",
|
|
1167
|
+
decimals: 18,
|
|
1168
|
+
l2_token_address: "0x04be8945e61dc3e19ebadd1579a6bd53b262f51ba89e6f8b0c4bc9a7e3c633fc",
|
|
1169
|
+
sort_order: 3,
|
|
1170
|
+
total_supply: null,
|
|
1171
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/f11b3823-25da-4e95-811f-c0bc8fd4db00/logo"
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
name: "Threshold tBTC",
|
|
1175
|
+
symbol: "tBTC",
|
|
1176
|
+
decimals: 18,
|
|
1177
|
+
l2_token_address: "0x04daa17763b286d1e59b97c283c0b8c949994c361e426a28f743c67bdfe9a32f",
|
|
1178
|
+
sort_order: 0,
|
|
1179
|
+
total_supply: null,
|
|
1180
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/9e04d713-fc0e-4e96-342b-0334f5133b00/logo"
|
|
1181
|
+
},
|
|
1182
|
+
{
|
|
1183
|
+
name: "Midas Re7 BTC",
|
|
1184
|
+
symbol: "mRe7BTC",
|
|
1185
|
+
decimals: 18,
|
|
1186
|
+
l2_token_address: "0x04e4fb1a9ca7e84bae609b9dc0078ad7719e49187ae7e425bb47d131710eddac",
|
|
1187
|
+
sort_order: 0,
|
|
1188
|
+
total_supply: null,
|
|
1189
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/3a62ecee-1e58-45d3-9862-3ce90dff1900/logo"
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
name: "Endur xsBTC",
|
|
1193
|
+
symbol: "xsBTC",
|
|
1194
|
+
decimals: 18,
|
|
1195
|
+
l2_token_address: "0x0580f3dc564a7b82f21d40d404b3842d490ae7205e6ac07b1b7af2b4a5183dc9",
|
|
1196
|
+
sort_order: 0,
|
|
1197
|
+
total_supply: null,
|
|
1198
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/b978fbfd-4aa0-4a56-5402-47857c921e00/logo"
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
name: "Solv BTC",
|
|
1202
|
+
symbol: "SolvBTC",
|
|
1203
|
+
decimals: 18,
|
|
1204
|
+
l2_token_address: "0x0593e034dda23eea82d2ba9a30960ed42cf4a01502cc2351dc9b9881f9931a68",
|
|
1205
|
+
sort_order: 0,
|
|
1206
|
+
total_supply: null,
|
|
1207
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/b510231d-c479-4f22-eda5-0457222e7e00/logo"
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
name: "Endur xWBTC",
|
|
1211
|
+
symbol: "xWBTC",
|
|
1212
|
+
decimals: 8,
|
|
1213
|
+
l2_token_address: "0x06a567e68c805323525fe1649adb80b03cddf92c23d2629a6779f54192dffc13",
|
|
1214
|
+
sort_order: 0,
|
|
1215
|
+
total_supply: null,
|
|
1216
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/6d2f83ef-6bd6-44af-dd34-9076eeae5e00/logo"
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
name: "Fartcoin",
|
|
1220
|
+
symbol: "Fartcoin",
|
|
1221
|
+
decimals: 6,
|
|
1222
|
+
l2_token_address: "0x06e0e0117b742747452601f9f14576eb9d71b326379a1794bb51d9adbce3dbd3",
|
|
1223
|
+
sort_order: 0,
|
|
1224
|
+
total_supply: null,
|
|
1225
|
+
logo_url: "https://assets.coingecko.com/coins/images/50891/standard/fart.jpg"
|
|
1226
|
+
},
|
|
1227
|
+
{
|
|
1228
|
+
name: "Official Trump",
|
|
1229
|
+
symbol: "TRUMP",
|
|
1230
|
+
decimals: 6,
|
|
1231
|
+
l2_token_address: "0x07380caa64fdf27501afad0bd93c89d1e83a081a553af89bbeffb28dae8d8916",
|
|
1232
|
+
sort_order: 0,
|
|
1233
|
+
total_supply: null,
|
|
1234
|
+
logo_url: "https://assets.coingecko.com/coins/images/53746/standard/trump.png"
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
name: "Bonk",
|
|
1238
|
+
symbol: "BONK",
|
|
1239
|
+
decimals: 5,
|
|
1240
|
+
l2_token_address: "0x074238dfa02063792077820584c925b679a013cbab38e5ca61af5627d1eda736",
|
|
1241
|
+
sort_order: 1,
|
|
1242
|
+
total_supply: null,
|
|
1243
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/05c7a597-ea71-4129-6bf0-ad2d18cb1200/logo"
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
name: "Endur xLBTC",
|
|
1247
|
+
symbol: "xLBTC",
|
|
1248
|
+
decimals: 8,
|
|
1249
|
+
l2_token_address: "0x07dd3c80de9fcc5545f0cb83678826819c79619ed7992cc06ff81fc67cd2efe0",
|
|
1250
|
+
sort_order: 0,
|
|
1251
|
+
total_supply: null,
|
|
1252
|
+
logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/1d016787-181b-4373-4aa5-962adddc6c00/logo"
|
|
977
1253
|
}
|
|
978
1254
|
], z = {
|
|
979
1255
|
theme: {
|
|
980
1256
|
name: "Cartridge",
|
|
981
1257
|
icon: "icon.svg"
|
|
982
1258
|
}
|
|
983
|
-
},
|
|
984
|
-
async function
|
|
1259
|
+
}, u = "https://static.cartridge.gg/presets";
|
|
1260
|
+
async function p() {
|
|
985
1261
|
try {
|
|
986
|
-
const
|
|
987
|
-
if (!
|
|
988
|
-
throw new Error(`Failed to load configs index: ${
|
|
989
|
-
return await
|
|
990
|
-
} catch (
|
|
991
|
-
return console.error("Error loading configs index:",
|
|
1262
|
+
const a = await fetch(`${u}/index.json`);
|
|
1263
|
+
if (!a.ok)
|
|
1264
|
+
throw new Error(`Failed to load configs index: ${a.statusText}`);
|
|
1265
|
+
return await a.json();
|
|
1266
|
+
} catch (a) {
|
|
1267
|
+
return console.error("Error loading configs index:", a), { configs: [], baseUrl: u };
|
|
992
1268
|
}
|
|
993
1269
|
}
|
|
994
|
-
async function
|
|
995
|
-
return (await
|
|
1270
|
+
async function se() {
|
|
1271
|
+
return (await p()).configs;
|
|
996
1272
|
}
|
|
997
|
-
async function de(
|
|
1273
|
+
async function de(a) {
|
|
998
1274
|
try {
|
|
999
|
-
const
|
|
1000
|
-
if (!
|
|
1275
|
+
const t = `${(await p()).baseUrl || u}/${a}`, d = await fetch(`${t}/config.json`);
|
|
1276
|
+
if (!d.ok)
|
|
1001
1277
|
throw new Error(
|
|
1002
|
-
`Failed to load config ${
|
|
1278
|
+
`Failed to load config ${a}: ${d.statusText}`
|
|
1003
1279
|
);
|
|
1004
|
-
const o = await
|
|
1280
|
+
const o = await d.json();
|
|
1005
1281
|
if (o && o.theme) {
|
|
1006
|
-
o.theme.icon && !o.theme.icon.startsWith("http") && (o.theme.icon = `${
|
|
1007
|
-
const
|
|
1008
|
-
if (
|
|
1009
|
-
for (const n in
|
|
1010
|
-
if (
|
|
1011
|
-
for (const i in
|
|
1012
|
-
|
|
1282
|
+
o.theme.icon && !o.theme.icon.startsWith("http") && (o.theme.icon = `${t}/${o.theme.icon}`), o.theme.cover && (typeof o.theme.cover == "string" ? o.theme.cover.startsWith("http") || (o.theme.cover = `${t}/${o.theme.cover}`) : (o.theme.cover.light && !o.theme.cover.light.startsWith("http") && (o.theme.cover.light = `${t}/${o.theme.cover.light}`), o.theme.cover.dark && !o.theme.cover.dark.startsWith("http") && (o.theme.cover.dark = `${t}/${o.theme.cover.dark}`)));
|
|
1283
|
+
const r = (l) => {
|
|
1284
|
+
if (l) {
|
|
1285
|
+
for (const n in l)
|
|
1286
|
+
if (l[n])
|
|
1287
|
+
for (const i in l[n])
|
|
1288
|
+
l[n][i] && !l[n][i].startsWith("http") && (l[n][i] = `${t}/${l[n][i]}`);
|
|
1013
1289
|
}
|
|
1014
1290
|
};
|
|
1015
|
-
if (o.theme.optimizedIcon &&
|
|
1291
|
+
if (o.theme.optimizedIcon && r(o.theme.optimizedIcon), o.theme.optimizedCover)
|
|
1016
1292
|
if (typeof o.theme.optimizedCover == "string")
|
|
1017
|
-
o.theme.optimizedCover.startsWith("http") || (o.theme.optimizedCover = `${
|
|
1293
|
+
o.theme.optimizedCover.startsWith("http") || (o.theme.optimizedCover = `${t}/${o.theme.optimizedCover}`);
|
|
1018
1294
|
else if (o.theme.optimizedCover.light || o.theme.optimizedCover.dark) {
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1295
|
+
const l = o.theme.optimizedCover;
|
|
1296
|
+
l.light && r(l.light), l.dark && r(l.dark);
|
|
1021
1297
|
} else
|
|
1022
|
-
|
|
1298
|
+
r(o.theme.optimizedCover);
|
|
1023
1299
|
}
|
|
1024
1300
|
return o;
|
|
1025
1301
|
} catch (e) {
|
|
1026
|
-
return console.error(`Error loading config ${
|
|
1302
|
+
return console.error(`Error loading config ${a}:`, e), null;
|
|
1027
1303
|
}
|
|
1028
1304
|
}
|
|
1029
1305
|
async function le() {
|
|
1030
|
-
const
|
|
1306
|
+
const a = await p(), e = a.configs, s = a.baseUrl || u, t = {};
|
|
1031
1307
|
return await Promise.all(
|
|
1032
|
-
e.map(async (
|
|
1308
|
+
e.map(async (d) => {
|
|
1033
1309
|
try {
|
|
1034
|
-
const o = await fetch(`${s}/${
|
|
1310
|
+
const o = await fetch(`${s}/${d}/config.json`);
|
|
1035
1311
|
if (o.ok) {
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1312
|
+
const r = await o.json();
|
|
1313
|
+
t[d] = r;
|
|
1038
1314
|
}
|
|
1039
1315
|
} catch (o) {
|
|
1040
|
-
console.error(`Error loading config ${
|
|
1316
|
+
console.error(`Error loading config ${d}:`, o);
|
|
1041
1317
|
}
|
|
1042
1318
|
})
|
|
1043
|
-
),
|
|
1319
|
+
), t;
|
|
1044
1320
|
}
|
|
1045
1321
|
z.theme.icon = "https://static.cartridge.gg/presets/cartridge/icon.svg";
|
|
1046
|
-
var
|
|
1322
|
+
var re = W, ne = z.theme;
|
|
1047
1323
|
export {
|
|
1048
|
-
|
|
1049
|
-
|
|
1324
|
+
ee as A,
|
|
1325
|
+
te as B,
|
|
1050
1326
|
D as E,
|
|
1051
|
-
|
|
1327
|
+
w as F,
|
|
1052
1328
|
m as H,
|
|
1053
1329
|
V as I,
|
|
1054
|
-
|
|
1055
|
-
|
|
1330
|
+
q as K,
|
|
1331
|
+
M as N,
|
|
1056
1332
|
Y as R,
|
|
1057
1333
|
A as a,
|
|
1058
|
-
|
|
1334
|
+
x as b,
|
|
1059
1335
|
G as c,
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
ae as x
|
|
1336
|
+
R as d,
|
|
1337
|
+
J as e,
|
|
1338
|
+
oe as f,
|
|
1339
|
+
$ as g,
|
|
1340
|
+
L as h,
|
|
1341
|
+
h as i,
|
|
1342
|
+
C as j,
|
|
1343
|
+
k,
|
|
1344
|
+
ne as l,
|
|
1345
|
+
re as m,
|
|
1346
|
+
F as n,
|
|
1347
|
+
se as o,
|
|
1348
|
+
X as p,
|
|
1349
|
+
p as q,
|
|
1350
|
+
le as r,
|
|
1351
|
+
K as s,
|
|
1352
|
+
g as t,
|
|
1353
|
+
de as u,
|
|
1354
|
+
Q as v,
|
|
1355
|
+
ae as w
|
|
1081
1356
|
};
|
|
1082
|
-
//# sourceMappingURL=index-
|
|
1357
|
+
//# sourceMappingURL=index-C7KGk-LM.js.map
|