@ecency/wallets 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ecency-sdk.es.js +241 -244
- package/package.json +2 -2
package/dist/ecency-sdk.es.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { BtcWallet as
|
|
4
|
-
import { EthWallet as
|
|
5
|
-
import { TrxWallet as
|
|
6
|
-
import { TonWallet as
|
|
7
|
-
import { SolWallet as
|
|
8
|
-
import { AtomWallet as
|
|
9
|
-
import { AptosWallet as
|
|
10
|
-
import
|
|
11
|
-
import { CONFIG as l, getQueryClient as i, getDynamicPropsQueryOptions as N, getAccountFullQueryOptions as T, Keychain as b, EcencyAnalytics as
|
|
12
|
-
import { LRUCache as
|
|
13
|
-
import { PrivateKey as
|
|
14
|
-
import
|
|
1
|
+
import { useCallback as se } from "react";
|
|
2
|
+
import { useQuery as E, queryOptions as h, infiniteQueryOptions as R, useMutation as O, useQueryClient as G } from "@tanstack/react-query";
|
|
3
|
+
import { BtcWallet as ae } from "@okxweb3/coin-bitcoin";
|
|
4
|
+
import { EthWallet as oe } from "@okxweb3/coin-ethereum";
|
|
5
|
+
import { TrxWallet as ie } from "@okxweb3/coin-tron";
|
|
6
|
+
import { TonWallet as ce } from "@okxweb3/coin-ton";
|
|
7
|
+
import { SolWallet as ue } from "@okxweb3/coin-solana";
|
|
8
|
+
import { AtomWallet as le } from "@okxweb3/coin-cosmos";
|
|
9
|
+
import { AptosWallet as fe } from "@okxweb3/coin-aptos";
|
|
10
|
+
import me from "bip39";
|
|
11
|
+
import { CONFIG as l, getQueryClient as i, getDynamicPropsQueryOptions as N, getAccountFullQueryOptions as T, Keychain as b, EcencyAnalytics as W, getAccessToken as ye, useAccountUpdate as pe } from "@ecency/sdk";
|
|
12
|
+
import { LRUCache as he } from "lru-cache";
|
|
13
|
+
import { PrivateKey as C, utils as A } from "@hiveio/dhive";
|
|
14
|
+
import Q from "dayjs";
|
|
15
15
|
import d from "hivesigner";
|
|
16
16
|
var m = /* @__PURE__ */ ((e) => (e.BTC = "BTC", e.ETH = "ETH", e.APT = "APT", e.ATOM = "ATOM", e.TON = "TON", e.TRON = "TRX", e.SOL = "SOL", e))(m || {}), w = /* @__PURE__ */ ((e) => (e.Points = "POINTS", e.HivePower = "HP", e.Hive = "HIVE", e.HiveDollar = "HBD", e.Spk = "SPK", e))(w || {});
|
|
17
|
-
function
|
|
17
|
+
function ge(e) {
|
|
18
18
|
return new Promise((t) => setTimeout(t, e));
|
|
19
19
|
}
|
|
20
20
|
function Y(e) {
|
|
21
21
|
switch (e) {
|
|
22
22
|
case m.BTC:
|
|
23
|
-
return new
|
|
23
|
+
return new ae();
|
|
24
24
|
case m.ETH:
|
|
25
|
-
return new
|
|
25
|
+
return new oe();
|
|
26
26
|
case m.TRON:
|
|
27
|
-
return new
|
|
27
|
+
return new ie();
|
|
28
28
|
case m.TON:
|
|
29
|
-
return new
|
|
29
|
+
return new ce();
|
|
30
30
|
case m.SOL:
|
|
31
|
-
return new
|
|
31
|
+
return new ue();
|
|
32
32
|
case m.ATOM:
|
|
33
|
-
return new
|
|
33
|
+
return new le();
|
|
34
34
|
case m.APT:
|
|
35
|
-
return new
|
|
35
|
+
return new fe();
|
|
36
36
|
default:
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
40
|
+
function gt(e, t) {
|
|
41
|
+
return E({
|
|
42
42
|
queryKey: ["ecency-wallets", "external-wallet-balance", e, t],
|
|
43
43
|
queryFn: async () => {
|
|
44
44
|
switch (e) {
|
|
@@ -79,7 +79,7 @@ function wt(e, t) {
|
|
|
79
79
|
const P = (await (await fetch(
|
|
80
80
|
`https://fullnode.mainnet.aptoslabs.com/v1/accounts/${t}/resources`
|
|
81
81
|
)).json()).find(
|
|
82
|
-
(
|
|
82
|
+
(re) => re.type.includes("coin::CoinStore")
|
|
83
83
|
);
|
|
84
84
|
return P ? parseInt(P.data.coin.value) / 1e8 : 0;
|
|
85
85
|
case m.ATOM:
|
|
@@ -90,13 +90,13 @@ function wt(e, t) {
|
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
93
|
+
function X(e) {
|
|
94
|
+
return E({
|
|
95
95
|
queryKey: ["ecency-wallets", "seed", e],
|
|
96
|
-
queryFn: async () =>
|
|
96
|
+
queryFn: async () => me.generateMnemonic(128)
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
const
|
|
99
|
+
const we = {
|
|
100
100
|
max: 500,
|
|
101
101
|
// how long to live in ms
|
|
102
102
|
ttl: 1e3 * 60 * 5,
|
|
@@ -104,12 +104,12 @@ const de = {
|
|
|
104
104
|
allowStale: !1,
|
|
105
105
|
updateAgeOnGet: !1,
|
|
106
106
|
updateAgeOnHas: !1
|
|
107
|
-
},
|
|
108
|
-
const t =
|
|
107
|
+
}, z = new he(we), J = Symbol("undefined"), de = (e, t) => z.set(e, t === void 0 ? J : t), _e = (e) => {
|
|
108
|
+
const t = z.get(e);
|
|
109
109
|
return t === J ? void 0 : t;
|
|
110
110
|
};
|
|
111
|
-
function
|
|
112
|
-
return
|
|
111
|
+
function wt(e) {
|
|
112
|
+
return E({
|
|
113
113
|
queryKey: ["ecency-wallets", "coingecko-price", e],
|
|
114
114
|
queryFn: async () => {
|
|
115
115
|
let t = e;
|
|
@@ -129,7 +129,7 @@ function dt(e) {
|
|
|
129
129
|
default:
|
|
130
130
|
t = e;
|
|
131
131
|
}
|
|
132
|
-
let n =
|
|
132
|
+
let n = _e("gecko"), r;
|
|
133
133
|
if (n)
|
|
134
134
|
r = n;
|
|
135
135
|
else {
|
|
@@ -145,22 +145,22 @@ function dt(e) {
|
|
|
145
145
|
})
|
|
146
146
|
}
|
|
147
147
|
)).json();
|
|
148
|
-
|
|
148
|
+
de("gecko", o === void 0 ? J : o), r = o;
|
|
149
149
|
}
|
|
150
150
|
return 1 / +r[Object.keys(r)[0]].usd;
|
|
151
151
|
},
|
|
152
152
|
enabled: !!e
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
const { data: t } =
|
|
157
|
-
return
|
|
155
|
+
function ve(e) {
|
|
156
|
+
const { data: t } = X(e);
|
|
157
|
+
return E({
|
|
158
158
|
queryKey: ["ecencу-wallets", "hive-keys", e, t],
|
|
159
159
|
staleTime: 1 / 0,
|
|
160
160
|
queryFn: async () => {
|
|
161
161
|
if (!t)
|
|
162
162
|
throw new Error("[Ecency][Wallets] - no seed to create Hive account");
|
|
163
|
-
const n =
|
|
163
|
+
const n = C.fromLogin(e, t, "owner"), r = C.fromLogin(e, t, "active"), s = C.fromLogin(e, t, "posting"), a = C.fromLogin(e, t, "memo");
|
|
164
164
|
return {
|
|
165
165
|
username: e,
|
|
166
166
|
owner: n.toString(),
|
|
@@ -175,29 +175,29 @@ function ke(e) {
|
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
var
|
|
178
|
+
var Z = /* @__PURE__ */ ((e) => (e.HIVE = "HIVE", e.HBD = "HBD", e.VESTS = "VESTS", e.SPK = "SPK", e))(Z || {}), ee = /* @__PURE__ */ ((e) => (e["@@000000021"] = "HIVE", e["@@000000013"] = "HBD", e["@@000000037"] = "VESTS", e))(ee || {});
|
|
179
179
|
function p(e) {
|
|
180
180
|
if (typeof e == "string") {
|
|
181
181
|
const t = e.split(" ");
|
|
182
182
|
return {
|
|
183
183
|
amount: parseFloat(t[0]),
|
|
184
184
|
// @ts-ignore
|
|
185
|
-
symbol:
|
|
185
|
+
symbol: Z[t[1]]
|
|
186
186
|
};
|
|
187
187
|
} else
|
|
188
188
|
return {
|
|
189
189
|
amount: parseFloat(e.amount.toString()) / Math.pow(10, e.precision),
|
|
190
190
|
// @ts-ignore
|
|
191
|
-
symbol:
|
|
191
|
+
symbol: ee[e.nai]
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function dt(e) {
|
|
195
195
|
return e === void 0 ? !0 : parseInt(e.split("-")[0], 10) < 1980;
|
|
196
196
|
}
|
|
197
197
|
function B(e, t) {
|
|
198
198
|
return e / 1e6 * t;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function ke(e, t) {
|
|
201
201
|
let n = 0, r = 0, s = 0, a = 0, o = e.head_block - e.spk_block;
|
|
202
202
|
if (e.spk_block) {
|
|
203
203
|
if (o < 28800)
|
|
@@ -239,13 +239,13 @@ function q(e) {
|
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function be(e) {
|
|
243
243
|
let f = 9.5 - (e.headBlock - 7e6) / 25e4 * 0.01;
|
|
244
244
|
f < 0.95 && (f = 0.95);
|
|
245
245
|
const g = e.vestingRewardPercent / 1e4, _ = e.virtualSupply, v = e.totalVestingFund;
|
|
246
246
|
return (_ * f * g / v).toFixed(3);
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function Pe(e) {
|
|
249
249
|
return h({
|
|
250
250
|
queryKey: ["assets", "hive-power", "general-info", e],
|
|
251
251
|
staleTime: 6e4,
|
|
@@ -275,7 +275,7 @@ function qe(e) {
|
|
|
275
275
|
// nextVestingSharesWithdrawal,
|
|
276
276
|
t.hivePerMVests
|
|
277
277
|
).toFixed(3),
|
|
278
|
-
apr:
|
|
278
|
+
apr: be(t),
|
|
279
279
|
parts: [
|
|
280
280
|
{
|
|
281
281
|
name: "delegating",
|
|
@@ -296,7 +296,7 @@ function qe(e) {
|
|
|
296
296
|
}
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function qe(e) {
|
|
300
300
|
return h({
|
|
301
301
|
queryKey: ["assets", "hbd", "general-info", e],
|
|
302
302
|
staleTime: 6e4,
|
|
@@ -335,7 +335,7 @@ function Se(e) {
|
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
|
-
const y = A.operationOrders,
|
|
338
|
+
const y = A.operationOrders, D = {
|
|
339
339
|
transfers: [
|
|
340
340
|
y.transfer,
|
|
341
341
|
y.transfer_to_savings,
|
|
@@ -375,8 +375,8 @@ const y = A.operationOrders, Q = {
|
|
|
375
375
|
y.proposal_pay
|
|
376
376
|
]
|
|
377
377
|
};
|
|
378
|
-
function
|
|
379
|
-
return
|
|
378
|
+
function te(e, t = 20, n) {
|
|
379
|
+
return R({
|
|
380
380
|
queryKey: ["assets", "hive", "transactions", e, t, n],
|
|
381
381
|
initialData: { pages: [], pageParams: [] },
|
|
382
382
|
initialPageParam: -1,
|
|
@@ -389,27 +389,27 @@ function ne(e, t = 20, n) {
|
|
|
389
389
|
switch (n) {
|
|
390
390
|
case "transfers":
|
|
391
391
|
s = A.makeBitMaskFilter(
|
|
392
|
-
|
|
392
|
+
D.transfers
|
|
393
393
|
);
|
|
394
394
|
break;
|
|
395
395
|
case "market-orders":
|
|
396
396
|
s = A.makeBitMaskFilter(
|
|
397
|
-
|
|
397
|
+
D["market-orders"]
|
|
398
398
|
);
|
|
399
399
|
break;
|
|
400
400
|
case "interests":
|
|
401
401
|
s = A.makeBitMaskFilter(
|
|
402
|
-
|
|
402
|
+
D.interests
|
|
403
403
|
);
|
|
404
404
|
break;
|
|
405
405
|
case "stake-operations":
|
|
406
406
|
s = A.makeBitMaskFilter(
|
|
407
|
-
|
|
407
|
+
D["stake-operations"]
|
|
408
408
|
);
|
|
409
409
|
break;
|
|
410
410
|
case "rewards":
|
|
411
411
|
s = A.makeBitMaskFilter(
|
|
412
|
-
|
|
412
|
+
D.rewards
|
|
413
413
|
);
|
|
414
414
|
break;
|
|
415
415
|
default:
|
|
@@ -470,9 +470,9 @@ function ne(e, t = 20, n) {
|
|
|
470
470
|
})
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
return
|
|
475
|
-
...
|
|
473
|
+
function _t(e, t = 20, n) {
|
|
474
|
+
return R({
|
|
475
|
+
...te(e, t, n),
|
|
476
476
|
queryKey: ["assets", "hive-power", "transactions", e, t, n],
|
|
477
477
|
select: ({ pages: r, pageParams: s }) => ({
|
|
478
478
|
pageParams: s,
|
|
@@ -512,9 +512,9 @@ function vt(e, t = 20, n) {
|
|
|
512
512
|
})
|
|
513
513
|
});
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
return
|
|
517
|
-
...
|
|
515
|
+
function vt(e, t = 20, n) {
|
|
516
|
+
return R({
|
|
517
|
+
...te(e, t, n),
|
|
518
518
|
queryKey: ["assets", "hbd", "transactions", e, t, n],
|
|
519
519
|
select: ({ pages: r, pageParams: s }) => ({
|
|
520
520
|
pageParams: s,
|
|
@@ -547,16 +547,16 @@ function kt(e, t = 20, n) {
|
|
|
547
547
|
})
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
|
-
function
|
|
551
|
-
return
|
|
550
|
+
function kt(e = 86400) {
|
|
551
|
+
return R({
|
|
552
552
|
queryKey: ["assets", "hive", "metrics", e],
|
|
553
553
|
queryFn: async ({ pageParam: [t, n] }) => (await l.hiveClient.call(
|
|
554
554
|
"condenser_api",
|
|
555
555
|
"get_market_history",
|
|
556
556
|
[
|
|
557
557
|
e,
|
|
558
|
-
|
|
559
|
-
|
|
558
|
+
Q(t).format("YYYY-MM-DDTHH:mm:ss"),
|
|
559
|
+
Q(n).format("YYYY-MM-DDTHH:mm:ss")
|
|
560
560
|
]
|
|
561
561
|
)).map(({ hive: s, non_hive: a, open: o }) => ({
|
|
562
562
|
close: a.close / s.close,
|
|
@@ -568,19 +568,16 @@ function bt(e = 86400) {
|
|
|
568
568
|
})),
|
|
569
569
|
initialPageParam: [
|
|
570
570
|
// Fetch at least 8 hours or given interval
|
|
571
|
-
|
|
571
|
+
Q().subtract(Math.max(100 * e, 28800), "second").toDate(),
|
|
572
572
|
/* @__PURE__ */ new Date()
|
|
573
573
|
],
|
|
574
574
|
getNextPageParam: (t, n, [r]) => [
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
-Math.max(100 * e, 28800)
|
|
578
|
-
),
|
|
579
|
-
L(new Date(r.getTime()), -e)
|
|
575
|
+
Q(r.getTime()).subtract(Math.max(100 * e, 28800), "second").toDate(),
|
|
576
|
+
Q(r.getTime()).subtract(e, "second").toDate()
|
|
580
577
|
]
|
|
581
578
|
});
|
|
582
579
|
}
|
|
583
|
-
function
|
|
580
|
+
function bt(e) {
|
|
584
581
|
return h({
|
|
585
582
|
queryKey: ["assets", "hive", "withdrawal-routes", e],
|
|
586
583
|
queryFn: () => l.hiveClient.database.call("get_withdraw_routes", [
|
|
@@ -589,7 +586,7 @@ function Pt(e) {
|
|
|
589
586
|
])
|
|
590
587
|
});
|
|
591
588
|
}
|
|
592
|
-
async function
|
|
589
|
+
async function x(e) {
|
|
593
590
|
const n = p(e.amount).symbol;
|
|
594
591
|
if (e.type === "key" && "key" in e) {
|
|
595
592
|
const { key: r, type: s, ...a } = e;
|
|
@@ -633,7 +630,7 @@ async function U(e) {
|
|
|
633
630
|
}
|
|
634
631
|
);
|
|
635
632
|
}
|
|
636
|
-
async function
|
|
633
|
+
async function U(e) {
|
|
637
634
|
if (e.type === "key" && "key" in e) {
|
|
638
635
|
const { key: t, type: n, ...r } = e;
|
|
639
636
|
return l.hiveClient.broadcast.sendOperations(
|
|
@@ -669,7 +666,7 @@ async function Oe(e) {
|
|
|
669
666
|
}
|
|
670
667
|
);
|
|
671
668
|
}
|
|
672
|
-
async function
|
|
669
|
+
async function Se(e) {
|
|
673
670
|
if (e.type === "key" && "key" in e) {
|
|
674
671
|
const { key: t, type: n, ...r } = e;
|
|
675
672
|
return l.hiveClient.broadcast.sendOperations(
|
|
@@ -687,7 +684,7 @@ async function Ae(e) {
|
|
|
687
684
|
}
|
|
688
685
|
);
|
|
689
686
|
}
|
|
690
|
-
async function
|
|
687
|
+
async function Ae(e) {
|
|
691
688
|
if (e.type === "key" && "key" in e) {
|
|
692
689
|
const { key: t, type: n, ...r } = e;
|
|
693
690
|
return l.hiveClient.broadcast.sendOperations(
|
|
@@ -705,7 +702,7 @@ async function Ne(e) {
|
|
|
705
702
|
}
|
|
706
703
|
);
|
|
707
704
|
}
|
|
708
|
-
async function
|
|
705
|
+
async function Ne(e) {
|
|
709
706
|
if (e.type === "key" && "key" in e) {
|
|
710
707
|
const { key: r, type: s, ...a } = e;
|
|
711
708
|
return l.hiveClient.broadcast.sendOperations(
|
|
@@ -730,7 +727,7 @@ async function Te(e) {
|
|
|
730
727
|
);
|
|
731
728
|
}
|
|
732
729
|
var u = /* @__PURE__ */ ((e) => (e.Transfer = "transfer", e.TransferToSavings = "transfer-saving", e.Delegate = "delegate", e.PowerUp = "power-up", e.PowerDown = "power-down", e.WithdrawRoutes = "withdraw-saving", e.Swap = "swap", e.Gift = "gift", e.Promote = "promote", e.Claim = "claim", e.Buy = "buy", e.LockLiquidity = "lock", e.Stake = "stake", e.Unstake = "unstake", e.Undelegate = "undelegate", e))(u || {});
|
|
733
|
-
async function
|
|
730
|
+
async function Te(e) {
|
|
734
731
|
const t = JSON.stringify({
|
|
735
732
|
to: e.to,
|
|
736
733
|
amount: +e.amount * 1e3,
|
|
@@ -808,7 +805,7 @@ const He = async (e) => {
|
|
|
808
805
|
}
|
|
809
806
|
}
|
|
810
807
|
};
|
|
811
|
-
async function
|
|
808
|
+
async function Ke(e) {
|
|
812
809
|
const t = JSON.stringify({ amount: +e.amount * 1e3 }), n = {
|
|
813
810
|
id: `spkcc_power_${e.mode}`,
|
|
814
811
|
json: t,
|
|
@@ -843,7 +840,7 @@ async function Qe(e) {
|
|
|
843
840
|
}
|
|
844
841
|
}
|
|
845
842
|
}
|
|
846
|
-
function
|
|
843
|
+
function H() {
|
|
847
844
|
return h({
|
|
848
845
|
queryKey: ["assets", "spk", "markets"],
|
|
849
846
|
staleTime: 6e4,
|
|
@@ -860,7 +857,7 @@ function K() {
|
|
|
860
857
|
}
|
|
861
858
|
});
|
|
862
859
|
}
|
|
863
|
-
function
|
|
860
|
+
function K(e) {
|
|
864
861
|
return h({
|
|
865
862
|
queryKey: ["assets", "spk", "wallet", e],
|
|
866
863
|
queryFn: async () => (await fetch(l.spkNode + `/@${e}`)).json(),
|
|
@@ -869,22 +866,22 @@ function H(e) {
|
|
|
869
866
|
refetchInterval: 9e4
|
|
870
867
|
});
|
|
871
868
|
}
|
|
872
|
-
function
|
|
869
|
+
function V(e) {
|
|
873
870
|
return e.toFixed(3);
|
|
874
871
|
}
|
|
875
|
-
function
|
|
872
|
+
function Qe(e) {
|
|
876
873
|
return h({
|
|
877
874
|
queryKey: ["assets", "larynx", "general-info", e],
|
|
878
875
|
staleTime: 6e4,
|
|
879
876
|
refetchInterval: 9e4,
|
|
880
877
|
queryFn: async () => {
|
|
881
|
-
await i().prefetchQuery(
|
|
878
|
+
await i().prefetchQuery(K(e)), await i().prefetchQuery(H()), await i().prefetchQuery(
|
|
882
879
|
q(e)
|
|
883
880
|
);
|
|
884
881
|
const t = i().getQueryData(
|
|
885
|
-
|
|
882
|
+
K(e).queryKey
|
|
886
883
|
), n = i().getQueryData(
|
|
887
|
-
|
|
884
|
+
H().queryKey
|
|
888
885
|
), r = i().getQueryData(
|
|
889
886
|
q(e).queryKey
|
|
890
887
|
);
|
|
@@ -895,9 +892,9 @@ function De(e) {
|
|
|
895
892
|
price: 1,
|
|
896
893
|
accountBalance: 0
|
|
897
894
|
};
|
|
898
|
-
const s = +
|
|
895
|
+
const s = +V(
|
|
899
896
|
t.balance / 1e3 * +t.tick * ((r == null ? void 0 : r.price) ?? 0)
|
|
900
|
-
), a = +
|
|
897
|
+
), a = +V(t.balance / 1e3);
|
|
901
898
|
return {
|
|
902
899
|
name: "LARYNX",
|
|
903
900
|
layer: "SPK",
|
|
@@ -908,22 +905,22 @@ function De(e) {
|
|
|
908
905
|
}
|
|
909
906
|
});
|
|
910
907
|
}
|
|
911
|
-
function
|
|
908
|
+
function I(e) {
|
|
912
909
|
return e.toFixed(3);
|
|
913
910
|
}
|
|
914
|
-
function
|
|
911
|
+
function De(e) {
|
|
915
912
|
return h({
|
|
916
913
|
queryKey: ["assets", "spk", "general-info", e],
|
|
917
914
|
staleTime: 6e4,
|
|
918
915
|
refetchInterval: 9e4,
|
|
919
916
|
queryFn: async () => {
|
|
920
|
-
await i().prefetchQuery(
|
|
917
|
+
await i().prefetchQuery(K(e)), await i().prefetchQuery(H()), await i().prefetchQuery(
|
|
921
918
|
q(e)
|
|
922
919
|
);
|
|
923
920
|
const t = i().getQueryData(
|
|
924
|
-
|
|
921
|
+
K(e).queryKey
|
|
925
922
|
), n = i().getQueryData(
|
|
926
|
-
|
|
923
|
+
H().queryKey
|
|
927
924
|
), r = i().getQueryData(
|
|
928
925
|
q(e).queryKey
|
|
929
926
|
);
|
|
@@ -934,17 +931,17 @@ function Ee(e) {
|
|
|
934
931
|
price: 1,
|
|
935
932
|
accountBalance: 0
|
|
936
933
|
};
|
|
937
|
-
const s = +
|
|
934
|
+
const s = +I(
|
|
938
935
|
(t.gov + t.spk) / 1e3 * +t.tick * ((r == null ? void 0 : r.price) ?? 0)
|
|
939
|
-
), a = +
|
|
940
|
-
(t.spk +
|
|
936
|
+
), a = +I(
|
|
937
|
+
(t.spk + ke(
|
|
941
938
|
t,
|
|
942
939
|
n.raw.stats || {
|
|
943
940
|
spk_rate_lgov: "0.001",
|
|
944
|
-
spk_rate_lpow:
|
|
941
|
+
spk_rate_lpow: I(
|
|
945
942
|
parseFloat(n.raw.stats.spk_rate_lpow) * 100
|
|
946
943
|
),
|
|
947
|
-
spk_rate_ldel:
|
|
944
|
+
spk_rate_ldel: I(
|
|
948
945
|
parseFloat(n.raw.stats.spk_rate_ldel) * 100
|
|
949
946
|
)
|
|
950
947
|
}
|
|
@@ -959,23 +956,23 @@ function Ee(e) {
|
|
|
959
956
|
}
|
|
960
957
|
});
|
|
961
958
|
}
|
|
962
|
-
function
|
|
959
|
+
function j(e) {
|
|
963
960
|
return e.toFixed(3);
|
|
964
961
|
}
|
|
965
|
-
function
|
|
962
|
+
function Ee(e) {
|
|
966
963
|
return h({
|
|
967
964
|
queryKey: ["assets", "larynx-power", "general-info", e],
|
|
968
965
|
staleTime: 6e4,
|
|
969
966
|
refetchInterval: 9e4,
|
|
970
967
|
queryFn: async () => {
|
|
971
968
|
var o, c;
|
|
972
|
-
await i().prefetchQuery(
|
|
969
|
+
await i().prefetchQuery(K(e)), await i().prefetchQuery(H()), await i().prefetchQuery(
|
|
973
970
|
q(e)
|
|
974
971
|
);
|
|
975
972
|
const t = i().getQueryData(
|
|
976
|
-
|
|
973
|
+
K(e).queryKey
|
|
977
974
|
), n = i().getQueryData(
|
|
978
|
-
|
|
975
|
+
H().queryKey
|
|
979
976
|
), r = i().getQueryData(
|
|
980
977
|
q(e).queryKey
|
|
981
978
|
);
|
|
@@ -986,9 +983,9 @@ function Re(e) {
|
|
|
986
983
|
price: 1,
|
|
987
984
|
accountBalance: 0
|
|
988
985
|
};
|
|
989
|
-
const s = +
|
|
986
|
+
const s = +j(
|
|
990
987
|
t.poweredUp / 1e3 * +t.tick * ((r == null ? void 0 : r.price) ?? 0)
|
|
991
|
-
), a = +
|
|
988
|
+
), a = +j(t.poweredUp / 1e3);
|
|
992
989
|
return {
|
|
993
990
|
name: "LP",
|
|
994
991
|
title: "LARYNX Power",
|
|
@@ -998,18 +995,18 @@ function Re(e) {
|
|
|
998
995
|
parts: [
|
|
999
996
|
{
|
|
1000
997
|
name: "delegating",
|
|
1001
|
-
balance: (o = t.granting) != null && o.t ? +
|
|
998
|
+
balance: (o = t.granting) != null && o.t ? +j(t.granting.t / 1e3) : 0
|
|
1002
999
|
},
|
|
1003
1000
|
{
|
|
1004
1001
|
name: "recieved",
|
|
1005
|
-
balance: (c = t.granted) != null && c.t ? +
|
|
1002
|
+
balance: (c = t.granted) != null && c.t ? +j(t.granted.t / 1e3) : 0
|
|
1006
1003
|
}
|
|
1007
1004
|
]
|
|
1008
1005
|
};
|
|
1009
1006
|
}
|
|
1010
1007
|
});
|
|
1011
1008
|
}
|
|
1012
|
-
function
|
|
1009
|
+
function F(e) {
|
|
1013
1010
|
return h({
|
|
1014
1011
|
queryKey: ["assets", "hive-engine", "metadata-list", e],
|
|
1015
1012
|
staleTime: 6e4,
|
|
@@ -1035,7 +1032,7 @@ function j(e) {
|
|
|
1035
1032
|
)).json()).result
|
|
1036
1033
|
});
|
|
1037
1034
|
}
|
|
1038
|
-
const
|
|
1035
|
+
const L = [
|
|
1039
1036
|
"LEO",
|
|
1040
1037
|
"ARCHON",
|
|
1041
1038
|
"WAIV",
|
|
@@ -1087,7 +1084,7 @@ function $(e) {
|
|
|
1087
1084
|
)).json()).result
|
|
1088
1085
|
});
|
|
1089
1086
|
}
|
|
1090
|
-
function
|
|
1087
|
+
function Re() {
|
|
1091
1088
|
return h({
|
|
1092
1089
|
queryKey: ["assets", "hive-engine", "markets"],
|
|
1093
1090
|
staleTime: 6e4,
|
|
@@ -1111,7 +1108,7 @@ function Ce() {
|
|
|
1111
1108
|
)).json()).result
|
|
1112
1109
|
});
|
|
1113
1110
|
}
|
|
1114
|
-
function
|
|
1111
|
+
function Ce(e, t) {
|
|
1115
1112
|
return h({
|
|
1116
1113
|
queryKey: ["assets", "hive-engine", t, "general-info", e],
|
|
1117
1114
|
enabled: !!t && !!e,
|
|
@@ -1126,13 +1123,13 @@ function Ie(e, t) {
|
|
|
1126
1123
|
await i().prefetchQuery(n);
|
|
1127
1124
|
const r = i().getQueryData(
|
|
1128
1125
|
n.queryKey
|
|
1129
|
-
), s =
|
|
1126
|
+
), s = F(L);
|
|
1130
1127
|
await i().prefetchQuery(s);
|
|
1131
1128
|
const a = i().getQueryData(s.queryKey), o = $(e);
|
|
1132
1129
|
await i().prefetchQuery(o);
|
|
1133
|
-
const c = i().getQueryData(o.queryKey), f =
|
|
1130
|
+
const c = i().getQueryData(o.queryKey), f = Re();
|
|
1134
1131
|
await i().prefetchQuery(f);
|
|
1135
|
-
const g = i().getQueryData(f.queryKey), _ = a == null ? void 0 : a.find((P) => P.symbol === t), v = c == null ? void 0 : c.find((P) => P.symbol === t),
|
|
1132
|
+
const g = i().getQueryData(f.queryKey), _ = a == null ? void 0 : a.find((P) => P.symbol === t), v = c == null ? void 0 : c.find((P) => P.symbol === t), S = g == null ? void 0 : g.find((P) => P.symbol === t), k = +((S == null ? void 0 : S.lastPrice) ?? "0");
|
|
1136
1133
|
return {
|
|
1137
1134
|
name: t,
|
|
1138
1135
|
title: (_ == null ? void 0 : _.name) ?? "",
|
|
@@ -1143,8 +1140,8 @@ function Ie(e, t) {
|
|
|
1143
1140
|
}
|
|
1144
1141
|
});
|
|
1145
1142
|
}
|
|
1146
|
-
function
|
|
1147
|
-
return
|
|
1143
|
+
function Pt(e, t, n = 20) {
|
|
1144
|
+
return R({
|
|
1148
1145
|
queryKey: ["assets", "hive-engine", t, "transactions", e],
|
|
1149
1146
|
enabled: !!t && !!e,
|
|
1150
1147
|
initialPageParam: 0,
|
|
@@ -1164,7 +1161,7 @@ function qt(e, t, n = 20) {
|
|
|
1164
1161
|
}
|
|
1165
1162
|
});
|
|
1166
1163
|
}
|
|
1167
|
-
function
|
|
1164
|
+
function qt(e, t = "daily") {
|
|
1168
1165
|
return h({
|
|
1169
1166
|
queryKey: ["assets", "hive-engine", e],
|
|
1170
1167
|
staleTime: 6e4,
|
|
@@ -1179,7 +1176,7 @@ function St(e, t = "daily") {
|
|
|
1179
1176
|
}
|
|
1180
1177
|
});
|
|
1181
1178
|
}
|
|
1182
|
-
async function
|
|
1179
|
+
async function Ie(e) {
|
|
1183
1180
|
const n = p(e.amount).amount.toString();
|
|
1184
1181
|
if (e.type === "key" && "key" in e) {
|
|
1185
1182
|
const { key: r, type: s, ...a } = e, o = {
|
|
@@ -1242,7 +1239,7 @@ async function je(e) {
|
|
|
1242
1239
|
}
|
|
1243
1240
|
);
|
|
1244
1241
|
}
|
|
1245
|
-
async function
|
|
1242
|
+
async function je(e) {
|
|
1246
1243
|
const n = p(e.amount).amount.toString();
|
|
1247
1244
|
if (e.type === "key" && "key" in e) {
|
|
1248
1245
|
const { key: r, type: s, ...a } = e, o = {
|
|
@@ -1305,7 +1302,7 @@ async function Fe(e) {
|
|
|
1305
1302
|
}
|
|
1306
1303
|
);
|
|
1307
1304
|
}
|
|
1308
|
-
async function
|
|
1305
|
+
async function Fe(e) {
|
|
1309
1306
|
const n = p(e.amount).amount.toString();
|
|
1310
1307
|
if (e.type === "key" && "key" in e) {
|
|
1311
1308
|
const { key: r, type: s, ...a } = e, o = {
|
|
@@ -1368,7 +1365,7 @@ async function Le(e) {
|
|
|
1368
1365
|
}
|
|
1369
1366
|
);
|
|
1370
1367
|
}
|
|
1371
|
-
async function
|
|
1368
|
+
async function Le(e) {
|
|
1372
1369
|
const n = p(e.amount).amount.toString();
|
|
1373
1370
|
if (e.type === "key" && "key" in e) {
|
|
1374
1371
|
const { key: r, type: s, ...a } = e, o = {
|
|
@@ -1431,7 +1428,7 @@ async function Be(e) {
|
|
|
1431
1428
|
}
|
|
1432
1429
|
);
|
|
1433
1430
|
}
|
|
1434
|
-
async function
|
|
1431
|
+
async function Be(e) {
|
|
1435
1432
|
const n = p(e.amount).amount.toString();
|
|
1436
1433
|
if (e.type === "key" && "key" in e) {
|
|
1437
1434
|
const { key: r, type: s, ...a } = e, o = {
|
|
@@ -1526,7 +1523,7 @@ function M(e) {
|
|
|
1526
1523
|
enabled: !!e
|
|
1527
1524
|
});
|
|
1528
1525
|
}
|
|
1529
|
-
function
|
|
1526
|
+
function Me(e) {
|
|
1530
1527
|
return h({
|
|
1531
1528
|
queryKey: ["assets", "points", "general-info", e],
|
|
1532
1529
|
staleTime: 6e4,
|
|
@@ -1570,12 +1567,12 @@ function Ot(e, t) {
|
|
|
1570
1567
|
}))
|
|
1571
1568
|
});
|
|
1572
1569
|
}
|
|
1573
|
-
function
|
|
1574
|
-
const { mutateAsync: r } =
|
|
1570
|
+
function St(e, t, n) {
|
|
1571
|
+
const { mutateAsync: r } = W.useRecordActivity(
|
|
1575
1572
|
e,
|
|
1576
1573
|
"points-claimed"
|
|
1577
1574
|
);
|
|
1578
|
-
return
|
|
1575
|
+
return O({
|
|
1579
1576
|
mutationFn: async () => {
|
|
1580
1577
|
if (!e)
|
|
1581
1578
|
throw new Error(
|
|
@@ -1586,7 +1583,7 @@ function At(e, t, n) {
|
|
|
1586
1583
|
headers: {
|
|
1587
1584
|
"Content-Type": "application/json"
|
|
1588
1585
|
},
|
|
1589
|
-
body: JSON.stringify({ code:
|
|
1586
|
+
body: JSON.stringify({ code: ye(e) })
|
|
1590
1587
|
});
|
|
1591
1588
|
},
|
|
1592
1589
|
onError: n,
|
|
@@ -1601,7 +1598,7 @@ function At(e, t, n) {
|
|
|
1601
1598
|
}
|
|
1602
1599
|
});
|
|
1603
1600
|
}
|
|
1604
|
-
async function
|
|
1601
|
+
async function Je({
|
|
1605
1602
|
from: e,
|
|
1606
1603
|
to: t,
|
|
1607
1604
|
amount: n,
|
|
@@ -1634,15 +1631,15 @@ async function $e({
|
|
|
1634
1631
|
}
|
|
1635
1632
|
);
|
|
1636
1633
|
}
|
|
1637
|
-
var
|
|
1638
|
-
function
|
|
1634
|
+
var $e = /* @__PURE__ */ ((e) => (e[e.CHECKIN = 10] = "CHECKIN", e[e.LOGIN = 20] = "LOGIN", e[e.CHECKIN_EXTRA = 30] = "CHECKIN_EXTRA", e[e.POST = 100] = "POST", e[e.COMMENT = 110] = "COMMENT", e[e.VOTE = 120] = "VOTE", e[e.REBLOG = 130] = "REBLOG", e[e.DELEGATION = 150] = "DELEGATION", e[e.REFERRAL = 160] = "REFERRAL", e[e.COMMUNITY = 170] = "COMMUNITY", e[e.TRANSFER_SENT = 998] = "TRANSFER_SENT", e[e.TRANSFER_INCOMING = 999] = "TRANSFER_INCOMING", e[e.MINTED = 991] = "MINTED", e))($e || {});
|
|
1635
|
+
function At(e) {
|
|
1639
1636
|
return h({
|
|
1640
1637
|
queryKey: ["ecency-wallets", "all-tokens-list", e],
|
|
1641
1638
|
queryFn: async () => {
|
|
1642
1639
|
await i().prefetchQuery(
|
|
1643
|
-
|
|
1640
|
+
F(L)
|
|
1644
1641
|
);
|
|
1645
|
-
const t = i().getQueryData(
|
|
1642
|
+
const t = i().getQueryData(F(L).queryKey);
|
|
1646
1643
|
return {
|
|
1647
1644
|
basic: [
|
|
1648
1645
|
w.Points,
|
|
@@ -1661,7 +1658,7 @@ function Nt(e) {
|
|
|
1661
1658
|
}
|
|
1662
1659
|
});
|
|
1663
1660
|
}
|
|
1664
|
-
function
|
|
1661
|
+
function xe(e) {
|
|
1665
1662
|
return h({
|
|
1666
1663
|
queryKey: ["ecency-wallets", "list", e],
|
|
1667
1664
|
enabled: !!e,
|
|
@@ -1679,7 +1676,7 @@ function Ue(e) {
|
|
|
1679
1676
|
}
|
|
1680
1677
|
});
|
|
1681
1678
|
}
|
|
1682
|
-
function
|
|
1679
|
+
function Ue(e, t, n = { refetch: !1 }) {
|
|
1683
1680
|
const r = async (s) => (n.refetch ? await i().fetchQuery(s) : await i().prefetchQuery(s), i().getQueryData(
|
|
1684
1681
|
s.queryKey
|
|
1685
1682
|
));
|
|
@@ -1689,20 +1686,20 @@ function Ve(e, t, n = { refetch: !1 }) {
|
|
|
1689
1686
|
if (t === "HIVE")
|
|
1690
1687
|
return r(q(e));
|
|
1691
1688
|
if (t === "HP")
|
|
1692
|
-
return r(
|
|
1689
|
+
return r(Pe(e));
|
|
1693
1690
|
if (t === "HBD")
|
|
1694
|
-
return r(
|
|
1691
|
+
return r(qe(e));
|
|
1695
1692
|
if (t === "SPK")
|
|
1696
|
-
return r(Ee(e));
|
|
1697
|
-
if (t === "LARYNX")
|
|
1698
1693
|
return r(De(e));
|
|
1694
|
+
if (t === "LARYNX")
|
|
1695
|
+
return r(Qe(e));
|
|
1699
1696
|
if (t === "LP")
|
|
1700
|
-
return r(
|
|
1697
|
+
return r(Ee(e));
|
|
1701
1698
|
if (t === "POINTS")
|
|
1702
|
-
return r(
|
|
1703
|
-
if (
|
|
1699
|
+
return r(Me(e));
|
|
1700
|
+
if (L.includes(t))
|
|
1704
1701
|
return await r(
|
|
1705
|
-
|
|
1702
|
+
Ce(e, t)
|
|
1706
1703
|
);
|
|
1707
1704
|
throw new Error(
|
|
1708
1705
|
"[SDK][Wallets] – has requested unrecognized asset info"
|
|
@@ -1710,7 +1707,7 @@ function Ve(e, t, n = { refetch: !1 }) {
|
|
|
1710
1707
|
}
|
|
1711
1708
|
});
|
|
1712
1709
|
}
|
|
1713
|
-
function
|
|
1710
|
+
function Nt(e, t, n = !1) {
|
|
1714
1711
|
return h({
|
|
1715
1712
|
queryKey: ["wallets", "token-operations", e, t, n],
|
|
1716
1713
|
queryFn: async () => {
|
|
@@ -1760,22 +1757,22 @@ function Tt(e, t, n = !1) {
|
|
|
1760
1757
|
await i().prefetchQuery(r);
|
|
1761
1758
|
const s = i().getQueryData(
|
|
1762
1759
|
r.queryKey
|
|
1763
|
-
), a =
|
|
1760
|
+
), a = F(
|
|
1764
1761
|
(s == null ? void 0 : s.map((k) => k.symbol)) ?? []
|
|
1765
1762
|
);
|
|
1766
1763
|
await i().prefetchQuery(a);
|
|
1767
|
-
const o = i().getQueryData(a.queryKey), c = s == null ? void 0 : s.find((k) => k.symbol === e), f = o == null ? void 0 : o.find((k) => k.symbol === e), g = n && (f == null ? void 0 : f.delegationEnabled) && c && parseFloat(c.delegationsOut) !== parseFloat(c.balance), _ = n && parseFloat((c == null ? void 0 : c.delegationsOut) ?? "0") > 0, v = n && (f == null ? void 0 : f.stakingEnabled),
|
|
1764
|
+
const o = i().getQueryData(a.queryKey), c = s == null ? void 0 : s.find((k) => k.symbol === e), f = o == null ? void 0 : o.find((k) => k.symbol === e), g = n && (f == null ? void 0 : f.delegationEnabled) && c && parseFloat(c.delegationsOut) !== parseFloat(c.balance), _ = n && parseFloat((c == null ? void 0 : c.delegationsOut) ?? "0") > 0, v = n && (f == null ? void 0 : f.stakingEnabled), S = n && parseFloat((c == null ? void 0 : c.stake) ?? "0") > 0;
|
|
1768
1765
|
return [
|
|
1769
1766
|
u.Transfer,
|
|
1770
1767
|
...g ? [u.Delegate] : [],
|
|
1771
1768
|
..._ ? [u.Undelegate] : [],
|
|
1772
1769
|
...v ? [u.Stake] : [],
|
|
1773
|
-
...
|
|
1770
|
+
...S ? [u.Unstake] : []
|
|
1774
1771
|
];
|
|
1775
1772
|
}
|
|
1776
1773
|
});
|
|
1777
1774
|
}
|
|
1778
|
-
const
|
|
1775
|
+
const Ve = {
|
|
1779
1776
|
[m.BTC]: "m/44'/0'/0'/0/0",
|
|
1780
1777
|
// Bitcoin (BIP44)
|
|
1781
1778
|
[m.ETH]: "m/44'/60'/0'/0/0",
|
|
@@ -1791,17 +1788,17 @@ const Ge = {
|
|
|
1791
1788
|
[m.ATOM]: "m/44'/118'/0'/0/0"
|
|
1792
1789
|
// Cosmos (BIP44)
|
|
1793
1790
|
};
|
|
1794
|
-
function
|
|
1795
|
-
const { data: n } =
|
|
1791
|
+
function Tt(e, t) {
|
|
1792
|
+
const { data: n } = X(e), r = G(), s = O({
|
|
1796
1793
|
mutationKey: ["ecency-wallets", "create-wallet", e, t],
|
|
1797
1794
|
mutationFn: async () => {
|
|
1798
1795
|
if (!n)
|
|
1799
1796
|
throw new Error("[Ecency][Wallets] - No seed to create a wallet");
|
|
1800
1797
|
const o = Y(t), c = await (o == null ? void 0 : o.getDerivedPrivateKey({
|
|
1801
1798
|
mnemonic: n,
|
|
1802
|
-
hdPath:
|
|
1799
|
+
hdPath: Ve[t]
|
|
1803
1800
|
}));
|
|
1804
|
-
await
|
|
1801
|
+
await ge(1e3);
|
|
1805
1802
|
const f = await (o == null ? void 0 : o.getNewAddress({
|
|
1806
1803
|
privateKey: c
|
|
1807
1804
|
}));
|
|
@@ -1819,18 +1816,18 @@ function Kt(e, t) {
|
|
|
1819
1816
|
(c) => new Map(c ? Array.from(c.entries()) : []).set(o.currency, o)
|
|
1820
1817
|
);
|
|
1821
1818
|
}
|
|
1822
|
-
}), a =
|
|
1819
|
+
}), a = se(() => {
|
|
1823
1820
|
}, []);
|
|
1824
1821
|
return {
|
|
1825
1822
|
createWallet: s,
|
|
1826
1823
|
importWallet: a
|
|
1827
1824
|
};
|
|
1828
1825
|
}
|
|
1829
|
-
function
|
|
1830
|
-
const { data: t } =
|
|
1826
|
+
function Ge(e) {
|
|
1827
|
+
const { data: t } = E({
|
|
1831
1828
|
queryKey: ["ecency-wallets", "wallets", e]
|
|
1832
|
-
}), { data: n } =
|
|
1833
|
-
return
|
|
1829
|
+
}), { data: n } = ve(e);
|
|
1830
|
+
return O({
|
|
1834
1831
|
mutationKey: ["ecency-wallets", "create-account-with-wallets", e],
|
|
1835
1832
|
mutationFn: ({ currency: r, address: s }) => fetch(l.privateApiHost + "/private-api/wallets-add", {
|
|
1836
1833
|
method: "POST",
|
|
@@ -1858,8 +1855,8 @@ function We(e) {
|
|
|
1858
1855
|
})
|
|
1859
1856
|
});
|
|
1860
1857
|
}
|
|
1861
|
-
function
|
|
1862
|
-
return
|
|
1858
|
+
function ne() {
|
|
1859
|
+
return O({
|
|
1863
1860
|
mutationKey: ["ecency-wallets", "check-wallet-existence"],
|
|
1864
1861
|
mutationFn: async ({ address: e, currency: t }) => (await (await fetch(
|
|
1865
1862
|
l.privateApiHost + "/private-api/wallets-exist",
|
|
@@ -1878,9 +1875,9 @@ function re() {
|
|
|
1878
1875
|
}
|
|
1879
1876
|
const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1880
1877
|
__proto__: null,
|
|
1881
|
-
useCheckWalletExistence:
|
|
1882
|
-
useCreateAccountWithWallets:
|
|
1883
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1878
|
+
useCheckWalletExistence: ne,
|
|
1879
|
+
useCreateAccountWithWallets: Ge
|
|
1880
|
+
}, Symbol.toStringTag, { value: "Module" })), We = {
|
|
1884
1881
|
[m.BTC]: ["m/84'/0'/0'/0/0"],
|
|
1885
1882
|
[m.ETH]: ["m/84'/60'/0'/0/0"],
|
|
1886
1883
|
// its not working for Trust, Exodus, todo: check others below
|
|
@@ -1892,7 +1889,7 @@ const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1892
1889
|
[m.ATOM]: ["m/84'/118'/0'/0'/0"]
|
|
1893
1890
|
};
|
|
1894
1891
|
async function Ye(e, t, n) {
|
|
1895
|
-
for (const r of
|
|
1892
|
+
for (const r of We[n] || [])
|
|
1896
1893
|
try {
|
|
1897
1894
|
const s = await t.getDerivedPrivateKey({
|
|
1898
1895
|
mnemonic: e,
|
|
@@ -1907,9 +1904,9 @@ async function Ye(e, t, n) {
|
|
|
1907
1904
|
}
|
|
1908
1905
|
return [];
|
|
1909
1906
|
}
|
|
1910
|
-
function
|
|
1911
|
-
const n =
|
|
1912
|
-
return
|
|
1907
|
+
function Kt(e, t) {
|
|
1908
|
+
const n = G(), { mutateAsync: r } = ne();
|
|
1909
|
+
return O({
|
|
1913
1910
|
mutationKey: ["ecency-wallets", "import-wallet", e, t],
|
|
1914
1911
|
mutationFn: async ({ privateKeyOrSeed: s }) => {
|
|
1915
1912
|
const a = Y(t);
|
|
@@ -1955,9 +1952,9 @@ function Qt(e, t) {
|
|
|
1955
1952
|
}
|
|
1956
1953
|
});
|
|
1957
1954
|
}
|
|
1958
|
-
function
|
|
1959
|
-
const { mutateAsync: t } =
|
|
1960
|
-
return
|
|
1955
|
+
function Qt(e) {
|
|
1956
|
+
const { mutateAsync: t } = pe(e);
|
|
1957
|
+
return O({
|
|
1961
1958
|
mutationKey: ["ecency-wallets", "save-wallet-to-metadata", e],
|
|
1962
1959
|
mutationFn: ({
|
|
1963
1960
|
wallets: n
|
|
@@ -1973,8 +1970,8 @@ function Dt(e) {
|
|
|
1973
1970
|
})
|
|
1974
1971
|
});
|
|
1975
1972
|
}
|
|
1976
|
-
function
|
|
1977
|
-
return
|
|
1973
|
+
function Dt(e) {
|
|
1974
|
+
return O({
|
|
1978
1975
|
mutationKey: ["wallets", "assets-list", e],
|
|
1979
1976
|
mutationFn: async (t) => (l.storage.setItem(
|
|
1980
1977
|
l.storagePrefix + "_wallet_assets_list",
|
|
@@ -1982,52 +1979,52 @@ function Et(e) {
|
|
|
1982
1979
|
), t),
|
|
1983
1980
|
onSuccess() {
|
|
1984
1981
|
i().invalidateQueries({
|
|
1985
|
-
queryKey:
|
|
1982
|
+
queryKey: xe(e).queryKey
|
|
1986
1983
|
});
|
|
1987
1984
|
}
|
|
1988
1985
|
});
|
|
1989
1986
|
}
|
|
1990
|
-
const
|
|
1987
|
+
const Xe = {
|
|
1991
1988
|
HIVE: {
|
|
1992
|
-
[u.Transfer]:
|
|
1993
|
-
[u.TransferToSavings]:
|
|
1989
|
+
[u.Transfer]: x,
|
|
1990
|
+
[u.TransferToSavings]: U,
|
|
1994
1991
|
[u.PowerUp]: Oe
|
|
1995
1992
|
},
|
|
1996
1993
|
HBD: {
|
|
1997
|
-
[u.Transfer]:
|
|
1998
|
-
[u.TransferToSavings]:
|
|
1994
|
+
[u.Transfer]: x,
|
|
1995
|
+
[u.TransferToSavings]: U
|
|
1999
1996
|
},
|
|
2000
1997
|
HP: {
|
|
2001
|
-
[u.PowerDown]:
|
|
2002
|
-
[u.Delegate]:
|
|
2003
|
-
[u.WithdrawRoutes]:
|
|
1998
|
+
[u.PowerDown]: Ae,
|
|
1999
|
+
[u.Delegate]: Se,
|
|
2000
|
+
[u.WithdrawRoutes]: Ne
|
|
2004
2001
|
},
|
|
2005
2002
|
POINTS: {
|
|
2006
|
-
[u.Gift]:
|
|
2003
|
+
[u.Gift]: Je
|
|
2007
2004
|
},
|
|
2008
2005
|
SPK: {
|
|
2009
|
-
[u.Transfer]:
|
|
2006
|
+
[u.Transfer]: Te
|
|
2010
2007
|
},
|
|
2011
2008
|
LARYNX: {
|
|
2012
2009
|
[u.LockLiquidity]: He,
|
|
2013
|
-
[u.PowerUp]:
|
|
2010
|
+
[u.PowerUp]: Ke
|
|
2014
2011
|
}
|
|
2015
|
-
},
|
|
2016
|
-
[u.Transfer]:
|
|
2017
|
-
[u.Stake]:
|
|
2018
|
-
[u.Unstake]:
|
|
2019
|
-
[u.Delegate]:
|
|
2020
|
-
[u.Undelegate]:
|
|
2012
|
+
}, ze = {
|
|
2013
|
+
[u.Transfer]: Be,
|
|
2014
|
+
[u.Stake]: Fe,
|
|
2015
|
+
[u.Unstake]: Le,
|
|
2016
|
+
[u.Delegate]: Ie,
|
|
2017
|
+
[u.Undelegate]: je
|
|
2021
2018
|
};
|
|
2022
|
-
function
|
|
2023
|
-
const { mutateAsync: r } =
|
|
2019
|
+
function Et(e, t, n) {
|
|
2020
|
+
const { mutateAsync: r } = W.useRecordActivity(
|
|
2024
2021
|
e,
|
|
2025
2022
|
n
|
|
2026
2023
|
);
|
|
2027
|
-
return
|
|
2024
|
+
return O({
|
|
2028
2025
|
mutationKey: ["ecency-wallets", t, n],
|
|
2029
2026
|
mutationFn: async (s) => {
|
|
2030
|
-
const a =
|
|
2027
|
+
const a = Xe[t][n];
|
|
2031
2028
|
if (a)
|
|
2032
2029
|
return a(s);
|
|
2033
2030
|
const o = $(e);
|
|
@@ -2036,7 +2033,7 @@ function Rt(e, t, n) {
|
|
|
2036
2033
|
o.queryKey
|
|
2037
2034
|
);
|
|
2038
2035
|
if (c != null && c.some((f) => f.symbol === t)) {
|
|
2039
|
-
const f =
|
|
2036
|
+
const f = ze[n];
|
|
2040
2037
|
if (f)
|
|
2041
2038
|
return f({ ...s, asset: t });
|
|
2042
2039
|
}
|
|
@@ -2044,7 +2041,7 @@ function Rt(e, t, n) {
|
|
|
2044
2041
|
},
|
|
2045
2042
|
onSuccess: () => {
|
|
2046
2043
|
r();
|
|
2047
|
-
const s =
|
|
2044
|
+
const s = Ue(e, t, {
|
|
2048
2045
|
refetch: !0
|
|
2049
2046
|
});
|
|
2050
2047
|
setTimeout(
|
|
@@ -2061,61 +2058,61 @@ export {
|
|
|
2061
2058
|
w as EcencyWalletBasicTokens,
|
|
2062
2059
|
m as EcencyWalletCurrency,
|
|
2063
2060
|
Ht as EcencyWalletsPrivateApi,
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2061
|
+
ee as NaiMap,
|
|
2062
|
+
$e as PointTransactionType,
|
|
2063
|
+
Z as Symbol,
|
|
2064
|
+
Ie as delegateEngineToken,
|
|
2065
|
+
Se as delegateHive,
|
|
2066
|
+
Ue as getAccountWalletAssetInfoQueryOptions,
|
|
2067
|
+
xe as getAccountWalletListQueryOptions,
|
|
2068
|
+
At as getAllTokensListQueryOptions,
|
|
2069
|
+
qe as getHbdAssetGeneralInfoQueryOptions,
|
|
2070
|
+
vt as getHbdAssetTransactionsQueryOptions,
|
|
2074
2071
|
q as getHiveAssetGeneralInfoQueryOptions,
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2072
|
+
kt as getHiveAssetMetricQueryOptions,
|
|
2073
|
+
te as getHiveAssetTransactionsQueryOptions,
|
|
2074
|
+
bt as getHiveAssetWithdrawalRoutesQueryOptions,
|
|
2075
|
+
Ce as getHiveEngineTokenGeneralInfoQueryOptions,
|
|
2076
|
+
Pt as getHiveEngineTokenTransactionsQueryOptions,
|
|
2080
2077
|
$ as getHiveEngineTokensBalancesQueryOptions,
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2078
|
+
Re as getHiveEngineTokensMarketQueryOptions,
|
|
2079
|
+
F as getHiveEngineTokensMetadataQueryOptions,
|
|
2080
|
+
qt as getHiveEngineTokensMetricsQueryOptions,
|
|
2081
|
+
Pe as getHivePowerAssetGeneralInfoQueryOptions,
|
|
2082
|
+
_t as getHivePowerAssetTransactionsQueryOptions,
|
|
2083
|
+
Qe as getLarynxAssetGeneralInfoQueryOptions,
|
|
2084
|
+
Ee as getLarynxPowerAssetGeneralInfoQueryOptions,
|
|
2085
|
+
Me as getPointsAssetGeneralInfoQueryOptions,
|
|
2089
2086
|
Ot as getPointsAssetTransactionsQueryOptions,
|
|
2090
2087
|
M as getPointsQueryOptions,
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2088
|
+
De as getSpkAssetGeneralInfoQueryOptions,
|
|
2089
|
+
H as getSpkMarketsQueryOptions,
|
|
2090
|
+
Nt as getTokenOperationsQueryOptions,
|
|
2091
|
+
dt as isEmptyDate,
|
|
2095
2092
|
He as lockLarynx,
|
|
2096
2093
|
p as parseAsset,
|
|
2097
|
-
|
|
2094
|
+
Ae as powerDownHive,
|
|
2098
2095
|
Oe as powerUpHive,
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2096
|
+
Ke as powerUpLarynx,
|
|
2097
|
+
ke as rewardSpk,
|
|
2098
|
+
Fe as stakeEngineToken,
|
|
2099
|
+
Be as transferEngineToken,
|
|
2100
|
+
x as transferHive,
|
|
2101
|
+
Je as transferPoint,
|
|
2102
|
+
Te as transferSpk,
|
|
2103
|
+
U as transferToSavingsHive,
|
|
2104
|
+
je as undelegateEngineToken,
|
|
2105
|
+
Le as unstakeEngineToken,
|
|
2106
|
+
Dt as useChangeAssetsList,
|
|
2107
|
+
St as useClaimPoints,
|
|
2108
|
+
wt as useCoinGeckoPriceQuery,
|
|
2109
|
+
gt as useGetExternalWalletBalanceQuery,
|
|
2110
|
+
ve as useHiveKeysQuery,
|
|
2111
|
+
Kt as useImportWallet,
|
|
2112
|
+
Qt as useSaveWalletInformationToMetadata,
|
|
2113
|
+
X as useSeedPhrase,
|
|
2114
|
+
Tt as useWalletCreate,
|
|
2115
|
+
Et as useWalletOperation,
|
|
2119
2116
|
B as vestsToHp,
|
|
2120
|
-
|
|
2117
|
+
Ne as withdrawVestingRouteHive
|
|
2121
2118
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecency/wallets",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "./dist/ecency-sdk.umd.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@types/node": "^22.13.8",
|
|
24
24
|
"@types/react": "^19.0.10",
|
|
25
25
|
"@vitejs/plugin-react": "^4.3.4",
|
|
26
|
-
"
|
|
26
|
+
"dayjs": "^1.11.10",
|
|
27
27
|
"eslint": "^9.21.0",
|
|
28
28
|
"lru-cache": "^11.0.2",
|
|
29
29
|
"prettier": "^3.5.2",
|