@initia/interwovenkit-react 2.0.3 → 2.0.4
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/index.cjs +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1272 -1265
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { toPrivyWalletConnector as Ra, toPrivyWallet as Ba } from "@privy-io/cross-app-connect/rainbow-kit";
|
|
2
2
|
import { useSignMessage as Oa, useAccount as Mt, useDisconnect as La, useConnect as Ma, useChainId as Fa, useSwitchChain as za, useWatchAsset as Ua } from "wagmi";
|
|
3
|
-
import { useSuspenseQuery as ie, useQueries as on, queryOptions as Ln, useQuery as he, useQueryClient as wt, useMutation as
|
|
3
|
+
import { useSuspenseQuery as ie, useQueries as on, queryOptions as Ln, useQuery as he, useQueryClient as wt, useMutation as Ke, useIsMutating as Ka, useSuspenseInfiniteQuery as Ha, QueryClient as Wa, QueryClientProvider as ja } from "@tanstack/react-query";
|
|
4
4
|
import { getIbcDenom as Va, createMoveClient as Ga, InitiaAddress as z, fromBaseUnit as nn, formatNumber as Xr, createUserDerivedObjectAddress as wr, formatAmount as se, resolveBcsType as Qa, truncate as we, toBaseUnit as Mn } from "@initia/utils";
|
|
5
5
|
import { TxRaw as kn, Tx as br, AuthInfo as Ya, TxBody as Ja } from "cosmjs-types/cosmos/tx/v1beta1/tx.js";
|
|
6
6
|
import { encodeSecp256k1Pubkey as Ws, pubkeyType as Za, pubkeyToAddress as Xa } from "@cosmjs/amino";
|
|
7
7
|
import { accountFromAny as ei, SigningStargateClient as eo, AminoTypes as ti, QueryClient as ni, setupTxExtension as si, calculateFee as to, GasPrice as no } from "@cosmjs/stargate";
|
|
8
|
-
import { atom as
|
|
8
|
+
import { atom as He, useAtom as Me, useSetAtom as Cr, useAtomValue as js } from "jotai";
|
|
9
9
|
import { jsx as n, jsxs as u, Fragment as K } from "react/jsx-runtime";
|
|
10
|
-
import { take as ri, adjust as oi, includes as so, path as De, descend as
|
|
11
|
-
import { createContext as
|
|
10
|
+
import { take as ri, adjust as oi, includes as so, path as De, descend as G, head as Fn, sortWith as nt, zipObj as xn, prop as Bt, pick as ai, ascend as Ot, isNil as ii, partition as ro, without as ci, uniq as li, any as di, pickBy as ui, last as hi, has as mi } from "ramda";
|
|
11
|
+
import { createContext as st, useContext as We, useState as B, useCallback as J, useMemo as F, useEffect as M, Suspense as _i, useRef as Se, createElement as Es, Fragment as fi } from "react";
|
|
12
12
|
import te, { HTTPError as oo } from "ky";
|
|
13
13
|
import { createQueryKeys as Re } from "@lukemorales/query-key-factory";
|
|
14
14
|
import { ethers as En, BrowserProvider as pi, computeAddress as gi, isAddress as ao } from "ethers";
|
|
@@ -34,17 +34,17 @@ import D from "clsx";
|
|
|
34
34
|
import { nanoid as Ir } from "nanoid";
|
|
35
35
|
import { createPortal as Ui } from "react-dom";
|
|
36
36
|
import { useTransition as Ki, animated as zn, useSpring as Js } from "@react-spring/web";
|
|
37
|
-
import { IconClose as ho, IconCloseCircleFilled as an, IconCheckCircleFilled as Un, IconChevronDown as
|
|
37
|
+
import { IconClose as ho, IconCloseCircleFilled as an, IconCheckCircleFilled as Un, IconChevronDown as rt, IconWarningFilled as Kn, IconInfoFilled as Zs, IconCopy as qs, IconQrCode as Hi, IconSignOut as Wi, IconExternalLink as Xs, IconChevronRight as mo, IconSearch as ji, IconCheck as Hn, IconArrowRight as _o, IconSwap as fo, IconPlus as Vi, IconBack as Gi, IconWallet as Wn, IconEdit as Qi, IconClockFilled as Yi, IconSettingFilled as Ji, IconArrowDown as Ps, IconMinus as Zi, IconList as Xi } from "@initia/icons-react";
|
|
38
38
|
import { Dialog as Ie } from "@base-ui-components/react/dialog";
|
|
39
39
|
import { sentenceCase as er, capitalCase as ec } from "change-case";
|
|
40
40
|
import { Select as Be } from "@base-ui-components/react/select";
|
|
41
41
|
import tc from "qr-code-styling";
|
|
42
42
|
import nc from "xss";
|
|
43
|
-
import { Tabs as
|
|
43
|
+
import { Tabs as Ye } from "@base-ui-components/react/tabs";
|
|
44
44
|
import { isPast as po, format as go, addSeconds as sc, isFuture as rc } from "date-fns";
|
|
45
45
|
import { atomWithStorage as oc } from "jotai/utils";
|
|
46
46
|
import { Popover as Tt } from "@base-ui-components/react/popover";
|
|
47
|
-
import { Menu as
|
|
47
|
+
import { Menu as Je } from "@base-ui-components/react";
|
|
48
48
|
import { Controller as yo, useFormContext as Ft, useForm as jn, FormProvider as tr } from "react-hook-form";
|
|
49
49
|
import { MsgSend as Sr } from "cosmjs-types/cosmos/bank/v1beta1/tx.js";
|
|
50
50
|
import { mergeRefs as vo } from "react-merge-refs";
|
|
@@ -57,7 +57,7 @@ const Dn = 1.4, lc = 1.05, dc = {
|
|
|
57
57
|
routerApiUrl: "https://router-api.initia.xyz",
|
|
58
58
|
usernamesModuleAddress: "0x72ed9b26ecdcd6a21d304df50f19abfdbe31d2c02f60c84627844620a45940ef",
|
|
59
59
|
theme: "dark"
|
|
60
|
-
},
|
|
60
|
+
}, xv = {
|
|
61
61
|
defaultChainId: "initiation-2",
|
|
62
62
|
registryUrl: "https://registry.testnet.initia.xyz",
|
|
63
63
|
routerApiUrl: "https://router-api.initiation-2.initia.xyz",
|
|
@@ -69,9 +69,9 @@ const Dn = 1.4, lc = 1.05, dc = {
|
|
|
69
69
|
name: "Socials",
|
|
70
70
|
iconUrl: "https://assets.initia.xyz/images/wallets/Privy.webp",
|
|
71
71
|
iconBackground: "#ffffff"
|
|
72
|
-
},
|
|
72
|
+
}, $v = Ra(nr), Av = Ba(nr), wo = st(null);
|
|
73
73
|
function Vn() {
|
|
74
|
-
return
|
|
74
|
+
return We(wo);
|
|
75
75
|
}
|
|
76
76
|
function bo() {
|
|
77
77
|
const { location: e } = Vn();
|
|
@@ -116,13 +116,47 @@ const No = ({ children: e, initialEntry: t }) => {
|
|
|
116
116
|
return /* @__PURE__ */ n("button", { type: "button", ...a, onClick: (d) => {
|
|
117
117
|
d.preventDefault(), o?.(d), s ? l(e, t) : i(e, t);
|
|
118
118
|
}, children: r });
|
|
119
|
-
}, Io =
|
|
119
|
+
}, Io = st(null), Qn = () => We(Io), So = st(null);
|
|
120
120
|
function le() {
|
|
121
|
-
const e =
|
|
121
|
+
const e = We(So);
|
|
122
122
|
if (!e) throw new Error("Check if the InterwovenKitProvider is mounted");
|
|
123
123
|
return e;
|
|
124
124
|
}
|
|
125
|
-
|
|
125
|
+
const U = {
|
|
126
|
+
SECOND: 1e3,
|
|
127
|
+
MINUTE: 1e3 * 60,
|
|
128
|
+
INFINITY: (
|
|
129
|
+
/* HOUR, just in case */
|
|
130
|
+
1e3 * 60 * 60
|
|
131
|
+
)
|
|
132
|
+
};
|
|
133
|
+
async function hc(e) {
|
|
134
|
+
if (e instanceof oo) {
|
|
135
|
+
const { response: t } = e, s = t.headers.get("content-type") ?? "";
|
|
136
|
+
if (so("application/json", s))
|
|
137
|
+
try {
|
|
138
|
+
const r = await t.json();
|
|
139
|
+
if (r.message) return r.message;
|
|
140
|
+
} catch {
|
|
141
|
+
return e.message;
|
|
142
|
+
}
|
|
143
|
+
try {
|
|
144
|
+
return await t.text();
|
|
145
|
+
} catch {
|
|
146
|
+
return e.message;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (e instanceof Error) {
|
|
150
|
+
if (De(["code"], e) === 4001 || De(["code"], e) === "ACTION_REJECTED") return "User rejected";
|
|
151
|
+
const t = De(["error", "message"], e), s = De(["cause", "message"], e), r = De(["shortMessage"], e);
|
|
152
|
+
return t || s || r || e.message;
|
|
153
|
+
}
|
|
154
|
+
return String(e);
|
|
155
|
+
}
|
|
156
|
+
async function Fe(e) {
|
|
157
|
+
return new Error(await hc(e));
|
|
158
|
+
}
|
|
159
|
+
class mc extends Error {
|
|
126
160
|
originalError;
|
|
127
161
|
moduleAddress;
|
|
128
162
|
moduleName;
|
|
@@ -133,9 +167,9 @@ class hc extends Error {
|
|
|
133
167
|
super(t), this.name = "MoveError", this.originalError = s, this.moduleAddress = r, this.moduleName = o, this.errorCode = a, this.errorCodeHex = i, this.isFromRegistry = l;
|
|
134
168
|
}
|
|
135
169
|
}
|
|
136
|
-
const
|
|
137
|
-
function
|
|
138
|
-
const t = e.match(
|
|
170
|
+
const _c = /VM aborted: location=([0-9A-Fa-f]+)::(\w+), code=(\d+)/, hs = /* @__PURE__ */ new Map();
|
|
171
|
+
function fc(e) {
|
|
172
|
+
const t = e.match(_c);
|
|
139
173
|
if (!t) return null;
|
|
140
174
|
const [, s, r, o] = t;
|
|
141
175
|
return {
|
|
@@ -144,7 +178,7 @@ function _c(e) {
|
|
|
144
178
|
errorCode: o.replace(/^0+/, "") || "0"
|
|
145
179
|
};
|
|
146
180
|
}
|
|
147
|
-
async function
|
|
181
|
+
async function pc(e, t, s) {
|
|
148
182
|
const r = `${e}:${t}`;
|
|
149
183
|
if (hs.has(r))
|
|
150
184
|
return hs.get(r);
|
|
@@ -155,8 +189,8 @@ async function fc(e, t, s) {
|
|
|
155
189
|
return null;
|
|
156
190
|
}
|
|
157
191
|
}
|
|
158
|
-
function
|
|
159
|
-
return new
|
|
192
|
+
function gc(e, t, s, r, o, a, i) {
|
|
193
|
+
return new mc(
|
|
160
194
|
e,
|
|
161
195
|
t,
|
|
162
196
|
s,
|
|
@@ -168,15 +202,15 @@ function pc(e, t, s, r, o, a, i) {
|
|
|
168
202
|
}
|
|
169
203
|
async function qt(e, t, s) {
|
|
170
204
|
if (!t.metadata?.is_l1 && t.metadata?.minitia?.type !== "minimove")
|
|
171
|
-
return e;
|
|
172
|
-
const r =
|
|
173
|
-
if (!r) return e;
|
|
174
|
-
const o = await
|
|
205
|
+
return await Fe(e);
|
|
206
|
+
const r = fc(e.message);
|
|
207
|
+
if (!r) return await Fe(e);
|
|
208
|
+
const o = await pc(
|
|
175
209
|
t.chain_name,
|
|
176
210
|
r.moduleAddress,
|
|
177
211
|
s
|
|
178
212
|
), a = `0x${parseInt(r.errorCode, 10).toString(16)}`, i = `Failed with code ${a} in module ${r.moduleName} at ${r.moduleAddress}`, l = o?.[r.moduleName]?.[r.errorCode], c = l || i, d = !!l;
|
|
179
|
-
return
|
|
213
|
+
return gc(
|
|
180
214
|
c,
|
|
181
215
|
e,
|
|
182
216
|
r.moduleAddress,
|
|
@@ -186,37 +220,6 @@ async function qt(e, t, s) {
|
|
|
186
220
|
d
|
|
187
221
|
);
|
|
188
222
|
}
|
|
189
|
-
const U = {
|
|
190
|
-
SECOND: 1e3,
|
|
191
|
-
MINUTE: 1e3 * 60,
|
|
192
|
-
INFINITY: (
|
|
193
|
-
/* HOUR, just in case */
|
|
194
|
-
1e3 * 60 * 60
|
|
195
|
-
)
|
|
196
|
-
};
|
|
197
|
-
async function rt(e) {
|
|
198
|
-
if (e instanceof oo) {
|
|
199
|
-
const { response: t } = e, s = t.headers.get("content-type") ?? "";
|
|
200
|
-
if (so("application/json", s))
|
|
201
|
-
try {
|
|
202
|
-
const r = await t.json();
|
|
203
|
-
if (r.message) return r.message;
|
|
204
|
-
} catch {
|
|
205
|
-
return e.message;
|
|
206
|
-
}
|
|
207
|
-
try {
|
|
208
|
-
return await t.text();
|
|
209
|
-
} catch {
|
|
210
|
-
return e.message;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
if (e instanceof Error) {
|
|
214
|
-
if (De(["code"], e) === 4001 || De(["code"], e) === "ACTION_REJECTED") return "User rejected";
|
|
215
|
-
const t = De(["error", "message"], e), s = De(["cause", "message"], e), r = De(["shortMessage"], e);
|
|
216
|
-
return t || s || r || e.message;
|
|
217
|
-
}
|
|
218
|
-
return String(e);
|
|
219
|
-
}
|
|
220
223
|
const rr = Re("interwovenkit:chain", {
|
|
221
224
|
list: (e) => [e],
|
|
222
225
|
prices: (e) => [e],
|
|
@@ -227,15 +230,15 @@ function gn(e) {
|
|
|
227
230
|
if (!t) throw new Error("URL not found");
|
|
228
231
|
return t;
|
|
229
232
|
}
|
|
230
|
-
function
|
|
231
|
-
const { chain_id: t, chain_name: s, pretty_name: r, logo_URIs: o, apis: a, metadata: i } = e, l = r || s, c = o?.png ?? "", { rpc: d, rest: h, ["json-rpc"]: m, indexer: _ } = a, f = gn(d), p = gn(h), g = gn(_),
|
|
232
|
-
return { ...e, chainId: t, name: l, logoUrl: c, rpcUrl: f, restUrl: p, indexerUrl: g, jsonRpcUrl:
|
|
233
|
+
function yc(e) {
|
|
234
|
+
const { chain_id: t, chain_name: s, pretty_name: r, logo_URIs: o, apis: a, metadata: i } = e, l = r || s, c = o?.png ?? "", { rpc: d, rest: h, ["json-rpc"]: m, indexer: _ } = a, f = gn(d), p = gn(h), g = gn(_), b = i?.minitia?.type === "minievm" ? gn(m) : void 0;
|
|
235
|
+
return { ...e, chainId: t, name: l, logoUrl: c, rpcUrl: f, restUrl: p, indexerUrl: g, jsonRpcUrl: b };
|
|
233
236
|
}
|
|
234
237
|
function ne() {
|
|
235
238
|
const { defaultChainId: e, registryUrl: t, customChain: s } = le(), { data: r } = ie({
|
|
236
239
|
queryKey: rr.list(t).queryKey,
|
|
237
240
|
queryFn: () => te.create({ prefixUrl: t }).get("chains.json").json(),
|
|
238
|
-
select: (o) => (s ? [s, ...o.filter((i) => i.chain_id !== s.chain_id)] : o).map(
|
|
241
|
+
select: (o) => (s ? [s, ...o.filter((i) => i.chain_id !== s.chain_id)] : o).map(yc).toSorted(G((i) => i.chainId === e)),
|
|
239
242
|
staleTime: U.MINUTE
|
|
240
243
|
});
|
|
241
244
|
return r;
|
|
@@ -248,12 +251,12 @@ function ot() {
|
|
|
248
251
|
return s;
|
|
249
252
|
};
|
|
250
253
|
}
|
|
251
|
-
function
|
|
254
|
+
function je(e) {
|
|
252
255
|
return ot()(e);
|
|
253
256
|
}
|
|
254
257
|
function cn() {
|
|
255
258
|
const { defaultChainId: e } = le();
|
|
256
|
-
return
|
|
259
|
+
return je(e);
|
|
257
260
|
}
|
|
258
261
|
function be() {
|
|
259
262
|
const t = ne().find((s) => s.metadata?.is_l1);
|
|
@@ -271,36 +274,36 @@ function Yn(e) {
|
|
|
271
274
|
const t = ko();
|
|
272
275
|
return he(t(e));
|
|
273
276
|
}
|
|
274
|
-
function
|
|
277
|
+
function vc() {
|
|
275
278
|
const e = ne(), t = ko();
|
|
276
279
|
return on({
|
|
277
280
|
queries: e.map((s) => t(s))
|
|
278
281
|
});
|
|
279
282
|
}
|
|
280
|
-
function
|
|
283
|
+
function wc(e) {
|
|
281
284
|
if (e?.typeUrl === "/initia.crypto.v1beta1.ethsecp256k1.PubKey") {
|
|
282
285
|
const { key: t } = Ds.decode(e.value);
|
|
283
286
|
return Ws(t);
|
|
284
287
|
}
|
|
285
288
|
return Ii(e);
|
|
286
289
|
}
|
|
287
|
-
function
|
|
290
|
+
function bc({ typeUrl: e, value: t }) {
|
|
288
291
|
if (e === "/cosmos.auth.v1beta1.BaseAccount") {
|
|
289
|
-
const { address: s, pubKey: r, accountNumber: o, sequence: a } = Di.decode(t), i =
|
|
292
|
+
const { address: s, pubKey: r, accountNumber: o, sequence: a } = Di.decode(t), i = wc(r);
|
|
290
293
|
return { address: s, pubkey: i, accountNumber: Number(o), sequence: Number(a) };
|
|
291
294
|
}
|
|
292
295
|
return ei({ typeUrl: e, value: t });
|
|
293
296
|
}
|
|
294
|
-
function
|
|
297
|
+
function Cc(e) {
|
|
295
298
|
return e.type === "initia/PubKeyEthSecp256k1";
|
|
296
299
|
}
|
|
297
|
-
const
|
|
300
|
+
const Nc = {
|
|
298
301
|
...Za,
|
|
299
302
|
/** https://github.com/initia-labs/initia/blob/main/crypto/ethsecp256k1/ethsecp256k1.go#L40 */
|
|
300
303
|
ethsecp256k1: "initia/PubKeyEthSecp256k1"
|
|
301
304
|
};
|
|
302
|
-
function
|
|
303
|
-
if (
|
|
305
|
+
function Ic(e) {
|
|
306
|
+
if (Cc(e)) {
|
|
304
307
|
const t = Ds.fromPartial({
|
|
305
308
|
key: _t(e.value)
|
|
306
309
|
});
|
|
@@ -317,11 +320,11 @@ function xo(e) {
|
|
|
317
320
|
"Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03"
|
|
318
321
|
);
|
|
319
322
|
return {
|
|
320
|
-
type:
|
|
323
|
+
type: Nc.ethsecp256k1,
|
|
321
324
|
value: bt(e)
|
|
322
325
|
};
|
|
323
326
|
}
|
|
324
|
-
function
|
|
327
|
+
function Sc(e, t) {
|
|
325
328
|
if (t.length !== 64)
|
|
326
329
|
throw new Error(
|
|
327
330
|
"Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s."
|
|
@@ -352,7 +355,7 @@ const $e = "interwovenkit", O = {
|
|
|
352
355
|
const e = le();
|
|
353
356
|
return new ti({ ...Vs, ...e.aminoConverters });
|
|
354
357
|
};
|
|
355
|
-
class
|
|
358
|
+
class kc {
|
|
356
359
|
constructor(t, s) {
|
|
357
360
|
this.address = t, this.signMessage = s;
|
|
358
361
|
}
|
|
@@ -384,7 +387,7 @@ class Sc {
|
|
|
384
387
|
async signAmino(t, s) {
|
|
385
388
|
if (this.address !== t)
|
|
386
389
|
throw new Error("Signer address does not match the provided address");
|
|
387
|
-
const r = vi(wi(s)), o = await this.signMessage(r), a = pn(o.replace("0x", "")).subarray(0, -1), l = Ci.fromFixedLength(a).toFixedLength(), c =
|
|
390
|
+
const r = vi(wi(s)), o = await this.signMessage(r), a = pn(o.replace("0x", "")).subarray(0, -1), l = Ci.fromFixedLength(a).toFixedLength(), c = Sc(await this.getCachedPublicKey(), l);
|
|
388
391
|
return { signed: s, signature: c };
|
|
389
392
|
}
|
|
390
393
|
}
|
|
@@ -392,23 +395,23 @@ function or() {
|
|
|
392
395
|
const e = Jn(), t = Zn(), s = zt(), r = Ao();
|
|
393
396
|
return async function(o, a, i, l, c, d) {
|
|
394
397
|
if (!s) throw new Error("Signer not initialized");
|
|
395
|
-
const h = await r(o), { accountNumber: m, ..._ } = await h.getSequence(a), f = _.sequence + (d?.incrementSequence ?? 0), [p] = await s.getAccounts(), g =
|
|
398
|
+
const h = await r(o), { accountNumber: m, ..._ } = await h.getSequence(a), f = _.sequence + (d?.incrementSequence ?? 0), [p] = await s.getAccounts(), g = Ic(xo(p.pubkey)), b = yi.SIGN_MODE_EIP_191, k = i.map((v) => t.toAmino(v)), S = bi(k, l, o, c, m, f), { signature: $, signed: w } = await s.signAmino(a, S), q = {
|
|
396
399
|
typeUrl: "/cosmos.tx.v1beta1.TxBody",
|
|
397
400
|
value: {
|
|
398
401
|
messages: w.msgs.map((v) => t.fromAmino(v)),
|
|
399
402
|
memo: c
|
|
400
403
|
}
|
|
401
|
-
}, E = e.encode(q),
|
|
404
|
+
}, E = e.encode(q), I = Nr.fromString(w.fee.gas).toNumber(), y = Nr.fromString(w.sequence).toNumber(), C = xi(
|
|
402
405
|
[{ pubkey: g, sequence: y }],
|
|
403
406
|
w.fee.amount,
|
|
404
|
-
|
|
407
|
+
I,
|
|
405
408
|
w.fee.granter,
|
|
406
409
|
w.fee.payer,
|
|
407
|
-
|
|
410
|
+
b
|
|
408
411
|
);
|
|
409
412
|
return kn.fromPartial({
|
|
410
413
|
bodyBytes: E,
|
|
411
|
-
authInfoBytes:
|
|
414
|
+
authInfoBytes: C,
|
|
412
415
|
signatures: [_t($.signature)]
|
|
413
416
|
});
|
|
414
417
|
};
|
|
@@ -416,7 +419,7 @@ function or() {
|
|
|
416
419
|
function zt() {
|
|
417
420
|
const e = re(), { signMessageAsync: t } = Oa();
|
|
418
421
|
return F(
|
|
419
|
-
() => new
|
|
422
|
+
() => new kc(e, (s) => t({ message: s })),
|
|
420
423
|
[e, t]
|
|
421
424
|
);
|
|
422
425
|
}
|
|
@@ -440,8 +443,8 @@ function Ao() {
|
|
|
440
443
|
const l = await o(a), c = await eo.createWithSigner(l, s, {
|
|
441
444
|
registry: e,
|
|
442
445
|
aminoTypes: t,
|
|
443
|
-
accountParser:
|
|
444
|
-
broadcastPollIntervalMs:
|
|
446
|
+
accountParser: bc,
|
|
447
|
+
broadcastPollIntervalMs: 500
|
|
445
448
|
});
|
|
446
449
|
return _s.set(i, c), c;
|
|
447
450
|
};
|
|
@@ -453,14 +456,14 @@ function To() {
|
|
|
453
456
|
return new pi(await e.getProvider());
|
|
454
457
|
};
|
|
455
458
|
}
|
|
456
|
-
const
|
|
457
|
-
function
|
|
459
|
+
const xc = "c33b940c24c17e95f7d9d525d508ac61";
|
|
460
|
+
function $c() {
|
|
458
461
|
const { disableAnalytics: e } = le();
|
|
459
462
|
M(() => {
|
|
460
|
-
e || Gs.init(
|
|
463
|
+
e || Gs.init(xc, { autocapture: !1 });
|
|
461
464
|
}, [e]);
|
|
462
465
|
}
|
|
463
|
-
function
|
|
466
|
+
function Ac() {
|
|
464
467
|
const { connector: e } = Mt(), { defaultChainId: t, disableAnalytics: s } = le();
|
|
465
468
|
M(() => {
|
|
466
469
|
const r = new Pi();
|
|
@@ -479,9 +482,9 @@ function Xn() {
|
|
|
479
482
|
[e]
|
|
480
483
|
);
|
|
481
484
|
}
|
|
482
|
-
const
|
|
485
|
+
const Tc = He(!1);
|
|
483
486
|
function Ut() {
|
|
484
|
-
const e = Co(), [t, s] = Me(
|
|
487
|
+
const e = Co(), [t, s] = Me(Tc), r = Xn();
|
|
485
488
|
return { isDrawerOpen: t, openDrawer: (i, l) => {
|
|
486
489
|
i && e(i, l), s(!0), r("Widget Opened");
|
|
487
490
|
}, closeDrawer: () => {
|
|
@@ -494,50 +497,50 @@ function Eo() {
|
|
|
494
497
|
e("/blank"), t(), s(), localStorage.removeItem(O.BRIDGE_SRC_CHAIN_ID), localStorage.removeItem(O.BRIDGE_SRC_DENOM), localStorage.removeItem(O.BRIDGE_DST_CHAIN_ID), localStorage.removeItem(O.BRIDGE_DST_DENOM), localStorage.removeItem(O.BRIDGE_QUANTITY), localStorage.removeItem(O.BRIDGE_SLIPPAGE_PERCENT);
|
|
495
498
|
};
|
|
496
499
|
}
|
|
497
|
-
const Do = "approve", es =
|
|
500
|
+
const Do = "approve", es = He(), qo = He(null);
|
|
498
501
|
function Po() {
|
|
499
502
|
const e = js(es);
|
|
500
503
|
if (!e) throw new Error("Tx request not found");
|
|
501
504
|
return e;
|
|
502
505
|
}
|
|
503
506
|
function Ro() {
|
|
504
|
-
const e = ce(), t = re(), { defaultChainId: s, registryUrl: r } = le(), o = ot(), { openDrawer: a, closeDrawer: i } = Ut(), { openModal: l, closeModal: c } = Qn(), d = Cr(es), h = Cr(qo), m = $o(), _ = Ao(), f = zt(), p = Jn(), g = async ({ messages:
|
|
507
|
+
const e = ce(), t = re(), { defaultChainId: s, registryUrl: r } = le(), o = ot(), { openDrawer: a, closeDrawer: i } = Ut(), { openModal: l, closeModal: c } = Qn(), d = Cr(es), h = Cr(qo), m = $o(), _ = Ao(), f = zt(), p = Jn(), g = async ({ messages: I, memo: y, chainId: C = s }) => {
|
|
505
508
|
try {
|
|
506
|
-
return await (await _(
|
|
509
|
+
return await (await _(C)).simulate(t, I, y);
|
|
507
510
|
} catch (v) {
|
|
508
|
-
throw await qt(v, o(
|
|
511
|
+
throw await qt(v, o(C), r);
|
|
509
512
|
}
|
|
510
|
-
},
|
|
511
|
-
const v = await m(
|
|
512
|
-
return
|
|
513
|
-
},
|
|
514
|
-
txRequest:
|
|
513
|
+
}, b = async ({ messages: I, memo: y, chainId: C = s }) => {
|
|
514
|
+
const v = await m(C), A = ni.withExtensions(v, si), N = I.map((de) => p.encodeAsAny(de)), [R] = await f.getAccounts(), x = Ws(R.pubkey), V = await _(C), { sequence: W } = await V.getSequence(t);
|
|
515
|
+
return A.tx.simulate(N, y, x, W);
|
|
516
|
+
}, k = async ({
|
|
517
|
+
txRequest: I,
|
|
515
518
|
broadcaster: y
|
|
516
519
|
}) => {
|
|
517
520
|
const v = { ...{
|
|
518
521
|
memo: "",
|
|
519
522
|
chainId: s,
|
|
520
|
-
gas:
|
|
523
|
+
gas: I.gas || await g(I),
|
|
521
524
|
gasAdjustment: Dn,
|
|
522
525
|
gasPrices: null,
|
|
523
526
|
spendCoins: [],
|
|
524
527
|
internal: !1
|
|
525
|
-
}, ...
|
|
526
|
-
return new Promise((
|
|
528
|
+
}, ...I };
|
|
529
|
+
return new Promise((A, N) => {
|
|
527
530
|
d({
|
|
528
531
|
txRequest: v,
|
|
529
|
-
resolve: async (
|
|
532
|
+
resolve: async (x) => {
|
|
530
533
|
try {
|
|
531
|
-
const V = await _(v.chainId),
|
|
532
|
-
|
|
534
|
+
const V = await _(v.chainId), W = await y(V, kn.encode(x).finish());
|
|
535
|
+
A(W), typeof v.internal == "string" && e(v.internal);
|
|
533
536
|
} catch (V) {
|
|
534
|
-
|
|
537
|
+
N(await qt(V, o(v.chainId), r));
|
|
535
538
|
} finally {
|
|
536
539
|
R();
|
|
537
540
|
}
|
|
538
541
|
},
|
|
539
|
-
reject: (
|
|
540
|
-
|
|
542
|
+
reject: (x) => {
|
|
543
|
+
N(x), R();
|
|
541
544
|
}
|
|
542
545
|
}), v.internal ? l({ path: "/tx" }) : a("/tx");
|
|
543
546
|
const R = () => {
|
|
@@ -548,62 +551,66 @@ function Ro() {
|
|
|
548
551
|
c();
|
|
549
552
|
};
|
|
550
553
|
});
|
|
551
|
-
}, S = async (
|
|
552
|
-
const y =
|
|
554
|
+
}, S = async (I) => {
|
|
555
|
+
const y = I.chainId ?? s;
|
|
553
556
|
try {
|
|
554
|
-
const
|
|
555
|
-
txRequest:
|
|
556
|
-
broadcaster: async (v,
|
|
557
|
+
const C = await k({
|
|
558
|
+
txRequest: I,
|
|
559
|
+
broadcaster: async (v, A) => await v.broadcastTxSync(A)
|
|
557
560
|
});
|
|
558
|
-
return
|
|
559
|
-
h({ status: v.code === 0 ? "success" : "error", chainId: y, txHash:
|
|
561
|
+
return I.internal && typeof I.internal != "number" && (h({ txHash: C, chainId: y, status: "loading" }), E({ txHash: C, chainId: I.chainId }).then((v) => {
|
|
562
|
+
h({ status: v.code === 0 ? "success" : "error", chainId: y, txHash: C });
|
|
560
563
|
}).catch(() => {
|
|
561
|
-
h({ status: "error", chainId: y, txHash:
|
|
562
|
-
})),
|
|
563
|
-
} catch (
|
|
564
|
-
throw
|
|
564
|
+
h({ status: "error", chainId: y, txHash: C });
|
|
565
|
+
})), C;
|
|
566
|
+
} catch (C) {
|
|
567
|
+
throw I.internal && typeof I.internal != "number" && h({ status: "error", chainId: y, error: C }), C;
|
|
565
568
|
}
|
|
566
|
-
}, $ = (
|
|
567
|
-
txRequest:
|
|
568
|
-
broadcaster: async (
|
|
569
|
-
const
|
|
570
|
-
if (
|
|
571
|
-
return
|
|
569
|
+
}, $ = (I, y = 30 * 1e3, C = 0.5 * 1e3) => k({
|
|
570
|
+
txRequest: I,
|
|
571
|
+
broadcaster: async (v, A) => {
|
|
572
|
+
const N = await v.broadcastTx(A, y, C);
|
|
573
|
+
if (N.code !== 0) throw new Error(N.rawLog);
|
|
574
|
+
return N;
|
|
572
575
|
}
|
|
573
|
-
}), w = or(),
|
|
574
|
-
const y =
|
|
576
|
+
}), w = or(), T = async (I) => {
|
|
577
|
+
const y = I.chainId ?? s;
|
|
575
578
|
try {
|
|
576
|
-
const { messages:
|
|
577
|
-
return await
|
|
578
|
-
} catch (
|
|
579
|
-
throw await qt(
|
|
579
|
+
const { messages: C, memo: v = "", fee: A } = I, N = await _(y), R = await w(y, t, C, A, v);
|
|
580
|
+
return await N.broadcastTxSync(kn.encode(R).finish());
|
|
581
|
+
} catch (C) {
|
|
582
|
+
throw await qt(C, o(y), r);
|
|
580
583
|
}
|
|
581
|
-
}, q = async (
|
|
582
|
-
const
|
|
584
|
+
}, q = async (I, y = 30 * 1e3, C = 0.5 * 1e3) => {
|
|
585
|
+
const v = I.chainId ?? s;
|
|
583
586
|
try {
|
|
584
|
-
const { messages:
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
587
|
+
const { messages: A, memo: N = "", fee: R } = I, x = await _(v), V = await w(v, t, A, R, N), W = await x.broadcastTx(
|
|
588
|
+
kn.encode(V).finish(),
|
|
589
|
+
y,
|
|
590
|
+
C
|
|
591
|
+
);
|
|
592
|
+
if (W.code !== 0) throw new Error(W.rawLog);
|
|
593
|
+
return W;
|
|
594
|
+
} catch (A) {
|
|
595
|
+
throw await qt(A, o(v), r);
|
|
589
596
|
}
|
|
590
597
|
}, E = async ({
|
|
591
|
-
chainId:
|
|
598
|
+
chainId: I = s,
|
|
592
599
|
...y
|
|
593
600
|
}) => {
|
|
594
601
|
try {
|
|
595
|
-
const
|
|
596
|
-
return await Bo({ ...y, client:
|
|
597
|
-
} catch (
|
|
598
|
-
throw await qt(
|
|
602
|
+
const C = await _(I);
|
|
603
|
+
return await Bo({ ...y, client: C });
|
|
604
|
+
} catch (C) {
|
|
605
|
+
throw await qt(C, o(I), r);
|
|
599
606
|
}
|
|
600
607
|
};
|
|
601
608
|
return {
|
|
602
609
|
estimateGas: g,
|
|
603
|
-
simulateTx:
|
|
610
|
+
simulateTx: b,
|
|
604
611
|
requestTxSync: S,
|
|
605
612
|
requestTxBlock: $,
|
|
606
|
-
submitTxSync:
|
|
613
|
+
submitTxSync: T,
|
|
607
614
|
submitTxBlock: q,
|
|
608
615
|
waitForTxConfirmation: E
|
|
609
616
|
};
|
|
@@ -611,44 +618,44 @@ function Ro() {
|
|
|
611
618
|
async function Bo({
|
|
612
619
|
txHash: e,
|
|
613
620
|
client: t,
|
|
614
|
-
|
|
615
|
-
|
|
621
|
+
timeoutMs: s = 30 * 1e3,
|
|
622
|
+
intervalMs: r = 0.5 * 1e3
|
|
616
623
|
}) {
|
|
617
|
-
const o = Date.now()
|
|
624
|
+
const o = Date.now();
|
|
618
625
|
for (; ; ) {
|
|
619
|
-
const
|
|
620
|
-
if (
|
|
621
|
-
if (
|
|
622
|
-
return
|
|
626
|
+
const a = await t.getTx(e);
|
|
627
|
+
if (a) {
|
|
628
|
+
if (a.code !== 0) throw new Error(a.rawLog);
|
|
629
|
+
return a;
|
|
623
630
|
}
|
|
624
|
-
if (Date.now() - o >=
|
|
631
|
+
if (Date.now() - o >= s)
|
|
625
632
|
throw new Error(
|
|
626
|
-
`Transaction was submitted, but not found on the chain within ${s} seconds.`
|
|
633
|
+
`Transaction was submitted, but not found on the chain within ${s / 1e3} seconds.`
|
|
627
634
|
);
|
|
628
|
-
await new Promise((
|
|
635
|
+
await new Promise((i) => setTimeout(i, r));
|
|
629
636
|
}
|
|
630
637
|
}
|
|
631
|
-
function
|
|
638
|
+
function Ec(e) {
|
|
632
639
|
return e.pagination?.next_key ?? null;
|
|
633
640
|
}
|
|
634
641
|
async function Oo(e, t, s) {
|
|
635
642
|
const r = te.create(t), o = async (a, i) => {
|
|
636
|
-
const l = await r.extend(i ? { searchParams: { "pagination.key": i } } : {}).get(e).json(), c = l[s] ?? [], d =
|
|
643
|
+
const l = await r.extend(i ? { searchParams: { "pagination.key": i } } : {}).get(e).json(), c = l[s] ?? [], d = Ec(l), h = [...a, ...c];
|
|
637
644
|
return d ? o(h, d) : h;
|
|
638
645
|
};
|
|
639
646
|
return o([], null);
|
|
640
647
|
}
|
|
641
|
-
const
|
|
648
|
+
const Dc = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60">
|
|
642
649
|
<circle fill="#2F3337" cx="30" cy="30" r="30"/>
|
|
643
650
|
<path fill="#757C82" d="M26.328 34.288v-.48c0-2.048 1.024-2.816 4.128-4.16 3.104-1.28 3.712-1.952 3.712-3.488v-.128c0-1.664-1.344-2.464-4.224-2.464-2.816 0-4.416.736-4.768 3.296h-5.248c.416-5.536 4.416-7.584 9.888-7.584h.352c6.208 0 9.28 2.496 9.28 6.24v.352c0 3.392-1.28 4.96-5.376 6.592-1.504.64-2.048 1.024-2.208 1.824h-5.536ZM26.168 42v-5.152h5.792V42h-5.792Z"/>
|
|
644
|
-
</svg>`,
|
|
651
|
+
</svg>`, qc = encodeURIComponent(Dc), ar = `data:image/svg+xml;utf8,${qc}`, qn = Re("interwovenkit:asset", {
|
|
645
652
|
list: (e) => [e],
|
|
646
653
|
item: (e, t) => [e, t],
|
|
647
654
|
resource: (e, t) => [e.chainId, t.denom],
|
|
648
655
|
denom: (e, t) => [e, t],
|
|
649
656
|
metadata: (e, t) => [e, t]
|
|
650
657
|
});
|
|
651
|
-
function
|
|
658
|
+
function Pc(e) {
|
|
652
659
|
const { base: t, symbol: s, denom_units: r = [], display: o, logo_URIs: a, name: i, address: l, traces: c } = e, d = r.find((m) => m.denom === o)?.exponent ?? r.find((m) => m.denom === t)?.exponent ?? Fn(r)?.exponent ?? 0, h = a?.png ?? "";
|
|
653
660
|
return { denom: t, symbol: s, decimals: d, logoUrl: h, name: i, address: l, traces: c };
|
|
654
661
|
}
|
|
@@ -661,7 +668,7 @@ function Lo() {
|
|
|
661
668
|
queryFn: async () => s ? te.get(s).json() : { assets: [] },
|
|
662
669
|
select: ({ assets: r }) => {
|
|
663
670
|
if (!t) return [];
|
|
664
|
-
const o = r.map(
|
|
671
|
+
const o = r.map(Pc);
|
|
665
672
|
for (const a of o)
|
|
666
673
|
e.setQueryData(qn.item(t.chainId, a.denom).queryKey, a);
|
|
667
674
|
return o;
|
|
@@ -674,7 +681,7 @@ function sn(e) {
|
|
|
674
681
|
const t = Lo(), { data: s } = ie(t(e));
|
|
675
682
|
return s;
|
|
676
683
|
}
|
|
677
|
-
function
|
|
684
|
+
function Rc() {
|
|
678
685
|
const e = ne(), t = Lo();
|
|
679
686
|
return on({
|
|
680
687
|
queries: e.map((s) => t(s))
|
|
@@ -715,7 +722,7 @@ function Fo(e) {
|
|
|
715
722
|
};
|
|
716
723
|
}
|
|
717
724
|
const kr = "usernames";
|
|
718
|
-
function
|
|
725
|
+
function Bc({ restUrl: e, moduleAddress: t }) {
|
|
719
726
|
const { viewFunction: s } = Ga(e);
|
|
720
727
|
async function r(i) {
|
|
721
728
|
if (!z.validate(i)) return null;
|
|
@@ -752,7 +759,7 @@ const ts = Re("interwovenkit:account", {
|
|
|
752
759
|
});
|
|
753
760
|
function zo() {
|
|
754
761
|
const { restUrl: e } = be(), { usernamesModuleAddress: t } = le();
|
|
755
|
-
return
|
|
762
|
+
return Bc({ restUrl: e, moduleAddress: t });
|
|
756
763
|
}
|
|
757
764
|
function Uo() {
|
|
758
765
|
const e = re();
|
|
@@ -770,22 +777,22 @@ function ir(e) {
|
|
|
770
777
|
const t = Uo(), { data: s } = ie(t(e));
|
|
771
778
|
return s;
|
|
772
779
|
}
|
|
773
|
-
function
|
|
780
|
+
function Oc() {
|
|
774
781
|
const e = ne(), t = Uo();
|
|
775
782
|
return on({
|
|
776
783
|
queries: e.map((s) => t(s))
|
|
777
784
|
});
|
|
778
785
|
}
|
|
779
|
-
function
|
|
786
|
+
function Lc(e) {
|
|
780
787
|
const t = ir(e), s = sn(e), r = at(e), o = Fo(e), { data: a } = Yn(e), i = (c) => e.fees.fee_tokens.some((d) => d.denom === c), l = (c) => s.some((d) => d.denom === c);
|
|
781
|
-
return
|
|
788
|
+
return nt(
|
|
782
789
|
[
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
790
|
+
G(({ denom: c }) => o(c) === "uinit"),
|
|
791
|
+
G(({ denom: c }) => i(c)),
|
|
792
|
+
G(({ value: c }) => c),
|
|
793
|
+
G(({ denom: c }) => l(c)),
|
|
787
794
|
({ balance: c }, { balance: d }) => P(d).comparedTo(c) ?? 0,
|
|
788
|
-
|
|
795
|
+
G(({ symbol: c }) => c.toLowerCase())
|
|
789
796
|
],
|
|
790
797
|
t.filter(({ amount: c }) => !P(c).isZero()).map(({ amount: c, denom: d }) => {
|
|
791
798
|
const h = r(d), m = a?.find(({ id: f }) => f === h?.denom)?.price ?? 0, _ = P(c).times(m).div(P(10).pow(h.decimals)).toNumber();
|
|
@@ -793,61 +800,61 @@ function Oc(e) {
|
|
|
793
800
|
})
|
|
794
801
|
);
|
|
795
802
|
}
|
|
796
|
-
const
|
|
803
|
+
const Mc = "INIT", Fc = "Initia";
|
|
797
804
|
function cr(e) {
|
|
798
805
|
return e.assets.reduce((t, { value: s }) => t + (s ?? 0), 0);
|
|
799
806
|
}
|
|
800
|
-
function
|
|
807
|
+
function zc(e) {
|
|
801
808
|
return e.assets.reduce((t, { quantity: s }) => t.plus(s), P(0)).toString();
|
|
802
809
|
}
|
|
803
|
-
function
|
|
810
|
+
function Uc(e, t) {
|
|
804
811
|
return { symbol: t?.symbol ?? e, logoUrl: t?.logoUrl ?? ar };
|
|
805
812
|
}
|
|
806
813
|
function xr(e) {
|
|
807
814
|
return ai(["chainId", "name", "logoUrl"], e);
|
|
808
815
|
}
|
|
809
|
-
function
|
|
810
|
-
return
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
816
|
+
function Kc(e) {
|
|
817
|
+
return nt([
|
|
818
|
+
G(({ symbol: t }) => t === Mc),
|
|
819
|
+
G(cr),
|
|
820
|
+
G(({ assets: t }) => t.length),
|
|
814
821
|
Ot(({ symbol: t }) => t)
|
|
815
822
|
])(e);
|
|
816
823
|
}
|
|
817
|
-
function
|
|
818
|
-
return
|
|
819
|
-
|
|
820
|
-
|
|
824
|
+
function Hc(e) {
|
|
825
|
+
return nt([
|
|
826
|
+
G(({ value: t }) => t ?? 0),
|
|
827
|
+
G(({ quantity: t }) => Number(t)),
|
|
821
828
|
// Supported assets only
|
|
822
829
|
Ot(({ chain: t }) => t.name)
|
|
823
830
|
])(e);
|
|
824
831
|
}
|
|
825
|
-
function
|
|
826
|
-
return
|
|
827
|
-
|
|
832
|
+
function Wc(e) {
|
|
833
|
+
return nt([
|
|
834
|
+
G(({ chain: t }) => t.name === Fc),
|
|
828
835
|
Ot(({ chain: t }) => t.name),
|
|
829
836
|
Ot(({ denom: t }) => t)
|
|
830
837
|
])(e);
|
|
831
838
|
}
|
|
832
|
-
function
|
|
833
|
-
return
|
|
834
|
-
|
|
835
|
-
|
|
839
|
+
function jc(e, t) {
|
|
840
|
+
return nt([
|
|
841
|
+
G(({ chainId: s }) => s === t),
|
|
842
|
+
G(Bt("value"))
|
|
836
843
|
])(e);
|
|
837
844
|
}
|
|
838
|
-
function
|
|
845
|
+
function Vc(e, t, s, r, o) {
|
|
839
846
|
const a = {};
|
|
840
847
|
for (const h of e) {
|
|
841
848
|
const m = h.chainId, _ = t[m] ?? [], f = s[m], p = r[m], g = [];
|
|
842
|
-
for (const { amount:
|
|
843
|
-
if (!P(
|
|
844
|
-
const S = f?.find((E) => E.denom ===
|
|
849
|
+
for (const { amount: b, denom: k } of _) {
|
|
850
|
+
if (!P(b).gt(0)) continue;
|
|
851
|
+
const S = f?.find((E) => E.denom === k), $ = p?.find((E) => E.id === k)?.price, w = S?.decimals ?? 0, T = nn(b, { decimals: w }), q = $ ? P(T).times($).toNumber() : void 0;
|
|
845
852
|
g.push({
|
|
846
|
-
...
|
|
847
|
-
amount:
|
|
848
|
-
denom:
|
|
853
|
+
...Uc(k, S),
|
|
854
|
+
amount: b,
|
|
855
|
+
denom: k,
|
|
849
856
|
decimals: w,
|
|
850
|
-
quantity:
|
|
857
|
+
quantity: T,
|
|
851
858
|
price: $,
|
|
852
859
|
value: q,
|
|
853
860
|
address: S?.address,
|
|
@@ -875,7 +882,7 @@ function jc(e, t, s, r, o) {
|
|
|
875
882
|
for (const [h, m] of l) {
|
|
876
883
|
const _ = Fn(m);
|
|
877
884
|
if (!_) continue;
|
|
878
|
-
const f =
|
|
885
|
+
const f = Hc(m);
|
|
879
886
|
c.push({ symbol: h, logoUrl: _.logoUrl, assets: f });
|
|
880
887
|
}
|
|
881
888
|
const d = [];
|
|
@@ -883,14 +890,14 @@ function jc(e, t, s, r, o) {
|
|
|
883
890
|
for (const m of h)
|
|
884
891
|
m.unlisted && d.push(m);
|
|
885
892
|
return {
|
|
886
|
-
chainsByValue:
|
|
887
|
-
assetGroups:
|
|
888
|
-
unlistedAssets:
|
|
893
|
+
chainsByValue: jc(Array.from(i.values()), o),
|
|
894
|
+
assetGroups: Kc(c),
|
|
895
|
+
unlistedAssets: Wc(d),
|
|
889
896
|
totalValue: c.reduce((h, m) => h + cr(m), 0)
|
|
890
897
|
};
|
|
891
898
|
}
|
|
892
899
|
function Ko() {
|
|
893
|
-
const { defaultChainId: e } = le(), t = ne(), s =
|
|
900
|
+
const { defaultChainId: e } = le(), t = ne(), s = Oc(), r = Rc(), o = vc(), a = t.map((_) => _.chainId), i = xn(a, s.map(Bt("data"))), l = xn(a, r.map(Bt("data"))), c = xn(a, o.map(Bt("data"))), d = Vc(
|
|
894
901
|
t,
|
|
895
902
|
i,
|
|
896
903
|
l,
|
|
@@ -913,7 +920,7 @@ function ln() {
|
|
|
913
920
|
const e = cn(), t = re(), s = lr();
|
|
914
921
|
return e.metadata?.minitia?.type === "minievm" ? s : t;
|
|
915
922
|
}
|
|
916
|
-
function
|
|
923
|
+
function Gc() {
|
|
917
924
|
const e = ln(), t = zo();
|
|
918
925
|
return he({
|
|
919
926
|
queryKey: ts.username(t.restUrl, e).queryKey,
|
|
@@ -923,7 +930,7 @@ function Vc() {
|
|
|
923
930
|
});
|
|
924
931
|
}
|
|
925
932
|
function ke() {
|
|
926
|
-
const e = ln(), t = re(), s = lr(), { data: r } =
|
|
933
|
+
const e = ln(), t = re(), s = lr(), { data: r } = Gc(), o = zt(), a = Eo(), { isDrawerOpen: i, openDrawer: l } = Ut(), c = () => {
|
|
927
934
|
l("/");
|
|
928
935
|
}, d = () => {
|
|
929
936
|
l("/connect");
|
|
@@ -945,7 +952,7 @@ function ke() {
|
|
|
945
952
|
...m
|
|
946
953
|
};
|
|
947
954
|
}
|
|
948
|
-
function
|
|
955
|
+
function Qc() {
|
|
949
956
|
const e = [
|
|
950
957
|
"initia-wallet-widget:last-connected-wallet",
|
|
951
958
|
"initia-wallet-widget:fee-denoms",
|
|
@@ -974,9 +981,9 @@ function Gc() {
|
|
|
974
981
|
}
|
|
975
982
|
}
|
|
976
983
|
}
|
|
977
|
-
const
|
|
978
|
-
status:
|
|
979
|
-
error:
|
|
984
|
+
const Yc = "_status_tn9m1_1", Jc = "_error_tn9m1_9", $r = {
|
|
985
|
+
status: Yc,
|
|
986
|
+
error: Jc
|
|
980
987
|
}, Y = ({ error: e, children: t }) => /* @__PURE__ */ n("p", { className: D($r.status, { [$r.error]: e }), children: t }), me = ({
|
|
981
988
|
errorBoundaryProps: e = { fallbackRender: ({ error: r }) => /* @__PURE__ */ n(Y, { error: !0, children: r.message }) },
|
|
982
989
|
suspenseFallback: t = /* @__PURE__ */ n(Y, { children: "Loading..." }),
|
|
@@ -991,7 +998,7 @@ const Qc = "_status_tn9m1_1", Yc = "_error_tn9m1_9", $r = {
|
|
|
991
998
|
txTrack: (e, t) => [e, t],
|
|
992
999
|
txStatus: (e, t) => [e, t]
|
|
993
1000
|
});
|
|
994
|
-
function
|
|
1001
|
+
function Ve() {
|
|
995
1002
|
const { routerApiUrl: e } = le();
|
|
996
1003
|
return F(() => te.create({ prefixUrl: e }), [e]);
|
|
997
1004
|
}
|
|
@@ -1007,12 +1014,12 @@ function rn(e) {
|
|
|
1007
1014
|
return dn()(e);
|
|
1008
1015
|
}
|
|
1009
1016
|
function dr() {
|
|
1010
|
-
const e =
|
|
1017
|
+
const e = Ve(), { data: t } = ie({
|
|
1011
1018
|
queryKey: qe.chains.queryKey,
|
|
1012
1019
|
queryFn: () => e.get("v2/info/chains").json(),
|
|
1013
|
-
select: ({ chains: s }) =>
|
|
1020
|
+
select: ({ chains: s }) => nt(
|
|
1014
1021
|
[
|
|
1015
|
-
|
|
1022
|
+
G(({ chain_name: r }) => r === "initia"),
|
|
1016
1023
|
Ot(({ pretty_name: r }) => r)
|
|
1017
1024
|
],
|
|
1018
1025
|
s
|
|
@@ -1033,14 +1040,14 @@ function Pe(e) {
|
|
|
1033
1040
|
return Nt()(e);
|
|
1034
1041
|
}
|
|
1035
1042
|
function Lt(e) {
|
|
1036
|
-
const t =
|
|
1043
|
+
const t = Ve(), s = wt(), { data: r } = ie({
|
|
1037
1044
|
queryKey: qe.assets(e).queryKey,
|
|
1038
1045
|
queryFn: () => t.get("v2/fungible/assets", { searchParams: { chain_ids: e } }).json(),
|
|
1039
1046
|
select: ({ chain_to_assets_map: o }) => {
|
|
1040
1047
|
const { assets: a } = o[e] ?? { assets: [] };
|
|
1041
1048
|
for (const i of a)
|
|
1042
1049
|
s.setQueryData(qe.asset(e, i.denom).queryKey, i);
|
|
1043
|
-
return a.toSorted(
|
|
1050
|
+
return a.toSorted(G((i) => i.symbol === "INIT"));
|
|
1044
1051
|
},
|
|
1045
1052
|
staleTime: U.MINUTE
|
|
1046
1053
|
});
|
|
@@ -1054,23 +1061,23 @@ function Wo(e) {
|
|
|
1054
1061
|
return r;
|
|
1055
1062
|
};
|
|
1056
1063
|
}
|
|
1057
|
-
function
|
|
1064
|
+
function ze(e, t) {
|
|
1058
1065
|
return Wo(t)(e);
|
|
1059
1066
|
}
|
|
1060
|
-
const ur =
|
|
1067
|
+
const ur = st(null);
|
|
1061
1068
|
function yt() {
|
|
1062
|
-
const { container: e } =
|
|
1069
|
+
const { container: e } = We(ur);
|
|
1063
1070
|
return e;
|
|
1064
1071
|
}
|
|
1065
1072
|
function jo(e) {
|
|
1066
1073
|
const t = yt();
|
|
1067
1074
|
return t ? getComputedStyle(t).getPropertyValue(e) : "";
|
|
1068
1075
|
}
|
|
1069
|
-
const
|
|
1076
|
+
const Zc = ({ children: e }) => {
|
|
1070
1077
|
const [t, s] = B(null);
|
|
1071
1078
|
return /* @__PURE__ */ n(ur.Provider, { value: { container: t, setContainer: s }, children: e });
|
|
1072
|
-
},
|
|
1073
|
-
loader:
|
|
1079
|
+
}, Xc = "_loader_4gdsk_1", el = {
|
|
1080
|
+
loader: Xc
|
|
1074
1081
|
}, It = ({ size: e = 24, color: t = "currentColor", border: s = 2 }) => {
|
|
1075
1082
|
const r = {
|
|
1076
1083
|
width: `${e}px`,
|
|
@@ -1078,19 +1085,19 @@ const Jc = ({ children: e }) => {
|
|
|
1078
1085
|
borderColor: `${t} ${t} transparent ${t}`,
|
|
1079
1086
|
borderWidth: `${s}px`
|
|
1080
1087
|
};
|
|
1081
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1082
|
-
},
|
|
1083
|
-
container:
|
|
1084
|
-
toast:
|
|
1085
|
-
info:
|
|
1086
|
-
success:
|
|
1087
|
-
error:
|
|
1088
|
-
icon:
|
|
1089
|
-
content:
|
|
1090
|
-
title:
|
|
1091
|
-
description:
|
|
1092
|
-
close:
|
|
1093
|
-
},
|
|
1088
|
+
return /* @__PURE__ */ n("div", { className: el.loader, style: r });
|
|
1089
|
+
}, tl = "_container_1zg8z_1", nl = "_toast_1zg8z_10", sl = "_info_1zg8z_23", rl = "_success_1zg8z_27", ol = "_error_1zg8z_31", al = "_icon_1zg8z_36", il = "_content_1zg8z_43", cl = "_title_1zg8z_46", ll = "_description_1zg8z_51", dl = "_close_1zg8z_72", Ze = {
|
|
1090
|
+
container: tl,
|
|
1091
|
+
toast: nl,
|
|
1092
|
+
info: sl,
|
|
1093
|
+
success: rl,
|
|
1094
|
+
error: ol,
|
|
1095
|
+
icon: al,
|
|
1096
|
+
content: il,
|
|
1097
|
+
title: cl,
|
|
1098
|
+
description: ll,
|
|
1099
|
+
close: dl
|
|
1100
|
+
}, ul = ({ notification: e, onClose: t, ...s }) => {
|
|
1094
1101
|
const r = Ki(e, {
|
|
1095
1102
|
keys: (a) => a?.id || "empty",
|
|
1096
1103
|
from: { transform: "translateY(-52px)", opacity: 0 },
|
|
@@ -1113,16 +1120,16 @@ const Jc = ({ children: e }) => {
|
|
|
1113
1120
|
return r((a, i) => {
|
|
1114
1121
|
if (!i) return null;
|
|
1115
1122
|
const { type: l, title: c, description: d } = i, h = o(l);
|
|
1116
|
-
return /* @__PURE__ */ n(zn.div, { style: a, className:
|
|
1117
|
-
h && /* @__PURE__ */ n("div", { className:
|
|
1118
|
-
/* @__PURE__ */ u("div", { className:
|
|
1119
|
-
/* @__PURE__ */ n("p", { className:
|
|
1120
|
-
d && /* @__PURE__ */ n("div", { className:
|
|
1123
|
+
return /* @__PURE__ */ n(zn.div, { style: a, className: Ze.container, children: /* @__PURE__ */ u("div", { className: D(Ze.toast, l && Ze[l]), ...s, children: [
|
|
1124
|
+
h && /* @__PURE__ */ n("div", { className: Ze.icon, children: h }),
|
|
1125
|
+
/* @__PURE__ */ u("div", { className: Ze.content, children: [
|
|
1126
|
+
/* @__PURE__ */ n("p", { className: Ze.title, children: c }),
|
|
1127
|
+
d && /* @__PURE__ */ n("div", { className: Ze.description, children: d })
|
|
1121
1128
|
] }),
|
|
1122
|
-
/* @__PURE__ */ n("button", { className:
|
|
1129
|
+
/* @__PURE__ */ n("button", { className: Ze.close, onClick: t, children: /* @__PURE__ */ n(ho, { size: 14 }) })
|
|
1123
1130
|
] }) });
|
|
1124
1131
|
});
|
|
1125
|
-
}, Vo =
|
|
1132
|
+
}, Vo = st(null), hr = () => We(Vo), fs = 5e3, hl = ({ children: e }) => {
|
|
1126
1133
|
const t = yt(), [s, r] = B(null), o = Se(null), a = Se(!1), i = () => {
|
|
1127
1134
|
o.current && (clearTimeout(o.current), o.current = null);
|
|
1128
1135
|
}, l = J(() => {
|
|
@@ -1150,7 +1157,7 @@ const Jc = ({ children: e }) => {
|
|
|
1150
1157
|
e,
|
|
1151
1158
|
t && Ui(
|
|
1152
1159
|
/* @__PURE__ */ n(
|
|
1153
|
-
|
|
1160
|
+
ul,
|
|
1154
1161
|
{
|
|
1155
1162
|
notification: s,
|
|
1156
1163
|
onClose: l,
|
|
@@ -1163,15 +1170,15 @@ const Jc = ({ children: e }) => {
|
|
|
1163
1170
|
]
|
|
1164
1171
|
}
|
|
1165
1172
|
);
|
|
1166
|
-
}, Go =
|
|
1167
|
-
overlay:
|
|
1168
|
-
fullscreen:
|
|
1169
|
-
content:
|
|
1170
|
-
header:
|
|
1171
|
-
title:
|
|
1172
|
-
close:
|
|
1173
|
+
}, Go = st(!1), ml = "_overlay_2lgi8_1", _l = "_fullscreen_2lgi8_15", fl = "_content_2lgi8_19", pl = "_header_2lgi8_54", gl = "_title_2lgi8_63", yl = "_close_2lgi8_68", lt = {
|
|
1174
|
+
overlay: ml,
|
|
1175
|
+
fullscreen: _l,
|
|
1176
|
+
content: fl,
|
|
1177
|
+
header: pl,
|
|
1178
|
+
title: gl,
|
|
1179
|
+
close: yl
|
|
1173
1180
|
}, Qo = ({ title: e, children: t, trigger: s, className: r, open: o, onOpenChange: a }) => {
|
|
1174
|
-
const i = yt(), l =
|
|
1181
|
+
const i = yt(), l = We(Go);
|
|
1175
1182
|
return i ? /* @__PURE__ */ u(
|
|
1176
1183
|
Ie.Root,
|
|
1177
1184
|
{
|
|
@@ -1200,7 +1207,7 @@ const Jc = ({ children: e }) => {
|
|
|
1200
1207
|
]
|
|
1201
1208
|
}
|
|
1202
1209
|
) : null;
|
|
1203
|
-
},
|
|
1210
|
+
}, vl = 10;
|
|
1204
1211
|
function Yo() {
|
|
1205
1212
|
const e = re();
|
|
1206
1213
|
return (t, s) => Ln({
|
|
@@ -1209,27 +1216,27 @@ function Yo() {
|
|
|
1209
1216
|
if (!s.enabled) return [];
|
|
1210
1217
|
const r = {
|
|
1211
1218
|
"pagination.reverse": !0,
|
|
1212
|
-
"pagination.limit":
|
|
1219
|
+
"pagination.limit": vl
|
|
1213
1220
|
}, { txs: o } = await te.create({ prefixUrl: t.indexerUrl }).get(`indexer/tx/v1/txs/by_account/${e}`, { searchParams: r }).json();
|
|
1214
1221
|
return o;
|
|
1215
1222
|
},
|
|
1216
1223
|
staleTime: U.SECOND
|
|
1217
1224
|
});
|
|
1218
1225
|
}
|
|
1219
|
-
function
|
|
1226
|
+
function wl(e, t) {
|
|
1220
1227
|
const s = Yo();
|
|
1221
1228
|
return ie(s(e, t));
|
|
1222
1229
|
}
|
|
1223
|
-
function
|
|
1230
|
+
function bl(e, t) {
|
|
1224
1231
|
const s = e.flatMap((r, o) => (t[o] ?? []).map((i) => ({ ...i, chain: r })));
|
|
1225
|
-
return
|
|
1232
|
+
return nt([G((r) => new Date(r.timestamp).getTime())])(
|
|
1226
1233
|
s
|
|
1227
1234
|
);
|
|
1228
1235
|
}
|
|
1229
|
-
const
|
|
1236
|
+
const Cl = () => {
|
|
1230
1237
|
const e = ne(), t = Yo(), s = on({
|
|
1231
1238
|
queries: e.map((i) => t(i, { enabled: !0 }))
|
|
1232
|
-
}), r = s.map(Bt("data")), o =
|
|
1239
|
+
}), r = s.map(Bt("data")), o = bl(e, r), a = s.some((i) => i.isLoading);
|
|
1233
1240
|
return { activities: o, isLoading: a };
|
|
1234
1241
|
};
|
|
1235
1242
|
function Jo(e) {
|
|
@@ -1238,7 +1245,7 @@ function Jo(e) {
|
|
|
1238
1245
|
queryFn: async () => {
|
|
1239
1246
|
if (e.metadata?.is_l1) {
|
|
1240
1247
|
const { restUrl: s } = e, { gas_prices: r } = await te.create({ prefixUrl: s }).get("initia/tx/v1/gas_prices").json();
|
|
1241
|
-
return r.toSorted(
|
|
1248
|
+
return r.toSorted(G(({ denom: o }) => o === "uinit")).map(({ denom: o, amount: a }) => {
|
|
1242
1249
|
const i = o === "uinit" ? 1 : lc;
|
|
1243
1250
|
return { amount: P(a).times(i).toFixed(18), denom: o };
|
|
1244
1251
|
});
|
|
@@ -1253,7 +1260,7 @@ function Jo(e) {
|
|
|
1253
1260
|
return t;
|
|
1254
1261
|
}
|
|
1255
1262
|
function Zo(e) {
|
|
1256
|
-
const t = re(), { data: s } =
|
|
1263
|
+
const t = re(), { data: s } = wl(e, { enabled: e.fees.fee_tokens.length >= 2 });
|
|
1257
1264
|
if (e.fees.fee_tokens.length === 0)
|
|
1258
1265
|
return null;
|
|
1259
1266
|
const r = e.fees.fee_tokens[0].denom;
|
|
@@ -1270,14 +1277,14 @@ function Zo(e) {
|
|
|
1270
1277
|
return r;
|
|
1271
1278
|
}
|
|
1272
1279
|
}
|
|
1273
|
-
const
|
|
1274
|
-
root:
|
|
1275
|
-
item:
|
|
1276
|
-
chevron:
|
|
1277
|
-
trigger:
|
|
1278
|
-
content:
|
|
1280
|
+
const Nl = "_root_hypwm_1", Il = "_item_hypwm_10", Sl = "_chevron_hypwm_14", kl = "_trigger_hypwm_19", xl = "_content_hypwm_39", Gt = {
|
|
1281
|
+
root: Nl,
|
|
1282
|
+
item: Il,
|
|
1283
|
+
chevron: Sl,
|
|
1284
|
+
trigger: kl,
|
|
1285
|
+
content: xl
|
|
1279
1286
|
};
|
|
1280
|
-
function
|
|
1287
|
+
function $l(e) {
|
|
1281
1288
|
const { list: t, getKey: s, renderHeader: r, renderContent: o, footer: a, ...i } = e;
|
|
1282
1289
|
return /* @__PURE__ */ u(Vt.Root, { className: Gt.root, type: "multiple", ...i, children: [
|
|
1283
1290
|
t.map((l, c) => /* @__PURE__ */ u(
|
|
@@ -1288,7 +1295,7 @@ function xl(e) {
|
|
|
1288
1295
|
children: [
|
|
1289
1296
|
/* @__PURE__ */ n(Vt.Header, { children: /* @__PURE__ */ u(Vt.Trigger, { className: Gt.trigger, children: [
|
|
1290
1297
|
r(l),
|
|
1291
|
-
/* @__PURE__ */ n(
|
|
1298
|
+
/* @__PURE__ */ n(rt, { className: Gt.chevron, size: 16 })
|
|
1292
1299
|
] }) }),
|
|
1293
1300
|
/* @__PURE__ */ n(Vt.Content, { className: Gt.content, children: o(l) })
|
|
1294
1301
|
]
|
|
@@ -1298,9 +1305,9 @@ function xl(e) {
|
|
|
1298
1305
|
a
|
|
1299
1306
|
] });
|
|
1300
1307
|
}
|
|
1301
|
-
const
|
|
1302
|
-
scrollable:
|
|
1303
|
-
},
|
|
1308
|
+
const Al = "_scrollable_abvhw_1", Tl = {
|
|
1309
|
+
scrollable: Al
|
|
1310
|
+
}, Ge = ({ className: e, children: t, ref: s }) => /* @__PURE__ */ n("div", { ref: s, className: D(Tl.scrollable, e), children: t }), Rs = ({ children: e }) => {
|
|
1304
1311
|
const t = Se(null), [s, r] = B(0), o = Js({
|
|
1305
1312
|
height: s,
|
|
1306
1313
|
config: { tension: 500, friction: 30, clamp: !0 }
|
|
@@ -1311,14 +1318,14 @@ const $l = "_scrollable_abvhw_1", Al = {
|
|
|
1311
1318
|
r(a);
|
|
1312
1319
|
}
|
|
1313
1320
|
}, [e]), e ? /* @__PURE__ */ n(zn.div, { style: { overflow: "hidden", ...o }, children: /* @__PURE__ */ n("div", { ref: t, children: e }) }) : null;
|
|
1314
|
-
},
|
|
1315
|
-
help:
|
|
1316
|
-
icon:
|
|
1317
|
-
info:
|
|
1318
|
-
warning:
|
|
1319
|
-
error:
|
|
1320
|
-
success:
|
|
1321
|
-
},
|
|
1321
|
+
}, El = "_help_7m3jv_1", Dl = "_icon_7m3jv_10", ql = "_info_7m3jv_17", Pl = "_warning_7m3jv_21", Rl = "_error_7m3jv_25", Bl = "_success_7m3jv_31", ps = {
|
|
1322
|
+
help: El,
|
|
1323
|
+
icon: Dl,
|
|
1324
|
+
info: ql,
|
|
1325
|
+
warning: Pl,
|
|
1326
|
+
error: Rl,
|
|
1327
|
+
success: Bl
|
|
1328
|
+
}, et = ({ level: e, className: t, mt: s = 8, children: r }) => {
|
|
1322
1329
|
if (!r) return null;
|
|
1323
1330
|
const o = () => {
|
|
1324
1331
|
switch (e) {
|
|
@@ -1337,28 +1344,28 @@ const $l = "_scrollable_abvhw_1", Al = {
|
|
|
1337
1344
|
/* @__PURE__ */ n("div", { className: ps.icon, children: o() }),
|
|
1338
1345
|
/* @__PURE__ */ n("p", { children: r })
|
|
1339
1346
|
] });
|
|
1340
|
-
},
|
|
1341
|
-
stack:
|
|
1342
|
-
help:
|
|
1343
|
-
info:
|
|
1344
|
-
warning:
|
|
1345
|
-
error:
|
|
1346
|
-
success:
|
|
1347
|
-
},
|
|
1348
|
-
X.Stack =
|
|
1349
|
-
const
|
|
1350
|
-
footer:
|
|
1351
|
-
actions:
|
|
1347
|
+
}, Ol = "_stack_14kq8_1", Ll = "_help_14kq8_6", Ml = "_info_14kq8_14", Fl = "_warning_14kq8_19", zl = "_error_14kq8_24", Ul = "_success_14kq8_29", Bs = {
|
|
1348
|
+
stack: Ol,
|
|
1349
|
+
help: Ll,
|
|
1350
|
+
info: Ml,
|
|
1351
|
+
warning: Fl,
|
|
1352
|
+
error: zl,
|
|
1353
|
+
success: Ul
|
|
1354
|
+
}, Kl = ({ children: e }) => !e || Array.isArray(e) && e.filter(Boolean).length === 0 ? null : /* @__PURE__ */ n(Rs, { children: /* @__PURE__ */ n("div", { className: Bs.stack, children: e }) }), X = (e) => /* @__PURE__ */ n(et, { ...e, className: D(Bs.help, Bs[e.level]), mt: 0 });
|
|
1355
|
+
X.Stack = Kl;
|
|
1356
|
+
const Hl = "_footer_xif7g_1", Wl = "_actions_xif7g_10", Ar = {
|
|
1357
|
+
footer: Hl,
|
|
1358
|
+
actions: Wl
|
|
1352
1359
|
}, ee = ({ extra: e, className: t, children: s }) => /* @__PURE__ */ u("footer", { className: D(Ar.footer, t), children: [
|
|
1353
1360
|
e,
|
|
1354
1361
|
/* @__PURE__ */ n("div", { className: Ar.actions, children: s })
|
|
1355
|
-
] }),
|
|
1356
|
-
button:
|
|
1357
|
-
outline:
|
|
1358
|
-
sm:
|
|
1359
|
-
full:
|
|
1360
|
-
small:
|
|
1361
|
-
unpadded:
|
|
1362
|
+
] }), jl = "_button_1n7c4_1", Vl = "_outline_1n7c4_25", Gl = "_sm_1n7c4_43", Ql = "_full_1n7c4_49", Yl = "_small_1n7c4_53", Jl = "_unpadded_1n7c4_83", ft = {
|
|
1363
|
+
button: jl,
|
|
1364
|
+
outline: Vl,
|
|
1365
|
+
sm: Gl,
|
|
1366
|
+
full: Ql,
|
|
1367
|
+
small: Yl,
|
|
1368
|
+
unpadded: Jl
|
|
1362
1369
|
}, Xo = (e) => {
|
|
1363
1370
|
const { sm: t, fullWidth: s, loading: r, className: o, children: a, disabled: i, ...l } = e;
|
|
1364
1371
|
return /* @__PURE__ */ n(
|
|
@@ -1373,26 +1380,26 @@ const Kl = "_footer_xif7g_1", Hl = "_actions_xif7g_10", Ar = {
|
|
|
1373
1380
|
] }) : a
|
|
1374
1381
|
}
|
|
1375
1382
|
);
|
|
1376
|
-
},
|
|
1383
|
+
}, Zl = ({ className: e, ...t }) => /* @__PURE__ */ n(Xo, { ...t, className: D(ft.outline, e) }), Xl = ({ className: e, unpadded: t, ...s }) => /* @__PURE__ */ n("button", { ...s, className: D(ft.small, { [ft.unpadded]: t }, e) }), j = {
|
|
1377
1384
|
White: Xo,
|
|
1378
|
-
Outline:
|
|
1379
|
-
Small:
|
|
1380
|
-
},
|
|
1381
|
-
item:
|
|
1382
|
-
title:
|
|
1383
|
-
content:
|
|
1385
|
+
Outline: Zl,
|
|
1386
|
+
Small: Xl
|
|
1387
|
+
}, ed = "_item_1n572_1", td = "_title_1n572_10", nd = "_content_1n572_14", gs = {
|
|
1388
|
+
item: ed,
|
|
1389
|
+
title: td,
|
|
1390
|
+
content: nd
|
|
1384
1391
|
}, ys = ({ title: e, content: t }) => /* @__PURE__ */ u("div", { className: gs.item, children: [
|
|
1385
1392
|
/* @__PURE__ */ n("div", { className: gs.title, children: e }),
|
|
1386
1393
|
/* @__PURE__ */ n("div", { className: gs.content, children: t })
|
|
1387
1394
|
] });
|
|
1388
|
-
function
|
|
1395
|
+
function Ue(e) {
|
|
1389
1396
|
if (e && P(e).gt(0) && P(e).lt(0.01)) return "<$0.01";
|
|
1390
1397
|
const t = Xr(e, { dp: 2 });
|
|
1391
1398
|
return t ? `$${t}` : "";
|
|
1392
1399
|
}
|
|
1393
|
-
const
|
|
1394
|
-
placeholder:
|
|
1395
|
-
logo:
|
|
1400
|
+
const sd = "_placeholder_yluz4_1", rd = "_logo_yluz4_5", Tr = {
|
|
1401
|
+
placeholder: sd,
|
|
1402
|
+
logo: rd
|
|
1396
1403
|
}, H = ({ src: e, alt: t, placeholder: s, classNames: r, style: o, logo: a, ...i }) => {
|
|
1397
1404
|
const [l, c] = B(!1), { width: d, height: h } = i, m = s ?? /* @__PURE__ */ n(
|
|
1398
1405
|
"div",
|
|
@@ -1486,14 +1493,14 @@ const na = ({ metadata: e, chain: t, children: s }) => {
|
|
|
1486
1493
|
staleTime: U.INFINITY
|
|
1487
1494
|
});
|
|
1488
1495
|
return s(o);
|
|
1489
|
-
},
|
|
1490
|
-
root:
|
|
1491
|
-
title:
|
|
1492
|
-
changes:
|
|
1493
|
-
change:
|
|
1494
|
-
amount:
|
|
1495
|
-
text:
|
|
1496
|
-
value:
|
|
1496
|
+
}, od = "_root_jioyr_1", ad = "_title_jioyr_7", id = "_changes_jioyr_13", cd = "_change_jioyr_13", ld = "_amount_jioyr_34", dd = "_text_jioyr_40", ud = "_value_jioyr_47", pt = {
|
|
1497
|
+
root: od,
|
|
1498
|
+
title: ad,
|
|
1499
|
+
changes: id,
|
|
1500
|
+
change: cd,
|
|
1501
|
+
amount: ld,
|
|
1502
|
+
text: dd,
|
|
1503
|
+
value: ud
|
|
1497
1504
|
}, sa = ({ amount: e, asset: t, price: s }) => {
|
|
1498
1505
|
const { denom: r, symbol: o, decimals: a, logoUrl: i } = t, l = se(e, { decimals: a }), c = s && P(nn(e, { decimals: a })).times(s).abs();
|
|
1499
1506
|
return /* @__PURE__ */ u("div", { className: pt.change, children: [
|
|
@@ -1505,15 +1512,15 @@ const na = ({ metadata: e, chain: t, children: s }) => {
|
|
|
1505
1512
|
o || r
|
|
1506
1513
|
] })
|
|
1507
1514
|
] }),
|
|
1508
|
-
c && /* @__PURE__ */ n("div", { className: pt.value, children:
|
|
1515
|
+
c && /* @__PURE__ */ n("div", { className: pt.value, children: Ue(c) })
|
|
1509
1516
|
] });
|
|
1510
|
-
},
|
|
1517
|
+
}, hd = ({ changes: e, chain: t }) => {
|
|
1511
1518
|
const s = at(t), { data: r } = Yn(t);
|
|
1512
1519
|
return e.map(({ amount: o, denom: a }, i) => {
|
|
1513
1520
|
const l = s(a), c = r?.find(({ id: d }) => d === a)?.price;
|
|
1514
1521
|
return /* @__PURE__ */ n(sa, { amount: o, asset: l, price: c }, i);
|
|
1515
1522
|
});
|
|
1516
|
-
},
|
|
1523
|
+
}, md = ({
|
|
1517
1524
|
changes: e,
|
|
1518
1525
|
chain: t
|
|
1519
1526
|
}) => {
|
|
@@ -1523,14 +1530,14 @@ const na = ({ metadata: e, chain: t, children: s }) => {
|
|
|
1523
1530
|
return /* @__PURE__ */ n(sa, { amount: o, asset: s(l), price: c });
|
|
1524
1531
|
} }, i));
|
|
1525
1532
|
};
|
|
1526
|
-
function
|
|
1533
|
+
function _d(e, t) {
|
|
1527
1534
|
return typeof t == "bigint" ? t.toString() : t;
|
|
1528
1535
|
}
|
|
1529
|
-
const
|
|
1530
|
-
simulate: (e) => [JSON.stringify(e,
|
|
1531
|
-
}),
|
|
1532
|
-
const { initiaAddress: r, hexAddress: o } = ke(), a =
|
|
1533
|
-
queryKey:
|
|
1536
|
+
const fd = Re("interwovenkit:tx", {
|
|
1537
|
+
simulate: (e) => [JSON.stringify(e, _d)]
|
|
1538
|
+
}), pd = ({ messages: e, memo: t, chainId: s }) => {
|
|
1539
|
+
const { initiaAddress: r, hexAddress: o } = ke(), a = je(s), { simulateTx: i } = Ro(), { data: l } = ie({
|
|
1540
|
+
queryKey: fd.simulate({ messages: e, memo: t, chainId: s }).queryKey,
|
|
1534
1541
|
queryFn: () => i({ messages: e, memo: t, chainId: s }),
|
|
1535
1542
|
staleTime: U.SECOND
|
|
1536
1543
|
}), c = (_) => /* @__PURE__ */ u("div", { className: pt.root, children: [
|
|
@@ -1542,25 +1549,25 @@ const _d = Re("interwovenkit:tx", {
|
|
|
1542
1549
|
if (d.length === 0) return null;
|
|
1543
1550
|
if (a.metadata?.is_l1 || a.metadata?.minitia?.type === "minimove") {
|
|
1544
1551
|
const _ = ta(d, o), [f] = Er(_);
|
|
1545
|
-
return f.length === 0 ? null : c(/* @__PURE__ */ n(
|
|
1552
|
+
return f.length === 0 ? null : c(/* @__PURE__ */ n(md, { changes: f, chain: a }));
|
|
1546
1553
|
}
|
|
1547
1554
|
const h = ea(d, r), [m] = Er(h);
|
|
1548
|
-
return m.length === 0 ? null : c(/* @__PURE__ */ n(
|
|
1555
|
+
return m.length === 0 ? null : c(/* @__PURE__ */ n(hd, { changes: m, chain: a }));
|
|
1549
1556
|
};
|
|
1550
1557
|
function Er(e) {
|
|
1551
1558
|
return ro((t) => new P(t.amount).isNegative(), e);
|
|
1552
1559
|
}
|
|
1553
|
-
const
|
|
1554
|
-
value:
|
|
1555
|
-
trigger:
|
|
1556
|
-
icon:
|
|
1557
|
-
content:
|
|
1558
|
-
item:
|
|
1559
|
-
},
|
|
1560
|
-
const r = yt(), { txRequest: o } = Po(), a =
|
|
1560
|
+
const gd = "_value_9u3br_1", yd = "_trigger_9u3br_7", vd = "_icon_9u3br_23", wd = "_content_9u3br_32", bd = "_item_9u3br_40", Qt = {
|
|
1561
|
+
value: gd,
|
|
1562
|
+
trigger: yd,
|
|
1563
|
+
icon: vd,
|
|
1564
|
+
content: wd,
|
|
1565
|
+
item: bd
|
|
1566
|
+
}, Cd = ({ options: e, value: t, onChange: s }) => {
|
|
1567
|
+
const r = yt(), { txRequest: o } = Po(), a = je(o.chainId), i = at(a), l = ({ amount: [{ amount: f, denom: p }] }) => {
|
|
1561
1568
|
if (P(f).isZero()) return "0";
|
|
1562
|
-
const { symbol: g, decimals:
|
|
1563
|
-
return `${se(f, { decimals:
|
|
1569
|
+
const { symbol: g, decimals: b } = i(p);
|
|
1570
|
+
return `${se(f, { decimals: b })} ${g}`;
|
|
1564
1571
|
};
|
|
1565
1572
|
if (e.length === 1)
|
|
1566
1573
|
return l(e[0]);
|
|
@@ -1572,7 +1579,7 @@ const pd = "_value_9u3br_1", gd = "_trigger_9u3br_7", yd = "_icon_9u3br_23", vd
|
|
|
1572
1579
|
/* @__PURE__ */ n("span", { className: "monospace", children: se(d, { decimals: m }) }),
|
|
1573
1580
|
/* @__PURE__ */ u(Be.Trigger, { className: Qt.trigger, children: [
|
|
1574
1581
|
/* @__PURE__ */ n(Be.Value, { children: _ }),
|
|
1575
|
-
/* @__PURE__ */ n(Be.Icon, { className: Qt.icon, children: /* @__PURE__ */ n(
|
|
1582
|
+
/* @__PURE__ */ n(Be.Icon, { className: Qt.icon, children: /* @__PURE__ */ n(rt, { size: 16 }) })
|
|
1576
1583
|
] })
|
|
1577
1584
|
] }),
|
|
1578
1585
|
/* @__PURE__ */ n(Be.Portal, { container: r, children: /* @__PURE__ */ n(
|
|
@@ -1608,17 +1615,17 @@ function Pn(e) {
|
|
|
1608
1615
|
return "unknown";
|
|
1609
1616
|
}
|
|
1610
1617
|
}
|
|
1611
|
-
const
|
|
1612
|
-
container:
|
|
1613
|
-
toggle:
|
|
1614
|
-
list:
|
|
1615
|
-
arg:
|
|
1616
|
-
type:
|
|
1617
|
-
},
|
|
1618
|
+
const Nd = "_container_1xzyq_1", Id = "_toggle_1xzyq_5", Sd = "_list_1xzyq_11", kd = "_arg_1xzyq_16", xd = "_type_1xzyq_21", Yt = {
|
|
1619
|
+
container: Nd,
|
|
1620
|
+
toggle: Id,
|
|
1621
|
+
list: Sd,
|
|
1622
|
+
arg: kd,
|
|
1623
|
+
type: xd
|
|
1624
|
+
}, $d = Re("interwovenkit:move", {
|
|
1618
1625
|
abi: (e, t, s, r) => [e, t, s, r]
|
|
1619
|
-
}),
|
|
1620
|
-
const [r, o] = Qs(!1), { restUrl: a } =
|
|
1621
|
-
queryKey:
|
|
1626
|
+
}), Ad = ({ type: e, arg: t }) => Pn(Qa(e).parse(t)), Td = ({ msg: e, chainId: t, fallback: s }) => {
|
|
1627
|
+
const [r, o] = Qs(!1), { restUrl: a } = je(t), { moduleAddress: i, moduleName: l, functionName: c, args: d } = e, { data: h } = he({
|
|
1628
|
+
queryKey: $d.abi(a, i, l, c).queryKey,
|
|
1622
1629
|
queryFn: async () => {
|
|
1623
1630
|
const _ = await te.create({ prefixUrl: a }).get(`initia/move/v1/accounts/${i}/modules/${l}`).json(), p = JSON.parse(_.module.abi).exposed_functions.find(({ name: g }) => g === c);
|
|
1624
1631
|
if (!p)
|
|
@@ -1632,59 +1639,59 @@ const Cd = "_container_1xzyq_1", Nd = "_toggle_1xzyq_5", Id = "_list_1xzyq_11",
|
|
|
1632
1639
|
const p = h[f];
|
|
1633
1640
|
return /* @__PURE__ */ u("div", { className: Yt.arg, children: [
|
|
1634
1641
|
/* @__PURE__ */ n("div", { className: Yt.type, children: p }),
|
|
1635
|
-
/* @__PURE__ */ n(uo, { fallback: /* @__PURE__ */ n("div", { className: "error", children: "Error decoding argument" }), children: /* @__PURE__ */ n(
|
|
1642
|
+
/* @__PURE__ */ n(uo, { fallback: /* @__PURE__ */ n("div", { className: "error", children: "Error decoding argument" }), children: /* @__PURE__ */ n(Ad, { type: p, arg: _ }) })
|
|
1636
1643
|
] }, f);
|
|
1637
1644
|
};
|
|
1638
1645
|
return /* @__PURE__ */ u("div", { className: Yt.container, children: [
|
|
1639
|
-
/* @__PURE__ */ n(
|
|
1646
|
+
/* @__PURE__ */ n(j.Small, { className: Yt.toggle, onClick: o, disabled: !h, children: r ? "Encode" : "Decode" }),
|
|
1640
1647
|
r ? /* @__PURE__ */ n("div", { className: Yt.list, children: d.map(m) }) : s
|
|
1641
1648
|
] });
|
|
1642
|
-
},
|
|
1643
|
-
list:
|
|
1644
|
-
key:
|
|
1645
|
-
value:
|
|
1646
|
-
},
|
|
1649
|
+
}, Ed = "_list_r67rl_1", Dd = "_key_r67rl_8", qd = "_value_r67rl_13", vs = {
|
|
1650
|
+
list: Ed,
|
|
1651
|
+
key: Dd,
|
|
1652
|
+
value: qd
|
|
1653
|
+
}, Pd = ({ message: e, chainId: t }) => {
|
|
1647
1654
|
const { typeUrl: s, value: r } = e;
|
|
1648
1655
|
return /* @__PURE__ */ n("div", { className: vs.list, children: Object.entries(r).map(([o, a]) => /* @__PURE__ */ u("div", { children: [
|
|
1649
1656
|
/* @__PURE__ */ n("div", { className: vs.key, children: o }),
|
|
1650
|
-
/* @__PURE__ */ n("div", { className: vs.value, children: s === "/initia.move.v1.MsgExecute" && o === "args" ? /* @__PURE__ */ n(
|
|
1657
|
+
/* @__PURE__ */ n("div", { className: vs.value, children: s === "/initia.move.v1.MsgExecute" && o === "args" ? /* @__PURE__ */ n(Td, { msg: r, chainId: t, fallback: Pn(a) }) : Pn(a) })
|
|
1651
1658
|
] }, o)) });
|
|
1652
|
-
},
|
|
1653
|
-
title:
|
|
1654
|
-
meta:
|
|
1655
|
-
footer:
|
|
1659
|
+
}, Rd = "_title_kspdu_1", Bd = "_meta_kspdu_7", Od = "_footer_kspdu_14", ws = {
|
|
1660
|
+
title: Rd,
|
|
1661
|
+
meta: Bd,
|
|
1662
|
+
footer: Od
|
|
1656
1663
|
}, ra = () => {
|
|
1657
|
-
const { txRequest: e, resolve: t, reject: s } = Po(), { messages: r, memo: o, chainId: a, gas: i, gasAdjustment: l, spendCoins: c } = e, d = re(), h = zt(), m = or(), _ =
|
|
1658
|
-
({ amount: y, denom:
|
|
1659
|
-
),
|
|
1660
|
-
const
|
|
1661
|
-
if (
|
|
1662
|
-
const
|
|
1663
|
-
return P(
|
|
1664
|
+
const { txRequest: e, resolve: t, reject: s } = Po(), { messages: r, memo: o, chainId: a, gas: i, gasAdjustment: l, spendCoins: c } = e, d = re(), h = zt(), m = or(), _ = je(a), f = ir(_), p = Jo(_), g = Zo(_), b = (e.gasPrices ?? p).map(
|
|
1665
|
+
({ amount: y, denom: C }) => to(Math.ceil(i * l), no.fromString(y + C))
|
|
1666
|
+
), k = b.map((y) => y.amount[0]), S = (y) => {
|
|
1667
|
+
const C = f.find((N) => N.denom === y)?.amount ?? 0, v = k.find((N) => N.denom === y)?.amount ?? 0, A = c.filter((N) => N.denom === y).reduce((N, R) => P(N).plus(R.amount), P(0));
|
|
1668
|
+
if (A.gt(0)) {
|
|
1669
|
+
const N = P(v).plus(A);
|
|
1670
|
+
return P(C).gte(N);
|
|
1664
1671
|
}
|
|
1665
|
-
return P(
|
|
1672
|
+
return P(C).gte(v);
|
|
1666
1673
|
}, $ = () => {
|
|
1667
1674
|
if (g && S(g))
|
|
1668
1675
|
return g;
|
|
1669
|
-
for (const { denom: y } of
|
|
1676
|
+
for (const { denom: y } of k)
|
|
1670
1677
|
if (S(y))
|
|
1671
1678
|
return y;
|
|
1672
|
-
return
|
|
1673
|
-
}, [w,
|
|
1679
|
+
return k[0]?.denom;
|
|
1680
|
+
}, [w, T] = B($), { mutate: q, isPending: E } = Ke({
|
|
1674
1681
|
mutationKey: [Do],
|
|
1675
1682
|
mutationFn: async () => {
|
|
1676
|
-
const y =
|
|
1683
|
+
const y = b.find((v) => v.amount[0].denom === w);
|
|
1677
1684
|
if (!y) throw new Error("Fee not found");
|
|
1678
1685
|
if (!h) throw new Error("Signer not initialized");
|
|
1679
|
-
const
|
|
1680
|
-
await t(
|
|
1686
|
+
const C = await m(a, d, r, y, o);
|
|
1687
|
+
await t(C);
|
|
1681
1688
|
},
|
|
1682
1689
|
onError: async (y) => {
|
|
1683
|
-
s(
|
|
1690
|
+
s(y);
|
|
1684
1691
|
}
|
|
1685
|
-
}),
|
|
1692
|
+
}), I = !S(w);
|
|
1686
1693
|
return /* @__PURE__ */ u(K, { children: [
|
|
1687
|
-
/* @__PURE__ */ u(
|
|
1694
|
+
/* @__PURE__ */ u(Ge, { children: [
|
|
1688
1695
|
/* @__PURE__ */ n("h1", { className: ws.title, children: "Confirm tx" }),
|
|
1689
1696
|
/* @__PURE__ */ u("div", { className: ws.meta, children: [
|
|
1690
1697
|
/* @__PURE__ */ n(ys, { title: "Chain", content: a }),
|
|
@@ -1692,28 +1699,28 @@ const Cd = "_container_1xzyq_1", Nd = "_toggle_1xzyq_5", Id = "_list_1xzyq_11",
|
|
|
1692
1699
|
ys,
|
|
1693
1700
|
{
|
|
1694
1701
|
title: "Tx fee",
|
|
1695
|
-
content: /* @__PURE__ */ n(
|
|
1702
|
+
content: /* @__PURE__ */ n(Cd, { options: b, value: w, onChange: T })
|
|
1696
1703
|
}
|
|
1697
1704
|
),
|
|
1698
1705
|
o && /* @__PURE__ */ n(ys, { title: "Memo", content: o }),
|
|
1699
|
-
|
|
1706
|
+
I && /* @__PURE__ */ n(X, { level: "error", children: "Insufficient balance for fee" })
|
|
1700
1707
|
] }),
|
|
1701
|
-
/* @__PURE__ */ n(
|
|
1708
|
+
/* @__PURE__ */ n(pd, { messages: r, memo: o, chainId: a }),
|
|
1702
1709
|
/* @__PURE__ */ n(
|
|
1703
|
-
|
|
1710
|
+
$l,
|
|
1704
1711
|
{
|
|
1705
1712
|
list: r,
|
|
1706
1713
|
renderHeader: ({ typeUrl: y }) => er(y.split(".").pop().replace(/^Msg/, "")),
|
|
1707
|
-
renderContent: (y) => /* @__PURE__ */ n(
|
|
1714
|
+
renderContent: (y) => /* @__PURE__ */ n(Pd, { message: y, chainId: a })
|
|
1708
1715
|
}
|
|
1709
1716
|
)
|
|
1710
1717
|
] }),
|
|
1711
1718
|
/* @__PURE__ */ u(ee, { className: ws.footer, children: [
|
|
1712
|
-
/* @__PURE__ */ n(
|
|
1713
|
-
/* @__PURE__ */ n(
|
|
1719
|
+
/* @__PURE__ */ n(j.Outline, { onClick: () => s(new Error("User rejected")), disabled: E, children: "Reject" }),
|
|
1720
|
+
/* @__PURE__ */ n(j.White, { onClick: () => q(), disabled: I, loading: E, children: "Approve" })
|
|
1714
1721
|
] })
|
|
1715
1722
|
] });
|
|
1716
|
-
},
|
|
1723
|
+
}, Ld = ({ children: e }) => {
|
|
1717
1724
|
const [{ title: t, content: s, path: r }, o] = B({}), [a, i] = B(!1), l = js(es), c = J((m) => {
|
|
1718
1725
|
o(m), i(!0);
|
|
1719
1726
|
}, []), d = J(() => {
|
|
@@ -1736,7 +1743,7 @@ const Cd = "_container_1xzyq_1", Nd = "_toggle_1xzyq_5", Id = "_list_1xzyq_11",
|
|
|
1736
1743
|
}
|
|
1737
1744
|
)
|
|
1738
1745
|
] });
|
|
1739
|
-
},
|
|
1746
|
+
}, Md = () => ($c(), Ac(), null);
|
|
1740
1747
|
function ns() {
|
|
1741
1748
|
return Oi("(max-width: 576px)");
|
|
1742
1749
|
}
|
|
@@ -1745,13 +1752,13 @@ function oa() {
|
|
|
1745
1752
|
const e = document.querySelector(Os) || document.body.appendChild(document.createElement(Os));
|
|
1746
1753
|
return e.shadowRoot || e.attachShadow({ mode: "open" });
|
|
1747
1754
|
}
|
|
1748
|
-
function
|
|
1755
|
+
function Fd() {
|
|
1749
1756
|
const { theme: e, container: t } = le();
|
|
1750
1757
|
return M(() => {
|
|
1751
1758
|
document.querySelector(Os)?.setAttribute("data-theme", e);
|
|
1752
1759
|
}, [e]), t ?? oa();
|
|
1753
1760
|
}
|
|
1754
|
-
function
|
|
1761
|
+
function Tv(e) {
|
|
1755
1762
|
const t = oa(), s = document.createElement("style");
|
|
1756
1763
|
s.textContent = e, t.appendChild(s);
|
|
1757
1764
|
}
|
|
@@ -1776,20 +1783,20 @@ const vt = ({ title: e, content: t, children: s, className: r }) => {
|
|
|
1776
1783
|
} catch {
|
|
1777
1784
|
}
|
|
1778
1785
|
}, copied: s });
|
|
1779
|
-
},
|
|
1780
|
-
root:
|
|
1781
|
-
address:
|
|
1782
|
-
copy:
|
|
1783
|
-
labelWrapper:
|
|
1784
|
-
labelCopy:
|
|
1785
|
-
labelCopied:
|
|
1786
|
-
copied:
|
|
1787
|
-
derived:
|
|
1788
|
-
derivedLabel:
|
|
1789
|
-
derivedAddress:
|
|
1790
|
-
hexAddress:
|
|
1791
|
-
derivedCopy:
|
|
1792
|
-
},
|
|
1786
|
+
}, zd = "_root_19tvg_1", Ud = "_address_19tvg_9", Kd = "_copy_19tvg_19", Hd = "_labelWrapper_19tvg_33", Wd = "_labelCopy_19tvg_43", jd = "_labelCopied_19tvg_47", Vd = "_copied_19tvg_55", Gd = "_derived_19tvg_65", Qd = "_derivedLabel_19tvg_78", Yd = "_derivedAddress_19tvg_82", Jd = "_hexAddress_19tvg_88", Zd = "_derivedCopy_19tvg_93", oe = {
|
|
1787
|
+
root: zd,
|
|
1788
|
+
address: Ud,
|
|
1789
|
+
copy: Kd,
|
|
1790
|
+
labelWrapper: Hd,
|
|
1791
|
+
labelCopy: Wd,
|
|
1792
|
+
labelCopied: jd,
|
|
1793
|
+
copied: Vd,
|
|
1794
|
+
derived: Gd,
|
|
1795
|
+
derivedLabel: Qd,
|
|
1796
|
+
derivedAddress: Yd,
|
|
1797
|
+
hexAddress: Jd,
|
|
1798
|
+
derivedCopy: Zd
|
|
1799
|
+
}, Xd = () => {
|
|
1793
1800
|
const e = Se(null), t = Se(null), { initiaAddress: s, hexAddress: r } = ke(), o = jo("--gray-0");
|
|
1794
1801
|
return M(() => {
|
|
1795
1802
|
e.current && (t.current ? t.current.update({
|
|
@@ -1827,19 +1834,19 @@ const vt = ({ title: e, content: t, children: s, className: r }) => {
|
|
|
1827
1834
|
] })
|
|
1828
1835
|
] }) })
|
|
1829
1836
|
] });
|
|
1830
|
-
},
|
|
1831
|
-
header:
|
|
1832
|
-
account:
|
|
1833
|
-
name:
|
|
1834
|
-
address:
|
|
1835
|
-
icon:
|
|
1836
|
-
copied:
|
|
1837
|
-
button:
|
|
1838
|
-
qr:
|
|
1839
|
-
disconnect:
|
|
1840
|
-
label:
|
|
1841
|
-
expanded:
|
|
1842
|
-
},
|
|
1837
|
+
}, eu = "_header_1cvtq_1", tu = "_account_1cvtq_16", nu = "_name_1cvtq_27", su = "_address_1cvtq_31", ru = "_icon_1cvtq_35", ou = "_copied_1cvtq_42", au = "_button_1cvtq_57", iu = "_qr_1cvtq_68", cu = "_disconnect_1cvtq_72", lu = "_label_1cvtq_82", du = "_expanded_1cvtq_90", pe = {
|
|
1838
|
+
header: eu,
|
|
1839
|
+
account: tu,
|
|
1840
|
+
name: nu,
|
|
1841
|
+
address: su,
|
|
1842
|
+
icon: ru,
|
|
1843
|
+
copied: ou,
|
|
1844
|
+
button: au,
|
|
1845
|
+
qr: iu,
|
|
1846
|
+
disconnect: cu,
|
|
1847
|
+
label: lu,
|
|
1848
|
+
expanded: du
|
|
1849
|
+
}, uu = () => {
|
|
1843
1850
|
const e = cn(), { connector: t } = Mt(), s = Eo(), { address: r, username: o } = ke(), a = o ?? r, [i, l] = B(!1), c = Se(null), d = Js({
|
|
1844
1851
|
width: i ? 140 : 52,
|
|
1845
1852
|
config: { tension: 500, friction: 30, clamp: !0 }
|
|
@@ -1866,7 +1873,7 @@ const vt = ({ title: e, content: t, children: s, className: r }) => {
|
|
|
1866
1873
|
vt,
|
|
1867
1874
|
{
|
|
1868
1875
|
title: "Initia address",
|
|
1869
|
-
content: () => /* @__PURE__ */ n(
|
|
1876
|
+
content: () => /* @__PURE__ */ n(Xd, {}),
|
|
1870
1877
|
className: D(pe.button, pe.qr),
|
|
1871
1878
|
children: /* @__PURE__ */ n(Hi, { size: 16 })
|
|
1872
1879
|
}
|
|
@@ -1887,20 +1894,20 @@ const vt = ({ title: e, content: t, children: s, className: r }) => {
|
|
|
1887
1894
|
)
|
|
1888
1895
|
] }) : null;
|
|
1889
1896
|
};
|
|
1890
|
-
function
|
|
1897
|
+
function hu(e) {
|
|
1891
1898
|
return /^[A-F0-9]{64}$/i.test(e);
|
|
1892
1899
|
}
|
|
1893
|
-
function
|
|
1900
|
+
function mu(e, t) {
|
|
1894
1901
|
const { txHash: s, accountAddress: r, pathSuffix: o } = t;
|
|
1895
1902
|
if (s)
|
|
1896
|
-
return
|
|
1903
|
+
return hu(s) ? De(["explorers", 0, "tx_page"], e)?.replace(/\$\{txHash\}/g, s) : void 0;
|
|
1897
1904
|
if (r) {
|
|
1898
1905
|
if (!z.validate(r)) return;
|
|
1899
1906
|
const i = De(["explorers", 0, "account_page"], e)?.replace(/\$\{accountAddress\}/g, r);
|
|
1900
1907
|
return i && o ? i + o : i;
|
|
1901
1908
|
}
|
|
1902
1909
|
}
|
|
1903
|
-
function
|
|
1910
|
+
function _u(e) {
|
|
1904
1911
|
try {
|
|
1905
1912
|
const t = new URL(e, window.location.href);
|
|
1906
1913
|
if (!["http:", "https:"].includes(t.protocol))
|
|
@@ -1910,15 +1917,15 @@ function mu(e) {
|
|
|
1910
1917
|
return "#";
|
|
1911
1918
|
}
|
|
1912
1919
|
}
|
|
1913
|
-
const
|
|
1914
|
-
link:
|
|
1920
|
+
const fu = "_link_guafb_1", Dr = {
|
|
1921
|
+
link: fu
|
|
1915
1922
|
}, ss = ({ chainId: e, txHash: t, accountAddress: s, pathSuffix: r, ...o }) => {
|
|
1916
|
-
const { showIcon: a, className: i, children: l, onClick: c, ...d } = o, h =
|
|
1923
|
+
const { showIcon: a, className: i, children: l, onClick: c, ...d } = o, h = je(e), m = mu(h, { txHash: t, accountAddress: s, pathSuffix: r }), _ = t ? we(t) : s ? we(s) : "", f = l ?? _;
|
|
1917
1924
|
return m ? /* @__PURE__ */ u(
|
|
1918
1925
|
"a",
|
|
1919
1926
|
{
|
|
1920
1927
|
...d,
|
|
1921
|
-
href: nc(
|
|
1928
|
+
href: nc(_u(m)),
|
|
1922
1929
|
className: D(Dr.link, i),
|
|
1923
1930
|
onClick: c,
|
|
1924
1931
|
target: "_blank",
|
|
@@ -1928,7 +1935,7 @@ const _u = "_link_guafb_1", Dr = {
|
|
|
1928
1935
|
]
|
|
1929
1936
|
}
|
|
1930
1937
|
) : /* @__PURE__ */ n("span", { ...d, className: D(Dr.link, i), children: f });
|
|
1931
|
-
},
|
|
1938
|
+
}, pu = () => {
|
|
1932
1939
|
const [e, t] = Me(qo), { showNotification: s, updateNotification: r, hideNotification: o } = hr();
|
|
1933
1940
|
return M(() => {
|
|
1934
1941
|
if (!e) return;
|
|
@@ -1958,15 +1965,15 @@ const _u = "_link_guafb_1", Dr = {
|
|
|
1958
1965
|
}
|
|
1959
1966
|
}, [e, t, s, r, o]), null;
|
|
1960
1967
|
};
|
|
1961
|
-
function
|
|
1968
|
+
function gu() {
|
|
1962
1969
|
return Li(), null;
|
|
1963
1970
|
}
|
|
1964
|
-
const
|
|
1965
|
-
overlay:
|
|
1966
|
-
content:
|
|
1967
|
-
inner:
|
|
1968
|
-
},
|
|
1969
|
-
const { isDrawerOpen: t, closeDrawer: s } = Ut(), { setContainer: r } =
|
|
1971
|
+
const yu = "_overlay_1dhd9_1", vu = "_content_1dhd9_27", wu = "_inner_1dhd9_58", bs = {
|
|
1972
|
+
overlay: yu,
|
|
1973
|
+
content: vu,
|
|
1974
|
+
inner: wu
|
|
1975
|
+
}, bu = ({ children: e }) => {
|
|
1976
|
+
const { isDrawerOpen: t, closeDrawer: s } = Ut(), { setContainer: r } = We(ur), o = ns(), a = Fd(), i = js(es), l = Ka({ mutationKey: [Do] }), c = () => {
|
|
1970
1977
|
const f = l ? "User exited before response arrived. Transaction may succeed or fail." : "User rejected";
|
|
1971
1978
|
s(), i?.reject(new Error(f));
|
|
1972
1979
|
}, d = Gn(), h = ce(), m = wt(), _ = {
|
|
@@ -1974,9 +1981,9 @@ const gu = "_overlay_1dhd9_1", yu = "_content_1dhd9_27", vu = "_inner_1dhd9_58",
|
|
|
1974
1981
|
const g = () => {
|
|
1975
1982
|
d === "/bridge" && (localStorage.removeItem(O.BRIDGE_SRC_CHAIN_ID), localStorage.removeItem(O.BRIDGE_SRC_DENOM), localStorage.removeItem(O.BRIDGE_DST_CHAIN_ID), localStorage.removeItem(O.BRIDGE_DST_DENOM)), h("/"), m.clear(), p();
|
|
1976
1983
|
};
|
|
1977
|
-
return /* @__PURE__ */ u(
|
|
1984
|
+
return /* @__PURE__ */ u(Ge, { children: [
|
|
1978
1985
|
/* @__PURE__ */ n(Y, { error: !0, children: f.message }),
|
|
1979
|
-
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
1986
|
+
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(j.White, { onClick: g, children: "Retry" }) })
|
|
1980
1987
|
] });
|
|
1981
1988
|
}
|
|
1982
1989
|
};
|
|
@@ -1992,37 +1999,37 @@ const gu = "_overlay_1dhd9_1", yu = "_content_1dhd9_27", vu = "_inner_1dhd9_58",
|
|
|
1992
1999
|
/* @__PURE__ */ n("path", { d: "M0.028 14.04 l 6.028 -6.028 L0.028 1.984 L1.43 .582 l 7.43 7.43 l -7.43 7.43 L0.028 14.04 Z" })
|
|
1993
2000
|
] }) }),
|
|
1994
2001
|
/* @__PURE__ */ n(Ie.Popup, { className: bs.content, children: /* @__PURE__ */ u("div", { className: D(bs.inner, "body"), ref: r, children: [
|
|
1995
|
-
o && /* @__PURE__ */ n(
|
|
1996
|
-
/* @__PURE__ */ n(
|
|
1997
|
-
/* @__PURE__ */ n(
|
|
2002
|
+
o && /* @__PURE__ */ n(gu, {}),
|
|
2003
|
+
/* @__PURE__ */ n(pu, {}),
|
|
2004
|
+
/* @__PURE__ */ n(uu, {}),
|
|
1998
2005
|
/* @__PURE__ */ n(me, { errorBoundaryProps: _, children: e })
|
|
1999
2006
|
] }) })
|
|
2000
2007
|
] })
|
|
2001
2008
|
}
|
|
2002
2009
|
);
|
|
2003
|
-
},
|
|
2004
|
-
page:
|
|
2005
|
-
title:
|
|
2006
|
-
scrollable:
|
|
2007
|
-
list:
|
|
2008
|
-
item:
|
|
2009
|
-
name:
|
|
2010
|
-
dimmed:
|
|
2011
|
-
recent:
|
|
2012
|
-
installed:
|
|
2013
|
-
},
|
|
2010
|
+
}, Cu = "_page_1f6wh_1", Nu = "_title_1f6wh_10", Iu = "_scrollable_1f6wh_17", Su = "_list_1f6wh_22", ku = "_item_1f6wh_32", xu = "_name_1f6wh_56", $u = "_dimmed_1f6wh_64", Au = "_recent_1f6wh_68", Tu = "_installed_1f6wh_69", Ce = {
|
|
2011
|
+
page: Cu,
|
|
2012
|
+
title: Nu,
|
|
2013
|
+
scrollable: Iu,
|
|
2014
|
+
list: Su,
|
|
2015
|
+
item: ku,
|
|
2016
|
+
name: xu,
|
|
2017
|
+
dimmed: $u,
|
|
2018
|
+
recent: Au,
|
|
2019
|
+
installed: Tu
|
|
2020
|
+
}, Eu = [
|
|
2014
2021
|
{ name: "Rabby", url: "https://rabby.io" },
|
|
2015
2022
|
{ name: "Phantom", url: "https://phantom.com" },
|
|
2016
2023
|
{ name: "Keplr", url: "https://keplr.app" },
|
|
2017
2024
|
{ name: "Leap", url: "https://leapwallet.io" }
|
|
2018
2025
|
], qr = ({ onSuccess: e }) => {
|
|
2019
|
-
const { connectors: t, connectAsync: s } = Ma(), r = Mi("wagmi.recentConnectorId"), [o, a] = B(null), { mutate: i, isPending: l } =
|
|
2026
|
+
const { connectors: t, connectAsync: s } = Ma(), r = Mi("wagmi.recentConnectorId"), [o, a] = B(null), { mutate: i, isPending: l } = Ke({
|
|
2020
2027
|
mutationFn: async (c) => {
|
|
2021
2028
|
a(c.id);
|
|
2022
2029
|
try {
|
|
2023
2030
|
await s({ connector: c });
|
|
2024
2031
|
} catch (d) {
|
|
2025
|
-
throw
|
|
2032
|
+
throw await Fe(d);
|
|
2026
2033
|
}
|
|
2027
2034
|
},
|
|
2028
2035
|
onSettled: () => {
|
|
@@ -2034,8 +2041,8 @@ const gu = "_overlay_1dhd9_1", yu = "_content_1dhd9_27", vu = "_inner_1dhd9_58",
|
|
|
2034
2041
|
});
|
|
2035
2042
|
return /* @__PURE__ */ u("div", { className: Ce.page, children: [
|
|
2036
2043
|
/* @__PURE__ */ n("h1", { className: Ce.title, children: "Connect wallet" }),
|
|
2037
|
-
/* @__PURE__ */ n(
|
|
2038
|
-
t.toSorted(
|
|
2044
|
+
/* @__PURE__ */ n(Ge, { className: Ce.scrollable, children: /* @__PURE__ */ u("div", { className: Ce.list, children: [
|
|
2045
|
+
t.toSorted(G((c) => c.id === r)).map((c) => {
|
|
2039
2046
|
const { name: d, icon: h, id: m } = c;
|
|
2040
2047
|
return /* @__PURE__ */ u(
|
|
2041
2048
|
"button",
|
|
@@ -2052,7 +2059,7 @@ const gu = "_overlay_1dhd9_1", yu = "_content_1dhd9_27", vu = "_inner_1dhd9_58",
|
|
|
2052
2059
|
m
|
|
2053
2060
|
);
|
|
2054
2061
|
}),
|
|
2055
|
-
|
|
2062
|
+
Eu.filter(({ name: c }) => !t.some((d) => d.name.includes(c))).map(({ name: c, url: d }) => {
|
|
2056
2063
|
const h = `https://assets.initia.xyz/images/wallets/${c}.webp`;
|
|
2057
2064
|
return /* @__PURE__ */ u("a", { href: d, className: Ce.item, target: "_blank", children: [
|
|
2058
2065
|
/* @__PURE__ */ n(H, { src: h, width: 24, height: 24 }),
|
|
@@ -2062,36 +2069,36 @@ const gu = "_overlay_1dhd9_1", yu = "_content_1dhd9_27", vu = "_inner_1dhd9_58",
|
|
|
2062
2069
|
})
|
|
2063
2070
|
] }) })
|
|
2064
2071
|
] });
|
|
2065
|
-
},
|
|
2066
|
-
root:
|
|
2067
|
-
header:
|
|
2068
|
-
title:
|
|
2069
|
-
warning:
|
|
2070
|
-
content:
|
|
2071
|
-
footer:
|
|
2072
|
-
secondary:
|
|
2072
|
+
}, Du = "_root_xwz5z_1", qu = "_header_xwz5z_6", Pu = "_title_xwz5z_12", Ru = "_warning_xwz5z_18", Bu = "_content_xwz5z_22", Ou = "_footer_xwz5z_26", Lu = "_secondary_xwz5z_36", dt = {
|
|
2073
|
+
root: Du,
|
|
2074
|
+
header: qu,
|
|
2075
|
+
title: Pu,
|
|
2076
|
+
warning: Ru,
|
|
2077
|
+
content: Bu,
|
|
2078
|
+
footer: Ou,
|
|
2079
|
+
secondary: Lu
|
|
2073
2080
|
}, aa = (e) => {
|
|
2074
2081
|
const { type: t, icon: s, title: r, children: o, primaryButton: a, secondaryButton: i } = e;
|
|
2075
|
-
return /* @__PURE__ */ u(
|
|
2082
|
+
return /* @__PURE__ */ u(Ge, { className: dt.root, children: [
|
|
2076
2083
|
/* @__PURE__ */ u("header", { className: D(dt.header, t && dt[t]), children: [
|
|
2077
2084
|
s,
|
|
2078
2085
|
/* @__PURE__ */ n("h1", { className: dt.title, children: r })
|
|
2079
2086
|
] }),
|
|
2080
2087
|
/* @__PURE__ */ n("div", { className: dt.content, children: o }),
|
|
2081
2088
|
/* @__PURE__ */ u("footer", { className: dt.footer, children: [
|
|
2082
|
-
/* @__PURE__ */ n(
|
|
2089
|
+
/* @__PURE__ */ n(j.White, { onClick: a.onClick, sm: !0, fullWidth: !0, children: a.label }),
|
|
2083
2090
|
/* @__PURE__ */ u("button", { className: dt.secondary, onClick: i.onClick, children: [
|
|
2084
2091
|
/* @__PURE__ */ n("span", { children: i.label }),
|
|
2085
2092
|
/* @__PURE__ */ n(mo, { size: 14 })
|
|
2086
2093
|
] })
|
|
2087
2094
|
] })
|
|
2088
2095
|
] });
|
|
2089
|
-
},
|
|
2090
|
-
list:
|
|
2091
|
-
row:
|
|
2092
|
-
dt:
|
|
2093
|
-
asset:
|
|
2094
|
-
},
|
|
2096
|
+
}, Mu = "_list_tmcxc_1", Fu = "_row_tmcxc_8", zu = "_dt_tmcxc_19", Uu = "_asset_tmcxc_25", yn = {
|
|
2097
|
+
list: Mu,
|
|
2098
|
+
row: Fu,
|
|
2099
|
+
dt: zu,
|
|
2100
|
+
asset: Uu
|
|
2101
|
+
}, Ku = ({ list: e, onNavigate: t, onDismiss: s }) => {
|
|
2095
2102
|
const r = be(), o = ot(), a = at(r);
|
|
2096
2103
|
return /* @__PURE__ */ n(
|
|
2097
2104
|
aa,
|
|
@@ -2119,9 +2126,9 @@ const gu = "_overlay_1dhd9_1", yu = "_content_1dhd9_27", vu = "_inner_1dhd9_58",
|
|
|
2119
2126
|
function Cs(e, t) {
|
|
2120
2127
|
return e.chainId === t.chainId && e.txHash === t.txHash;
|
|
2121
2128
|
}
|
|
2122
|
-
const vn = ({ chainId: e, txHash: t }) => `${O.OP_REMINDER}:${e}:${t}`,
|
|
2129
|
+
const vn = ({ chainId: e, txHash: t }) => `${O.OP_REMINDER}:${e}:${t}`, Hu = oc(O.OP_REMINDER, []);
|
|
2123
2130
|
function Kt() {
|
|
2124
|
-
const e = re(), [t = [], s] = Me(
|
|
2131
|
+
const e = re(), [t = [], s] = Me(Hu), r = F(() => t.map((c) => {
|
|
2125
2132
|
const d = localStorage.getItem(vn(c));
|
|
2126
2133
|
return d ? JSON.parse(d) : null;
|
|
2127
2134
|
}).filter((c) => {
|
|
@@ -2167,20 +2174,20 @@ function ia() {
|
|
|
2167
2174
|
o(c, { ...c, dismissed: !0 });
|
|
2168
2175
|
};
|
|
2169
2176
|
t({
|
|
2170
|
-
content: Es(
|
|
2177
|
+
content: Es(Ku, { list: a, onNavigate: i, onDismiss: l })
|
|
2171
2178
|
});
|
|
2172
2179
|
}, [r, s, e, t, o]);
|
|
2173
2180
|
}
|
|
2174
|
-
const ca =
|
|
2181
|
+
const ca = st(null);
|
|
2175
2182
|
function la() {
|
|
2176
|
-
return
|
|
2177
|
-
}
|
|
2178
|
-
const
|
|
2179
|
-
root:
|
|
2180
|
-
label:
|
|
2181
|
-
input:
|
|
2182
|
-
hasValue:
|
|
2183
|
-
clear:
|
|
2183
|
+
return We(ca);
|
|
2184
|
+
}
|
|
2185
|
+
const Wu = "_root_7yxgy_1", ju = "_label_7yxgy_7", Vu = "_input_7yxgy_19", Gu = "_hasValue_7yxgy_29", Qu = "_clear_7yxgy_33", Jt = {
|
|
2186
|
+
root: Wu,
|
|
2187
|
+
label: ju,
|
|
2188
|
+
input: Vu,
|
|
2189
|
+
hasValue: Gu,
|
|
2190
|
+
clear: Qu
|
|
2184
2191
|
}, rs = (e) => {
|
|
2185
2192
|
const { rootClassName: t, padding: s = 16, iconSize: r = 16, onClear: o, ref: a, ...i } = e;
|
|
2186
2193
|
return /* @__PURE__ */ u(
|
|
@@ -2218,14 +2225,14 @@ const Hu = "_root_7yxgy_1", Wu = "_label_7yxgy_7", ju = "_input_7yxgy_19", Vu =
|
|
|
2218
2225
|
]
|
|
2219
2226
|
}
|
|
2220
2227
|
);
|
|
2221
|
-
},
|
|
2222
|
-
container:
|
|
2223
|
-
controls:
|
|
2224
|
-
search:
|
|
2225
|
-
},
|
|
2226
|
-
Root:
|
|
2227
|
-
Controls:
|
|
2228
|
-
SearchInput:
|
|
2228
|
+
}, Yu = "_container_t1267_1", Ju = "_controls_t1267_7", Zu = "_search_t1267_13", mr = {
|
|
2229
|
+
container: Yu,
|
|
2230
|
+
controls: Ju,
|
|
2231
|
+
search: Zu
|
|
2232
|
+
}, Xu = ({ children: e }) => /* @__PURE__ */ n("div", { className: mr.container, children: e }), eh = ({ children: e }) => /* @__PURE__ */ n("div", { className: mr.controls, children: e }), th = (e) => /* @__PURE__ */ n(rs, { ...e, rootClassName: mr.search }), tt = {
|
|
2233
|
+
Root: Xu,
|
|
2234
|
+
Controls: eh,
|
|
2235
|
+
SearchInput: th
|
|
2229
2236
|
};
|
|
2230
2237
|
function un() {
|
|
2231
2238
|
const e = Se(null), t = ns();
|
|
@@ -2233,22 +2240,22 @@ function un() {
|
|
|
2233
2240
|
t || e.current?.focus();
|
|
2234
2241
|
}, [t]), e;
|
|
2235
2242
|
}
|
|
2236
|
-
const
|
|
2237
|
-
trigger:
|
|
2238
|
-
icon:
|
|
2239
|
-
full:
|
|
2240
|
-
triggerContent:
|
|
2241
|
-
triggerText:
|
|
2242
|
-
popoverBackdrop:
|
|
2243
|
-
popoverPositioner:
|
|
2244
|
-
popoverPopup:
|
|
2245
|
-
search:
|
|
2246
|
-
viewport:
|
|
2247
|
-
item:
|
|
2248
|
-
highlighted:
|
|
2249
|
-
itemContent:
|
|
2243
|
+
const nh = "_trigger_386xl_1", sh = "_icon_386xl_21", rh = "_full_386xl_25", oh = "_triggerContent_386xl_30", ah = "_triggerText_386xl_38", ih = "_popoverBackdrop_386xl_49", ch = "_popoverPositioner_386xl_84", lh = "_popoverPopup_386xl_88", dh = "_search_386xl_131", uh = "_viewport_386xl_136", hh = "_item_386xl_141", mh = "_highlighted_386xl_155", _h = "_itemContent_386xl_160", ae = {
|
|
2244
|
+
trigger: nh,
|
|
2245
|
+
icon: sh,
|
|
2246
|
+
full: rh,
|
|
2247
|
+
triggerContent: oh,
|
|
2248
|
+
triggerText: ah,
|
|
2249
|
+
popoverBackdrop: ih,
|
|
2250
|
+
popoverPositioner: ch,
|
|
2251
|
+
popoverPopup: lh,
|
|
2252
|
+
search: dh,
|
|
2253
|
+
viewport: uh,
|
|
2254
|
+
item: hh,
|
|
2255
|
+
highlighted: mh,
|
|
2256
|
+
itemContent: _h
|
|
2250
2257
|
}, _r = ({ value: e, onChange: t, chainIds: s, fullWidth: r }) => {
|
|
2251
|
-
const [o, a] = B(""), [i, l] = B(!1), [c, d] = B(0), [h, m] = B(), _ = Se([]), f = Se(null), p = ne(), g = s.map((y) => p.find((
|
|
2258
|
+
const [o, a] = B(""), [i, l] = B(!1), [c, d] = B(0), [h, m] = B(), _ = Se([]), f = Se(null), p = ne(), g = s.map((y) => p.find((C) => C.chainId === y)).filter(Boolean), b = (y) => /* @__PURE__ */ u("svg", { xmlns: "http://www.w3.org/2000/svg", width: y, height: y, viewBox: "0 0 14 14", children: [
|
|
2252
2259
|
/* @__PURE__ */ n(
|
|
2253
2260
|
"path",
|
|
2254
2261
|
{
|
|
@@ -2263,19 +2270,19 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2263
2270
|
d: "M9.66003 2.63379C10.85 3.71879 11.6025 5.26754 11.6025 7.00004C11.6025 8.73254 10.85 10.2813 9.66003 11.3663C11.7513 10.99 13.3438 9.19629 13.3438 7.00004C13.3438 4.80379 11.7513 3.00129 9.66003 2.63379Z"
|
|
2264
2271
|
}
|
|
2265
2272
|
)
|
|
2266
|
-
] }),
|
|
2267
|
-
() => ({ chainId: "", name: "All", logoUrl:
|
|
2273
|
+
] }), k = F(
|
|
2274
|
+
() => ({ chainId: "", name: "All", logoUrl: b }),
|
|
2268
2275
|
[]
|
|
2269
2276
|
), S = F(() => {
|
|
2270
|
-
const y = [
|
|
2277
|
+
const y = [k, ...g];
|
|
2271
2278
|
if (!o) return y;
|
|
2272
|
-
const
|
|
2279
|
+
const C = o.toLowerCase();
|
|
2273
2280
|
return y.filter(
|
|
2274
|
-
(v) => v.name.toLowerCase().includes(
|
|
2281
|
+
(v) => v.name.toLowerCase().includes(C) || v.chainId.toLowerCase().includes(C)
|
|
2275
2282
|
);
|
|
2276
|
-
}, [g, o,
|
|
2283
|
+
}, [g, o, k]), $ = g.find((y) => y.chainId === e) || k, w = parseInt(jo("--drawer-offset")), T = 6, q = () => {
|
|
2277
2284
|
if (a(""), d(-1), f.current) {
|
|
2278
|
-
const
|
|
2285
|
+
const C = f.current.getBoundingClientRect().bottom + T, v = window.innerHeight - C - 2 * w;
|
|
2279
2286
|
m(v);
|
|
2280
2287
|
}
|
|
2281
2288
|
l(!0);
|
|
@@ -2287,10 +2294,10 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2287
2294
|
(y) => {
|
|
2288
2295
|
switch (y.key) {
|
|
2289
2296
|
case "ArrowDown":
|
|
2290
|
-
y.preventDefault(), d((
|
|
2297
|
+
y.preventDefault(), d((C) => (C + 1) % S.length);
|
|
2291
2298
|
break;
|
|
2292
2299
|
case "ArrowUp":
|
|
2293
|
-
y.preventDefault(), d((
|
|
2300
|
+
y.preventDefault(), d((C) => (C - 1 + S.length) % S.length);
|
|
2294
2301
|
break;
|
|
2295
2302
|
case "Enter":
|
|
2296
2303
|
y.preventDefault(), S[c] && (t(S[c].chainId), l(!1));
|
|
@@ -2301,7 +2308,7 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2301
2308
|
}
|
|
2302
2309
|
},
|
|
2303
2310
|
[S, c, t, l]
|
|
2304
|
-
),
|
|
2311
|
+
), I = (y) => {
|
|
2305
2312
|
t(y), l(!1);
|
|
2306
2313
|
};
|
|
2307
2314
|
return /* @__PURE__ */ u(Tt.Root, { open: i, onOpenChange: q, modal: "trap-focus", children: [
|
|
@@ -2320,7 +2327,7 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2320
2327
|
typeof $.logoUrl == "string" ? /* @__PURE__ */ n(H, { src: $.logoUrl, width: 14, height: 14, logo: !0 }) : $.logoUrl(14),
|
|
2321
2328
|
/* @__PURE__ */ n("span", { className: ae.triggerText, children: $.name })
|
|
2322
2329
|
] }),
|
|
2323
|
-
/* @__PURE__ */ n(
|
|
2330
|
+
/* @__PURE__ */ n(rt, { size: 16, className: ae.icon })
|
|
2324
2331
|
]
|
|
2325
2332
|
}
|
|
2326
2333
|
)
|
|
@@ -2334,7 +2341,7 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2334
2341
|
className: ae.popoverPositioner,
|
|
2335
2342
|
align: "end",
|
|
2336
2343
|
side: "bottom",
|
|
2337
|
-
sideOffset:
|
|
2344
|
+
sideOffset: T,
|
|
2338
2345
|
children: /* @__PURE__ */ u(
|
|
2339
2346
|
Tt.Popup,
|
|
2340
2347
|
{
|
|
@@ -2355,27 +2362,27 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2355
2362
|
ref: un()
|
|
2356
2363
|
}
|
|
2357
2364
|
),
|
|
2358
|
-
/* @__PURE__ */ n("div", { className: ae.viewport, role: "listbox", children: S.length === 0 ? /* @__PURE__ */ n(Y, { children: "No appchains found" }) : S.map(({ chainId: y, name:
|
|
2365
|
+
/* @__PURE__ */ n("div", { className: ae.viewport, role: "listbox", children: S.length === 0 ? /* @__PURE__ */ n(Y, { children: "No appchains found" }) : S.map(({ chainId: y, name: C, logoUrl: v }, A) => /* @__PURE__ */ u(
|
|
2359
2366
|
"div",
|
|
2360
2367
|
{
|
|
2361
2368
|
className: D(ae.item, {
|
|
2362
|
-
[ae.highlighted]:
|
|
2369
|
+
[ae.highlighted]: A === c
|
|
2363
2370
|
}),
|
|
2364
|
-
onClick: () =>
|
|
2365
|
-
onKeyDown: (
|
|
2366
|
-
(
|
|
2371
|
+
onClick: () => I(y),
|
|
2372
|
+
onKeyDown: (N) => {
|
|
2373
|
+
(N.key === "Enter" || N.key === " ") && (N.preventDefault(), I(y));
|
|
2367
2374
|
},
|
|
2368
|
-
onMouseEnter: () => d(
|
|
2375
|
+
onMouseEnter: () => d(A),
|
|
2369
2376
|
role: "option",
|
|
2370
2377
|
"aria-selected": e === y,
|
|
2371
2378
|
tabIndex: -1,
|
|
2372
|
-
ref: (
|
|
2373
|
-
|
|
2379
|
+
ref: (N) => {
|
|
2380
|
+
N && (_.current[A] = N);
|
|
2374
2381
|
},
|
|
2375
2382
|
children: [
|
|
2376
2383
|
/* @__PURE__ */ u("div", { className: ae.itemContent, children: [
|
|
2377
2384
|
typeof v == "string" ? /* @__PURE__ */ n(H, { src: v, width: 16, height: 16, logo: !0 }) : v(16),
|
|
2378
|
-
/* @__PURE__ */ n("span", { children:
|
|
2385
|
+
/* @__PURE__ */ n("span", { children: C })
|
|
2379
2386
|
] }),
|
|
2380
2387
|
e === y && /* @__PURE__ */ n(Hn, { size: 16 })
|
|
2381
2388
|
]
|
|
@@ -2389,24 +2396,24 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2389
2396
|
)
|
|
2390
2397
|
] })
|
|
2391
2398
|
] });
|
|
2392
|
-
},
|
|
2393
|
-
version:
|
|
2394
|
-
},
|
|
2399
|
+
}, fh = "2.0.4", ph = "_version_1sf5y_1", gh = {
|
|
2400
|
+
version: ph
|
|
2401
|
+
}, yh = () => /* @__PURE__ */ u("aside", { className: gh.version, children: [
|
|
2395
2402
|
"v",
|
|
2396
|
-
|
|
2397
|
-
] }),
|
|
2398
|
-
popup:
|
|
2399
|
-
item:
|
|
2403
|
+
fh
|
|
2404
|
+
] }), vh = He(""), wh = He(""), bh = He(""), Ch = He(""), Nh = He(""), Ih = "_popup_nbecp_1", Sh = "_item_nbecp_19", wn = {
|
|
2405
|
+
popup: Ih,
|
|
2406
|
+
item: Sh
|
|
2400
2407
|
}, da = ({ asset: e, children: t }) => {
|
|
2401
|
-
const { denom: s, decimals: r, symbol: o, logoUrl: a, unlisted: i, address: l, chain: c } = e, { chainId: d } = c, [h, m] = B(!1), _ = ce(), f = la(), { showNotification: p } = hr(), { defaultChainId: g } = le(), { evm_chain_id:
|
|
2408
|
+
const { denom: s, decimals: r, symbol: o, logoUrl: a, unlisted: i, address: l, chain: c } = e, { chainId: d } = c, [h, m] = B(!1), _ = ce(), f = la(), { showNotification: p } = hr(), { defaultChainId: g } = le(), { evm_chain_id: b } = cn(), k = Fa(), { switchChainAsync: S } = za(), { watchAssetAsync: $ } = Ua(), w = () => {
|
|
2402
2409
|
m(!1), _("/send", { denom: s, chain: c });
|
|
2403
|
-
},
|
|
2410
|
+
}, T = () => {
|
|
2404
2411
|
m(!1), _("/bridge", { srcChainId: d, srcDenom: s, quantity: "" });
|
|
2405
|
-
}, q =
|
|
2412
|
+
}, q = Ke({
|
|
2406
2413
|
mutationFn: async () => {
|
|
2407
2414
|
if (!l) throw new Error("Address is required");
|
|
2408
2415
|
const E = a;
|
|
2409
|
-
return await S({ chainId: Number(
|
|
2416
|
+
return await S({ chainId: Number(b) }), $({ type: "ERC20", options: { address: l, symbol: o, decimals: r, image: E } });
|
|
2410
2417
|
},
|
|
2411
2418
|
onSuccess: () => {
|
|
2412
2419
|
p({
|
|
@@ -2423,19 +2430,19 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2423
2430
|
});
|
|
2424
2431
|
}
|
|
2425
2432
|
});
|
|
2426
|
-
return /* @__PURE__ */ u(
|
|
2427
|
-
/* @__PURE__ */ n(
|
|
2428
|
-
/* @__PURE__ */ n(
|
|
2429
|
-
/* @__PURE__ */ u(
|
|
2433
|
+
return /* @__PURE__ */ u(Je.Root, { open: h, onOpenChange: m, modal: !1, children: [
|
|
2434
|
+
/* @__PURE__ */ n(Je.Trigger, { render: t }),
|
|
2435
|
+
/* @__PURE__ */ n(Je.Portal, { container: f.current, children: /* @__PURE__ */ n(Je.Positioner, { side: "bottom", sideOffset: -6, align: "end", children: /* @__PURE__ */ u(Je.Popup, { className: wn.popup, children: [
|
|
2436
|
+
/* @__PURE__ */ u(Je.Item, { className: wn.item, onClick: w, children: [
|
|
2430
2437
|
/* @__PURE__ */ n(_o, { size: 16 }),
|
|
2431
2438
|
/* @__PURE__ */ n("span", { children: "Send" })
|
|
2432
2439
|
] }),
|
|
2433
|
-
/* @__PURE__ */ u(
|
|
2440
|
+
/* @__PURE__ */ u(Je.Item, { className: wn.item, onClick: T, disabled: i, children: [
|
|
2434
2441
|
/* @__PURE__ */ n(fo, { size: 16 }),
|
|
2435
2442
|
/* @__PURE__ */ n("span", { children: "Bridge/Swap" })
|
|
2436
2443
|
] }),
|
|
2437
|
-
d === g &&
|
|
2438
|
-
|
|
2444
|
+
d === g && b === k && !!l && /* @__PURE__ */ u(
|
|
2445
|
+
Je.Item,
|
|
2439
2446
|
{
|
|
2440
2447
|
className: wn.item,
|
|
2441
2448
|
onClick: () => q.mutate(),
|
|
@@ -2448,8 +2455,8 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2448
2455
|
)
|
|
2449
2456
|
] }) }) })
|
|
2450
2457
|
] });
|
|
2451
|
-
},
|
|
2452
|
-
images:
|
|
2458
|
+
}, kh = "_images_cj4xz_1", Ns = {
|
|
2459
|
+
images: kh
|
|
2453
2460
|
}, os = ({
|
|
2454
2461
|
assetLogoUrl: e,
|
|
2455
2462
|
assetLogoSize: t = 36,
|
|
@@ -2479,15 +2486,15 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2479
2486
|
logo: !0
|
|
2480
2487
|
}
|
|
2481
2488
|
)
|
|
2482
|
-
] }),
|
|
2483
|
-
item:
|
|
2484
|
-
info:
|
|
2485
|
-
images:
|
|
2486
|
-
name:
|
|
2487
|
-
value:
|
|
2488
|
-
amount:
|
|
2489
|
-
usd:
|
|
2490
|
-
},
|
|
2489
|
+
] }), xh = "_item_knoro_1", $h = "_info_knoro_22", Ah = "_images_knoro_28", Th = "_name_knoro_32", Eh = "_value_knoro_38", Dh = "_amount_knoro_46", qh = "_usd_knoro_52", ut = {
|
|
2490
|
+
item: xh,
|
|
2491
|
+
info: $h,
|
|
2492
|
+
images: Ah,
|
|
2493
|
+
name: Th,
|
|
2494
|
+
value: Eh,
|
|
2495
|
+
amount: Dh,
|
|
2496
|
+
usd: qh
|
|
2497
|
+
}, Ph = ({ asset: e }) => {
|
|
2491
2498
|
const { amount: t, value: s, logoUrl: r, chain: o } = e, a = se(t, { decimals: e.decimals });
|
|
2492
2499
|
return /* @__PURE__ */ n(da, { asset: e, children: /* @__PURE__ */ u("button", { className: ut.item, children: [
|
|
2493
2500
|
/* @__PURE__ */ u("div", { className: ut.info, children: [
|
|
@@ -2506,29 +2513,29 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2506
2513
|
] }),
|
|
2507
2514
|
/* @__PURE__ */ u("div", { className: ut.value, children: [
|
|
2508
2515
|
/* @__PURE__ */ n("span", { className: ut.amount, children: a }),
|
|
2509
|
-
Number(s) > 0 && /* @__PURE__ */ n("span", { className: ut.usd, children:
|
|
2516
|
+
Number(s) > 0 && /* @__PURE__ */ n("span", { className: ut.usd, children: Ue(s) })
|
|
2510
2517
|
] })
|
|
2511
2518
|
] }) });
|
|
2512
|
-
},
|
|
2513
|
-
container:
|
|
2514
|
-
assetItem:
|
|
2515
|
-
assetInfo:
|
|
2516
|
-
logo:
|
|
2517
|
-
symbol:
|
|
2518
|
-
chainName:
|
|
2519
|
-
chainInfos:
|
|
2520
|
-
chainLogos:
|
|
2521
|
-
chainLogo:
|
|
2522
|
-
moreChains:
|
|
2523
|
-
expandIcon:
|
|
2524
|
-
expanded:
|
|
2525
|
-
valueColumn:
|
|
2526
|
-
amount:
|
|
2527
|
-
value:
|
|
2528
|
-
collapsibleContent:
|
|
2529
|
-
chainsList:
|
|
2530
|
-
},
|
|
2531
|
-
const { symbol: t, logoUrl: s, assets: r } = e, o = r.length === 1, [a, i] = Me(
|
|
2519
|
+
}, Rh = "_container_g5q73_1", Bh = "_assetItem_g5q73_6", Oh = "_assetInfo_g5q73_26", Lh = "_logo_g5q73_32", Mh = "_symbol_g5q73_36", Fh = "_chainName_g5q73_46", zh = "_chainInfos_g5q73_52", Uh = "_chainLogos_g5q73_58", Kh = "_chainLogo_g5q73_58", Hh = "_moreChains_g5q73_69", Wh = "_expandIcon_g5q73_81", jh = "_expanded_g5q73_85", Vh = "_valueColumn_g5q73_90", Gh = "_amount_g5q73_99", Qh = "_value_g5q73_90", Yh = "_collapsibleContent_g5q73_112", Jh = "_chainsList_g5q73_142", Q = {
|
|
2520
|
+
container: Rh,
|
|
2521
|
+
assetItem: Bh,
|
|
2522
|
+
assetInfo: Oh,
|
|
2523
|
+
logo: Lh,
|
|
2524
|
+
symbol: Mh,
|
|
2525
|
+
chainName: Fh,
|
|
2526
|
+
chainInfos: zh,
|
|
2527
|
+
chainLogos: Uh,
|
|
2528
|
+
chainLogo: Kh,
|
|
2529
|
+
moreChains: Hh,
|
|
2530
|
+
expandIcon: Wh,
|
|
2531
|
+
expanded: jh,
|
|
2532
|
+
valueColumn: Vh,
|
|
2533
|
+
amount: Gh,
|
|
2534
|
+
value: Qh,
|
|
2535
|
+
collapsibleContent: Yh,
|
|
2536
|
+
chainsList: Jh
|
|
2537
|
+
}, Zh = He([]), ua = ({ assetGroup: e }) => {
|
|
2538
|
+
const { symbol: t, logoUrl: s, assets: r } = e, o = r.length === 1, [a, i] = Me(Zh), l = F(() => zc(e), [e]), c = F(() => cr(e), [e]), d = a.includes(t), h = () => {
|
|
2532
2539
|
i((_) => d ? ci([t], _) : li([..._, t]));
|
|
2533
2540
|
}, m = () => /* @__PURE__ */ u("button", { className: Q.assetItem, children: [
|
|
2534
2541
|
/* @__PURE__ */ u("div", { className: Q.assetInfo, children: [
|
|
@@ -2552,7 +2559,7 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2552
2559
|
r.length - 5
|
|
2553
2560
|
] }),
|
|
2554
2561
|
/* @__PURE__ */ n(
|
|
2555
|
-
|
|
2562
|
+
rt,
|
|
2556
2563
|
{
|
|
2557
2564
|
size: 16,
|
|
2558
2565
|
className: D(Q.expandIcon, { [Q.expanded]: d })
|
|
@@ -2563,7 +2570,7 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2563
2570
|
] }),
|
|
2564
2571
|
/* @__PURE__ */ u("div", { className: Q.valueColumn, children: [
|
|
2565
2572
|
/* @__PURE__ */ n("div", { className: Q.amount, children: Xr(l, { dp: r[0].unlisted ? 0 : 6 }) }),
|
|
2566
|
-
c > 0 && /* @__PURE__ */ n("div", { className: Q.value, children:
|
|
2573
|
+
c > 0 && /* @__PURE__ */ n("div", { className: Q.value, children: Ue(c) })
|
|
2567
2574
|
] })
|
|
2568
2575
|
] });
|
|
2569
2576
|
if (o) {
|
|
@@ -2572,17 +2579,17 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2572
2579
|
}
|
|
2573
2580
|
return /* @__PURE__ */ n("div", { className: Q.container, children: /* @__PURE__ */ u(Le.Root, { open: d, onOpenChange: h, children: [
|
|
2574
2581
|
/* @__PURE__ */ n(Le.Trigger, { asChild: !0, children: m() }),
|
|
2575
|
-
/* @__PURE__ */ n(Le.Content, { className: Q.collapsibleContent, children: /* @__PURE__ */ n("div", { className: Q.chainsList, children: r.map((_) => /* @__PURE__ */ n(
|
|
2582
|
+
/* @__PURE__ */ n(Le.Content, { className: Q.collapsibleContent, children: /* @__PURE__ */ n("div", { className: Q.chainsList, children: r.map((_) => /* @__PURE__ */ n(Ph, { asset: _ }, _.chain.chainId)) }) })
|
|
2576
2583
|
] }) });
|
|
2577
|
-
},
|
|
2578
|
-
collapsible:
|
|
2579
|
-
trigger:
|
|
2580
|
-
divider:
|
|
2581
|
-
label:
|
|
2582
|
-
chevron:
|
|
2583
|
-
content:
|
|
2584
|
-
list:
|
|
2585
|
-
},
|
|
2584
|
+
}, Xh = "_collapsible_1spkj_1", em = "_trigger_1spkj_5", tm = "_divider_1spkj_20", nm = "_label_1spkj_26", sm = "_chevron_1spkj_31", rm = "_content_1spkj_39", om = "_list_1spkj_43", Xe = {
|
|
2585
|
+
collapsible: Xh,
|
|
2586
|
+
trigger: em,
|
|
2587
|
+
divider: tm,
|
|
2588
|
+
label: nm,
|
|
2589
|
+
chevron: sm,
|
|
2590
|
+
content: rm,
|
|
2591
|
+
list: om
|
|
2592
|
+
}, am = ({ unlistedAssets: e }) => {
|
|
2586
2593
|
const [t, s] = B(!0), r = la(), o = Se(null), [a, i] = B(0);
|
|
2587
2594
|
M(() => {
|
|
2588
2595
|
if (o.current) {
|
|
@@ -2603,25 +2610,25 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2603
2610
|
opacity: t ? 1 : 0,
|
|
2604
2611
|
config: { tension: 500, friction: 30, clamp: !0 }
|
|
2605
2612
|
});
|
|
2606
|
-
return e.length === 0 ? null : /* @__PURE__ */ u(Le.Root, { open: t, onOpenChange: l, className:
|
|
2607
|
-
/* @__PURE__ */ u(Le.Trigger, { className:
|
|
2608
|
-
/* @__PURE__ */ n("div", { className:
|
|
2609
|
-
/* @__PURE__ */ u("span", { className:
|
|
2613
|
+
return e.length === 0 ? null : /* @__PURE__ */ u(Le.Root, { open: t, onOpenChange: l, className: Xe.collapsible, children: [
|
|
2614
|
+
/* @__PURE__ */ u(Le.Trigger, { className: Xe.trigger, children: [
|
|
2615
|
+
/* @__PURE__ */ n("div", { className: Xe.divider }),
|
|
2616
|
+
/* @__PURE__ */ u("span", { className: Xe.label, children: [
|
|
2610
2617
|
"Unlisted assets (",
|
|
2611
2618
|
e.length,
|
|
2612
2619
|
")"
|
|
2613
2620
|
] }),
|
|
2614
2621
|
/* @__PURE__ */ n(
|
|
2615
|
-
|
|
2622
|
+
rt,
|
|
2616
2623
|
{
|
|
2617
|
-
className:
|
|
2624
|
+
className: Xe.chevron,
|
|
2618
2625
|
size: 12,
|
|
2619
2626
|
"data-state": t ? "open" : "closed"
|
|
2620
2627
|
}
|
|
2621
2628
|
),
|
|
2622
|
-
/* @__PURE__ */ n("div", { className:
|
|
2629
|
+
/* @__PURE__ */ n("div", { className: Xe.divider })
|
|
2623
2630
|
] }),
|
|
2624
|
-
/* @__PURE__ */ n(Le.Content, { forceMount: !0, asChild: !0, children: /* @__PURE__ */ n(zn.div, { className:
|
|
2631
|
+
/* @__PURE__ */ n(Le.Content, { forceMount: !0, asChild: !0, children: /* @__PURE__ */ n(zn.div, { className: Xe.content, style: c, children: /* @__PURE__ */ n("div", { className: Xe.list, ref: o, children: e.map((d) => /* @__PURE__ */ n(
|
|
2625
2632
|
ua,
|
|
2626
2633
|
{
|
|
2627
2634
|
assetGroup: { ...d, assets: [d] }
|
|
@@ -2629,13 +2636,13 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2629
2636
|
d.denom
|
|
2630
2637
|
)) }) }) })
|
|
2631
2638
|
] });
|
|
2632
|
-
},
|
|
2633
|
-
list:
|
|
2634
|
-
},
|
|
2635
|
-
const [e, t] = Me(
|
|
2639
|
+
}, im = "_list_szwvw_1", cm = {
|
|
2640
|
+
list: im
|
|
2641
|
+
}, lm = () => {
|
|
2642
|
+
const [e, t] = Me(vh), [s, r] = Me(wh), { assetGroups: o, unlistedAssets: a, chainsByValue: i, isLoading: l } = Ko(), c = i.filter(({ value: m }) => m).map(({ chainId: m }) => m), d = F(() => {
|
|
2636
2643
|
const m = e ? o.filter((f) => {
|
|
2637
2644
|
const { symbol: p, assets: g } = f;
|
|
2638
|
-
return p.toLowerCase().includes(e.toLowerCase()) || g.some(({ denom:
|
|
2645
|
+
return p.toLowerCase().includes(e.toLowerCase()) || g.some(({ denom: b, address: k }) => b.toLowerCase().includes(e.toLowerCase()) || k?.toLowerCase().includes(e.toLowerCase()));
|
|
2639
2646
|
}) : o;
|
|
2640
2647
|
return s ? m.map((f) => ({
|
|
2641
2648
|
...f,
|
|
@@ -2648,10 +2655,10 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2648
2655
|
return s ? m.filter(({ chain: f }) => f.chainId === s) : m;
|
|
2649
2656
|
}, [a, e, s]);
|
|
2650
2657
|
return l && o.length === 0 ? /* @__PURE__ */ n(Y, { children: "Loading assets..." }) : !d.length && !h.length && !e && !s && !l ? /* @__PURE__ */ n(Y, { children: "No assets" }) : /* @__PURE__ */ u(K, { children: [
|
|
2651
|
-
/* @__PURE__ */ u(
|
|
2652
|
-
/* @__PURE__ */ u(
|
|
2658
|
+
/* @__PURE__ */ u(tt.Root, { children: [
|
|
2659
|
+
/* @__PURE__ */ u(tt.Controls, { children: [
|
|
2653
2660
|
/* @__PURE__ */ n(
|
|
2654
|
-
|
|
2661
|
+
tt.SearchInput,
|
|
2655
2662
|
{
|
|
2656
2663
|
value: e,
|
|
2657
2664
|
onChange: (m) => t(m.target.value),
|
|
@@ -2662,24 +2669,24 @@ const th = "_trigger_386xl_1", nh = "_icon_386xl_21", sh = "_full_386xl_25", rh
|
|
|
2662
2669
|
/* @__PURE__ */ n(_r, { value: s, onChange: r, chainIds: c })
|
|
2663
2670
|
] }),
|
|
2664
2671
|
/* @__PURE__ */ n("div", { children: d.length === 0 && h.length === 0 ? /* @__PURE__ */ n(Y, { children: "No assets found" }) : /* @__PURE__ */ u(K, { children: [
|
|
2665
|
-
/* @__PURE__ */ n("div", { className:
|
|
2666
|
-
/* @__PURE__ */ n(
|
|
2672
|
+
/* @__PURE__ */ n("div", { className: cm.list, children: d.map((m) => /* @__PURE__ */ n(ua, { assetGroup: m }, m.symbol)) }),
|
|
2673
|
+
/* @__PURE__ */ n(am, { unlistedAssets: h })
|
|
2667
2674
|
] }) })
|
|
2668
2675
|
] }),
|
|
2669
|
-
/* @__PURE__ */ n(
|
|
2676
|
+
/* @__PURE__ */ n(yh, {})
|
|
2670
2677
|
] });
|
|
2671
2678
|
}, ha = Re("interwovenkit:nft", {
|
|
2672
2679
|
nfts: (e, t) => [e, t],
|
|
2673
2680
|
metadata: (e) => [e]
|
|
2674
2681
|
});
|
|
2675
|
-
function
|
|
2682
|
+
function dm(e, t) {
|
|
2676
2683
|
const { nft: s } = e, r = t.name ?? s.token_id;
|
|
2677
2684
|
return { ...e, ...s, ...t, name: r };
|
|
2678
2685
|
}
|
|
2679
|
-
function
|
|
2686
|
+
function um(e, t) {
|
|
2680
2687
|
return e.flatMap((s, r) => (t[r] ?? []).map((a) => ({ ...a, chain: s })));
|
|
2681
2688
|
}
|
|
2682
|
-
const
|
|
2689
|
+
const hm = () => {
|
|
2683
2690
|
const e = re(), t = ne(), s = on({
|
|
2684
2691
|
queries: t.map((i) => ({
|
|
2685
2692
|
queryKey: ha.nfts(i.indexerUrl, e).queryKey,
|
|
@@ -2690,10 +2697,10 @@ const um = () => {
|
|
|
2690
2697
|
),
|
|
2691
2698
|
staleTime: U.SECOND
|
|
2692
2699
|
}))
|
|
2693
|
-
}), r = s.map(Bt("data")), o =
|
|
2700
|
+
}), r = s.map(Bt("data")), o = um(t, r), a = s.some((i) => i.isLoading);
|
|
2694
2701
|
return { nftInfos: o, isLoading: a };
|
|
2695
2702
|
};
|
|
2696
|
-
function
|
|
2703
|
+
function mm(e) {
|
|
2697
2704
|
const t = Pr(e);
|
|
2698
2705
|
return he({
|
|
2699
2706
|
queryKey: ha.metadata(t).queryKey,
|
|
@@ -2712,10 +2719,10 @@ function hm(e) {
|
|
|
2712
2719
|
function Pr(e) {
|
|
2713
2720
|
return e?.replace("ipfs://", "https://ipfs.io/ipfs/");
|
|
2714
2721
|
}
|
|
2715
|
-
const
|
|
2716
|
-
thumbnail:
|
|
2717
|
-
placeholder:
|
|
2718
|
-
clickable:
|
|
2722
|
+
const _m = "_thumbnail_1lblb_1", fm = "_placeholder_1lblb_16", pm = "_clickable_1lblb_22", Zt = {
|
|
2723
|
+
thumbnail: _m,
|
|
2724
|
+
placeholder: fm,
|
|
2725
|
+
clickable: pm
|
|
2719
2726
|
}, fr = ({ nftInfo: e, size: t, onClick: s }) => {
|
|
2720
2727
|
const { collection_addr: r, object_addr: o, nft: a, chain: i } = e, l = new URL(
|
|
2721
2728
|
`/v1/${i.chainId}/${r}/${o || a.token_id}`,
|
|
@@ -2730,12 +2737,12 @@ const mm = "_thumbnail_1lblb_1", _m = "_placeholder_1lblb_16", fm = "_clickable_
|
|
|
2730
2737
|
children: /* @__PURE__ */ n(H, { src: l, classNames: { placeholder: Zt.placeholder } })
|
|
2731
2738
|
}
|
|
2732
2739
|
) : /* @__PURE__ */ n("div", { className: Zt.thumbnail, style: { width: t, height: t }, children: /* @__PURE__ */ n(H, { src: l, classNames: { placeholder: Zt.placeholder } }) });
|
|
2733
|
-
},
|
|
2734
|
-
nftItem:
|
|
2735
|
-
collectionName:
|
|
2736
|
-
nftName:
|
|
2737
|
-
chainInfo:
|
|
2738
|
-
},
|
|
2740
|
+
}, gm = "_nftItem_eopro_1", ym = "_collectionName_eopro_9", vm = "_nftName_eopro_19", wm = "_chainInfo_eopro_29", bn = {
|
|
2741
|
+
nftItem: gm,
|
|
2742
|
+
collectionName: ym,
|
|
2743
|
+
nftName: vm,
|
|
2744
|
+
chainInfo: wm
|
|
2745
|
+
}, bm = ({ normalizedNft: e }) => {
|
|
2739
2746
|
const { collection_name: t, name: s, chain: r } = e, o = ce();
|
|
2740
2747
|
return /* @__PURE__ */ u("div", { className: bn.nftItem, children: [
|
|
2741
2748
|
/* @__PURE__ */ n(fr, { nftInfo: e, onClick: () => o("/nft", e) }),
|
|
@@ -2748,13 +2755,13 @@ const mm = "_thumbnail_1lblb_1", _m = "_placeholder_1lblb_16", fm = "_clickable_
|
|
|
2748
2755
|
] })
|
|
2749
2756
|
] })
|
|
2750
2757
|
] });
|
|
2751
|
-
},
|
|
2752
|
-
const { data: s = {} } =
|
|
2758
|
+
}, Cm = ({ nftInfo: e, children: t }) => {
|
|
2759
|
+
const { data: s = {} } = mm(e.nft.uri), r = dm(e, s);
|
|
2753
2760
|
return t(r);
|
|
2754
|
-
},
|
|
2755
|
-
grid:
|
|
2756
|
-
},
|
|
2757
|
-
const [e, t] = Me(
|
|
2761
|
+
}, Nm = "_grid_a1fhu_1", Im = {
|
|
2762
|
+
grid: Nm
|
|
2763
|
+
}, Sm = () => {
|
|
2764
|
+
const [e, t] = Me(bh), [s, r] = Me(Ch), { nftInfos: o, isLoading: a } = hm(), i = F(() => o.filter(({ collection_addr: c, collection_name: d, nft: h, object_addr: m, chain: _ }) => {
|
|
2758
2765
|
if (s && _.chainId !== s)
|
|
2759
2766
|
return !1;
|
|
2760
2767
|
if (e) {
|
|
@@ -2763,10 +2770,10 @@ const mm = "_thumbnail_1lblb_1", _m = "_placeholder_1lblb_16", fm = "_clickable_
|
|
|
2763
2770
|
}
|
|
2764
2771
|
return !0;
|
|
2765
2772
|
}), [o, s, e]), l = F(() => Array.from(new Set(o.map(({ chain: c }) => c.chainId))), [o]);
|
|
2766
|
-
return a && o.length === 0 ? /* @__PURE__ */ n(Y, { children: "Loading NFTs..." }) : !o.length && !e && !a ? /* @__PURE__ */ n(Y, { children: "No NFTs" }) : /* @__PURE__ */ u(
|
|
2767
|
-
/* @__PURE__ */ u(
|
|
2773
|
+
return a && o.length === 0 ? /* @__PURE__ */ n(Y, { children: "Loading NFTs..." }) : !o.length && !e && !a ? /* @__PURE__ */ n(Y, { children: "No NFTs" }) : /* @__PURE__ */ u(tt.Root, { children: [
|
|
2774
|
+
/* @__PURE__ */ u(tt.Controls, { children: [
|
|
2768
2775
|
/* @__PURE__ */ n(
|
|
2769
|
-
|
|
2776
|
+
tt.SearchInput,
|
|
2770
2777
|
{
|
|
2771
2778
|
value: e,
|
|
2772
2779
|
onChange: (c) => t(c.target.value),
|
|
@@ -2783,9 +2790,9 @@ const mm = "_thumbnail_1lblb_1", _m = "_placeholder_1lblb_16", fm = "_clickable_
|
|
|
2783
2790
|
}
|
|
2784
2791
|
)
|
|
2785
2792
|
] }),
|
|
2786
|
-
i.length === 0 ? /* @__PURE__ */ n(Y, { children: "No NFTs found" }) : /* @__PURE__ */ n("div", { className:
|
|
2793
|
+
i.length === 0 ? /* @__PURE__ */ n(Y, { children: "No NFTs found" }) : /* @__PURE__ */ n("div", { className: Im.grid, children: i.map((c) => {
|
|
2787
2794
|
const { collection_addr: d, nft: h } = c;
|
|
2788
|
-
return /* @__PURE__ */ n(
|
|
2795
|
+
return /* @__PURE__ */ n(Cm, { nftInfo: c, children: (m) => /* @__PURE__ */ n(bm, { normalizedNft: m }) }, d + h.token_id);
|
|
2789
2796
|
}) })
|
|
2790
2797
|
] });
|
|
2791
2798
|
};
|
|
@@ -2807,16 +2814,16 @@ function ma(e, t) {
|
|
|
2807
2814
|
{}
|
|
2808
2815
|
);
|
|
2809
2816
|
}
|
|
2810
|
-
const
|
|
2811
|
-
message:
|
|
2812
|
-
more:
|
|
2813
|
-
},
|
|
2817
|
+
const km = "_message_1g2hc_1", xm = "_more_1g2hc_8", Rr = {
|
|
2818
|
+
message: km,
|
|
2819
|
+
more: xm
|
|
2820
|
+
}, $m = ({ messages: e }) => /* @__PURE__ */ u(K, { children: [
|
|
2814
2821
|
e.slice(0, 3).map((t, s) => /* @__PURE__ */ n("p", { className: Rr.message, children: er(t["@type"].split("Msg")[1]) }, s)),
|
|
2815
2822
|
e.length > 3 && /* @__PURE__ */ n("footer", { className: Rr.more, children: `+${e.length - 3} more` })
|
|
2816
|
-
] }),
|
|
2817
|
-
change:
|
|
2818
|
-
positive:
|
|
2819
|
-
negative:
|
|
2823
|
+
] }), Am = "_change_1x9v4_1", Tm = "_positive_1x9v4_10", Em = "_negative_1x9v4_14", Is = {
|
|
2824
|
+
change: Am,
|
|
2825
|
+
positive: Tm,
|
|
2826
|
+
negative: Em
|
|
2820
2827
|
}, _a = ({ amount: e, asset: t }) => {
|
|
2821
2828
|
const { denom: s, symbol: r, decimals: o } = t, a = new P(e).isPositive(), i = new P(e).abs().toString();
|
|
2822
2829
|
return /* @__PURE__ */ u("div", { className: D(Is.change, a ? Is.positive : Is.negative), children: [
|
|
@@ -2825,30 +2832,30 @@ const Sm = "_message_1g2hc_1", km = "_more_1g2hc_8", Rr = {
|
|
|
2825
2832
|
" ",
|
|
2826
2833
|
r || s
|
|
2827
2834
|
] });
|
|
2828
|
-
},
|
|
2835
|
+
}, Dm = ({ changes: e, chain: t }) => {
|
|
2829
2836
|
const s = at(t);
|
|
2830
2837
|
return e.map(({ amount: r, denom: o }, a) => /* @__PURE__ */ n(_a, { amount: r, asset: s(o) }, a));
|
|
2831
|
-
},
|
|
2838
|
+
}, qm = ({
|
|
2832
2839
|
changes: e,
|
|
2833
2840
|
chain: t
|
|
2834
2841
|
}) => {
|
|
2835
2842
|
const s = at(t);
|
|
2836
2843
|
return e.map(({ amount: r, metadata: o }, a) => /* @__PURE__ */ n(na, { metadata: o, chain: t, children: (i) => /* @__PURE__ */ n(_a, { amount: r, asset: s(i) }) }, a));
|
|
2837
|
-
},
|
|
2844
|
+
}, Pm = ({ events: e, chain: t }) => {
|
|
2838
2845
|
const { initiaAddress: s, hexAddress: r } = ke();
|
|
2839
|
-
return t.metadata?.is_l1 || t.metadata?.minitia?.type === "minimove" ? /* @__PURE__ */ n(
|
|
2840
|
-
},
|
|
2841
|
-
link:
|
|
2842
|
-
inner:
|
|
2843
|
-
header:
|
|
2844
|
-
time:
|
|
2845
|
-
error:
|
|
2846
|
-
timestamp:
|
|
2847
|
-
chainInfo:
|
|
2848
|
-
content:
|
|
2849
|
-
messages:
|
|
2850
|
-
changes:
|
|
2851
|
-
},
|
|
2846
|
+
return t.metadata?.is_l1 || t.metadata?.minitia?.type === "minimove" ? /* @__PURE__ */ n(qm, { changes: ta(e, r), chain: t }) : /* @__PURE__ */ n(Dm, { changes: ea(e, s), chain: t });
|
|
2847
|
+
}, Rm = "_link_oq58b_1", Bm = "_inner_oq58b_15", Om = "_header_oq58b_20", Lm = "_time_oq58b_29", Mm = "_error_oq58b_35", Fm = "_timestamp_oq58b_39", zm = "_chainInfo_oq58b_44", Um = "_content_oq58b_52", Km = "_messages_oq58b_59", Hm = "_changes_oq58b_64", Ae = {
|
|
2848
|
+
link: Rm,
|
|
2849
|
+
inner: Bm,
|
|
2850
|
+
header: Om,
|
|
2851
|
+
time: Lm,
|
|
2852
|
+
error: Mm,
|
|
2853
|
+
timestamp: Fm,
|
|
2854
|
+
chainInfo: zm,
|
|
2855
|
+
content: Um,
|
|
2856
|
+
messages: Km,
|
|
2857
|
+
changes: Hm
|
|
2858
|
+
}, Wm = ({ txItem: e, chain: t }) => /* @__PURE__ */ n(ss, { txHash: e.txhash, chainId: t.chainId, className: Ae.link, children: /* @__PURE__ */ u("div", { className: Ae.inner, children: [
|
|
2852
2859
|
/* @__PURE__ */ u("div", { className: Ae.header, children: [
|
|
2853
2860
|
/* @__PURE__ */ u("div", { className: Ae.time, children: [
|
|
2854
2861
|
e.code !== 0 && /* @__PURE__ */ n(Kn, { size: 14, className: Ae.error }),
|
|
@@ -2860,15 +2867,15 @@ const Sm = "_message_1g2hc_1", km = "_more_1g2hc_8", Rr = {
|
|
|
2860
2867
|
] })
|
|
2861
2868
|
] }),
|
|
2862
2869
|
/* @__PURE__ */ u("div", { className: Ae.content, children: [
|
|
2863
|
-
/* @__PURE__ */ n("div", { className: Ae.messages, children: /* @__PURE__ */ n(
|
|
2864
|
-
/* @__PURE__ */ n("div", { className: Ae.changes, children: /* @__PURE__ */ n(me, { suspenseFallback: null, errorBoundaryProps: { fallback: null }, children: /* @__PURE__ */ n(
|
|
2870
|
+
/* @__PURE__ */ n("div", { className: Ae.messages, children: /* @__PURE__ */ n($m, { messages: e.tx.body.messages }) }),
|
|
2871
|
+
/* @__PURE__ */ n("div", { className: Ae.changes, children: /* @__PURE__ */ n(me, { suspenseFallback: null, errorBoundaryProps: { fallback: null }, children: /* @__PURE__ */ n(Pm, { ...e, chain: t }) }) })
|
|
2865
2872
|
] })
|
|
2866
|
-
] }) }),
|
|
2867
|
-
list:
|
|
2868
|
-
dateGroup:
|
|
2869
|
-
dateHeader:
|
|
2870
|
-
more:
|
|
2871
|
-
},
|
|
2873
|
+
] }) }), jm = "_list_1wa9p_1", Vm = "_dateGroup_1wa9p_7", Gm = "_dateHeader_1wa9p_12", Qm = "_more_1wa9p_18", Cn = {
|
|
2874
|
+
list: jm,
|
|
2875
|
+
dateGroup: Vm,
|
|
2876
|
+
dateHeader: Gm,
|
|
2877
|
+
more: Qm
|
|
2878
|
+
}, Ym = ({ list: e, chainId: t }) => {
|
|
2872
2879
|
const s = re(), r = F(() => ma(e, (o) => {
|
|
2873
2880
|
if (o.timestamp)
|
|
2874
2881
|
return new Date(o.timestamp);
|
|
@@ -2876,7 +2883,7 @@ const Sm = "_message_1g2hc_1", km = "_more_1g2hc_8", Rr = {
|
|
|
2876
2883
|
return e.length === 0 ? /* @__PURE__ */ n(Y, { children: "No activity found" }) : /* @__PURE__ */ u(K, { children: [
|
|
2877
2884
|
/* @__PURE__ */ n("div", { className: Cn.list, children: Object.entries(r).map(([o, a]) => /* @__PURE__ */ u("div", { className: Cn.dateGroup, children: [
|
|
2878
2885
|
/* @__PURE__ */ n("div", { className: Cn.dateHeader, children: o }),
|
|
2879
|
-
a.map((i) => /* @__PURE__ */ n(me, { errorBoundaryProps: { fallback: null }, children: /* @__PURE__ */ n(
|
|
2886
|
+
a.map((i) => /* @__PURE__ */ n(me, { errorBoundaryProps: { fallback: null }, children: /* @__PURE__ */ n(Wm, { txItem: i, chain: i.chain }) }, i.txhash))
|
|
2880
2887
|
] }, o)) }),
|
|
2881
2888
|
/* @__PURE__ */ n(
|
|
2882
2889
|
ss,
|
|
@@ -2890,10 +2897,10 @@ const Sm = "_message_1g2hc_1", km = "_more_1g2hc_8", Rr = {
|
|
|
2890
2897
|
}
|
|
2891
2898
|
)
|
|
2892
2899
|
] });
|
|
2893
|
-
},
|
|
2894
|
-
const { activities: e, isLoading: t } =
|
|
2895
|
-
return t && e.length === 0 ? /* @__PURE__ */ n(Y, { children: "Loading activities..." }) : !e.length && !t ? /* @__PURE__ */ n(Y, { children: "No activity yet" }) : /* @__PURE__ */ u(
|
|
2896
|
-
/* @__PURE__ */ n(
|
|
2900
|
+
}, Jm = () => {
|
|
2901
|
+
const { activities: e, isLoading: t } = Cl(), [s, r] = Me(Nh), o = be(), a = F(() => Array.from(new Set(e.map((l) => l.chain.chainId))), [e]), i = F(() => s ? e.filter((l) => l.chain.chainId === s) : e, [e, s]);
|
|
2902
|
+
return t && e.length === 0 ? /* @__PURE__ */ n(Y, { children: "Loading activities..." }) : !e.length && !t ? /* @__PURE__ */ n(Y, { children: "No activity yet" }) : /* @__PURE__ */ u(tt.Root, { children: [
|
|
2903
|
+
/* @__PURE__ */ n(tt.Controls, { children: /* @__PURE__ */ n(
|
|
2897
2904
|
_r,
|
|
2898
2905
|
{
|
|
2899
2906
|
value: s,
|
|
@@ -2902,24 +2909,24 @@ const Sm = "_message_1g2hc_1", km = "_more_1g2hc_8", Rr = {
|
|
|
2902
2909
|
fullWidth: !0
|
|
2903
2910
|
}
|
|
2904
2911
|
) }),
|
|
2905
|
-
/* @__PURE__ */ n(
|
|
2912
|
+
/* @__PURE__ */ n(Ym, { list: i, chainId: s || o.chainId })
|
|
2906
2913
|
] });
|
|
2907
|
-
},
|
|
2908
|
-
totalValue:
|
|
2909
|
-
totalLabel:
|
|
2910
|
-
totalAmount:
|
|
2911
|
-
loading:
|
|
2912
|
-
nav:
|
|
2913
|
-
item:
|
|
2914
|
-
tabs:
|
|
2915
|
-
tab:
|
|
2916
|
-
},
|
|
2914
|
+
}, Zm = "_totalValue_1udv1_1", Xm = "_totalLabel_1udv1_7", e_ = "_totalAmount_1udv1_13", t_ = "_loading_1udv1_18", n_ = "_nav_1udv1_23", s_ = "_item_1udv1_28", r_ = "_tabs_1udv1_51", o_ = "_tab_1udv1_51", Ne = {
|
|
2915
|
+
totalValue: Zm,
|
|
2916
|
+
totalLabel: Xm,
|
|
2917
|
+
totalAmount: e_,
|
|
2918
|
+
loading: t_,
|
|
2919
|
+
nav: n_,
|
|
2920
|
+
item: s_,
|
|
2921
|
+
tabs: r_,
|
|
2922
|
+
tab: o_
|
|
2923
|
+
}, a_ = () => {
|
|
2917
2924
|
ia();
|
|
2918
2925
|
const e = ce(), t = Gn(), { totalValue: s, isLoading: r } = Ko(), o = Se(null);
|
|
2919
|
-
return /* @__PURE__ */ n(ca.Provider, { value: o, children: /* @__PURE__ */ u(
|
|
2926
|
+
return /* @__PURE__ */ n(ca.Provider, { value: o, children: /* @__PURE__ */ u(Ge, { ref: o, children: [
|
|
2920
2927
|
/* @__PURE__ */ u("div", { className: Ne.totalValue, children: [
|
|
2921
2928
|
/* @__PURE__ */ n("div", { className: Ne.totalLabel, children: "Total value" }),
|
|
2922
|
-
/* @__PURE__ */ n("div", { className: D(Ne.totalAmount, { [Ne.loading]: r }), children:
|
|
2929
|
+
/* @__PURE__ */ n("div", { className: D(Ne.totalAmount, { [Ne.loading]: r }), children: Ue(s) })
|
|
2923
2930
|
] }),
|
|
2924
2931
|
/* @__PURE__ */ u("div", { className: Ne.nav, children: [
|
|
2925
2932
|
/* @__PURE__ */ u(sr, { to: "/send", className: Ne.item, children: [
|
|
@@ -2931,38 +2938,38 @@ const Sm = "_message_1g2hc_1", km = "_more_1g2hc_8", Rr = {
|
|
|
2931
2938
|
/* @__PURE__ */ n("span", { children: "Bridge/Swap" })
|
|
2932
2939
|
] })
|
|
2933
2940
|
] }),
|
|
2934
|
-
/* @__PURE__ */ u(
|
|
2935
|
-
/* @__PURE__ */ u(
|
|
2936
|
-
/* @__PURE__ */ n(
|
|
2937
|
-
/* @__PURE__ */ n(
|
|
2938
|
-
/* @__PURE__ */ n(
|
|
2941
|
+
/* @__PURE__ */ u(Ye.Root, { value: t, onValueChange: e, children: [
|
|
2942
|
+
/* @__PURE__ */ u(Ye.List, { className: Ne.tabs, children: [
|
|
2943
|
+
/* @__PURE__ */ n(Ye.Tab, { className: Ne.tab, value: "/", children: "Assets" }),
|
|
2944
|
+
/* @__PURE__ */ n(Ye.Tab, { className: Ne.tab, value: "/nfts", children: "NFTs" }),
|
|
2945
|
+
/* @__PURE__ */ n(Ye.Tab, { className: Ne.tab, value: "/activity", children: "Activity" })
|
|
2939
2946
|
] }),
|
|
2940
|
-
/* @__PURE__ */ n(
|
|
2941
|
-
/* @__PURE__ */ n(
|
|
2942
|
-
/* @__PURE__ */ n(
|
|
2947
|
+
/* @__PURE__ */ n(Ye.Panel, { value: "/", children: /* @__PURE__ */ n(lm, {}) }),
|
|
2948
|
+
/* @__PURE__ */ n(Ye.Panel, { value: "/nfts", children: /* @__PURE__ */ n(Sm, {}) }),
|
|
2949
|
+
/* @__PURE__ */ n(Ye.Panel, { value: "/activity", children: /* @__PURE__ */ n(Jm, {}) })
|
|
2943
2950
|
] })
|
|
2944
2951
|
] }) });
|
|
2945
|
-
},
|
|
2946
|
-
header:
|
|
2947
|
-
back:
|
|
2948
|
-
title:
|
|
2952
|
+
}, i_ = "_header_acels_1", c_ = "_back_acels_11", l_ = "_title_acels_23", Ss = {
|
|
2953
|
+
header: i_,
|
|
2954
|
+
back: c_,
|
|
2955
|
+
title: l_
|
|
2949
2956
|
}, St = ({ title: e, backButton: t, extra: s, children: r }) => /* @__PURE__ */ u(K, { children: [
|
|
2950
2957
|
/* @__PURE__ */ u("header", { className: Ss.header, children: [
|
|
2951
2958
|
/* @__PURE__ */ n(sr, { to: t ?? -1, className: Ss.back, shouldReset: !!t, children: /* @__PURE__ */ n(Gi, { size: 16 }) }),
|
|
2952
2959
|
/* @__PURE__ */ n("h1", { className: Ss.title, children: e }),
|
|
2953
2960
|
s
|
|
2954
2961
|
] }),
|
|
2955
|
-
/* @__PURE__ */ n(
|
|
2956
|
-
] }),
|
|
2957
|
-
fieldset:
|
|
2958
|
-
upper:
|
|
2959
|
-
select:
|
|
2960
|
-
account:
|
|
2961
|
-
lower:
|
|
2962
|
-
wrapper:
|
|
2963
|
-
balance:
|
|
2964
|
-
value:
|
|
2965
|
-
error:
|
|
2962
|
+
/* @__PURE__ */ n(Ge, { children: r })
|
|
2963
|
+
] }), d_ = "_fieldset_y241y_1", u_ = "_upper_y241y_9", h_ = "_select_y241y_14", m_ = "_account_y241y_19", __ = "_lower_y241y_24", f_ = "_wrapper_y241y_25", p_ = "_balance_y241y_32", g_ = "_value_y241y_36", y_ = "_error_y241y_49", Oe = {
|
|
2964
|
+
fieldset: d_,
|
|
2965
|
+
upper: u_,
|
|
2966
|
+
select: h_,
|
|
2967
|
+
account: m_,
|
|
2968
|
+
lower: __,
|
|
2969
|
+
wrapper: f_,
|
|
2970
|
+
balance: p_,
|
|
2971
|
+
value: g_,
|
|
2972
|
+
error: y_
|
|
2966
2973
|
}, Ls = (e) => {
|
|
2967
2974
|
const {
|
|
2968
2975
|
selectButton: t,
|
|
@@ -2990,13 +2997,13 @@ const Sm = "_message_1g2hc_1", km = "_more_1g2hc_8", Rr = {
|
|
|
2990
2997
|
] })
|
|
2991
2998
|
] })
|
|
2992
2999
|
] });
|
|
2993
|
-
},
|
|
2994
|
-
root:
|
|
2995
|
-
content:
|
|
2996
|
-
details:
|
|
2997
|
-
symbol:
|
|
2998
|
-
chain:
|
|
2999
|
-
chevron:
|
|
3000
|
+
}, v_ = "_root_1ipwv_1", w_ = "_content_1ipwv_10", b_ = "_details_1ipwv_18", C_ = "_symbol_1ipwv_23", N_ = "_chain_1ipwv_31", I_ = "_chevron_1ipwv_40", ht = {
|
|
3001
|
+
root: v_,
|
|
3002
|
+
content: w_,
|
|
3003
|
+
details: b_,
|
|
3004
|
+
symbol: C_,
|
|
3005
|
+
chain: N_,
|
|
3006
|
+
chevron: I_
|
|
3000
3007
|
}, fa = ({ asset: e, chain: t, readOnly: s }) => {
|
|
3001
3008
|
const r = /* @__PURE__ */ u("div", { className: ht.content, children: [
|
|
3002
3009
|
/* @__PURE__ */ n(os, { assetLogoUrl: e.logoUrl, chainLogoUrl: t.logoUrl }),
|
|
@@ -3010,12 +3017,12 @@ const Sm = "_message_1g2hc_1", km = "_more_1g2hc_8", Rr = {
|
|
|
3010
3017
|
] });
|
|
3011
3018
|
return s ? /* @__PURE__ */ n("div", { className: ht.root, children: r }) : /* @__PURE__ */ u("div", { className: ht.root, children: [
|
|
3012
3019
|
r,
|
|
3013
|
-
/* @__PURE__ */ n(
|
|
3020
|
+
/* @__PURE__ */ n(rt, { size: 16, className: ht.chevron })
|
|
3014
3021
|
] });
|
|
3015
|
-
},
|
|
3016
|
-
wrapper:
|
|
3017
|
-
balance:
|
|
3018
|
-
button:
|
|
3022
|
+
}, S_ = "_wrapper_5ssm8_1", k_ = "_balance_5ssm8_11", x_ = "_button_5ssm8_15", ks = {
|
|
3023
|
+
wrapper: S_,
|
|
3024
|
+
balance: k_,
|
|
3025
|
+
button: x_
|
|
3019
3026
|
}, pa = ({ onClick: e, children: t, disabled: s }) => /* @__PURE__ */ u("div", { className: ks.wrapper, children: [
|
|
3020
3027
|
/* @__PURE__ */ n(Wn, { size: 16 }),
|
|
3021
3028
|
/* @__PURE__ */ n("span", { className: ks.balance, children: t }),
|
|
@@ -3030,8 +3037,8 @@ const Sm = "_message_1g2hc_1", km = "_more_1g2hc_8", Rr = {
|
|
|
3030
3037
|
children: "MAX"
|
|
3031
3038
|
}
|
|
3032
3039
|
)
|
|
3033
|
-
] }),
|
|
3034
|
-
input:
|
|
3040
|
+
] }), $_ = "_input_h8073_1", A_ = {
|
|
3041
|
+
input: $_
|
|
3035
3042
|
};
|
|
3036
3043
|
function Br(e, t) {
|
|
3037
3044
|
const s = e.replace(/[^0-9.]/g, ""), [r, ...o] = s.split(".");
|
|
@@ -3049,7 +3056,7 @@ function ga(e) {
|
|
|
3049
3056
|
"input",
|
|
3050
3057
|
{
|
|
3051
3058
|
...c,
|
|
3052
|
-
className: D(
|
|
3059
|
+
className: D(A_.input, o),
|
|
3053
3060
|
onChange: (d) => c.onChange(Br(d.target.value, r)),
|
|
3054
3061
|
onPaste: (d) => {
|
|
3055
3062
|
d.preventDefault();
|
|
@@ -3068,66 +3075,66 @@ function ga(e) {
|
|
|
3068
3075
|
}
|
|
3069
3076
|
);
|
|
3070
3077
|
}
|
|
3071
|
-
const
|
|
3072
|
-
input:
|
|
3073
|
-
placeholder:
|
|
3074
|
-
},
|
|
3078
|
+
const T_ = "_input_qpv94_1", E_ = "_placeholder_qpv94_18", Ms = {
|
|
3079
|
+
input: T_,
|
|
3080
|
+
placeholder: E_
|
|
3081
|
+
}, D_ = ({ children: e }) => /* @__PURE__ */ n("p", { className: D(Ms.input, { [Ms.placeholder]: P(e).isZero() }), children: e }), Bn = ({ balance: e, decimals: t }) => {
|
|
3075
3082
|
const { control: s } = Ft(), r = {
|
|
3076
3083
|
required: "Enter amount",
|
|
3077
3084
|
validate: (o) => P(o).isZero() ? "Enter amount" : P(Mn(o, { decimals: t })).gt(e ?? 0) ? "Insufficient balance" : !0
|
|
3078
3085
|
};
|
|
3079
3086
|
return /* @__PURE__ */ n(ga, { name: "quantity", control: s, className: Ms.input, rules: r });
|
|
3080
3087
|
};
|
|
3081
|
-
Bn.ReadOnly =
|
|
3082
|
-
const
|
|
3083
|
-
label:
|
|
3084
|
-
wrapper:
|
|
3085
|
-
input:
|
|
3086
|
-
clear:
|
|
3088
|
+
Bn.ReadOnly = D_;
|
|
3089
|
+
const q_ = "_label_9417z_1", P_ = "_wrapper_9417z_7", R_ = "_input_9417z_10", B_ = "_clear_9417z_18", Nn = {
|
|
3090
|
+
label: q_,
|
|
3091
|
+
wrapper: P_,
|
|
3092
|
+
input: R_,
|
|
3093
|
+
clear: B_
|
|
3087
3094
|
}, pr = ({ mode: e = "onChange", myAddress: t, ...s }) => {
|
|
3088
3095
|
const { validate: r = z.validate, chainType: o = "initia", onApply: a, ref: i } = s, l = un(), { control: c, getValues: d, setValue: h, formState: m } = Ft(), _ = d("recipient"), [f, p] = B(_), g = zo(), {
|
|
3089
|
-
data:
|
|
3090
|
-
isLoading:
|
|
3096
|
+
data: b,
|
|
3097
|
+
isLoading: k,
|
|
3091
3098
|
error: S
|
|
3092
3099
|
} = he({
|
|
3093
3100
|
queryKey: ts.address(g.restUrl, f).queryKey,
|
|
3094
3101
|
queryFn: () => g.getAddress(f),
|
|
3095
3102
|
staleTime: U.MINUTE,
|
|
3096
3103
|
enabled: g.validateUsername(f)
|
|
3097
|
-
}), $ =
|
|
3104
|
+
}), $ = b ?? (r(f) ? f : ""), w = t && z.equals($, t), T = async () => {
|
|
3098
3105
|
try {
|
|
3099
|
-
const
|
|
3100
|
-
p(
|
|
3106
|
+
const I = await navigator.clipboard.readText();
|
|
3107
|
+
p(I.trim());
|
|
3101
3108
|
} catch {
|
|
3102
3109
|
}
|
|
3103
3110
|
};
|
|
3104
3111
|
M(() => {
|
|
3105
|
-
e === "onChange" && (!f && !m.dirtyFields.recipient || h("recipient",
|
|
3112
|
+
e === "onChange" && (!f && !m.dirtyFields.recipient || h("recipient", b ?? f, {
|
|
3106
3113
|
shouldValidate: !0,
|
|
3107
3114
|
shouldDirty: !0
|
|
3108
3115
|
}));
|
|
3109
|
-
}, [m.dirtyFields.recipient, f, e, h,
|
|
3116
|
+
}, [m.dirtyFields.recipient, f, e, h, b]);
|
|
3110
3117
|
const q = () => {
|
|
3111
|
-
|
|
3118
|
+
k || S || (h("recipient", $, {
|
|
3112
3119
|
shouldValidate: !0,
|
|
3113
3120
|
shouldDirty: !0
|
|
3114
3121
|
}), a?.());
|
|
3115
3122
|
}, E = () => {
|
|
3116
|
-
if (
|
|
3117
|
-
return /* @__PURE__ */ n(
|
|
3123
|
+
if (k)
|
|
3124
|
+
return /* @__PURE__ */ n(et, { level: "loading", children: "Resolving username..." });
|
|
3118
3125
|
if (S)
|
|
3119
|
-
return /* @__PURE__ */ n(
|
|
3120
|
-
if (
|
|
3121
|
-
return /* @__PURE__ */ n(
|
|
3126
|
+
return /* @__PURE__ */ n(et, { level: "error", children: S.message });
|
|
3127
|
+
if (b)
|
|
3128
|
+
return /* @__PURE__ */ n(et, { level: "success", className: "monospace", children: b });
|
|
3122
3129
|
if (e === "onSubmit" && f && !$)
|
|
3123
|
-
return /* @__PURE__ */ n(
|
|
3130
|
+
return /* @__PURE__ */ n(et, { level: "error", children: "Invalid address" });
|
|
3124
3131
|
if (e === "onChange")
|
|
3125
|
-
return /* @__PURE__ */ n(
|
|
3132
|
+
return /* @__PURE__ */ n(et, { level: "error", children: m.errors.recipient?.message });
|
|
3126
3133
|
};
|
|
3127
3134
|
return /* @__PURE__ */ u("div", { children: [
|
|
3128
3135
|
/* @__PURE__ */ u("label", { htmlFor: "recipient", className: Nn.label, children: [
|
|
3129
3136
|
/* @__PURE__ */ n("span", { children: "Recipient" }),
|
|
3130
|
-
/* @__PURE__ */ n(
|
|
3137
|
+
/* @__PURE__ */ n(j.Small, { type: "button", tabIndex: -1, onClick: T, children: "Paste" })
|
|
3131
3138
|
] }),
|
|
3132
3139
|
/* @__PURE__ */ u("div", { className: Nn.wrapper, children: [
|
|
3133
3140
|
/* @__PURE__ */ n(
|
|
@@ -3137,7 +3144,7 @@ const D_ = "_label_9417z_1", q_ = "_wrapper_9417z_7", P_ = "_input_9417z_10", R_
|
|
|
3137
3144
|
control: c,
|
|
3138
3145
|
rules: {
|
|
3139
3146
|
required: "Recipient address is required",
|
|
3140
|
-
validate: (
|
|
3147
|
+
validate: (I) => r(I) || "Invalid address"
|
|
3141
3148
|
},
|
|
3142
3149
|
render: () => /* @__PURE__ */ n(
|
|
3143
3150
|
"input",
|
|
@@ -3145,7 +3152,7 @@ const D_ = "_label_9417z_1", q_ = "_wrapper_9417z_7", P_ = "_input_9417z_10", R_
|
|
|
3145
3152
|
id: "recipient",
|
|
3146
3153
|
className: D(Nn.input, "monospace"),
|
|
3147
3154
|
value: f,
|
|
3148
|
-
onChange: (
|
|
3155
|
+
onChange: (I) => p(I.target.value.trim()),
|
|
3149
3156
|
placeholder: o === "initia" ? "Address or username" : "Enter address",
|
|
3150
3157
|
autoComplete: "off",
|
|
3151
3158
|
"data-has-value": f ? "true" : void 0,
|
|
@@ -3166,17 +3173,17 @@ const D_ = "_label_9417z_1", q_ = "_wrapper_9417z_7", P_ = "_input_9417z_10", R_
|
|
|
3166
3173
|
)
|
|
3167
3174
|
] }),
|
|
3168
3175
|
E(),
|
|
3169
|
-
w && /* @__PURE__ */ n(
|
|
3176
|
+
w && /* @__PURE__ */ n(et, { children: "This is my address" }),
|
|
3170
3177
|
e === "onSubmit" && /* @__PURE__ */ n(
|
|
3171
3178
|
ee,
|
|
3172
3179
|
{
|
|
3173
3180
|
extra: (!t || !!$ && !w) && /* @__PURE__ */ n(X, { level: "warning", children: "Do not enter an exchange address. Tokens sent to an address that does not support bridge transfer will be irretrievable." }),
|
|
3174
3181
|
children: /* @__PURE__ */ n(
|
|
3175
|
-
|
|
3182
|
+
j.White,
|
|
3176
3183
|
{
|
|
3177
3184
|
type: "button",
|
|
3178
3185
|
onClick: q,
|
|
3179
|
-
disabled:
|
|
3186
|
+
disabled: k || !!S || !$,
|
|
3180
3187
|
children: "Apply"
|
|
3181
3188
|
}
|
|
3182
3189
|
)
|
|
@@ -3184,7 +3191,7 @@ const D_ = "_label_9417z_1", q_ = "_wrapper_9417z_7", P_ = "_input_9417z_10", R_
|
|
|
3184
3191
|
)
|
|
3185
3192
|
] });
|
|
3186
3193
|
};
|
|
3187
|
-
function
|
|
3194
|
+
function O_({
|
|
3188
3195
|
balances: e,
|
|
3189
3196
|
gasPrices: t,
|
|
3190
3197
|
gas: s
|
|
@@ -3194,14 +3201,14 @@ function B_({
|
|
|
3194
3201
|
return { amount: a, denom: r, balance: i };
|
|
3195
3202
|
}).filter(({ amount: r, balance: o }) => P(o).gte(r));
|
|
3196
3203
|
}
|
|
3197
|
-
function
|
|
3204
|
+
function L_({
|
|
3198
3205
|
denom: e,
|
|
3199
3206
|
balances: t,
|
|
3200
3207
|
gasPrices: s,
|
|
3201
3208
|
lastFeeDenom: r,
|
|
3202
3209
|
gas: o
|
|
3203
3210
|
}) {
|
|
3204
|
-
const a = t.find((d) => d.denom === e)?.amount ?? "0", i =
|
|
3211
|
+
const a = t.find((d) => d.denom === e)?.amount ?? "0", i = O_({ balances: t, gasPrices: s, gas: o }), l = i.find((d) => d.denom === r);
|
|
3205
3212
|
if (i.length === 0)
|
|
3206
3213
|
return a;
|
|
3207
3214
|
if (e === r && l) {
|
|
@@ -3215,18 +3222,18 @@ function O_({
|
|
|
3215
3222
|
}
|
|
3216
3223
|
return P(a).toString();
|
|
3217
3224
|
}
|
|
3218
|
-
const
|
|
3219
|
-
container:
|
|
3220
|
-
badge:
|
|
3225
|
+
const M_ = "_container_1a4ds_1", F_ = "_badge_1a4ds_5", Or = {
|
|
3226
|
+
container: M_,
|
|
3227
|
+
badge: F_
|
|
3221
3228
|
}, ya = (e) => {
|
|
3222
3229
|
const { offset: t = -4, disabled: s, children: r, className: o } = e;
|
|
3223
3230
|
return /* @__PURE__ */ u("div", { className: D(Or.container, o), children: [
|
|
3224
3231
|
r,
|
|
3225
3232
|
!s && /* @__PURE__ */ n("div", { className: Or.badge, style: { right: t, top: t } })
|
|
3226
3233
|
] });
|
|
3227
|
-
},
|
|
3228
|
-
tooltip:
|
|
3229
|
-
arrow:
|
|
3234
|
+
}, z_ = "_tooltip_6zakp_1", U_ = "_arrow_6zakp_43", Lr = {
|
|
3235
|
+
tooltip: z_,
|
|
3236
|
+
arrow: U_
|
|
3230
3237
|
}, hn = ({ label: e, children: t, small: s, ...r }) => /* @__PURE__ */ u(Dt.Root, { ...r, children: [
|
|
3231
3238
|
/* @__PURE__ */ n(Dt.Trigger, { asChild: !0, children: t }),
|
|
3232
3239
|
/* @__PURE__ */ n(Dt.Portal, { container: yt(), children: /* @__PURE__ */ u(
|
|
@@ -3242,13 +3249,13 @@ const L_ = "_container_1a4ds_1", M_ = "_badge_1a4ds_5", Or = {
|
|
|
3242
3249
|
]
|
|
3243
3250
|
}
|
|
3244
3251
|
) })
|
|
3245
|
-
] }),
|
|
3246
|
-
stack:
|
|
3247
|
-
title:
|
|
3248
|
-
grid:
|
|
3249
|
-
item:
|
|
3250
|
-
button:
|
|
3251
|
-
active:
|
|
3252
|
+
] }), K_ = "_stack_a3b9q_1", H_ = "_title_a3b9q_8", W_ = "_grid_a3b9q_15", j_ = "_item_a3b9q_21", V_ = "_button_a3b9q_25", G_ = "_active_a3b9q_43", Pt = {
|
|
3253
|
+
stack: K_,
|
|
3254
|
+
title: H_,
|
|
3255
|
+
grid: W_,
|
|
3256
|
+
item: j_,
|
|
3257
|
+
button: V_,
|
|
3258
|
+
active: G_
|
|
3252
3259
|
}, gt = ({ label: e, chains: t, value: s, onSelect: r, getShowIndicator: o }) => /* @__PURE__ */ u("div", { children: [
|
|
3253
3260
|
e && /* @__PURE__ */ n("h2", { className: Pt.title, children: e }),
|
|
3254
3261
|
/* @__PURE__ */ n("div", { className: Pt.grid, children: t.map(({ chainId: a, name: i, logoUrl: l }) => /* @__PURE__ */ n(
|
|
@@ -3269,27 +3276,27 @@ const L_ = "_container_1a4ds_1", M_ = "_badge_1a4ds_5", Or = {
|
|
|
3269
3276
|
},
|
|
3270
3277
|
a
|
|
3271
3278
|
)) })
|
|
3272
|
-
] }),
|
|
3273
|
-
gt.Stack =
|
|
3274
|
-
function
|
|
3279
|
+
] }), Q_ = ({ children: e }) => /* @__PURE__ */ n("div", { className: Pt.stack, children: e });
|
|
3280
|
+
gt.Stack = Q_;
|
|
3281
|
+
function Y_(e, t, s) {
|
|
3275
3282
|
return s.filter((r) => {
|
|
3276
3283
|
const o = e.map((a) => r[a]).map((a) => String(a ?? "").toLowerCase());
|
|
3277
3284
|
return di(so(t.toLowerCase()), o);
|
|
3278
3285
|
});
|
|
3279
3286
|
}
|
|
3280
|
-
const
|
|
3281
|
-
container:
|
|
3282
|
-
search:
|
|
3283
|
-
list:
|
|
3284
|
-
item:
|
|
3285
|
-
logo:
|
|
3286
|
-
info:
|
|
3287
|
-
symbol:
|
|
3288
|
-
name:
|
|
3289
|
-
balance:
|
|
3290
|
-
value:
|
|
3287
|
+
const J_ = "_container_1voou_1", Z_ = "_search_1voou_6", X_ = "_list_1voou_10", ef = "_item_1voou_14", tf = "_logo_1voou_35", nf = "_info_1voou_39", sf = "_symbol_1voou_44", rf = "_name_1voou_52", of = "_balance_1voou_58", af = "_value_1voou_65", ve = {
|
|
3288
|
+
container: J_,
|
|
3289
|
+
search: Z_,
|
|
3290
|
+
list: X_,
|
|
3291
|
+
item: ef,
|
|
3292
|
+
logo: tf,
|
|
3293
|
+
info: nf,
|
|
3294
|
+
symbol: sf,
|
|
3295
|
+
name: rf,
|
|
3296
|
+
balance: of,
|
|
3297
|
+
value: af
|
|
3291
3298
|
}, mn = (e) => {
|
|
3292
|
-
const { assets: t, onSelect: s, renderAsset: r = (l, c) => c(l) } = e, [o, a] = B(""), i =
|
|
3299
|
+
const { assets: t, onSelect: s, renderAsset: r = (l, c) => c(l) } = e, [o, a] = B(""), i = Y_(["symbol"], o, t);
|
|
3293
3300
|
return /* @__PURE__ */ u("div", { className: ve.container, children: [
|
|
3294
3301
|
/* @__PURE__ */ n(
|
|
3295
3302
|
rs,
|
|
@@ -3319,7 +3326,7 @@ const Y_ = "_container_1voou_1", J_ = "_search_1voou_6", Z_ = "_list_1voou_10",
|
|
|
3319
3326
|
] }),
|
|
3320
3327
|
/* @__PURE__ */ u("div", { className: ve.balance, children: [
|
|
3321
3328
|
f && /* @__PURE__ */ n("div", { children: se(f, { decimals: p }) }),
|
|
3322
|
-
g > 0 && /* @__PURE__ */ n("div", { className: ve.value, children:
|
|
3329
|
+
g > 0 && /* @__PURE__ */ n("div", { className: ve.value, children: Ue(g) })
|
|
3323
3330
|
] })
|
|
3324
3331
|
] });
|
|
3325
3332
|
})
|
|
@@ -3327,7 +3334,7 @@ const Y_ = "_container_1voou_1", J_ = "_search_1voou_6", Z_ = "_list_1voou_10",
|
|
|
3327
3334
|
l.denom
|
|
3328
3335
|
)) })
|
|
3329
3336
|
] });
|
|
3330
|
-
},
|
|
3337
|
+
}, cf = () => /* @__PURE__ */ u("div", { className: ve.container, children: [
|
|
3331
3338
|
/* @__PURE__ */ n(
|
|
3332
3339
|
rs,
|
|
3333
3340
|
{
|
|
@@ -3339,12 +3346,12 @@ const Y_ = "_container_1voou_1", J_ = "_search_1voou_6", Z_ = "_list_1voou_10",
|
|
|
3339
3346
|
),
|
|
3340
3347
|
/* @__PURE__ */ n(Y, { children: "Loading..." })
|
|
3341
3348
|
] });
|
|
3342
|
-
mn.Placeholder =
|
|
3343
|
-
const
|
|
3344
|
-
const s =
|
|
3349
|
+
mn.Placeholder = cf;
|
|
3350
|
+
const lf = ({ chain: e, onSelect: t }) => {
|
|
3351
|
+
const s = Lc(e);
|
|
3345
3352
|
return /* @__PURE__ */ n(mn, { assets: s, onSelect: t });
|
|
3346
|
-
},
|
|
3347
|
-
const { watch: t, setValue: s } = Ft(), { chainId: r, denom: o } = t(), { chainId: a } = t(), [i, l] = B(a), c =
|
|
3353
|
+
}, df = ({ afterSelect: e }) => {
|
|
3354
|
+
const { watch: t, setValue: s } = Ft(), { chainId: r, denom: o } = t(), { chainId: a } = t(), [i, l] = B(a), c = je(i), d = ne(), h = (m) => {
|
|
3348
3355
|
if (r === i && o === m) {
|
|
3349
3356
|
e();
|
|
3350
3357
|
return;
|
|
@@ -3353,18 +3360,18 @@ const cf = ({ chain: e, onSelect: t }) => {
|
|
|
3353
3360
|
};
|
|
3354
3361
|
return /* @__PURE__ */ u(K, { children: [
|
|
3355
3362
|
/* @__PURE__ */ n(gt.Stack, { children: /* @__PURE__ */ n(gt, { chains: d, value: i, onSelect: l }) }),
|
|
3356
|
-
/* @__PURE__ */ n(me, { suspenseFallback: /* @__PURE__ */ n(mn.Placeholder, {}), children: /* @__PURE__ */ n(
|
|
3363
|
+
/* @__PURE__ */ n(me, { suspenseFallback: /* @__PURE__ */ n(mn.Placeholder, {}), children: /* @__PURE__ */ n(lf, { chain: c, onSelect: h }) }, i)
|
|
3357
3364
|
] });
|
|
3358
|
-
},
|
|
3359
|
-
fields:
|
|
3360
|
-
divider:
|
|
3361
|
-
},
|
|
3365
|
+
}, uf = "_fields_brpej_1", hf = "_divider_brpej_11", Mr = {
|
|
3366
|
+
fields: uf,
|
|
3367
|
+
divider: hf
|
|
3368
|
+
}, mf = Re("interwovenkit:send", {
|
|
3362
3369
|
gas: (e) => [e]
|
|
3363
|
-
}),
|
|
3364
|
-
const { address: e, initiaAddress: t, estimateGas: s, requestTxSync: r } = ke(), { register: o, watch: a, setValue: i, handleSubmit: l, formState: c } = Ft(), { chainId: d, denom: h, recipient: m, quantity: _, memo: f } = a(), p =
|
|
3365
|
-
queryKey:
|
|
3370
|
+
}), _f = () => {
|
|
3371
|
+
const { address: e, initiaAddress: t, estimateGas: s, requestTxSync: r } = ke(), { register: o, watch: a, setValue: i, handleSubmit: l, formState: c } = Ft(), { chainId: d, denom: h, recipient: m, quantity: _, memo: f } = a(), p = je(d), g = ir(p), b = Jo(p), k = Zo(p), S = Mo(h, p), { data: $ } = Yn(p), { decimals: w } = S, T = g.find((N) => N.denom === h)?.amount ?? "0", q = $?.find(({ id: N }) => N === h)?.price, { data: E = 0, isLoading: I } = he({
|
|
3372
|
+
queryKey: mf.gas({ chainId: d, denom: h, recipient: m, initiaAddress: t }).queryKey,
|
|
3366
3373
|
queryFn: () => {
|
|
3367
|
-
const
|
|
3374
|
+
const N = [
|
|
3368
3375
|
{
|
|
3369
3376
|
typeUrl: "/cosmos.bank.v1beta1.MsgSend",
|
|
3370
3377
|
value: Sr.fromPartial({
|
|
@@ -3374,13 +3381,13 @@ const cf = ({ chain: e, onSelect: t }) => {
|
|
|
3374
3381
|
})
|
|
3375
3382
|
}
|
|
3376
3383
|
];
|
|
3377
|
-
return s({ messages:
|
|
3384
|
+
return s({ messages: N, chainId: d });
|
|
3378
3385
|
},
|
|
3379
3386
|
enabled: z.validate(m),
|
|
3380
3387
|
staleTime: U.INFINITY
|
|
3381
|
-
}), y = Math.ceil(E * Dn),
|
|
3382
|
-
mutationFn: ({ chainId:
|
|
3383
|
-
const de = Mn(
|
|
3388
|
+
}), y = Math.ceil(E * Dn), C = L_({ denom: h, balances: g, gasPrices: b, lastFeeDenom: k, gas: y }), { mutate: v, isPending: A } = Ke({
|
|
3389
|
+
mutationFn: ({ chainId: N, denom: R, quantity: x, recipient: V, memo: W }) => {
|
|
3390
|
+
const de = Mn(x, { decimals: w }), _e = [
|
|
3384
3391
|
{
|
|
3385
3392
|
typeUrl: "/cosmos.bank.v1beta1.MsgSend",
|
|
3386
3393
|
value: Sr.fromPartial({
|
|
@@ -3392,17 +3399,17 @@ const cf = ({ chain: e, onSelect: t }) => {
|
|
|
3392
3399
|
];
|
|
3393
3400
|
return r({
|
|
3394
3401
|
messages: _e,
|
|
3395
|
-
memo:
|
|
3396
|
-
chainId:
|
|
3402
|
+
memo: W,
|
|
3403
|
+
chainId: N,
|
|
3397
3404
|
gas: E,
|
|
3398
3405
|
gasAdjustment: Dn,
|
|
3399
|
-
gasPrices:
|
|
3406
|
+
gasPrices: b,
|
|
3400
3407
|
spendCoins: [{ denom: R, amount: de }],
|
|
3401
3408
|
internal: "/"
|
|
3402
3409
|
});
|
|
3403
3410
|
}
|
|
3404
3411
|
});
|
|
3405
|
-
return /* @__PURE__ */ n(St, { title: "Send", children: /* @__PURE__ */ u("form", { onSubmit: l((
|
|
3412
|
+
return /* @__PURE__ */ n(St, { title: "Send", children: /* @__PURE__ */ u("form", { onSubmit: l((N) => v(N)), children: [
|
|
3406
3413
|
/* @__PURE__ */ u("div", { className: Mr.fields, children: [
|
|
3407
3414
|
/* @__PURE__ */ n(
|
|
3408
3415
|
Ls,
|
|
@@ -3411,22 +3418,22 @@ const cf = ({ chain: e, onSelect: t }) => {
|
|
|
3411
3418
|
vt,
|
|
3412
3419
|
{
|
|
3413
3420
|
title: "Select chain and asset",
|
|
3414
|
-
content: (
|
|
3421
|
+
content: (N) => /* @__PURE__ */ n(df, { afterSelect: N }),
|
|
3415
3422
|
children: /* @__PURE__ */ n(fa, { asset: S, chain: p })
|
|
3416
3423
|
}
|
|
3417
3424
|
),
|
|
3418
|
-
quantityInput: /* @__PURE__ */ n(Bn, { balance:
|
|
3425
|
+
quantityInput: /* @__PURE__ */ n(Bn, { balance: T, decimals: w }),
|
|
3419
3426
|
balanceButton: /* @__PURE__ */ n(
|
|
3420
3427
|
pa,
|
|
3421
3428
|
{
|
|
3422
|
-
onClick: () => i("quantity", nn(
|
|
3429
|
+
onClick: () => i("quantity", nn(C, { decimals: w }), {
|
|
3423
3430
|
shouldValidate: !0
|
|
3424
3431
|
}),
|
|
3425
|
-
disabled:
|
|
3426
|
-
children: se(
|
|
3432
|
+
disabled: b.some(({ denom: N }) => N === h) && I,
|
|
3433
|
+
children: se(T ?? "0", { decimals: w })
|
|
3427
3434
|
}
|
|
3428
3435
|
),
|
|
3429
|
-
value: _ ? q ?
|
|
3436
|
+
value: _ ? q ? Ue(P(_).times(q)) : "$-" : "$0",
|
|
3430
3437
|
errorMessage: c.errors.quantity?.message
|
|
3431
3438
|
}
|
|
3432
3439
|
),
|
|
@@ -3438,44 +3445,44 @@ const cf = ({ chain: e, onSelect: t }) => {
|
|
|
3438
3445
|
"input",
|
|
3439
3446
|
{
|
|
3440
3447
|
...o("memo", {
|
|
3441
|
-
validate: (
|
|
3448
|
+
validate: (N) => !N || new Blob([N]).size <= 256 || "Memo is too long"
|
|
3442
3449
|
}),
|
|
3443
3450
|
id: "memo",
|
|
3444
3451
|
autoComplete: "off"
|
|
3445
3452
|
}
|
|
3446
3453
|
),
|
|
3447
|
-
/* @__PURE__ */ n(
|
|
3454
|
+
/* @__PURE__ */ n(et, { level: "error", children: c.errors.memo?.message })
|
|
3448
3455
|
] }),
|
|
3449
3456
|
/* @__PURE__ */ n(X.Stack, { children: !f && /* @__PURE__ */ n(X, { level: "warning", children: "Check if the above transaction requires a memo" }) })
|
|
3450
3457
|
] }),
|
|
3451
3458
|
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
3452
|
-
|
|
3459
|
+
j.White,
|
|
3453
3460
|
{
|
|
3454
3461
|
type: "submit",
|
|
3455
|
-
loading:
|
|
3462
|
+
loading: I || A,
|
|
3456
3463
|
disabled: !c.isValid,
|
|
3457
3464
|
children: "Confirm"
|
|
3458
3465
|
}
|
|
3459
3466
|
) })
|
|
3460
3467
|
] }) });
|
|
3461
|
-
},
|
|
3468
|
+
}, ff = () => {
|
|
3462
3469
|
const e = Ct(), t = cn(), s = sn(t), [r] = s, { chain: o = t, denom: a = r.denom } = e, i = jn({
|
|
3463
3470
|
mode: "onChange",
|
|
3464
3471
|
defaultValues: { chainId: o.chainId, denom: a, quantity: "", recipient: "", memo: "" }
|
|
3465
3472
|
});
|
|
3466
|
-
return /* @__PURE__ */ n(tr, { ...i, children: /* @__PURE__ */ n(
|
|
3467
|
-
},
|
|
3468
|
-
header:
|
|
3469
|
-
collectionName:
|
|
3470
|
-
name:
|
|
3471
|
-
chainInfo:
|
|
3472
|
-
attributes:
|
|
3473
|
-
title:
|
|
3474
|
-
count:
|
|
3475
|
-
item:
|
|
3476
|
-
type:
|
|
3477
|
-
value:
|
|
3478
|
-
},
|
|
3473
|
+
return /* @__PURE__ */ n(tr, { ...i, children: /* @__PURE__ */ n(_f, {}) });
|
|
3474
|
+
}, pf = "_header_4z0mk_1", gf = "_collectionName_4z0mk_6", yf = "_name_4z0mk_12", vf = "_chainInfo_4z0mk_18", wf = "_attributes_4z0mk_28", bf = "_title_4z0mk_31", Cf = "_count_4z0mk_36", Nf = "_item_4z0mk_40", If = "_type_4z0mk_46", Sf = "_value_4z0mk_52", Te = {
|
|
3475
|
+
header: pf,
|
|
3476
|
+
collectionName: gf,
|
|
3477
|
+
name: yf,
|
|
3478
|
+
chainInfo: vf,
|
|
3479
|
+
attributes: wf,
|
|
3480
|
+
title: bf,
|
|
3481
|
+
count: Cf,
|
|
3482
|
+
item: Nf,
|
|
3483
|
+
type: If,
|
|
3484
|
+
value: Sf
|
|
3485
|
+
}, kf = () => {
|
|
3479
3486
|
const e = ce(), t = Ct(), { collection_name: s, image: r, name: o, attributes: a, chain: i } = t;
|
|
3480
3487
|
return /* @__PURE__ */ u(St, { title: "NFT details", children: [
|
|
3481
3488
|
/* @__PURE__ */ u("header", { className: Te.header, children: [
|
|
@@ -3489,7 +3496,7 @@ const cf = ({ chain: e, onSelect: t }) => {
|
|
|
3489
3496
|
] })
|
|
3490
3497
|
] })
|
|
3491
3498
|
] }),
|
|
3492
|
-
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
3499
|
+
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(j.White, { onClick: () => e("/nft/send", t), sm: !0, children: "Send" }) }),
|
|
3493
3500
|
a && /* @__PURE__ */ u("div", { className: Te.attributes, children: [
|
|
3494
3501
|
/* @__PURE__ */ u("header", { className: Te.title, children: [
|
|
3495
3502
|
"Traits ",
|
|
@@ -3505,15 +3512,15 @@ const cf = ({ chain: e, onSelect: t }) => {
|
|
|
3505
3512
|
] }, l)) })
|
|
3506
3513
|
] })
|
|
3507
3514
|
] });
|
|
3508
|
-
},
|
|
3509
|
-
scrollable:
|
|
3510
|
-
list:
|
|
3511
|
-
item:
|
|
3512
|
-
name:
|
|
3515
|
+
}, xf = "_scrollable_1p1lw_1", $f = "_list_1p1lw_5", Af = "_item_1p1lw_9", Tf = "_name_1p1lw_13", In = {
|
|
3516
|
+
scrollable: xf,
|
|
3517
|
+
list: $f,
|
|
3518
|
+
item: Af,
|
|
3519
|
+
name: Tf
|
|
3513
3520
|
};
|
|
3514
3521
|
function va({ onSelect: e, list: t, ...s }) {
|
|
3515
3522
|
const { getImage: r, getName: o, getKey: a, getIsLoading: i, getDisabled: l } = s;
|
|
3516
|
-
return /* @__PURE__ */ n(
|
|
3523
|
+
return /* @__PURE__ */ n(Ge, { className: In.scrollable, children: /* @__PURE__ */ n("div", { className: In.list, children: t.map((c) => /* @__PURE__ */ u(
|
|
3517
3524
|
"button",
|
|
3518
3525
|
{
|
|
3519
3526
|
className: In.item,
|
|
@@ -3528,18 +3535,18 @@ function va({ onSelect: e, list: t, ...s }) {
|
|
|
3528
3535
|
a(c)
|
|
3529
3536
|
)) }) });
|
|
3530
3537
|
}
|
|
3531
|
-
const
|
|
3532
|
-
header:
|
|
3533
|
-
name:
|
|
3534
|
-
collection:
|
|
3535
|
-
nft:
|
|
3536
|
-
fields:
|
|
3537
|
-
chain:
|
|
3538
|
-
},
|
|
3538
|
+
const Ef = "_header_5w36t_1", Df = "_name_5w36t_8", qf = "_collection_5w36t_15", Pf = "_nft_5w36t_20", Rf = "_fields_5w36t_24", Bf = "_chain_5w36t_29", Et = {
|
|
3539
|
+
header: Ef,
|
|
3540
|
+
name: Df,
|
|
3541
|
+
collection: qf,
|
|
3542
|
+
nft: Pf,
|
|
3543
|
+
fields: Rf,
|
|
3544
|
+
chain: Bf
|
|
3545
|
+
}, Of = Re("interwovenkit:send-nft", {
|
|
3539
3546
|
simulation: (e) => [e]
|
|
3540
|
-
}),
|
|
3541
|
-
const e = ne(), t = Ct(), { chain: s, collection_addr: r, collection_name: o, image: a, name: i } = t, { routerApiUrl: l } = le(), c = Zn(), d = be(), { address: h, initiaAddress: m, requestTxSync: _ } = ke(), { watch: f, setValue: p, handleSubmit: g, formState:
|
|
3542
|
-
queryKey:
|
|
3547
|
+
}), Lf = () => {
|
|
3548
|
+
const e = ne(), t = Ct(), { chain: s, collection_addr: r, collection_name: o, image: a, name: i } = t, { routerApiUrl: l } = le(), c = Zn(), d = be(), { address: h, initiaAddress: m, requestTxSync: _ } = ke(), { watch: f, setValue: p, handleSubmit: g, formState: b } = Ft(), k = f(), { recipient: S, dstChainId: $ } = k, w = je($), T = he({
|
|
3549
|
+
queryKey: Of.simulation({
|
|
3543
3550
|
collection_addr: r,
|
|
3544
3551
|
nft: t,
|
|
3545
3552
|
sender: m,
|
|
@@ -3558,11 +3565,11 @@ const Tf = "_header_5w36t_1", Ef = "_name_5w36t_8", Df = "_collection_5w36t_15",
|
|
|
3558
3565
|
collection_address: r,
|
|
3559
3566
|
token_ids: [t.token_id],
|
|
3560
3567
|
object_addresses: [t.object_addr]
|
|
3561
|
-
}, { msgs:
|
|
3562
|
-
return
|
|
3568
|
+
}, { msgs: A } = await te.create({ prefixUrl: l }).post("nft", { json: v }).json();
|
|
3569
|
+
return A.map((N) => c.fromAmino(N));
|
|
3563
3570
|
},
|
|
3564
3571
|
enabled: z.validate(S)
|
|
3565
|
-
}), { data: q, isLoading: E, error:
|
|
3572
|
+
}), { data: q, isLoading: E, error: I } = T, { mutate: y, isPending: C } = Ke({
|
|
3566
3573
|
mutationFn: async () => {
|
|
3567
3574
|
if (!q) throw new Error("Route not found");
|
|
3568
3575
|
await _({ messages: q, chainId: s.chainId, internal: "/nfts" });
|
|
@@ -3586,13 +3593,13 @@ const Tf = "_header_5w36t_1", Ef = "_name_5w36t_8", Df = "_collection_5w36t_15",
|
|
|
3586
3593
|
content: (v) => /* @__PURE__ */ n(
|
|
3587
3594
|
va,
|
|
3588
3595
|
{
|
|
3589
|
-
onSelect: ({ chainId:
|
|
3590
|
-
p("dstChainId",
|
|
3596
|
+
onSelect: ({ chainId: A }) => {
|
|
3597
|
+
p("dstChainId", A), v();
|
|
3591
3598
|
},
|
|
3592
3599
|
list: e,
|
|
3593
|
-
getImage: (
|
|
3594
|
-
getName: (
|
|
3595
|
-
getKey: (
|
|
3600
|
+
getImage: (A) => A.logoUrl,
|
|
3601
|
+
getName: (A) => A.name,
|
|
3602
|
+
getKey: (A) => A.chainId
|
|
3596
3603
|
}
|
|
3597
3604
|
),
|
|
3598
3605
|
className: D("input", Et.chain),
|
|
@@ -3605,23 +3612,23 @@ const Tf = "_header_5w36t_1", Ef = "_name_5w36t_8", Df = "_collection_5w36t_15",
|
|
|
3605
3612
|
] }) }),
|
|
3606
3613
|
/* @__PURE__ */ n(pr, { myAddress: h, ref: un() })
|
|
3607
3614
|
] }),
|
|
3608
|
-
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
3615
|
+
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(j.White, { loading: E || C, disabled: !b.isValid || !!I, children: I ? "Route not found" : "Confirm" }) })
|
|
3609
3616
|
] });
|
|
3610
|
-
},
|
|
3617
|
+
}, Mf = () => {
|
|
3611
3618
|
const { chain: e } = Ct(), t = jn({
|
|
3612
3619
|
mode: "onChange",
|
|
3613
3620
|
defaultValues: { dstChainId: e.chainId, recipient: "" }
|
|
3614
3621
|
});
|
|
3615
|
-
return /* @__PURE__ */ n(St, { title: "Send NFT", children: /* @__PURE__ */ n(tr, { ...t, children: /* @__PURE__ */ n(
|
|
3622
|
+
return /* @__PURE__ */ n(St, { title: "Send NFT", children: /* @__PURE__ */ n(tr, { ...t, children: /* @__PURE__ */ n(Lf, {}) }) });
|
|
3616
3623
|
};
|
|
3617
|
-
function
|
|
3624
|
+
function Ff() {
|
|
3618
3625
|
return be().network_type === "testnet";
|
|
3619
3626
|
}
|
|
3620
3627
|
function it() {
|
|
3621
3628
|
return Ft();
|
|
3622
3629
|
}
|
|
3623
|
-
function
|
|
3624
|
-
const e = Ct(), t =
|
|
3630
|
+
function zf() {
|
|
3631
|
+
const e = Ct(), t = Ff(), s = {
|
|
3625
3632
|
quantity: "",
|
|
3626
3633
|
slippagePercent: "0.5",
|
|
3627
3634
|
sender: "",
|
|
@@ -3687,7 +3694,7 @@ function ba() {
|
|
|
3687
3694
|
}
|
|
3688
3695
|
};
|
|
3689
3696
|
}
|
|
3690
|
-
function
|
|
3697
|
+
function Uf() {
|
|
3691
3698
|
const e = Nt(), t = dn();
|
|
3692
3699
|
return ({
|
|
3693
3700
|
initialAddress: s,
|
|
@@ -3709,7 +3716,7 @@ function zf() {
|
|
|
3709
3716
|
return "";
|
|
3710
3717
|
};
|
|
3711
3718
|
}
|
|
3712
|
-
const
|
|
3719
|
+
const Kf = [
|
|
3713
3720
|
["d", 1440 * 60],
|
|
3714
3721
|
// day
|
|
3715
3722
|
["h", 3600],
|
|
@@ -3721,7 +3728,7 @@ const Uf = [
|
|
|
3721
3728
|
];
|
|
3722
3729
|
function Fs(e) {
|
|
3723
3730
|
if (!e) return;
|
|
3724
|
-
const { formattedParts: t } =
|
|
3731
|
+
const { formattedParts: t } = Kf.reduce(
|
|
3725
3732
|
({ remainingSeconds: s, formattedParts: r }, [o, a]) => {
|
|
3726
3733
|
const i = Math.floor(s / a);
|
|
3727
3734
|
return {
|
|
@@ -3740,7 +3747,7 @@ function Ca(e) {
|
|
|
3740
3747
|
}).join(", ");
|
|
3741
3748
|
}
|
|
3742
3749
|
function Fr(e, t) {
|
|
3743
|
-
const { watch: s } = it(), r = s(), o =
|
|
3750
|
+
const { watch: s } = it(), r = s(), o = Ve(), a = Xn(), i = { ...r, quantity: e }, l = wt();
|
|
3744
3751
|
return he({
|
|
3745
3752
|
queryKey: qe.route(i, t?.isOpWithdraw).queryKey,
|
|
3746
3753
|
queryFn: async () => {
|
|
@@ -3753,20 +3760,20 @@ function Fr(e, t) {
|
|
|
3753
3760
|
dest_asset_chain_id: m,
|
|
3754
3761
|
dest_asset_denom: _,
|
|
3755
3762
|
is_op_withdraw: t?.isOpWithdraw
|
|
3756
|
-
}, g = await o.post("v2/fungible/route", { json: p }).json(),
|
|
3763
|
+
}, g = await o.post("v2/fungible/route", { json: p }).json(), b = {
|
|
3757
3764
|
quantity: i.quantity,
|
|
3758
3765
|
srcChainId: i.srcChainId,
|
|
3759
3766
|
srcDenom: i.srcDenom,
|
|
3760
3767
|
dstChainId: i.dstChainId,
|
|
3761
3768
|
dstDenom: i.dstDenom
|
|
3762
3769
|
};
|
|
3763
|
-
return a("Bridge Simulation Success",
|
|
3770
|
+
return a("Bridge Simulation Success", b), g;
|
|
3764
3771
|
},
|
|
3765
3772
|
enabled: !!Number(i.quantity) && !t?.disabled,
|
|
3766
3773
|
staleTime: U.MINUTE
|
|
3767
3774
|
});
|
|
3768
3775
|
}
|
|
3769
|
-
function
|
|
3776
|
+
function Hf(e) {
|
|
3770
3777
|
return he({
|
|
3771
3778
|
queryKey: qe.routeErrorInfo(e || new Error()).queryKey,
|
|
3772
3779
|
queryFn: async () => {
|
|
@@ -3776,12 +3783,12 @@ function Kf(e) {
|
|
|
3776
3783
|
}
|
|
3777
3784
|
});
|
|
3778
3785
|
}
|
|
3779
|
-
function
|
|
3780
|
-
const { watch: e } = it(), { srcChainId: t, srcDenom: s, dstChainId: r, dstDenom: o } = e(), a = Pe(t), i = rn(a), l =
|
|
3786
|
+
function Wf() {
|
|
3787
|
+
const { watch: e } = it(), { srcChainId: t, srcDenom: s, dstChainId: r, dstDenom: o } = e(), a = Pe(t), i = rn(a), l = ze(s, t), c = ze(o, r), d = be(), h = ne();
|
|
3781
3788
|
return i === "initia" && r === d.chainId && l.symbol === c.symbol && h.find((m) => m.chainId === t)?.metadata?.op_denoms?.includes(c.denom);
|
|
3782
3789
|
}
|
|
3783
3790
|
function gr(e, t) {
|
|
3784
|
-
const s =
|
|
3791
|
+
const s = Ve();
|
|
3785
3792
|
return he({
|
|
3786
3793
|
queryKey: qe.balances(t, e).queryKey,
|
|
3787
3794
|
queryFn: () => s.post("v2/info/balances", { json: { chains: { [t]: { address: e, denoms: [] } } } }).json(),
|
|
@@ -3790,19 +3797,19 @@ function gr(e, t) {
|
|
|
3790
3797
|
staleTime: U.SECOND
|
|
3791
3798
|
});
|
|
3792
3799
|
}
|
|
3793
|
-
function
|
|
3800
|
+
function jf(e, t, s) {
|
|
3794
3801
|
const { data: r = {} } = gr(e, t);
|
|
3795
3802
|
return De([s], r);
|
|
3796
3803
|
}
|
|
3797
|
-
const
|
|
3804
|
+
const Vf = ({ address: e, chain: t, onSelect: s }) => {
|
|
3798
3805
|
const r = Lt(t.chain_id), { data: o = {} } = gr(e, t.chain_id);
|
|
3799
3806
|
return /* @__PURE__ */ n(
|
|
3800
3807
|
mn,
|
|
3801
3808
|
{
|
|
3802
|
-
assets:
|
|
3809
|
+
assets: nt(
|
|
3803
3810
|
[
|
|
3804
|
-
|
|
3805
|
-
|
|
3811
|
+
G((a) => a.symbol === "INIT"),
|
|
3812
|
+
G((a) => a.value),
|
|
3806
3813
|
({ balance: a = "0" }, { balance: i = "0" }) => P(i).comparedTo(a) ?? 0,
|
|
3807
3814
|
Ot((a) => a.symbol.toLowerCase())
|
|
3808
3815
|
],
|
|
@@ -3822,9 +3829,9 @@ const jf = ({ address: e, chain: t, onSelect: s }) => {
|
|
|
3822
3829
|
onSelect: s
|
|
3823
3830
|
}
|
|
3824
3831
|
);
|
|
3825
|
-
},
|
|
3826
|
-
const s = e === "src" ? "srcChainId" : "dstChainId", r = e === "src" ? "srcDenom" : "dstDenom", o = e === "src" ? "sender" : "recipient", a = ln(), i = dr(), { watch: l, setValue: c } = it(), d = l(o), h = l(s), m = l(r), [_, f] = B(h), p = Pe(_), g =
|
|
3827
|
-
(w) =>
|
|
3832
|
+
}, Gf = ({ type: e, afterSelect: t }) => {
|
|
3833
|
+
const s = e === "src" ? "srcChainId" : "dstChainId", r = e === "src" ? "srcDenom" : "dstDenom", o = e === "src" ? "sender" : "recipient", a = ln(), i = dr(), { watch: l, setValue: c } = it(), d = l(o), h = l(s), m = l(r), [_, f] = B(h), p = Pe(_), g = Uf(), b = Ho(), [k, S] = ro(
|
|
3834
|
+
(w) => b(w.chain_id),
|
|
3828
3835
|
i.filter((w) => !w.hidden)
|
|
3829
3836
|
), $ = (w) => {
|
|
3830
3837
|
if (h === _ && m === w) {
|
|
@@ -3839,7 +3846,7 @@ const jf = ({ address: e, chain: t, onSelect: s }) => {
|
|
|
3839
3846
|
gt,
|
|
3840
3847
|
{
|
|
3841
3848
|
label: "Interwoven Economy",
|
|
3842
|
-
chains:
|
|
3849
|
+
chains: k.map(({ chain_id: w, chain_name: T, pretty_name: q, logo_uri: E }) => ({ chainId: w, name: q || T, logoUrl: E ?? "" })),
|
|
3843
3850
|
value: _,
|
|
3844
3851
|
onSelect: f
|
|
3845
3852
|
}
|
|
@@ -3848,14 +3855,14 @@ const jf = ({ address: e, chain: t, onSelect: s }) => {
|
|
|
3848
3855
|
gt,
|
|
3849
3856
|
{
|
|
3850
3857
|
label: "Chains",
|
|
3851
|
-
chains: S.map(({ chain_id: w, chain_name:
|
|
3858
|
+
chains: S.map(({ chain_id: w, chain_name: T, pretty_name: q, logo_uri: E }) => ({ chainId: w, name: q || T, logoUrl: E ?? "" })),
|
|
3852
3859
|
value: _,
|
|
3853
3860
|
onSelect: f
|
|
3854
3861
|
}
|
|
3855
3862
|
)
|
|
3856
3863
|
] }),
|
|
3857
3864
|
/* @__PURE__ */ n(me, { suspenseFallback: /* @__PURE__ */ n(mn.Placeholder, {}), children: /* @__PURE__ */ n(
|
|
3858
|
-
|
|
3865
|
+
Vf,
|
|
3859
3866
|
{
|
|
3860
3867
|
address: g({
|
|
3861
3868
|
initialAddress: d,
|
|
@@ -3869,12 +3876,12 @@ const jf = ({ address: e, chain: t, onSelect: s }) => {
|
|
|
3869
3876
|
) }, _)
|
|
3870
3877
|
] });
|
|
3871
3878
|
}, zr = ({ type: e }) => {
|
|
3872
|
-
const t = e === "src" ? "srcChainId" : "dstChainId", s = e === "src" ? "srcDenom" : "dstDenom", r = e === "src" ? "Select source chain and asset" : "Select destination chain and asset", { watch: o } = it(), a = o(t), i = o(s), l = Pe(a), c =
|
|
3879
|
+
const t = e === "src" ? "srcChainId" : "dstChainId", s = e === "src" ? "srcDenom" : "dstDenom", r = e === "src" ? "Select source chain and asset" : "Select destination chain and asset", { watch: o } = it(), a = o(t), i = o(s), l = Pe(a), c = ze(i, a);
|
|
3873
3880
|
return /* @__PURE__ */ n(
|
|
3874
3881
|
vt,
|
|
3875
3882
|
{
|
|
3876
3883
|
title: r,
|
|
3877
|
-
content: (d) => /* @__PURE__ */ n(
|
|
3884
|
+
content: (d) => /* @__PURE__ */ n(Gf, { type: e, afterSelect: d }),
|
|
3878
3885
|
children: /* @__PURE__ */ n(
|
|
3879
3886
|
fa,
|
|
3880
3887
|
{
|
|
@@ -3911,12 +3918,12 @@ function as() {
|
|
|
3911
3918
|
];
|
|
3912
3919
|
return { list: e, find: (s) => e.find((r) => r.name === s) };
|
|
3913
3920
|
}
|
|
3914
|
-
const
|
|
3915
|
-
account:
|
|
3916
|
-
clear:
|
|
3917
|
-
white:
|
|
3921
|
+
const Qf = "_account_iwrlj_8", Yf = "_clear_iwrlj_27", Jf = "_white_iwrlj_38", Xt = {
|
|
3922
|
+
account: Qf,
|
|
3923
|
+
clear: Yf,
|
|
3924
|
+
white: Jf
|
|
3918
3925
|
}, Ur = ({ type: e }) => {
|
|
3919
|
-
const { watch: t, setValue: s } = it(), { srcChainId: r, dstChainId: o, cosmosWalletName: a } = t(), l = t(e === "src" ? "sender" : "recipient"), c = rn(Pe(o)), { list: d, find: h } = as(), m = h(a), _ = wa(), f = ba(), p = _(o), g = z.equals(l, p),
|
|
3926
|
+
const { watch: t, setValue: s } = it(), { srcChainId: r, dstChainId: o, cosmosWalletName: a } = t(), l = t(e === "src" ? "sender" : "recipient"), c = rn(Pe(o)), { list: d, find: h } = as(), m = h(a), _ = wa(), f = ba(), p = _(o), g = z.equals(l, p), b = () => /* @__PURE__ */ n(
|
|
3920
3927
|
vt,
|
|
3921
3928
|
{
|
|
3922
3929
|
title: "Connect wallet",
|
|
@@ -3924,9 +3931,9 @@ const Gf = "_account_iwrlj_8", Qf = "_clear_iwrlj_27", Yf = "_white_iwrlj_38", X
|
|
|
3924
3931
|
va,
|
|
3925
3932
|
{
|
|
3926
3933
|
onSelect: async (w) => {
|
|
3927
|
-
const
|
|
3928
|
-
if (!
|
|
3929
|
-
const q =
|
|
3934
|
+
const T = w.getProvider();
|
|
3935
|
+
if (!T) return window.open(w.fallbackUrl, "_blank");
|
|
3936
|
+
const q = T.getOfflineSigner(r), [{ address: E }] = await q.getAccounts();
|
|
3930
3937
|
s("sender", E), s("cosmosWalletName", w.name), $();
|
|
3931
3938
|
},
|
|
3932
3939
|
list: d,
|
|
@@ -3944,17 +3951,17 @@ const Gf = "_account_iwrlj_8", Qf = "_clear_iwrlj_27", Yf = "_white_iwrlj_38", X
|
|
|
3944
3951
|
/* @__PURE__ */ n(mo, { size: 14 })
|
|
3945
3952
|
] })
|
|
3946
3953
|
}
|
|
3947
|
-
),
|
|
3954
|
+
), k = ($) => /* @__PURE__ */ n(
|
|
3948
3955
|
vt,
|
|
3949
3956
|
{
|
|
3950
3957
|
title: "Recipient",
|
|
3951
|
-
content: (w) => /* @__PURE__ */ n(
|
|
3958
|
+
content: (w) => /* @__PURE__ */ n(Ge, { children: /* @__PURE__ */ n(
|
|
3952
3959
|
pr,
|
|
3953
3960
|
{
|
|
3954
3961
|
mode: "onSubmit",
|
|
3955
3962
|
myAddress: p,
|
|
3956
3963
|
chainType: c,
|
|
3957
|
-
validate: (
|
|
3964
|
+
validate: (T) => f(T, o),
|
|
3958
3965
|
onApply: w
|
|
3959
3966
|
}
|
|
3960
3967
|
) }),
|
|
@@ -3965,7 +3972,7 @@ const Gf = "_account_iwrlj_8", Qf = "_clear_iwrlj_27", Yf = "_white_iwrlj_38", X
|
|
|
3965
3972
|
switch (c) {
|
|
3966
3973
|
case "initia":
|
|
3967
3974
|
case "evm":
|
|
3968
|
-
return g ?
|
|
3975
|
+
return g ? k(/* @__PURE__ */ n(Wn, { size: 14 })) : /* @__PURE__ */ u("div", { className: Xt.account, children: [
|
|
3969
3976
|
/* @__PURE__ */ n("span", { className: "monospace", children: we(l) }),
|
|
3970
3977
|
/* @__PURE__ */ n(
|
|
3971
3978
|
"button",
|
|
@@ -3979,7 +3986,7 @@ const Gf = "_account_iwrlj_8", Qf = "_clear_iwrlj_27", Yf = "_white_iwrlj_38", X
|
|
|
3979
3986
|
)
|
|
3980
3987
|
] });
|
|
3981
3988
|
case "cosmos":
|
|
3982
|
-
return
|
|
3989
|
+
return k(
|
|
3983
3990
|
/* @__PURE__ */ u(K, { children: [
|
|
3984
3991
|
l ? /* @__PURE__ */ n("span", { className: "monospace", children: we(l) }) : /* @__PURE__ */ n("span", { children: "Recipient" }),
|
|
3985
3992
|
/* @__PURE__ */ n(Qi, { size: 14 })
|
|
@@ -3989,42 +3996,42 @@ const Gf = "_account_iwrlj_8", Qf = "_clear_iwrlj_27", Yf = "_white_iwrlj_38", X
|
|
|
3989
3996
|
};
|
|
3990
3997
|
switch (e) {
|
|
3991
3998
|
case "src":
|
|
3992
|
-
return
|
|
3999
|
+
return b();
|
|
3993
4000
|
case "dst":
|
|
3994
4001
|
return S();
|
|
3995
4002
|
}
|
|
3996
|
-
},
|
|
3997
|
-
description:
|
|
3998
|
-
presets:
|
|
3999
|
-
preset:
|
|
4000
|
-
active:
|
|
4001
|
-
custom:
|
|
4002
|
-
wrapper:
|
|
4003
|
-
percent:
|
|
4004
|
-
}, Kr = ["0.1", "0.5", "1.0"],
|
|
4003
|
+
}, Zf = "_description_l5bcv_1", Xf = "_presets_l5bcv_8", ep = "_preset_l5bcv_8", tp = "_active_l5bcv_29", np = "_custom_l5bcv_40", sp = "_wrapper_l5bcv_46", rp = "_percent_l5bcv_49", Ee = {
|
|
4004
|
+
description: Zf,
|
|
4005
|
+
presets: Xf,
|
|
4006
|
+
preset: ep,
|
|
4007
|
+
active: tp,
|
|
4008
|
+
custom: np,
|
|
4009
|
+
wrapper: sp,
|
|
4010
|
+
percent: rp
|
|
4011
|
+
}, Kr = ["0.1", "0.5", "1.0"], op = ({ afterConfirm: e }) => {
|
|
4005
4012
|
const t = it(), s = t.getValues("slippagePercent"), [r, o] = B(null), { control: a, watch: i, getValues: l, setValue: c } = jn({
|
|
4006
4013
|
defaultValues: { value: s }
|
|
4007
4014
|
}), d = i("value");
|
|
4008
4015
|
M(() => {
|
|
4009
|
-
const g = Kr.findIndex((
|
|
4016
|
+
const g = Kr.findIndex((b) => b === s);
|
|
4010
4017
|
o(g >= 0 ? g : null);
|
|
4011
4018
|
}, [s]);
|
|
4012
|
-
const h = (g,
|
|
4013
|
-
c("value", g), o(
|
|
4019
|
+
const h = (g, b) => {
|
|
4020
|
+
c("value", g), o(b);
|
|
4014
4021
|
}, m = () => {
|
|
4015
4022
|
o(null);
|
|
4016
4023
|
}, _ = F(() => Number(d) > 100 ? { type: "error", text: "Slippage must be less than 100%" } : Number(d) > 5 ? { type: "warning", text: "Your transaction may be frontrun" } : Number(d) < 0.1 ? { type: "warning", text: "Your transaction may fail" } : null, [d]), f = _?.type === "error", p = ({ value: g }) => {
|
|
4017
4024
|
t.setValue("slippagePercent", g), e();
|
|
4018
4025
|
};
|
|
4019
|
-
return /* @__PURE__ */ u(
|
|
4026
|
+
return /* @__PURE__ */ u(Ge, { children: [
|
|
4020
4027
|
/* @__PURE__ */ n("p", { className: Ee.description, children: "Slippage is how much price movement you can tolerate between the time you send out a transaction and the time it's executed." }),
|
|
4021
4028
|
/* @__PURE__ */ u("div", { className: Ee.presets, children: [
|
|
4022
|
-
Kr.map((g,
|
|
4029
|
+
Kr.map((g, b) => /* @__PURE__ */ u(
|
|
4023
4030
|
"button",
|
|
4024
4031
|
{
|
|
4025
4032
|
type: "button",
|
|
4026
|
-
className: D(Ee.preset, { [Ee.active]: r ===
|
|
4027
|
-
onClick: () => h(g,
|
|
4033
|
+
className: D(Ee.preset, { [Ee.active]: r === b }),
|
|
4034
|
+
onClick: () => h(g, b),
|
|
4028
4035
|
children: [
|
|
4029
4036
|
g,
|
|
4030
4037
|
"%"
|
|
@@ -4056,24 +4063,24 @@ const Gf = "_account_iwrlj_8", Qf = "_clear_iwrlj_27", Yf = "_white_iwrlj_38", X
|
|
|
4056
4063
|
] })
|
|
4057
4064
|
] }),
|
|
4058
4065
|
_ && /* @__PURE__ */ n(X, { level: _.type, children: _.text }),
|
|
4059
|
-
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
4066
|
+
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(j.White, { type: "button", onClick: () => p(l()), disabled: f, children: "Confirm" }) })
|
|
4060
4067
|
] });
|
|
4061
|
-
},
|
|
4062
|
-
skeleton:
|
|
4063
|
-
}, xs = ({ width: e = "100%", height: t }) => /* @__PURE__ */ n("div", { className:
|
|
4064
|
-
stack:
|
|
4065
|
-
button:
|
|
4066
|
-
isLoading:
|
|
4067
|
-
disabled:
|
|
4068
|
-
checked:
|
|
4069
|
-
header:
|
|
4070
|
-
title:
|
|
4071
|
-
duration:
|
|
4072
|
-
warning:
|
|
4073
|
-
amount:
|
|
4074
|
-
value:
|
|
4075
|
-
},
|
|
4076
|
-
const { data: a, isLoading: i } = t, { watch: l } = it(), { dstChainId: c, dstDenom: d } = l(), h =
|
|
4068
|
+
}, ap = "_skeleton_1l4jn_1", ip = {
|
|
4069
|
+
skeleton: ap
|
|
4070
|
+
}, xs = ({ width: e = "100%", height: t }) => /* @__PURE__ */ n("div", { className: ip.skeleton, style: { width: e, height: t } }), cp = "_stack_1ip8h_1", lp = "_button_1ip8h_6", dp = "_isLoading_1ip8h_19", up = "_disabled_1ip8h_19", hp = "_checked_1ip8h_23", mp = "_header_1ip8h_37", _p = "_title_1ip8h_43", fp = "_duration_1ip8h_52", pp = "_warning_1ip8h_62", gp = "_amount_1ip8h_66", yp = "_value_1ip8h_67", ye = {
|
|
4071
|
+
stack: cp,
|
|
4072
|
+
button: lp,
|
|
4073
|
+
isLoading: dp,
|
|
4074
|
+
disabled: up,
|
|
4075
|
+
checked: hp,
|
|
4076
|
+
header: mp,
|
|
4077
|
+
title: _p,
|
|
4078
|
+
duration: fp,
|
|
4079
|
+
warning: pp,
|
|
4080
|
+
amount: gp,
|
|
4081
|
+
value: yp
|
|
4082
|
+
}, vp = ({ children: e }) => /* @__PURE__ */ n("div", { className: ye.stack, children: e }), $n = ({ label: e, query: t, value: s, onSelect: r, ...o }) => {
|
|
4083
|
+
const { data: a, isLoading: i } = t, { watch: l } = it(), { dstChainId: c, dstDenom: d } = l(), h = ze(d, c), m = !i && o.checked, _ = !i && !a;
|
|
4077
4084
|
return /* @__PURE__ */ u(
|
|
4078
4085
|
"button",
|
|
4079
4086
|
{
|
|
@@ -4099,39 +4106,39 @@ const Gf = "_account_iwrlj_8", Qf = "_clear_iwrlj_27", Yf = "_white_iwrlj_38", X
|
|
|
4099
4106
|
] }),
|
|
4100
4107
|
(i || a) && /* @__PURE__ */ u(K, { children: [
|
|
4101
4108
|
/* @__PURE__ */ n("div", { className: ye.amount, children: i ? /* @__PURE__ */ n(xs, { width: 260, height: 40 }) : a ? se(a.amount_out, { decimals: h.decimals }) : null }),
|
|
4102
|
-
/* @__PURE__ */ n("div", { className: ye.value, children: i ? /* @__PURE__ */ n(xs, { width: 120, height: 16 }) : a ? a.usd_amount_out ?
|
|
4109
|
+
/* @__PURE__ */ n("div", { className: ye.value, children: i ? /* @__PURE__ */ n(xs, { width: 120, height: 16 }) : a ? a.usd_amount_out ? Ue(a.usd_amount_out) : "$-" : null })
|
|
4103
4110
|
] })
|
|
4104
4111
|
]
|
|
4105
4112
|
}
|
|
4106
4113
|
);
|
|
4107
4114
|
};
|
|
4108
|
-
$n.Stack =
|
|
4109
|
-
const
|
|
4110
|
-
form:
|
|
4111
|
-
arrow:
|
|
4112
|
-
divider:
|
|
4113
|
-
flip:
|
|
4114
|
-
meta:
|
|
4115
|
-
row:
|
|
4116
|
-
title:
|
|
4117
|
-
description:
|
|
4118
|
-
icon:
|
|
4119
|
-
edit:
|
|
4120
|
-
warning:
|
|
4121
|
-
},
|
|
4115
|
+
$n.Stack = vp;
|
|
4116
|
+
const wp = "_form_1coq4_1", bp = "_arrow_1coq4_5", Cp = "_divider_1coq4_13", Np = "_flip_1coq4_21", Ip = "_meta_1coq4_37", Sp = "_row_1coq4_50", kp = "_title_1coq4_56", xp = "_description_1coq4_60", $p = "_icon_1coq4_67", Ap = "_edit_1coq4_72", Tp = "_warning_1coq4_93", ue = {
|
|
4117
|
+
form: wp,
|
|
4118
|
+
arrow: bp,
|
|
4119
|
+
divider: Cp,
|
|
4120
|
+
flip: Np,
|
|
4121
|
+
meta: Ip,
|
|
4122
|
+
row: Sp,
|
|
4123
|
+
title: kp,
|
|
4124
|
+
description: xp,
|
|
4125
|
+
icon: $p,
|
|
4126
|
+
edit: Ap,
|
|
4127
|
+
warning: Tp
|
|
4128
|
+
}, Ep = () => {
|
|
4122
4129
|
const e = ce(), t = ns(), [s, r] = Ys(
|
|
4123
4130
|
O.BRIDGE_ROUTE_TYPE,
|
|
4124
4131
|
"default"
|
|
4125
|
-
), { watch: o, setValue: a, handleSubmit: i, formState: l } = it(), c = o(), { srcChainId: d, srcDenom: h, dstChainId: m, dstDenom: _, quantity: f, sender: p, slippagePercent: g } = c,
|
|
4126
|
-
disabled:
|
|
4127
|
-
}),
|
|
4132
|
+
), { watch: o, setValue: a, handleSubmit: i, formState: l } = it(), c = o(), { srcChainId: d, srcDenom: h, dstChainId: m, dstDenom: _, quantity: f, sender: p, slippagePercent: g } = c, b = ot(), k = Pe(d), S = rn(k), $ = Pe(m), w = rn($), T = ze(h, d), q = ze(_, m), { data: E } = gr(p, d), I = jf(p, d, h), [y] = Fi(f, 300), C = S !== "initia" && w !== "initia", v = Wf(), A = Fr(y, {
|
|
4133
|
+
disabled: C
|
|
4134
|
+
}), N = Fr(y, {
|
|
4128
4135
|
isOpWithdraw: !0,
|
|
4129
4136
|
disabled: !v
|
|
4130
|
-
}), R = v && s === "op" ?
|
|
4137
|
+
}), R = v && s === "op" ? N : A, { data: x, isLoading: V, isFetching: W, error: de } = R, { data: _e } = Hf(de), Wt = y && (V || W), jt = () => {
|
|
4131
4138
|
a("srcChainId", m), a("srcDenom", _), a("dstChainId", d), a("dstDenom", h), a("quantity", "", { shouldTouch: !1, shouldDirty: !1 });
|
|
4132
4139
|
}, { openModal: xt, closeModal: $t } = Qn(), xe = i((L) => {
|
|
4133
|
-
if (
|
|
4134
|
-
const { type: ct = "", message: ds } =
|
|
4140
|
+
if (x?.warning) {
|
|
4141
|
+
const { type: ct = "", message: ds } = x.warning ?? {};
|
|
4135
4142
|
xt({
|
|
4136
4143
|
content: /* @__PURE__ */ n(
|
|
4137
4144
|
aa,
|
|
@@ -4143,7 +4150,7 @@ const vp = "_form_1coq4_1", wp = "_arrow_1coq4_5", bp = "_divider_1coq4_13", Cp
|
|
|
4143
4150
|
secondaryButton: {
|
|
4144
4151
|
label: "Proceed anyway",
|
|
4145
4152
|
onClick: () => {
|
|
4146
|
-
e("/bridge/preview", { route:
|
|
4153
|
+
e("/bridge/preview", { route: x, values: L }), $t();
|
|
4147
4154
|
}
|
|
4148
4155
|
},
|
|
4149
4156
|
children: /* @__PURE__ */ n("p", { className: ue.warning, children: ds })
|
|
@@ -4152,31 +4159,31 @@ const vp = "_form_1coq4_1", wp = "_arrow_1coq4_5", bp = "_divider_1coq4_13", Cp
|
|
|
4152
4159
|
});
|
|
4153
4160
|
return;
|
|
4154
4161
|
}
|
|
4155
|
-
e("/bridge/preview", { route:
|
|
4156
|
-
}), fe = F(() =>
|
|
4162
|
+
e("/bridge/preview", { route: x, values: L });
|
|
4163
|
+
}), fe = F(() => x?.estimated_fees?.filter(
|
|
4157
4164
|
({ fee_behavior: L }) => L === "FEE_BEHAVIOR_DEDUCTED"
|
|
4158
|
-
) ?? [], [
|
|
4165
|
+
) ?? [], [x]), Qe = F(() => x?.estimated_fees?.filter(
|
|
4159
4166
|
({ fee_behavior: L }) => L === "FEE_BEHAVIOR_ADDITIONAL"
|
|
4160
|
-
) ?? [], [
|
|
4161
|
-
for (const L of
|
|
4162
|
-
const ct = E?.[L.origin_asset.denom]?.amount ?? "0", ds =
|
|
4167
|
+
) ?? [], [x]), At = F(() => {
|
|
4168
|
+
for (const L of Qe) {
|
|
4169
|
+
const ct = E?.[L.origin_asset.denom]?.amount ?? "0", ds = x?.source_asset_denom === L.origin_asset.denom ? x.amount_in : "0";
|
|
4163
4170
|
if (P(ct).lt(P(ds).plus(L.amount ?? "0"))) return `Insufficient ${L.origin_asset.symbol} for fees`;
|
|
4164
4171
|
}
|
|
4165
|
-
}, [E,
|
|
4172
|
+
}, [E, x, Qe]), _n = F(() => {
|
|
4166
4173
|
if (!c.sender) return "Connect wallet";
|
|
4167
4174
|
if (!c.quantity || !y) return "Enter amount";
|
|
4168
4175
|
if (!c.recipient) return "Enter recipient address";
|
|
4169
4176
|
if (l.errors.quantity) return l.errors.quantity.message;
|
|
4170
|
-
if (!
|
|
4177
|
+
if (!x) return "Route not found";
|
|
4171
4178
|
if (At) return At;
|
|
4172
|
-
}, [y, At, l,
|
|
4173
|
-
nn(
|
|
4179
|
+
}, [y, At, l, x, c]), Da = x ? se(x.amount_out, { decimals: q.decimals }) : "0", qa = P(f).gt(0) && P(f).isEqualTo(
|
|
4180
|
+
nn(I?.amount, { decimals: I?.decimals ?? 0 })
|
|
4174
4181
|
), Pa = (() => {
|
|
4175
4182
|
switch (S) {
|
|
4176
4183
|
case "initia":
|
|
4177
|
-
return
|
|
4184
|
+
return b(d).fees.fee_tokens.some(({ denom: L }) => L === h);
|
|
4178
4185
|
case "cosmos":
|
|
4179
|
-
return
|
|
4186
|
+
return k.fee_assets.some(({ denom: L }) => L === h);
|
|
4180
4187
|
case "evm":
|
|
4181
4188
|
return !ao(h);
|
|
4182
4189
|
default:
|
|
@@ -4188,22 +4195,22 @@ const vp = "_form_1coq4_1", wp = "_arrow_1coq4_5", bp = "_divider_1coq4_13", Cp
|
|
|
4188
4195
|
!t && /* @__PURE__ */ n(hn, { label: ct, children: /* @__PURE__ */ n("span", { className: ue.icon, children: /* @__PURE__ */ n(Zs, { size: 12 }) }) })
|
|
4189
4196
|
] }) : null,
|
|
4190
4197
|
[t]
|
|
4191
|
-
), fn = P(f).gt(0) && v, vr = F(() =>
|
|
4198
|
+
), fn = P(f).gt(0) && v, vr = F(() => x ? [
|
|
4192
4199
|
{
|
|
4193
|
-
condition: !!
|
|
4200
|
+
condition: !!x.estimated_fees?.length,
|
|
4194
4201
|
title: "Fees",
|
|
4195
4202
|
content: /* @__PURE__ */ u("div", { children: [
|
|
4196
4203
|
ls(fe, "Fee deducted from the amount you receive"),
|
|
4197
|
-
ls(
|
|
4204
|
+
ls(Qe, "Fee charged in addition to the amount you enter")
|
|
4198
4205
|
] })
|
|
4199
4206
|
},
|
|
4200
4207
|
{
|
|
4201
|
-
condition: !fn && !!Fs(
|
|
4208
|
+
condition: !fn && !!Fs(x.estimated_route_duration_seconds),
|
|
4202
4209
|
title: "Estimated time",
|
|
4203
|
-
content: /* @__PURE__ */ n("span", { className: ue.description, children: Fs(
|
|
4210
|
+
content: /* @__PURE__ */ n("span", { className: ue.description, children: Fs(x.estimated_route_duration_seconds) })
|
|
4204
4211
|
},
|
|
4205
4212
|
{
|
|
4206
|
-
condition:
|
|
4213
|
+
condition: x.does_swap,
|
|
4207
4214
|
title: "Slippage",
|
|
4208
4215
|
content: /* @__PURE__ */ u("span", { className: ue.description, children: [
|
|
4209
4216
|
/* @__PURE__ */ u("span", { children: [
|
|
@@ -4214,38 +4221,38 @@ const vp = "_form_1coq4_1", wp = "_arrow_1coq4_5", bp = "_divider_1coq4_13", Cp
|
|
|
4214
4221
|
vt,
|
|
4215
4222
|
{
|
|
4216
4223
|
title: "Slippage tolerance",
|
|
4217
|
-
content: (L) => /* @__PURE__ */ n(
|
|
4224
|
+
content: (L) => /* @__PURE__ */ n(op, { afterConfirm: L }),
|
|
4218
4225
|
className: ue.edit,
|
|
4219
4226
|
children: /* @__PURE__ */ n(Ji, { size: 12 })
|
|
4220
4227
|
}
|
|
4221
4228
|
)
|
|
4222
4229
|
] })
|
|
4223
4230
|
}
|
|
4224
|
-
].filter((L) => L.condition) : [], [
|
|
4231
|
+
].filter((L) => L.condition) : [], [Qe, fe, ls, x, fn, g]);
|
|
4225
4232
|
return /* @__PURE__ */ u("form", { className: ue.form, onSubmit: xe, children: [
|
|
4226
4233
|
/* @__PURE__ */ n(
|
|
4227
4234
|
Ls,
|
|
4228
4235
|
{
|
|
4229
4236
|
selectButton: /* @__PURE__ */ n(zr, { type: "src" }),
|
|
4230
4237
|
accountButton: S === "cosmos" && /* @__PURE__ */ n(Ur, { type: "src" }),
|
|
4231
|
-
quantityInput: /* @__PURE__ */ n(Bn, { balance:
|
|
4238
|
+
quantityInput: /* @__PURE__ */ n(Bn, { balance: I?.amount, decimals: T?.decimals }),
|
|
4232
4239
|
balanceButton: /* @__PURE__ */ n(
|
|
4233
4240
|
pa,
|
|
4234
4241
|
{
|
|
4235
4242
|
onClick: () => a(
|
|
4236
4243
|
"quantity",
|
|
4237
|
-
nn(
|
|
4244
|
+
nn(I?.amount, { decimals: T?.decimals ?? 0 }),
|
|
4238
4245
|
{ shouldValidate: !0 }
|
|
4239
4246
|
),
|
|
4240
|
-
children: se(
|
|
4247
|
+
children: se(I?.amount ?? "0", { decimals: T.decimals })
|
|
4241
4248
|
}
|
|
4242
4249
|
),
|
|
4243
|
-
value:
|
|
4250
|
+
value: x ? x.usd_amount_in ? Ue(x.usd_amount_in) : "$-" : "$0"
|
|
4244
4251
|
}
|
|
4245
4252
|
),
|
|
4246
4253
|
/* @__PURE__ */ u("div", { className: ue.arrow, children: [
|
|
4247
4254
|
/* @__PURE__ */ n("div", { className: ue.divider }),
|
|
4248
|
-
/* @__PURE__ */ n("button", { type: "button", className: ue.flip, onClick: () => jt(), children: /* @__PURE__ */ n(
|
|
4255
|
+
/* @__PURE__ */ n("button", { type: "button", className: ue.flip, onClick: () => jt(), children: /* @__PURE__ */ n(rt, { size: 16 }) })
|
|
4249
4256
|
] }),
|
|
4250
4257
|
/* @__PURE__ */ n(
|
|
4251
4258
|
Ls,
|
|
@@ -4253,7 +4260,7 @@ const vp = "_form_1coq4_1", wp = "_arrow_1coq4_5", bp = "_divider_1coq4_13", Cp
|
|
|
4253
4260
|
selectButton: /* @__PURE__ */ n(zr, { type: "dst" }),
|
|
4254
4261
|
accountButton: /* @__PURE__ */ n(Ur, { type: "dst" }),
|
|
4255
4262
|
quantityInput: /* @__PURE__ */ n(Bn.ReadOnly, { children: Da }),
|
|
4256
|
-
value:
|
|
4263
|
+
value: x ? x.usd_amount_out ? Ue(x.usd_amount_out) : "$-" : "$0",
|
|
4257
4264
|
hideNumbers: fn
|
|
4258
4265
|
}
|
|
4259
4266
|
),
|
|
@@ -4262,7 +4269,7 @@ const vp = "_form_1coq4_1", wp = "_arrow_1coq4_5", bp = "_divider_1coq4_13", Cp
|
|
|
4262
4269
|
$n,
|
|
4263
4270
|
{
|
|
4264
4271
|
label: "Fast",
|
|
4265
|
-
query:
|
|
4272
|
+
query: A,
|
|
4266
4273
|
value: "default",
|
|
4267
4274
|
onSelect: r,
|
|
4268
4275
|
checked: s === "default"
|
|
@@ -4272,7 +4279,7 @@ const vp = "_form_1coq4_1", wp = "_arrow_1coq4_5", bp = "_divider_1coq4_13", Cp
|
|
|
4272
4279
|
$n,
|
|
4273
4280
|
{
|
|
4274
4281
|
label: "Lossless",
|
|
4275
|
-
query:
|
|
4282
|
+
query: N,
|
|
4276
4283
|
value: "op",
|
|
4277
4284
|
onSelect: r,
|
|
4278
4285
|
checked: s === "op"
|
|
@@ -4284,48 +4291,48 @@ const vp = "_form_1coq4_1", wp = "_arrow_1coq4_5", bp = "_divider_1coq4_13", Cp
|
|
|
4284
4291
|
{
|
|
4285
4292
|
extra: /* @__PURE__ */ u(K, { children: [
|
|
4286
4293
|
/* @__PURE__ */ u(X.Stack, { children: [
|
|
4287
|
-
|
|
4294
|
+
x?.extra_infos?.map((L) => /* @__PURE__ */ n(X, { level: "info", children: L }, L)),
|
|
4288
4295
|
_e && /* @__PURE__ */ n(X, { level: "info", children: _e }),
|
|
4289
4296
|
qa && Pa && /* @__PURE__ */ n(X, { level: "warning", children: "Make sure to leave enough for transaction fee" }),
|
|
4290
|
-
|
|
4291
|
-
|
|
4297
|
+
x?.warning && /* @__PURE__ */ n(X, { level: "warning", children: x.warning.message }),
|
|
4298
|
+
x?.extra_warnings?.map((L) => /* @__PURE__ */ n(X, { level: "warning", children: L }, L))
|
|
4292
4299
|
] }),
|
|
4293
4300
|
/* @__PURE__ */ n(Rs, { children: vr.length > 0 && /* @__PURE__ */ n("div", { className: ue.meta, children: vr.map((L, ct) => /* @__PURE__ */ u("div", { className: ue.row, children: [
|
|
4294
4301
|
/* @__PURE__ */ n("span", { className: ue.title, children: L.title }),
|
|
4295
4302
|
L.content
|
|
4296
4303
|
] }, ct)) }) })
|
|
4297
4304
|
] }),
|
|
4298
|
-
children: /* @__PURE__ */ n(
|
|
4305
|
+
children: /* @__PURE__ */ n(j.White, { loading: Wt && "Simulating...", disabled: !!_n, children: _n ?? "Preview route" })
|
|
4299
4306
|
}
|
|
4300
4307
|
)
|
|
4301
4308
|
] });
|
|
4302
|
-
},
|
|
4309
|
+
}, Dp = () => {
|
|
4303
4310
|
ia();
|
|
4304
|
-
const e = uc(), t = ce(), { closeDrawer: s } = Ut(), r = ln(), o =
|
|
4311
|
+
const e = uc(), t = ce(), { closeDrawer: s } = Ut(), r = ln(), o = zf(), a = jn({
|
|
4305
4312
|
mode: "onChange",
|
|
4306
4313
|
defaultValues: o
|
|
4307
4314
|
}), { watch: i, setValue: l } = a, { srcChainId: c, dstChainId: d, srcDenom: h, dstDenom: m, quantity: _, slippagePercent: f, recipient: p } = i();
|
|
4308
|
-
i((
|
|
4315
|
+
i((C, { name: v }) => {
|
|
4309
4316
|
(v === "srcChainId" || v === "srcDenom") && l("quantity", "", { shouldTouch: !1, shouldDirty: !1 });
|
|
4310
4317
|
});
|
|
4311
|
-
const g = wa(),
|
|
4318
|
+
const g = wa(), b = g(c), k = g(d), $ = ba()(p, d);
|
|
4312
4319
|
M(() => {
|
|
4313
|
-
l("cosmosWalletName", void 0), l("sender",
|
|
4314
|
-
}, [c,
|
|
4315
|
-
$ || l("recipient",
|
|
4316
|
-
}, [
|
|
4317
|
-
const w = Lt(c),
|
|
4318
|
-
if (!w.find((
|
|
4320
|
+
l("cosmosWalletName", void 0), l("sender", b);
|
|
4321
|
+
}, [c, b, l]), M(() => {
|
|
4322
|
+
$ || l("recipient", k);
|
|
4323
|
+
}, [k, $, l]);
|
|
4324
|
+
const w = Lt(c), T = Lt(d), q = F(() => {
|
|
4325
|
+
if (!w.find((C) => C.denom === h))
|
|
4319
4326
|
return `${h} is not available for bridge/swap on ${c}`;
|
|
4320
|
-
if (!
|
|
4327
|
+
if (!T.find((C) => C.denom === m))
|
|
4321
4328
|
return `${m} is not available for bridge/swap on ${d}`;
|
|
4322
|
-
}, [
|
|
4329
|
+
}, [T, d, m, w, c, h]);
|
|
4323
4330
|
M(() => {
|
|
4324
4331
|
q || (localStorage.setItem(O.BRIDGE_SRC_CHAIN_ID, c), localStorage.setItem(O.BRIDGE_SRC_DENOM, h), localStorage.setItem(O.BRIDGE_DST_CHAIN_ID, d), localStorage.setItem(O.BRIDGE_DST_DENOM, m), localStorage.setItem(O.BRIDGE_QUANTITY, _), localStorage.setItem(O.BRIDGE_SLIPPAGE_PERCENT, f));
|
|
4325
4332
|
}, [c, h, d, m, _, f, q]);
|
|
4326
|
-
const E = e[0].path === "/bridge",
|
|
4333
|
+
const E = e[0].path === "/bridge", I = () => /* @__PURE__ */ u(K, { children: [
|
|
4327
4334
|
/* @__PURE__ */ n(Y, { error: !0, children: q }),
|
|
4328
|
-
/* @__PURE__ */ n(ee, { children: E ? /* @__PURE__ */ n(
|
|
4335
|
+
/* @__PURE__ */ n(ee, { children: E ? /* @__PURE__ */ n(j.White, { onClick: s, children: "Close" }) : /* @__PURE__ */ n(j.White, { onClick: () => t(-1), children: "Go back" }) })
|
|
4329
4336
|
] }), { reminders: y } = Kt();
|
|
4330
4337
|
return /* @__PURE__ */ n(
|
|
4331
4338
|
St,
|
|
@@ -4333,24 +4340,24 @@ const vp = "_form_1coq4_1", wp = "_arrow_1coq4_5", bp = "_divider_1coq4_13", Cp
|
|
|
4333
4340
|
title: "Bridge/Swap",
|
|
4334
4341
|
backButton: E ? "/" : void 0,
|
|
4335
4342
|
extra: /* @__PURE__ */ u(K, { children: [
|
|
4336
|
-
/* @__PURE__ */ n(
|
|
4343
|
+
/* @__PURE__ */ n(j.Small, { onClick: () => t("/bridge/history"), unpadded: !0, children: /* @__PURE__ */ u("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", width: "12", height: "12", children: [
|
|
4337
4344
|
/* @__PURE__ */ n("path", { d: "m0 9.818 1.414-1.414 L2 8.99 V8 a7 7 0 1 1 7 7 v-2 a5 5 0 1 0-5-5 v1.354 l.95-.95 1.414 1.414 L3.182 13 0 9.818 Z" }),
|
|
4338
4345
|
/* @__PURE__ */ n("path", { d: "M9 5.5 H7.5 v3.75 h3.75 v-1.5 H9 V5.5 Z" })
|
|
4339
4346
|
] }) }),
|
|
4340
|
-
/* @__PURE__ */ n(ya, { offset: 0, disabled: y.length === 0, children: /* @__PURE__ */ n(
|
|
4347
|
+
/* @__PURE__ */ n(ya, { offset: 0, disabled: y.length === 0, children: /* @__PURE__ */ n(j.Small, { onClick: () => t("/op/withdrawals"), disabled: !r, children: /* @__PURE__ */ n("span", { children: "Withdrawal status" }) }) })
|
|
4341
4348
|
] }),
|
|
4342
|
-
children: q ?
|
|
4349
|
+
children: q ? I() : /* @__PURE__ */ n(tr, { ...a, children: /* @__PURE__ */ n(me, { children: /* @__PURE__ */ n(Ep, {}) }) })
|
|
4343
4350
|
}
|
|
4344
4351
|
);
|
|
4345
|
-
},
|
|
4346
|
-
button:
|
|
4352
|
+
}, qp = "_button_1iys9_1", Pp = {
|
|
4353
|
+
button: qp
|
|
4347
4354
|
}, Na = ({ onClick: e, disabled: t }) => {
|
|
4348
4355
|
const { ref: s, inView: r } = ac();
|
|
4349
4356
|
return M(() => {
|
|
4350
4357
|
r && e();
|
|
4351
|
-
}, [r, e]), /* @__PURE__ */ u("button", { className:
|
|
4358
|
+
}, [r, e]), /* @__PURE__ */ u("button", { className: Pp.button, onClick: e, disabled: t, ref: s, children: [
|
|
4352
4359
|
/* @__PURE__ */ n("span", { children: "Load more" }),
|
|
4353
|
-
/* @__PURE__ */ n(
|
|
4360
|
+
/* @__PURE__ */ n(rt, { size: 12 })
|
|
4354
4361
|
] });
|
|
4355
4362
|
}, kt = Re("interwovenkit:op", {
|
|
4356
4363
|
bridge: (e) => [e],
|
|
@@ -4364,7 +4371,7 @@ function is() {
|
|
|
4364
4371
|
const { restUrl: e } = be();
|
|
4365
4372
|
return F(() => te.create({ prefixUrl: e }), [e]);
|
|
4366
4373
|
}
|
|
4367
|
-
function
|
|
4374
|
+
function Rp(e) {
|
|
4368
4375
|
const t = is(), { data: s } = ie({
|
|
4369
4376
|
queryKey: kt.bridge(e).queryKey,
|
|
4370
4377
|
queryFn: () => t.get(`opinit/ophost/v1/bridges/${e}`).json(),
|
|
@@ -4373,7 +4380,7 @@ function Pp(e) {
|
|
|
4373
4380
|
return s;
|
|
4374
4381
|
}
|
|
4375
4382
|
const Hr = 20;
|
|
4376
|
-
function
|
|
4383
|
+
function Bp(e) {
|
|
4377
4384
|
const t = re();
|
|
4378
4385
|
return Ha({
|
|
4379
4386
|
queryKey: kt.withdrawals(e, t).queryKey,
|
|
@@ -4390,7 +4397,7 @@ function Rp(e) {
|
|
|
4390
4397
|
staleTime: U.SECOND
|
|
4391
4398
|
});
|
|
4392
4399
|
}
|
|
4393
|
-
function
|
|
4400
|
+
function Op(e) {
|
|
4394
4401
|
const t = is(), { data: s } = ie({
|
|
4395
4402
|
queryKey: kt.latestOutput(e).queryKey,
|
|
4396
4403
|
queryFn: () => t.get(`opinit/ophost/v1/bridges/${e}/outputs`, {
|
|
@@ -4404,7 +4411,7 @@ function Bp(e) {
|
|
|
4404
4411
|
});
|
|
4405
4412
|
return s;
|
|
4406
4413
|
}
|
|
4407
|
-
function
|
|
4414
|
+
function Lp({ bridge_id: e, output_index: t }) {
|
|
4408
4415
|
const s = is(), { data: r } = ie({
|
|
4409
4416
|
queryKey: kt.output(e, t).queryKey,
|
|
4410
4417
|
queryFn: async () => {
|
|
@@ -4418,7 +4425,7 @@ function Op({ bridge_id: e, output_index: t }) {
|
|
|
4418
4425
|
});
|
|
4419
4426
|
return r;
|
|
4420
4427
|
}
|
|
4421
|
-
function
|
|
4428
|
+
function Mp({ bridge_id: e, sequence: t }) {
|
|
4422
4429
|
const r = ne().find(
|
|
4423
4430
|
({ metadata: c }) => c?.op_bridge_id === e.toString()
|
|
4424
4431
|
)?.chain_id;
|
|
@@ -4463,17 +4470,17 @@ function Sa(e) {
|
|
|
4463
4470
|
);
|
|
4464
4471
|
return en(en(d));
|
|
4465
4472
|
}
|
|
4466
|
-
const ka =
|
|
4473
|
+
const ka = st(
|
|
4467
4474
|
null
|
|
4468
4475
|
);
|
|
4469
4476
|
function cs() {
|
|
4470
|
-
return
|
|
4477
|
+
return We(ka);
|
|
4471
4478
|
}
|
|
4472
|
-
const
|
|
4473
|
-
asset:
|
|
4474
|
-
info:
|
|
4475
|
-
symbol:
|
|
4476
|
-
},
|
|
4479
|
+
const Fp = "_asset_6h8u2_1", zp = "_info_6h8u2_7", Up = "_symbol_6h8u2_11", As = {
|
|
4480
|
+
asset: Fp,
|
|
4481
|
+
info: zp,
|
|
4482
|
+
symbol: Up
|
|
4483
|
+
}, Kp = ({ amount: e, denom: t }) => {
|
|
4477
4484
|
const s = be(), r = Mo(t, s), { symbol: o, logoUrl: a, decimals: i } = r;
|
|
4478
4485
|
return /* @__PURE__ */ u("div", { className: As.asset, children: [
|
|
4479
4486
|
/* @__PURE__ */ n(H, { src: a, width: 32, height: 32, logo: !0 }),
|
|
@@ -4482,19 +4489,19 @@ const Mp = "_asset_6h8u2_1", Fp = "_info_6h8u2_7", zp = "_symbol_6h8u2_11", As =
|
|
|
4482
4489
|
/* @__PURE__ */ n("span", { className: As.symbol, children: o })
|
|
4483
4490
|
] })
|
|
4484
4491
|
] });
|
|
4485
|
-
},
|
|
4486
|
-
const { withdrawalTx: t } = cs(), s =
|
|
4492
|
+
}, Hp = ({ children: e }) => {
|
|
4493
|
+
const { withdrawalTx: t } = cs(), s = Op(t.bridge_id), r = t.output_index > Number(s?.output_index);
|
|
4487
4494
|
return e(r);
|
|
4488
|
-
},
|
|
4489
|
-
container:
|
|
4490
|
-
icon:
|
|
4491
|
-
},
|
|
4495
|
+
}, Wp = "_container_1oldz_1", jp = "_icon_1oldz_7", Wr = {
|
|
4496
|
+
container: Wp,
|
|
4497
|
+
icon: jp
|
|
4498
|
+
}, Vp = "Withdrawal will begin within an hour", jr = () => {
|
|
4492
4499
|
const e = ns();
|
|
4493
4500
|
return /* @__PURE__ */ u("div", { className: Wr.container, children: [
|
|
4494
4501
|
/* @__PURE__ */ n("span", { children: "In progress" }),
|
|
4495
|
-
!e && /* @__PURE__ */ n(hn, { label:
|
|
4502
|
+
!e && /* @__PURE__ */ n(hn, { label: Vp, children: /* @__PURE__ */ n("span", { className: Wr.icon, children: /* @__PURE__ */ n(Zs, { size: 12 }) }) })
|
|
4496
4503
|
] });
|
|
4497
|
-
}, xa = 1e3,
|
|
4504
|
+
}, xa = 1e3, Gp = 60, Qp = 60, Yp = 24, zs = xa * Gp, Us = zs * Qp, Vr = Us * Yp, Jp = ({ date: e }) => {
|
|
4498
4505
|
const t = J(() => {
|
|
4499
4506
|
const d = (/* @__PURE__ */ new Date()).getTime(), m = e.getTime() - d;
|
|
4500
4507
|
if (m <= 0)
|
|
@@ -4519,14 +4526,14 @@ const Mp = "_asset_6h8u2_1", Fp = "_info_6h8u2_7", zp = "_symbol_6h8u2_11", As =
|
|
|
4519
4526
|
o(c),
|
|
4520
4527
|
"s"
|
|
4521
4528
|
] }) });
|
|
4522
|
-
},
|
|
4523
|
-
container:
|
|
4524
|
-
title:
|
|
4525
|
-
},
|
|
4529
|
+
}, Zp = "_container_1lz3w_1", Xp = "_title_1lz3w_5", Gr = {
|
|
4530
|
+
container: Zp,
|
|
4531
|
+
title: Xp
|
|
4532
|
+
}, eg = ({ date: e }) => /* @__PURE__ */ u("div", { className: Gr.container, children: [
|
|
4526
4533
|
/* @__PURE__ */ n("div", { className: Gr.title, children: "Claimable in" }),
|
|
4527
|
-
/* @__PURE__ */ n(
|
|
4528
|
-
] }),
|
|
4529
|
-
const { withdrawalTx: t } = cs(), s =
|
|
4534
|
+
/* @__PURE__ */ n(Jp, { date: e })
|
|
4535
|
+
] }), tg = ({ children: e }) => {
|
|
4536
|
+
const { withdrawalTx: t } = cs(), s = Rp(t.bridge_id), r = Lp(t), o = F(() => {
|
|
4530
4537
|
if (!r) return null;
|
|
4531
4538
|
const { bridge_config: a } = s, { output_proposal: i } = r;
|
|
4532
4539
|
return sc(
|
|
@@ -4535,7 +4542,7 @@ const Mp = "_asset_6h8u2_1", Fp = "_info_6h8u2_7", zp = "_symbol_6h8u2_11", As =
|
|
|
4535
4542
|
);
|
|
4536
4543
|
}, [s, r]);
|
|
4537
4544
|
return e(o);
|
|
4538
|
-
},
|
|
4545
|
+
}, ng = ({ date: e, children: t }) => {
|
|
4539
4546
|
const { chainId: s, withdrawalTx: r } = cs(), o = bt(Sa(r)), a = Ia(r, o), { setReminder: i, removeReminder: l } = Kt();
|
|
4540
4547
|
return M(() => {
|
|
4541
4548
|
const c = { chainId: s, txHash: r.tx_hash };
|
|
@@ -4549,10 +4556,10 @@ const Mp = "_asset_6h8u2_1", Fp = "_info_6h8u2_7", zp = "_symbol_6h8u2_11", As =
|
|
|
4549
4556
|
dismissed: po(e.getTime()) ? !0 : void 0
|
|
4550
4557
|
});
|
|
4551
4558
|
}, [s, a, e, l, i, r]), t;
|
|
4552
|
-
},
|
|
4553
|
-
button:
|
|
4554
|
-
claimed:
|
|
4555
|
-
},
|
|
4559
|
+
}, sg = "_button_1btdg_1", rg = "_claimed_1btdg_23", Qr = {
|
|
4560
|
+
button: sg,
|
|
4561
|
+
claimed: rg
|
|
4562
|
+
}, og = () => {
|
|
4556
4563
|
const { withdrawalTx: e } = cs(), {
|
|
4557
4564
|
bridge_id: t,
|
|
4558
4565
|
sequence: s,
|
|
@@ -4563,7 +4570,7 @@ const Mp = "_asset_6h8u2_1", Fp = "_info_6h8u2_7", zp = "_symbol_6h8u2_11", As =
|
|
|
4563
4570
|
from: l,
|
|
4564
4571
|
to: c,
|
|
4565
4572
|
version: d
|
|
4566
|
-
} = e, h = be(), m = re(), { requestTxSync: _, waitForTxConfirmation: f } = ke(), p =
|
|
4573
|
+
} = e, h = be(), m = re(), { requestTxSync: _, waitForTxConfirmation: f } = ke(), p = Mp(e), g = bt(Sa(e)), b = Ia(e, g), k = wt(), { mutate: S, isPending: $ } = Ke({
|
|
4567
4574
|
mutationFn: async () => {
|
|
4568
4575
|
if (!p) throw new Error("Output not found");
|
|
4569
4576
|
const { last_block_hash: w } = p;
|
|
@@ -4591,21 +4598,21 @@ const Mp = "_asset_6h8u2_1", Fp = "_info_6h8u2_7", zp = "_symbol_6h8u2_11", As =
|
|
|
4591
4598
|
});
|
|
4592
4599
|
},
|
|
4593
4600
|
onSuccess: async (w) => {
|
|
4594
|
-
await f({ chainId: h.chain_id, txHash: w }),
|
|
4601
|
+
await f({ chainId: h.chain_id, txHash: w }), k.invalidateQueries({
|
|
4595
4602
|
queryKey: kt.withdrawalClaimed(t, g).queryKey
|
|
4596
4603
|
});
|
|
4597
4604
|
}
|
|
4598
4605
|
});
|
|
4599
|
-
return
|
|
4606
|
+
return b ? /* @__PURE__ */ u("div", { className: Qr.claimed, children: [
|
|
4600
4607
|
/* @__PURE__ */ n(Un, { size: 14 }),
|
|
4601
4608
|
/* @__PURE__ */ n("span", { children: "Claimed" })
|
|
4602
4609
|
] }) : /* @__PURE__ */ n("button", { className: Qr.button, onClick: () => S(), disabled: $, children: "Claim" });
|
|
4603
|
-
},
|
|
4604
|
-
item:
|
|
4605
|
-
},
|
|
4610
|
+
}, ag = () => /* @__PURE__ */ n(Hp, { children: (e) => e ? /* @__PURE__ */ n(jr, {}) : /* @__PURE__ */ n(tg, { children: (t) => t ? /* @__PURE__ */ n(ng, { date: t, children: rc(t) ? /* @__PURE__ */ n(eg, { date: t }) : /* @__PURE__ */ n(og, {}) }) : /* @__PURE__ */ n(jr, {}) }) }), ig = "_item_km5w2_1", cg = {
|
|
4611
|
+
item: ig
|
|
4612
|
+
}, lg = ({ chain: e }) => {
|
|
4606
4613
|
const t = e.metadata?.executor_uri;
|
|
4607
4614
|
if (!t) throw new Error("Executor URL is not defined");
|
|
4608
|
-
const { data: s, fetchNextPage: r, hasNextPage: o, isFetching: a } =
|
|
4615
|
+
const { data: s, fetchNextPage: r, hasNextPage: o, isFetching: a } = Bp(t), i = F(() => s?.pages.flat() ?? [], [s]), { syncReminders: l } = Kt();
|
|
4609
4616
|
return M(() => {
|
|
4610
4617
|
const c = i.map((d) => ({
|
|
4611
4618
|
chainId: e.chainId,
|
|
@@ -4615,17 +4622,17 @@ const Mp = "_asset_6h8u2_1", Fp = "_info_6h8u2_7", zp = "_symbol_6h8u2_11", As =
|
|
|
4615
4622
|
}, [e.chainId, i, l]), i.length ? /* @__PURE__ */ u(K, { children: [
|
|
4616
4623
|
i.map((c) => {
|
|
4617
4624
|
const { amount: d } = c;
|
|
4618
|
-
return /* @__PURE__ */ u("div", { className:
|
|
4619
|
-
/* @__PURE__ */ n(
|
|
4620
|
-
/* @__PURE__ */ n(me, { suspenseFallback: null, children: /* @__PURE__ */ n(ka.Provider, { value: { chainId: e.chainId, withdrawalTx: c }, children: /* @__PURE__ */ n(
|
|
4625
|
+
return /* @__PURE__ */ u("div", { className: cg.item, children: [
|
|
4626
|
+
/* @__PURE__ */ n(Kp, { ...d }),
|
|
4627
|
+
/* @__PURE__ */ n(me, { suspenseFallback: null, children: /* @__PURE__ */ n(ka.Provider, { value: { chainId: e.chainId, withdrawalTx: c }, children: /* @__PURE__ */ n(ag, {}) }) })
|
|
4621
4628
|
] }, c.sequence);
|
|
4622
4629
|
}),
|
|
4623
4630
|
o && /* @__PURE__ */ n(Na, { onClick: () => r(), disabled: a })
|
|
4624
4631
|
] }) : /* @__PURE__ */ n(Y, { children: "No withdrawals" });
|
|
4625
|
-
},
|
|
4626
|
-
content:
|
|
4627
|
-
title:
|
|
4628
|
-
},
|
|
4632
|
+
}, dg = "_content_dj1qm_1", ug = "_title_dj1qm_5", Yr = {
|
|
4633
|
+
content: dg,
|
|
4634
|
+
title: ug
|
|
4635
|
+
}, hg = () => {
|
|
4629
4636
|
const { chainId: e } = Ct(), t = ne(), s = cn(), [r, o] = B(
|
|
4630
4637
|
e ?? (s.metadata?.is_l1 ? "" : s.chainId)
|
|
4631
4638
|
), a = ot(), { reminders: i } = Kt(), l = r ? a(r) : void 0;
|
|
@@ -4641,11 +4648,11 @@ const Mp = "_asset_6h8u2_1", Fp = "_info_6h8u2_7", zp = "_symbol_6h8u2_11", As =
|
|
|
4641
4648
|
),
|
|
4642
4649
|
/* @__PURE__ */ n("div", { className: Yr.content, children: l ? /* @__PURE__ */ u(K, { children: [
|
|
4643
4650
|
/* @__PURE__ */ n("h2", { className: Yr.title, children: l.name }),
|
|
4644
|
-
/* @__PURE__ */ n(me, { children: /* @__PURE__ */ n(
|
|
4651
|
+
/* @__PURE__ */ n(me, { children: /* @__PURE__ */ n(lg, { chain: l }) }, r)
|
|
4645
4652
|
] }) : /* @__PURE__ */ n(X, { level: "info", children: "Select a chain to display your OP Bridge withdrawals" }) })
|
|
4646
4653
|
] });
|
|
4647
4654
|
};
|
|
4648
|
-
async function
|
|
4655
|
+
async function mg(e, t) {
|
|
4649
4656
|
const s = te.create({ prefixUrl: t }), r = `cosmos/auth/v1beta1/account_info/${e}`;
|
|
4650
4657
|
for (let o = 1; o <= 24; o++)
|
|
4651
4658
|
try {
|
|
@@ -4702,9 +4709,9 @@ async function Ks(e, t) {
|
|
|
4702
4709
|
function Ht() {
|
|
4703
4710
|
return Ct();
|
|
4704
4711
|
}
|
|
4705
|
-
function
|
|
4706
|
-
const t = ce(), { showNotification: s, updateNotification: r, hideNotification: o } = hr(), { addHistoryItem: a } = $a(), i = Xn(), { route: l, values: c } = Ht(), { srcChainId: d, sender: h, recipient: m, cosmosWalletName: _ } = c, f = To(), { requestTxSync: p, waitForTxConfirmation: g } = ke(), { find:
|
|
4707
|
-
return
|
|
4712
|
+
function _g(e) {
|
|
4713
|
+
const t = ce(), { showNotification: s, updateNotification: r, hideNotification: o } = hr(), { addHistoryItem: a } = $a(), i = Xn(), { route: l, values: c } = Ht(), { srcChainId: d, sender: h, recipient: m, cosmosWalletName: _ } = c, f = To(), { requestTxSync: p, waitForTxConfirmation: g } = ke(), { find: b } = as(), k = Jn(), S = Zn(), $ = Pe(d), w = rn($), T = Wo(d), q = wt(), { registryUrl: E } = le(), I = ot(), { addReminder: y } = Kt(), C = Ve();
|
|
4714
|
+
return Ke({
|
|
4708
4715
|
mutationFn: async () => {
|
|
4709
4716
|
try {
|
|
4710
4717
|
if ("cosmos_tx" in e) {
|
|
@@ -4717,57 +4724,57 @@ function mg(e) {
|
|
|
4717
4724
|
});
|
|
4718
4725
|
});
|
|
4719
4726
|
if (w === "initia") {
|
|
4720
|
-
const { srcDenom: xe, quantity: fe } = c, { decimals:
|
|
4727
|
+
const { srcDenom: xe, quantity: fe } = c, { decimals: Qe } = T(xe), At = await p({
|
|
4721
4728
|
messages: v,
|
|
4722
4729
|
chainId: d,
|
|
4723
4730
|
internal: 1,
|
|
4724
|
-
spendCoins: [{ denom: xe, amount: Mn(fe, { decimals:
|
|
4731
|
+
spendCoins: [{ denom: xe, amount: Mn(fe, { decimals: Qe }) }]
|
|
4725
4732
|
}), _n = g({ txHash: At, chainId: d });
|
|
4726
4733
|
return { txHash: At, wait: _n };
|
|
4727
4734
|
}
|
|
4728
|
-
const
|
|
4729
|
-
if (!
|
|
4730
|
-
const
|
|
4735
|
+
const A = b(_)?.getProvider();
|
|
4736
|
+
if (!A) throw new Error("Wallet not connected");
|
|
4737
|
+
const N = A.getOfflineSignerOnlyAmino(d), R = await eo.connectWithSigner(
|
|
4731
4738
|
$.rpc,
|
|
4732
|
-
|
|
4733
|
-
{ registry:
|
|
4734
|
-
),
|
|
4735
|
-
(xe) =>
|
|
4739
|
+
N,
|
|
4740
|
+
{ registry: k, aminoTypes: S }
|
|
4741
|
+
), x = await R.getAllBalances(h), V = $.fee_assets.find(
|
|
4742
|
+
(xe) => x.some(
|
|
4736
4743
|
(fe) => fe.denom === xe.denom && P(fe.amount).gt(0)
|
|
4737
4744
|
)
|
|
4738
4745
|
);
|
|
4739
4746
|
if (!V) {
|
|
4740
4747
|
const fe = [
|
|
4741
4748
|
"Insufficient balance for fees.",
|
|
4742
|
-
`Available fee assets: ${$.fee_assets.map((
|
|
4749
|
+
`Available fee assets: ${$.fee_assets.map((Qe) => T(Qe.denom).symbol).join(", ")}`,
|
|
4743
4750
|
"(note: asset symbols may refer to different tokens across chains)"
|
|
4744
4751
|
].join(" ");
|
|
4745
4752
|
throw new Error(fe);
|
|
4746
4753
|
}
|
|
4747
|
-
const { denom:
|
|
4748
|
-
if (!de) throw new Error(`Gas price not found for ${
|
|
4749
|
-
const _e = await R.simulate(h, v, ""), Wt = no.fromString(de.average +
|
|
4754
|
+
const { denom: W, gas_price: de } = V;
|
|
4755
|
+
if (!de) throw new Error(`Gas price not found for ${W}`);
|
|
4756
|
+
const _e = await R.simulate(h, v, ""), Wt = no.fromString(de.average + W), jt = to(Math.ceil(_e * Dn), Wt), xt = await R.signAndBroadcastSync(h, v, jt), $t = Bo({ txHash: xt, client: R });
|
|
4750
4757
|
return { txHash: xt, wait: $t };
|
|
4751
4758
|
}
|
|
4752
4759
|
if ("evm_tx" in e) {
|
|
4753
|
-
const { chain_id: v, to:
|
|
4754
|
-
await Ks(
|
|
4755
|
-
const
|
|
4756
|
-
return { txHash:
|
|
4760
|
+
const { chain_id: v, to: A, value: N, data: R } = e.evm_tx, x = await f(), V = await x.getSigner();
|
|
4761
|
+
await Ks(x, $);
|
|
4762
|
+
const W = await V.sendTransaction({ chainId: v, to: A, value: N, data: `0x${R}` });
|
|
4763
|
+
return { txHash: W.hash, wait: W.wait() };
|
|
4757
4764
|
}
|
|
4758
4765
|
throw new Error("Unlisted chain type");
|
|
4759
4766
|
} catch (v) {
|
|
4760
|
-
throw
|
|
4767
|
+
throw await Fe(v);
|
|
4761
4768
|
}
|
|
4762
4769
|
},
|
|
4763
|
-
onSuccess: async ({ txHash: v, wait:
|
|
4770
|
+
onSuccess: async ({ txHash: v, wait: A }) => {
|
|
4764
4771
|
localStorage.removeItem(O.BRIDGE_QUANTITY), t(-1), s({
|
|
4765
4772
|
type: "loading",
|
|
4766
4773
|
title: "Transaction is pending..."
|
|
4767
4774
|
});
|
|
4768
4775
|
try {
|
|
4769
|
-
await
|
|
4770
|
-
const
|
|
4776
|
+
await A;
|
|
4777
|
+
const N = yr(l) === "OP Bridge withdrawal", R = N ? { success: !0, error: null } : await vg(C, v, d);
|
|
4771
4778
|
if (!R.success && R.error) {
|
|
4772
4779
|
const _e = R.error instanceof Error ? R.error.message : String(R.error);
|
|
4773
4780
|
s({
|
|
@@ -4777,25 +4784,25 @@ function mg(e) {
|
|
|
4777
4784
|
autoHide: !0
|
|
4778
4785
|
});
|
|
4779
4786
|
}
|
|
4780
|
-
const
|
|
4781
|
-
a(
|
|
4787
|
+
const x = R.success, W = gg({ txHash: v, srcChainId: d, route: l, values: c, recipient: m }, x);
|
|
4788
|
+
a(W.tx, W.details), r(pg(o));
|
|
4782
4789
|
const de = Ts(c, v);
|
|
4783
|
-
if (i("Bridge Transaction Success", de),
|
|
4784
|
-
const _e =
|
|
4785
|
-
y(
|
|
4790
|
+
if (i("Bridge Transaction Success", de), N) {
|
|
4791
|
+
const _e = yg(W.tx, l, m);
|
|
4792
|
+
y(W.tx, _e);
|
|
4786
4793
|
}
|
|
4787
|
-
} catch (
|
|
4788
|
-
const R =
|
|
4794
|
+
} catch (N) {
|
|
4795
|
+
const R = N instanceof Error ? N.message : String(N);
|
|
4789
4796
|
r({
|
|
4790
4797
|
type: "error",
|
|
4791
4798
|
title: "Transaction not confirmed",
|
|
4792
4799
|
description: R
|
|
4793
4800
|
});
|
|
4794
|
-
const
|
|
4801
|
+
const x = {
|
|
4795
4802
|
...Ts(c, v),
|
|
4796
4803
|
error: R
|
|
4797
4804
|
};
|
|
4798
|
-
i("Bridge Confirmation Failed",
|
|
4805
|
+
i("Bridge Confirmation Failed", x);
|
|
4799
4806
|
} finally {
|
|
4800
4807
|
q.invalidateQueries({
|
|
4801
4808
|
queryKey: qe.balances(d, h).queryKey
|
|
@@ -4803,23 +4810,23 @@ function mg(e) {
|
|
|
4803
4810
|
}
|
|
4804
4811
|
},
|
|
4805
4812
|
onError: async (v) => {
|
|
4806
|
-
const
|
|
4813
|
+
const A = w === "initia" ? await qt(v, I(d), E) : v;
|
|
4807
4814
|
s({
|
|
4808
4815
|
type: "error",
|
|
4809
4816
|
title: "Transaction failed",
|
|
4810
|
-
description:
|
|
4817
|
+
description: A.message
|
|
4811
4818
|
});
|
|
4812
|
-
const
|
|
4819
|
+
const N = Ts(c);
|
|
4813
4820
|
i("Bridge Transaction Failed", {
|
|
4814
|
-
...
|
|
4815
|
-
error:
|
|
4821
|
+
...N,
|
|
4822
|
+
error: A.message
|
|
4816
4823
|
});
|
|
4817
4824
|
}
|
|
4818
4825
|
});
|
|
4819
4826
|
}
|
|
4820
|
-
function
|
|
4821
|
-
const e =
|
|
4822
|
-
return
|
|
4827
|
+
function fg() {
|
|
4828
|
+
const e = Ve(), t = re(), s = or(), { route: r, values: o } = Ht(), a = Nt();
|
|
4829
|
+
return Ke({
|
|
4823
4830
|
mutationFn: async () => {
|
|
4824
4831
|
try {
|
|
4825
4832
|
const { chain_id: i, hook: l } = await e.post("op-hook", {
|
|
@@ -4832,7 +4839,7 @@ function _g() {
|
|
|
4832
4839
|
dest_asset_denom: r.dest_asset_denom
|
|
4833
4840
|
}
|
|
4834
4841
|
}).json();
|
|
4835
|
-
await
|
|
4842
|
+
await mg(t, a(r.dest_asset_chain_id).rest);
|
|
4836
4843
|
const c = l.map(({ msg_type_url: m, msg: _ }) => Ei.fromAmino({
|
|
4837
4844
|
type: Vs[m].aminoType,
|
|
4838
4845
|
value: JSON.parse(_)
|
|
@@ -4850,12 +4857,12 @@ function _g() {
|
|
|
4850
4857
|
});
|
|
4851
4858
|
return { signer: t, hook: bt(br.encode(h).finish()) };
|
|
4852
4859
|
} catch (i) {
|
|
4853
|
-
throw
|
|
4860
|
+
throw await Fe(i);
|
|
4854
4861
|
}
|
|
4855
4862
|
}
|
|
4856
4863
|
});
|
|
4857
4864
|
}
|
|
4858
|
-
function
|
|
4865
|
+
function pg(e) {
|
|
4859
4866
|
return {
|
|
4860
4867
|
type: "info",
|
|
4861
4868
|
title: "Transaction submitted",
|
|
@@ -4883,7 +4890,7 @@ function Ts(e, t) {
|
|
|
4883
4890
|
txHash: t
|
|
4884
4891
|
};
|
|
4885
4892
|
}
|
|
4886
|
-
function
|
|
4893
|
+
function gg(e, t) {
|
|
4887
4894
|
const { txHash: s, srcChainId: r, route: o, values: a } = e, i = { chainId: r, txHash: s }, l = yr(o) === "OP Bridge withdrawal";
|
|
4888
4895
|
return {
|
|
4889
4896
|
tx: i,
|
|
@@ -4898,7 +4905,7 @@ function pg(e, t) {
|
|
|
4898
4905
|
isOpWithdraw: l
|
|
4899
4906
|
};
|
|
4900
4907
|
}
|
|
4901
|
-
function
|
|
4908
|
+
function yg(e, t, s) {
|
|
4902
4909
|
return {
|
|
4903
4910
|
...e,
|
|
4904
4911
|
recipient: z(s).bech32,
|
|
@@ -4907,26 +4914,26 @@ function gg(e, t, s) {
|
|
|
4907
4914
|
denom: t.dest_asset_denom
|
|
4908
4915
|
};
|
|
4909
4916
|
}
|
|
4910
|
-
async function
|
|
4917
|
+
async function vg(e, t, s) {
|
|
4911
4918
|
for (let a = 0; a <= 30; a++)
|
|
4912
4919
|
try {
|
|
4913
4920
|
return await e.post("v2/tx/track", { json: { tx_hash: t, chain_id: s } }).json(), { success: !0, error: null };
|
|
4914
4921
|
} catch (i) {
|
|
4915
4922
|
if (a === 30)
|
|
4916
|
-
return { success: !1, error: await
|
|
4923
|
+
return { success: !1, error: await Fe(i) };
|
|
4917
4924
|
await new Promise((l) => setTimeout(l, 1e3));
|
|
4918
4925
|
}
|
|
4919
4926
|
return { success: !1, error: new Error("Maximum retries exceeded") };
|
|
4920
4927
|
}
|
|
4921
|
-
function
|
|
4922
|
-
const { chainId: t, txHash: s, tracked: r } = e, o =
|
|
4928
|
+
function wg(e) {
|
|
4929
|
+
const { chainId: t, txHash: s, tracked: r } = e, o = Ve();
|
|
4923
4930
|
return he({
|
|
4924
4931
|
queryKey: qe.txTrack(t, s).queryKey,
|
|
4925
4932
|
queryFn: async () => {
|
|
4926
4933
|
try {
|
|
4927
4934
|
return await o.post("v2/tx/track", { json: { tx_hash: s, chain_id: t } }).json();
|
|
4928
4935
|
} catch (a) {
|
|
4929
|
-
throw
|
|
4936
|
+
throw await Fe(a);
|
|
4930
4937
|
}
|
|
4931
4938
|
},
|
|
4932
4939
|
select: ({ tx_hash: a }) => a,
|
|
@@ -4937,8 +4944,8 @@ function vg(e) {
|
|
|
4937
4944
|
enabled: !r
|
|
4938
4945
|
});
|
|
4939
4946
|
}
|
|
4940
|
-
function
|
|
4941
|
-
const { timestamp: t, chainId: s, txHash: r, tracked: o, state: a } = e, i =
|
|
4947
|
+
function bg(e) {
|
|
4948
|
+
const { timestamp: t, chainId: s, txHash: r, tracked: o, state: a } = e, i = Ve();
|
|
4942
4949
|
return he({
|
|
4943
4950
|
queryKey: qe.txStatus(s, r).queryKey,
|
|
4944
4951
|
queryFn: () => i.get("v2/tx/status", { searchParams: { tx_hash: r, chain_id: s } }).json(),
|
|
@@ -4958,17 +4965,17 @@ function yr(e) {
|
|
|
4958
4965
|
const { operations: t, dest_asset_denom: s } = e;
|
|
4959
4966
|
return mi("op_init_transfer", Fn(t)) && s === "uinit" ? "OP Bridge withdrawal" : "Skip";
|
|
4960
4967
|
}
|
|
4961
|
-
const
|
|
4962
|
-
content:
|
|
4963
|
-
info:
|
|
4964
|
-
arrow:
|
|
4965
|
-
divider:
|
|
4966
|
-
type:
|
|
4967
|
-
asset:
|
|
4968
|
-
amount:
|
|
4969
|
-
lower:
|
|
4970
|
-
chain:
|
|
4971
|
-
address:
|
|
4968
|
+
const Cg = "_content_c0tee_1", Ng = "_info_c0tee_6", Ig = "_arrow_c0tee_11", Sg = "_divider_c0tee_19", kg = "_type_c0tee_26", xg = "_asset_c0tee_44", $g = "_amount_c0tee_52", Ag = "_lower_c0tee_57", Tg = "_chain_c0tee_63", Eg = "_address_c0tee_69", ge = {
|
|
4969
|
+
content: Cg,
|
|
4970
|
+
info: Ng,
|
|
4971
|
+
arrow: Ig,
|
|
4972
|
+
divider: Sg,
|
|
4973
|
+
type: kg,
|
|
4974
|
+
asset: xg,
|
|
4975
|
+
amount: $g,
|
|
4976
|
+
lower: Ag,
|
|
4977
|
+
chain: Tg,
|
|
4978
|
+
address: Eg
|
|
4972
4979
|
}, Ta = (e) => {
|
|
4973
4980
|
const { source: t, label: s, amount: r, denom: o, chainId: a, address: i, walletIcon: l } = e, { symbol: c = we(o), decimals: d = 0, logo_uri: h = ar } = e, { chain_name: m, pretty_name: _, ...f } = Pe(a);
|
|
4974
4981
|
return /* @__PURE__ */ u("div", { children: [
|
|
@@ -4998,18 +5005,18 @@ const bg = "_content_c0tee_1", Cg = "_info_c0tee_6", Ng = "_arrow_c0tee_11", Ig
|
|
|
4998
5005
|
] })
|
|
4999
5006
|
] });
|
|
5000
5007
|
}, Rt = (e) => {
|
|
5001
|
-
const t =
|
|
5008
|
+
const t = ze(e.denom, e.chainId);
|
|
5002
5009
|
return /* @__PURE__ */ n(Ta, { ...e, ...t });
|
|
5003
5010
|
};
|
|
5004
5011
|
Rt.Placeholder = Ta;
|
|
5005
|
-
const
|
|
5006
|
-
root:
|
|
5007
|
-
flexEnd:
|
|
5008
|
-
toggle:
|
|
5009
|
-
route:
|
|
5010
|
-
content:
|
|
5012
|
+
const Dg = "_root_1l4he_1", qg = "_flexEnd_1l4he_6", Pg = "_toggle_1l4he_11", Rg = "_route_1l4he_34", Bg = "_content_1l4he_41", tn = {
|
|
5013
|
+
root: Dg,
|
|
5014
|
+
flexEnd: qg,
|
|
5015
|
+
toggle: Pg,
|
|
5016
|
+
route: Rg,
|
|
5017
|
+
content: Bg
|
|
5011
5018
|
};
|
|
5012
|
-
function
|
|
5019
|
+
function Og(e) {
|
|
5013
5020
|
const t = ({ name: s }) => s === "initia-dex" ? "Initia DEX" : ec(Fn(s?.split("-") ?? []) ?? "");
|
|
5014
5021
|
if ("transfer" in e)
|
|
5015
5022
|
return { label: "Bridge via IBC", ...e, ...e.transfer };
|
|
@@ -5041,7 +5048,7 @@ function Bg(e) {
|
|
|
5041
5048
|
return { label: "Bridge via LayerZero", ...e, ...e.layer_zero_transfer };
|
|
5042
5049
|
throw new Error("Unknown operation type");
|
|
5043
5050
|
}
|
|
5044
|
-
const
|
|
5051
|
+
const Lg = ({ addressList: e }) => {
|
|
5045
5052
|
const { values: t, route: s } = Ht(), { source_asset_denom: r, source_asset_chain_id: o, amount_in: a, operations: i } = s, l = xn(s.required_chain_addresses, e), { find: c } = as(), { connector: d, address: h = "" } = Mt(), [m, _] = Qs(!1), f = i.length > 1, p = /* @__PURE__ */ n(
|
|
5046
5053
|
H,
|
|
5047
5054
|
{
|
|
@@ -5055,17 +5062,17 @@ const Og = ({ addressList: e }) => {
|
|
|
5055
5062
|
chainId: o,
|
|
5056
5063
|
address: t.sender,
|
|
5057
5064
|
walletIcon: p
|
|
5058
|
-
},
|
|
5059
|
-
const { label: q, amount_out: E, denom:
|
|
5065
|
+
}, b = (T) => z.equals(T, h) ? p : /* @__PURE__ */ n(Wn, { size: 11 }), k = (T) => {
|
|
5066
|
+
const { label: q, amount_out: E, denom: I, denom_out: y = I, chain_id: C, from_chain_id: v, to_chain_id: A = C ?? v } = T, N = l[A];
|
|
5060
5067
|
return {
|
|
5061
5068
|
label: f && !m ? void 0 : q,
|
|
5062
5069
|
amount: E,
|
|
5063
5070
|
denom: y,
|
|
5064
|
-
chainId:
|
|
5065
|
-
address:
|
|
5066
|
-
walletIcon:
|
|
5071
|
+
chainId: A,
|
|
5072
|
+
address: N,
|
|
5073
|
+
walletIcon: b(N)
|
|
5067
5074
|
};
|
|
5068
|
-
}, S = i.map(
|
|
5075
|
+
}, S = i.map(Og).map(k), $ = S.slice(0, -1), w = S[S.length - 1];
|
|
5069
5076
|
return /* @__PURE__ */ u(Le.Root, { className: tn.root, open: m, onOpenChange: _, children: [
|
|
5070
5077
|
f && /* @__PURE__ */ n("div", { className: tn.flexEnd, children: /* @__PURE__ */ n(Le.Trigger, { className: tn.toggle, children: m ? /* @__PURE__ */ u(K, { children: [
|
|
5071
5078
|
/* @__PURE__ */ n(Zi, { size: 12 }),
|
|
@@ -5076,12 +5083,12 @@ const Og = ({ addressList: e }) => {
|
|
|
5076
5083
|
] }) }) }),
|
|
5077
5084
|
/* @__PURE__ */ u("div", { className: tn.route, children: [
|
|
5078
5085
|
/* @__PURE__ */ n(Rt, { ...g, source: !0 }),
|
|
5079
|
-
/* @__PURE__ */ n(Le.Content, { className: tn.content, children: $.map((
|
|
5086
|
+
/* @__PURE__ */ n(Le.Content, { className: tn.content, children: $.map((T, q) => /* @__PURE__ */ n(
|
|
5080
5087
|
me,
|
|
5081
5088
|
{
|
|
5082
|
-
suspenseFallback: /* @__PURE__ */ n(Rt.Placeholder, { ...
|
|
5083
|
-
errorBoundaryProps: { fallback: /* @__PURE__ */ n(Rt.Placeholder, { ...
|
|
5084
|
-
children: /* @__PURE__ */ n(Rt, { ...
|
|
5089
|
+
suspenseFallback: /* @__PURE__ */ n(Rt.Placeholder, { ...T }),
|
|
5090
|
+
errorBoundaryProps: { fallback: /* @__PURE__ */ n(Rt.Placeholder, { ...T }) },
|
|
5091
|
+
children: /* @__PURE__ */ n(Rt, { ...T })
|
|
5085
5092
|
},
|
|
5086
5093
|
q
|
|
5087
5094
|
)) }),
|
|
@@ -5090,47 +5097,47 @@ const Og = ({ addressList: e }) => {
|
|
|
5090
5097
|
] });
|
|
5091
5098
|
}, Hs = ({ error: e }) => {
|
|
5092
5099
|
const t = ce();
|
|
5093
|
-
return /* @__PURE__ */ n(ee, { extra: /* @__PURE__ */ n(X, { level: "error", children: e.message }), children: /* @__PURE__ */ n(
|
|
5094
|
-
},
|
|
5095
|
-
const t = Ht(), { route: s, values: r } = t, { required_chain_addresses: o } = s, { srcChainId: a, dstChainId: i, sender: l, recipient: c } = r, { initiaAddress: d, hexAddress: h } = ke(), m = zt(), _ = Nt(), f = dn(), p = _(a), g = f(p),
|
|
5096
|
-
const
|
|
5097
|
-
return f(
|
|
5098
|
-
}) && g !== "cosmos", [
|
|
5100
|
+
return /* @__PURE__ */ n(ee, { extra: /* @__PURE__ */ n(X, { level: "error", children: e.message }), children: /* @__PURE__ */ n(j.White, { onClick: () => t("/bridge"), children: "Home" }) });
|
|
5101
|
+
}, Mg = ({ children: e }) => {
|
|
5102
|
+
const t = Ht(), { route: s, values: r } = t, { required_chain_addresses: o } = s, { srcChainId: a, dstChainId: i, sender: l, recipient: c } = r, { initiaAddress: d, hexAddress: h } = ke(), m = zt(), _ = Nt(), f = dn(), p = _(a), g = f(p), b = o.slice(0, -1).some((E) => {
|
|
5103
|
+
const I = _(E);
|
|
5104
|
+
return f(I) === "cosmos";
|
|
5105
|
+
}) && g !== "cosmos", [k, S] = B(void 0), [$, w] = B(!1), [T, q] = B(null);
|
|
5099
5106
|
if (M(() => {
|
|
5100
5107
|
(async () => {
|
|
5101
5108
|
try {
|
|
5102
|
-
if (!
|
|
5109
|
+
if (!b) return;
|
|
5103
5110
|
if (!m) throw new Error("Wallet not connected");
|
|
5104
5111
|
w(!0), q(null);
|
|
5105
|
-
const [{ pubkey:
|
|
5106
|
-
S(
|
|
5107
|
-
} catch (
|
|
5108
|
-
q(
|
|
5112
|
+
const [{ pubkey: I }] = await m.getAccounts();
|
|
5113
|
+
S(I);
|
|
5114
|
+
} catch (I) {
|
|
5115
|
+
q(await Fe(I));
|
|
5109
5116
|
} finally {
|
|
5110
5117
|
w(!1);
|
|
5111
5118
|
}
|
|
5112
5119
|
})();
|
|
5113
|
-
}, [
|
|
5114
|
-
return /* @__PURE__ */ n(Hs, { error:
|
|
5120
|
+
}, [b, m]), T)
|
|
5121
|
+
return /* @__PURE__ */ n(Hs, { error: T });
|
|
5115
5122
|
if ($)
|
|
5116
|
-
return /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
5117
|
-
if (!
|
|
5118
|
-
const E = o.map((
|
|
5123
|
+
return /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(j.White, { loading: $ && "Generating intermediary addresses..." }) });
|
|
5124
|
+
if (!b || k) {
|
|
5125
|
+
const E = o.map((I, y) => {
|
|
5119
5126
|
if (y === o.length - 1) {
|
|
5120
5127
|
const R = _(i);
|
|
5121
5128
|
return f(R) === "initia" ? z(c).bech32 : c;
|
|
5122
5129
|
}
|
|
5123
|
-
const
|
|
5130
|
+
const C = _(I), v = f(C), A = _(a), N = f(A);
|
|
5124
5131
|
switch (v) {
|
|
5125
5132
|
case "initia":
|
|
5126
5133
|
return d;
|
|
5127
5134
|
case "evm":
|
|
5128
5135
|
return h;
|
|
5129
5136
|
case "cosmos": {
|
|
5130
|
-
if (
|
|
5131
|
-
return Ni(
|
|
5132
|
-
if (!
|
|
5133
|
-
return Xa(Ws(
|
|
5137
|
+
if (N === "cosmos")
|
|
5138
|
+
return Ni(C.bech32_prefix, lo(l).data);
|
|
5139
|
+
if (!k) throw new Error("Pubkey not found");
|
|
5140
|
+
return Xa(Ws(k), C.bech32_prefix);
|
|
5134
5141
|
}
|
|
5135
5142
|
default:
|
|
5136
5143
|
throw new Error("Unlisted chain type");
|
|
@@ -5139,8 +5146,8 @@ const Og = ({ addressList: e }) => {
|
|
|
5139
5146
|
return e(E);
|
|
5140
5147
|
}
|
|
5141
5148
|
return null;
|
|
5142
|
-
},
|
|
5143
|
-
const r =
|
|
5149
|
+
}, Fg = ({ addressList: e, signedOpHook: t, children: s }) => {
|
|
5150
|
+
const r = Ve(), { route: o, values: a } = Ht(), [i, l] = B(void 0), [c, d] = B(!1), [h, m] = B(null);
|
|
5144
5151
|
return M(() => {
|
|
5145
5152
|
(async () => {
|
|
5146
5153
|
try {
|
|
@@ -5168,18 +5175,18 @@ const Og = ({ addressList: e }) => {
|
|
|
5168
5175
|
d(!1);
|
|
5169
5176
|
}
|
|
5170
5177
|
})();
|
|
5171
|
-
}, [o, a, e, t, r]), h ? /* @__PURE__ */ n(Hs, { error: h }) : c ? /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
5172
|
-
},
|
|
5173
|
-
const { route: t } = Ht(), s =
|
|
5178
|
+
}, [o, a, e, t, r]), h ? /* @__PURE__ */ n(Hs, { error: h }) : c ? /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(j.White, { loading: c && "Fetching messages..." }) }) : i ? s(i) : /* @__PURE__ */ n(Hs, { error: new Error("Failed to fetch messages") });
|
|
5179
|
+
}, zg = ({ children: e }) => {
|
|
5180
|
+
const { route: t } = Ht(), s = fg();
|
|
5174
5181
|
return t.required_op_hook && !s.data ? /* @__PURE__ */ n(ee, { extra: /* @__PURE__ */ n(X, { level: "error", children: s.error?.message }), children: /* @__PURE__ */ n(
|
|
5175
|
-
|
|
5182
|
+
j.White,
|
|
5176
5183
|
{
|
|
5177
5184
|
onClick: () => s.mutate(),
|
|
5178
5185
|
loading: s.isPending && "Awaiting signature...",
|
|
5179
5186
|
children: "Authorize conversion"
|
|
5180
5187
|
}
|
|
5181
5188
|
) }) : e(s.data);
|
|
5182
|
-
},
|
|
5189
|
+
}, Ug = ({ tx: e, children: t }) => {
|
|
5183
5190
|
const s = To(), r = Nt(), { data: o, isLoading: a } = he({
|
|
5184
5191
|
queryKey: ["erc20-approvals-needed", e],
|
|
5185
5192
|
queryFn: async () => {
|
|
@@ -5190,13 +5197,13 @@ const Og = ({ addressList: e }) => {
|
|
|
5190
5197
|
const f = ["function allowance(address owner, address spender) view returns (uint256)"];
|
|
5191
5198
|
return (await Promise.all(
|
|
5192
5199
|
e.evm_tx.required_erc20_approvals.map(async (g) => {
|
|
5193
|
-
const { token_contract:
|
|
5200
|
+
const { token_contract: b, spender: k } = g, $ = await new En.Contract(b, f, _).allowance(m, k);
|
|
5194
5201
|
return { approval: g, currentAllowance: BigInt($.toString()) };
|
|
5195
5202
|
})
|
|
5196
|
-
)).filter(({ approval: g, currentAllowance:
|
|
5203
|
+
)).filter(({ approval: g, currentAllowance: b }) => b < BigInt(g.amount)).map(({ approval: g }) => g);
|
|
5197
5204
|
},
|
|
5198
5205
|
enabled: !!e && "evm_tx" in e && !!e.evm_tx.required_erc20_approvals
|
|
5199
|
-
}), { mutate: i, data: l, isPending: c, error: d } =
|
|
5206
|
+
}), { mutate: i, data: l, isPending: c, error: d } = Ke({
|
|
5200
5207
|
mutationFn: async () => {
|
|
5201
5208
|
try {
|
|
5202
5209
|
if (!("evm_tx" in e)) throw new Error("Transaction is not EVM");
|
|
@@ -5204,38 +5211,38 @@ const Og = ({ addressList: e }) => {
|
|
|
5204
5211
|
const { chain_id: h } = e.evm_tx, m = await s(), _ = await m.getSigner();
|
|
5205
5212
|
await Ks(m, r(h));
|
|
5206
5213
|
for (const f of o) {
|
|
5207
|
-
const { token_contract: p, spender: g, amount:
|
|
5214
|
+
const { token_contract: p, spender: g, amount: b } = f, k = [
|
|
5208
5215
|
"function approve(address spender, uint256 amount) external returns (bool)"
|
|
5209
5216
|
];
|
|
5210
|
-
await (await new En.Contract(p,
|
|
5217
|
+
await (await new En.Contract(p, k, _).approve(g, b)).wait();
|
|
5211
5218
|
}
|
|
5212
5219
|
return !0;
|
|
5213
5220
|
} catch (h) {
|
|
5214
|
-
throw
|
|
5221
|
+
throw await Fe(h);
|
|
5215
5222
|
}
|
|
5216
5223
|
}
|
|
5217
5224
|
});
|
|
5218
|
-
return a ? /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
5219
|
-
},
|
|
5220
|
-
const { mutate: t, isPending: s } =
|
|
5221
|
-
return /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
5222
|
-
},
|
|
5223
|
-
/* @__PURE__ */ n(
|
|
5224
|
-
/* @__PURE__ */ n(
|
|
5225
|
-
] }) }) }),
|
|
5226
|
-
button:
|
|
5227
|
-
checkbox:
|
|
5228
|
-
checked:
|
|
5229
|
-
},
|
|
5225
|
+
return a ? /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(j.White, { loading: "Checking approvals..." }) }) : o && o.length > 0 && !l ? /* @__PURE__ */ n(ee, { extra: /* @__PURE__ */ n(X, { level: "error", children: d?.message }), children: /* @__PURE__ */ n(j.White, { onClick: () => i(), loading: c && "Approving tokens...", children: "Approve tokens" }) }) : t;
|
|
5226
|
+
}, Kg = ({ tx: e }) => {
|
|
5227
|
+
const { mutate: t, isPending: s } = _g(e);
|
|
5228
|
+
return /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(j.White, { onClick: () => t(), loading: s && "Signing transaction...", children: "Confirm" }) });
|
|
5229
|
+
}, Hg = () => /* @__PURE__ */ n(St, { title: "Route preview", children: /* @__PURE__ */ n(Mg, { children: (e) => /* @__PURE__ */ u(K, { children: [
|
|
5230
|
+
/* @__PURE__ */ n(Lg, { addressList: e }),
|
|
5231
|
+
/* @__PURE__ */ n(zg, { children: (t) => /* @__PURE__ */ n(Fg, { addressList: e, signedOpHook: t, children: (s) => /* @__PURE__ */ n(Ug, { tx: s, children: /* @__PURE__ */ n(Kg, { tx: s }) }) }) })
|
|
5232
|
+
] }) }) }), Wg = "_button_14cv7_1", jg = "_checkbox_14cv7_10", Vg = "_checked_14cv7_23", Sn = {
|
|
5233
|
+
button: Wg,
|
|
5234
|
+
checkbox: jg,
|
|
5235
|
+
checked: Vg
|
|
5236
|
+
}, Gg = ({ checked: e, onClick: t, label: s, className: r }) => /* @__PURE__ */ u("button", { type: "button", className: D(Sn.button, r), onClick: t, children: [
|
|
5230
5237
|
/* @__PURE__ */ n("div", { className: D(Sn.checkbox, { [Sn.checked]: e }), children: e && /* @__PURE__ */ n(Hn, { size: 12 }) }),
|
|
5231
5238
|
/* @__PURE__ */ n("span", { className: Sn.label, children: s })
|
|
5232
|
-
] }),
|
|
5233
|
-
success:
|
|
5234
|
-
error:
|
|
5235
|
-
},
|
|
5239
|
+
] }), Qg = "_success_t4dfk_1", Yg = "_error_t4dfk_5", Zr = {
|
|
5240
|
+
success: Qg,
|
|
5241
|
+
error: Yg
|
|
5242
|
+
}, Jg = ({ tx: e }) => {
|
|
5236
5243
|
const [t, s] = Aa(e);
|
|
5237
5244
|
if (!t) throw new Error("Bridge history details not found");
|
|
5238
|
-
const { data: r } =
|
|
5245
|
+
const { data: r } = bg(t), o = t.state ?? Zg(r);
|
|
5239
5246
|
switch (M(() => {
|
|
5240
5247
|
o !== "loading" && s((a) => {
|
|
5241
5248
|
if (!a) throw new Error("Bridge history details not found");
|
|
@@ -5250,7 +5257,7 @@ const Og = ({ addressList: e }) => {
|
|
|
5250
5257
|
return /* @__PURE__ */ n(It, { size: 14 });
|
|
5251
5258
|
}
|
|
5252
5259
|
};
|
|
5253
|
-
function
|
|
5260
|
+
function Zg(e) {
|
|
5254
5261
|
if (!e) return "loading";
|
|
5255
5262
|
switch (e.state) {
|
|
5256
5263
|
case "STATE_ABANDONED":
|
|
@@ -5263,45 +5270,45 @@ function Jg(e) {
|
|
|
5263
5270
|
return "loading";
|
|
5264
5271
|
}
|
|
5265
5272
|
}
|
|
5266
|
-
const
|
|
5267
|
-
link:
|
|
5268
|
-
header:
|
|
5269
|
-
title:
|
|
5270
|
-
date:
|
|
5271
|
-
explorer:
|
|
5272
|
-
fees:
|
|
5273
|
-
label:
|
|
5274
|
-
content:
|
|
5275
|
-
route:
|
|
5276
|
-
row:
|
|
5277
|
-
asset:
|
|
5278
|
-
amount:
|
|
5279
|
-
chain:
|
|
5280
|
-
account:
|
|
5281
|
-
arrow:
|
|
5282
|
-
},
|
|
5273
|
+
const Xg = "_link_12p3n_1", ey = "_header_12p3n_22", ty = "_title_12p3n_30", ny = "_date_12p3n_36", sy = "_explorer_12p3n_40", ry = "_fees_12p3n_55", oy = "_label_12p3n_63", ay = "_content_12p3n_67", iy = "_route_12p3n_73", cy = "_row_12p3n_78", ly = "_asset_12p3n_84", dy = "_amount_12p3n_92", uy = "_chain_12p3n_97", hy = "_account_12p3n_106", my = "_arrow_12p3n_113", Z = {
|
|
5274
|
+
link: Xg,
|
|
5275
|
+
header: ey,
|
|
5276
|
+
title: ty,
|
|
5277
|
+
date: ny,
|
|
5278
|
+
explorer: sy,
|
|
5279
|
+
fees: ry,
|
|
5280
|
+
label: oy,
|
|
5281
|
+
content: ay,
|
|
5282
|
+
route: iy,
|
|
5283
|
+
row: cy,
|
|
5284
|
+
asset: ly,
|
|
5285
|
+
amount: dy,
|
|
5286
|
+
chain: uy,
|
|
5287
|
+
account: hy,
|
|
5288
|
+
arrow: my
|
|
5289
|
+
}, _y = ({ tx: e }) => {
|
|
5283
5290
|
const [t, s] = Aa(e);
|
|
5284
5291
|
if (!t) throw new Error("Bridge history details not found");
|
|
5285
|
-
const { chainId: r, txHash: o, route: a, values: i, timestamp: l, tracked: c } = t, { data: d } =
|
|
5292
|
+
const { chainId: r, txHash: o, route: a, values: i, timestamp: l, tracked: c } = t, { data: d } = wg(t), { address: h = "", connector: m } = Mt(), { find: _ } = as();
|
|
5286
5293
|
M(() => {
|
|
5287
|
-
d && s((
|
|
5288
|
-
if (!
|
|
5289
|
-
return { ...
|
|
5294
|
+
d && s((x) => {
|
|
5295
|
+
if (!x) throw new Error("Bridge history details not found");
|
|
5296
|
+
return { ...x, tracked: !0 };
|
|
5290
5297
|
});
|
|
5291
5298
|
}, [s, d]);
|
|
5292
5299
|
const {
|
|
5293
5300
|
amount_in: f,
|
|
5294
5301
|
amount_out: p,
|
|
5295
5302
|
source_asset_chain_id: g,
|
|
5296
|
-
source_asset_denom:
|
|
5297
|
-
dest_asset_chain_id:
|
|
5303
|
+
source_asset_denom: b,
|
|
5304
|
+
dest_asset_chain_id: k,
|
|
5298
5305
|
dest_asset_denom: S,
|
|
5299
5306
|
estimated_fees: $ = []
|
|
5300
|
-
} = a, w = Pe(g),
|
|
5307
|
+
} = a, w = Pe(g), T = Pe(k), q = ze(b, g), E = ze(S, k), I = (x, V) => V ? /* @__PURE__ */ n(H, { src: V, width: 12, height: 12 }) : z.equals(x, h) ? /* @__PURE__ */ n(H, { src: m?.icon, width: 12, height: 12 }) : /* @__PURE__ */ n(Wn, { size: 12 }), y = (x, { symbol: V, decimals: W, logo_uri: de }, { chain_name: _e, pretty_name: Wt, ...jt }, xt, $t) => /* @__PURE__ */ u("div", { className: Z.row, children: [
|
|
5301
5308
|
/* @__PURE__ */ n(os, { assetLogoUrl: de, chainLogoUrl: jt.logo_uri ?? void 0 }),
|
|
5302
5309
|
/* @__PURE__ */ u("div", { children: [
|
|
5303
5310
|
/* @__PURE__ */ u("div", { className: Z.asset, children: [
|
|
5304
|
-
/* @__PURE__ */ n("span", { className: Z.amount, children: se(
|
|
5311
|
+
/* @__PURE__ */ n("span", { className: Z.amount, children: se(x, { decimals: W }) }),
|
|
5305
5312
|
/* @__PURE__ */ n("span", { children: V })
|
|
5306
5313
|
] }),
|
|
5307
5314
|
/* @__PURE__ */ u("div", { className: Z.chain, children: [
|
|
@@ -5315,17 +5322,17 @@ const Zg = "_link_12p3n_1", Xg = "_header_12p3n_22", ey = "_title_12p3n_30", ty
|
|
|
5315
5322
|
] })
|
|
5316
5323
|
] })
|
|
5317
5324
|
] })
|
|
5318
|
-
] }),
|
|
5319
|
-
switch (
|
|
5325
|
+
] }), C = yr(a), v = F(() => {
|
|
5326
|
+
switch (C) {
|
|
5320
5327
|
case Tn.SKIP:
|
|
5321
5328
|
return "Skip Explorer";
|
|
5322
5329
|
case Tn.OP_WITHDRAW:
|
|
5323
5330
|
return "Initia Scan";
|
|
5324
5331
|
}
|
|
5325
|
-
}, [
|
|
5332
|
+
}, [C]), A = /* @__PURE__ */ u(K, { children: [
|
|
5326
5333
|
/* @__PURE__ */ u("header", { className: Z.header, children: [
|
|
5327
5334
|
/* @__PURE__ */ u("div", { className: Z.title, children: [
|
|
5328
|
-
c ? /* @__PURE__ */ n(
|
|
5335
|
+
c ? /* @__PURE__ */ n(Jg, { tx: e }) : /* @__PURE__ */ n(It, { size: 14 }),
|
|
5329
5336
|
/* @__PURE__ */ n("div", { className: Z.date, children: go(new Date(l), "h:mm a") })
|
|
5330
5337
|
] }),
|
|
5331
5338
|
/* @__PURE__ */ u("div", { className: Z.explorer, children: [
|
|
@@ -5339,15 +5346,15 @@ const Zg = "_link_12p3n_1", Xg = "_header_12p3n_22", ey = "_title_12p3n_30", ty
|
|
|
5339
5346
|
q,
|
|
5340
5347
|
w,
|
|
5341
5348
|
i.sender,
|
|
5342
|
-
|
|
5349
|
+
I(i.sender, _(i.cosmosWalletName)?.image)
|
|
5343
5350
|
),
|
|
5344
5351
|
/* @__PURE__ */ n("div", { className: Z.arrow, children: /* @__PURE__ */ n(Ps, { size: 12 }) }),
|
|
5345
5352
|
y(
|
|
5346
5353
|
p,
|
|
5347
5354
|
E,
|
|
5348
|
-
|
|
5355
|
+
T,
|
|
5349
5356
|
i.recipient,
|
|
5350
|
-
|
|
5357
|
+
I(i.recipient)
|
|
5351
5358
|
)
|
|
5352
5359
|
] }),
|
|
5353
5360
|
$.length > 0 && /* @__PURE__ */ u("div", { className: Z.fees, children: [
|
|
@@ -5355,24 +5362,24 @@ const Zg = "_link_12p3n_1", Xg = "_header_12p3n_22", ey = "_title_12p3n_30", ty
|
|
|
5355
5362
|
/* @__PURE__ */ n("span", { className: Z.content, children: Ca($) })
|
|
5356
5363
|
] })
|
|
5357
5364
|
] });
|
|
5358
|
-
if (
|
|
5359
|
-
return /* @__PURE__ */ n(ss, { chainId: r, txHash: o, className: Z.link, children:
|
|
5360
|
-
const
|
|
5361
|
-
return /* @__PURE__ */ n("a", { href: R.toString(), className: Z.link, target: "_blank", children:
|
|
5362
|
-
},
|
|
5363
|
-
history:
|
|
5364
|
-
header:
|
|
5365
|
-
checkbox:
|
|
5366
|
-
groups:
|
|
5367
|
-
dateGroup:
|
|
5368
|
-
dateHeader:
|
|
5369
|
-
list:
|
|
5370
|
-
},
|
|
5365
|
+
if (C === Tn.OP_WITHDRAW)
|
|
5366
|
+
return /* @__PURE__ */ n(ss, { chainId: r, txHash: o, className: Z.link, children: A });
|
|
5367
|
+
const N = new URLSearchParams({ tx_hash: o, chain_id: r }), R = new URL(`?${N.toString()}`, "https://explorer.skip.build");
|
|
5368
|
+
return /* @__PURE__ */ n("a", { href: R.toString(), className: Z.link, target: "_blank", children: A });
|
|
5369
|
+
}, fy = "_history_13u9z_1", py = "_header_13u9z_5", gy = "_checkbox_13u9z_9", yy = "_groups_13u9z_13", vy = "_dateGroup_13u9z_21", wy = "_dateHeader_13u9z_26", by = "_list_13u9z_32", mt = {
|
|
5370
|
+
history: fy,
|
|
5371
|
+
header: py,
|
|
5372
|
+
checkbox: gy,
|
|
5373
|
+
groups: yy,
|
|
5374
|
+
dateGroup: vy,
|
|
5375
|
+
dateHeader: wy,
|
|
5376
|
+
list: by
|
|
5377
|
+
}, Cy = () => {
|
|
5371
5378
|
const { initiaAddress: e, hexAddress: t } = ke(), { history: s, getHistoryDetails: r } = $a(), o = s.filter((f) => r(f)), a = o.filter((f) => {
|
|
5372
5379
|
const p = r(f);
|
|
5373
5380
|
if (!p) return !1;
|
|
5374
|
-
const { values: g } = p, { sender:
|
|
5375
|
-
return [
|
|
5381
|
+
const { values: g } = p, { sender: b, recipient: k } = g;
|
|
5382
|
+
return [b, k].some((S) => [e, t].includes(S));
|
|
5376
5383
|
}), [i, l] = B(1), [c, d] = Qs(!a.length), h = c ? o : a, m = h.slice(0, i * Jr), _ = F(() => ma(m, (f) => {
|
|
5377
5384
|
const p = r(f);
|
|
5378
5385
|
if (p)
|
|
@@ -5380,7 +5387,7 @@ const Zg = "_link_12p3n_1", Xg = "_header_12p3n_22", ey = "_title_12p3n_30", ty
|
|
|
5380
5387
|
}), [m, r]);
|
|
5381
5388
|
return /* @__PURE__ */ n(St, { title: "Bridge/Swap activity", children: /* @__PURE__ */ u("div", { className: mt.history, children: [
|
|
5382
5389
|
o.length > 0 && o.length !== a.length && /* @__PURE__ */ n("header", { className: mt.header, children: /* @__PURE__ */ n(
|
|
5383
|
-
|
|
5390
|
+
Gg,
|
|
5384
5391
|
{
|
|
5385
5392
|
checked: c,
|
|
5386
5393
|
onClick: d,
|
|
@@ -5390,7 +5397,7 @@ const Zg = "_link_12p3n_1", Xg = "_header_12p3n_22", ey = "_title_12p3n_30", ty
|
|
|
5390
5397
|
) }),
|
|
5391
5398
|
h.length === 0 ? /* @__PURE__ */ n(Y, { children: "No bridge/swap activity" }) : /* @__PURE__ */ n("div", { className: mt.groups, children: Object.entries(_).map(([f, p]) => /* @__PURE__ */ u("div", { className: mt.dateGroup, children: [
|
|
5392
5399
|
/* @__PURE__ */ n("div", { className: mt.dateHeader, children: f }),
|
|
5393
|
-
/* @__PURE__ */ n("div", { className: mt.list, children: p.map((g) => /* @__PURE__ */ n(me, { children: /* @__PURE__ */ n(
|
|
5400
|
+
/* @__PURE__ */ n("div", { className: mt.list, children: p.map((g) => /* @__PURE__ */ n(me, { children: /* @__PURE__ */ n(_y, { tx: g }) }, g.txHash)) })
|
|
5394
5401
|
] }, f)) }),
|
|
5395
5402
|
h.length > i * Jr ? /* @__PURE__ */ n(Na, { onClick: () => l((f) => f + 1) }) : s.length >= On && /* @__PURE__ */ u(Y, { children: [
|
|
5396
5403
|
"Only the latest ",
|
|
@@ -5416,62 +5423,62 @@ const Zg = "_link_12p3n_1", Xg = "_header_12p3n_22", ey = "_title_12p3n_30", ty
|
|
|
5416
5423
|
case "/":
|
|
5417
5424
|
case "/nfts":
|
|
5418
5425
|
case "/activity":
|
|
5419
|
-
return /* @__PURE__ */ n(
|
|
5426
|
+
return /* @__PURE__ */ n(a_, {});
|
|
5420
5427
|
case "/send":
|
|
5421
|
-
return /* @__PURE__ */ n(
|
|
5428
|
+
return /* @__PURE__ */ n(ff, {}, s);
|
|
5422
5429
|
case "/nft":
|
|
5423
|
-
return /* @__PURE__ */ n(
|
|
5430
|
+
return /* @__PURE__ */ n(kf, {});
|
|
5424
5431
|
case "/nft/send":
|
|
5425
|
-
return /* @__PURE__ */ n(
|
|
5432
|
+
return /* @__PURE__ */ n(Mf, {}, s);
|
|
5426
5433
|
case "/bridge":
|
|
5427
|
-
return /* @__PURE__ */ n(
|
|
5434
|
+
return /* @__PURE__ */ n(Dp, {}, s);
|
|
5428
5435
|
case "/bridge/preview":
|
|
5429
|
-
return /* @__PURE__ */ n(
|
|
5436
|
+
return /* @__PURE__ */ n(Hg, {});
|
|
5430
5437
|
case "/bridge/history":
|
|
5431
|
-
return /* @__PURE__ */ n(
|
|
5438
|
+
return /* @__PURE__ */ n(Cy, {});
|
|
5432
5439
|
case "/op/withdrawals":
|
|
5433
|
-
return /* @__PURE__ */ n(
|
|
5440
|
+
return /* @__PURE__ */ n(hg, {});
|
|
5434
5441
|
case "/tx":
|
|
5435
5442
|
return /* @__PURE__ */ n(ra, {});
|
|
5436
5443
|
}
|
|
5437
|
-
},
|
|
5444
|
+
}, Ny = "https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@100..700&display=swap", Iy = () => /* @__PURE__ */ u(K, { children: [
|
|
5438
5445
|
/* @__PURE__ */ n("link", { rel: "preconnect", href: "https://fonts.googleapis.com" }),
|
|
5439
5446
|
/* @__PURE__ */ n("link", { rel: "preconnect", href: "https://fonts.gstatic.com", crossOrigin: "" }),
|
|
5440
|
-
/* @__PURE__ */ n("link", { rel: "stylesheet", href:
|
|
5447
|
+
/* @__PURE__ */ n("link", { rel: "stylesheet", href: Ny }),
|
|
5441
5448
|
/* @__PURE__ */ n("link", { rel: "stylesheet", href: "https://assets.initia.xyz/fonts/PilatWide.css" })
|
|
5442
|
-
] }),
|
|
5449
|
+
] }), Sy = () => {
|
|
5443
5450
|
ne();
|
|
5444
5451
|
const e = be();
|
|
5445
5452
|
return dr(), Lt(localStorage.getItem(O.BRIDGE_SRC_CHAIN_ID) ?? e.chainId), Lt(localStorage.getItem(O.BRIDGE_DST_CHAIN_ID) ?? e.chainId), null;
|
|
5446
|
-
},
|
|
5447
|
-
|
|
5453
|
+
}, ky = new Wa({ defaultOptions: { queries: { retry: 0 } } }), Ev = ({ children: e, ...t }) => (M(() => {
|
|
5454
|
+
Qc();
|
|
5448
5455
|
}, []), zi() ? /* @__PURE__ */ u(K, { children: [
|
|
5449
|
-
/* @__PURE__ */ n(
|
|
5450
|
-
/* @__PURE__ */ n(So.Provider, { value: { ...dc, ...t }, children: /* @__PURE__ */ n(No, { children: /* @__PURE__ */ n(
|
|
5456
|
+
/* @__PURE__ */ n(Iy, {}),
|
|
5457
|
+
/* @__PURE__ */ n(So.Provider, { value: { ...dc, ...t }, children: /* @__PURE__ */ n(No, { children: /* @__PURE__ */ n(Zc, { children: /* @__PURE__ */ n(Dt.Provider, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ n(hl, { children: /* @__PURE__ */ u(Ld, { children: [
|
|
5451
5458
|
e,
|
|
5452
|
-
/* @__PURE__ */ u(ja, { client:
|
|
5453
|
-
/* @__PURE__ */ n(
|
|
5454
|
-
/* @__PURE__ */ n(me, { suspenseFallback: null, errorBoundaryProps: { fallback: null }, children: /* @__PURE__ */ n(
|
|
5455
|
-
/* @__PURE__ */ n(
|
|
5459
|
+
/* @__PURE__ */ u(ja, { client: ky, children: [
|
|
5460
|
+
/* @__PURE__ */ n(Md, {}),
|
|
5461
|
+
/* @__PURE__ */ n(me, { suspenseFallback: null, errorBoundaryProps: { fallback: null }, children: /* @__PURE__ */ n(Sy, {}) }),
|
|
5462
|
+
/* @__PURE__ */ n(bu, { children: /* @__PURE__ */ n(Ea, {}) })
|
|
5456
5463
|
] })
|
|
5457
5464
|
] }) }) }) }) }) })
|
|
5458
|
-
] }) : null),
|
|
5465
|
+
] }) : null), Dv = ({ bridge: e }) => /* @__PURE__ */ n(No, { initialEntry: { path: e ? "/bridge" : "/", state: e }, children: /* @__PURE__ */ n("div", { className: "body", children: /* @__PURE__ */ n(Go.Provider, { value: !!e, children: /* @__PURE__ */ n(me, { children: /* @__PURE__ */ n(Ea, {}) }) }) }) });
|
|
5459
5466
|
export {
|
|
5460
5467
|
Dn as DEFAULT_GAS_ADJUSTMENT,
|
|
5461
5468
|
lc as DEFAULT_GAS_PRICE_MULTIPLIER,
|
|
5462
|
-
|
|
5463
|
-
|
|
5469
|
+
Dv as InterwovenKit,
|
|
5470
|
+
Ev as InterwovenKitProvider,
|
|
5464
5471
|
dc as MAINNET,
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5472
|
+
mc as MoveError,
|
|
5473
|
+
xv as TESTNET,
|
|
5474
|
+
Av as initiaPrivyWallet,
|
|
5475
|
+
$v as initiaPrivyWalletConnector,
|
|
5469
5476
|
nr as initiaPrivyWalletOptions,
|
|
5470
|
-
|
|
5477
|
+
Tv as injectStyles,
|
|
5471
5478
|
ln as useAddress,
|
|
5472
5479
|
lr as useHexAddress,
|
|
5473
5480
|
re as useInitiaAddress,
|
|
5474
5481
|
ke as useInterwovenKit,
|
|
5475
5482
|
Ko as usePortfolio,
|
|
5476
|
-
|
|
5483
|
+
Gc as useUsernameQuery
|
|
5477
5484
|
};
|