@ecency/wallets 1.3.6 → 1.3.7
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 +836 -655
- package/dist/modules/wallets/utils/derive-hive-bip44-keys.d.ts +15 -0
- package/dist/modules/wallets/utils/derive-hive-master-password-keys.d.ts +15 -0
- package/dist/modules/wallets/utils/detect-hive-key-derivation.d.ts +3 -0
- package/dist/modules/wallets/utils/index.d.ts +3 -0
- package/package.json +1 -1
package/dist/ecency-sdk.es.js
CHANGED
|
@@ -1,80 +1,195 @@
|
|
|
1
|
-
import { CONFIG as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import
|
|
4
|
-
import { LRUCache as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
1
|
+
import { CONFIG as p, getQueryClient as c, getDynamicPropsQueryOptions as N, getAccountFullQueryOptions as q, Keychain as P, useBroadcastMutation as le, EcencyAnalytics as Z, getAccessToken as ye, useAccountUpdate as fe } from "@ecency/sdk";
|
|
2
|
+
import { useQuery as T, queryOptions as v, infiniteQueryOptions as I, useQueryClient as $, useMutation as K } from "@tanstack/react-query";
|
|
3
|
+
import pe, { mnemonicToSeedSync as me } from "bip39";
|
|
4
|
+
import { LRUCache as he } from "lru-cache";
|
|
5
|
+
import { BtcWallet as de } from "@okxweb3/coin-bitcoin";
|
|
6
|
+
import { EthWallet as we } from "@okxweb3/coin-ethereum";
|
|
7
|
+
import { TrxWallet as ge } from "@okxweb3/coin-tron";
|
|
8
|
+
import { TonWallet as ve } from "@okxweb3/coin-ton";
|
|
9
|
+
import { SolWallet as _e } from "@okxweb3/coin-solana";
|
|
10
|
+
import { AtomWallet as ke } from "@okxweb3/coin-cosmos";
|
|
11
|
+
import { AptosWallet as be } from "@okxweb3/coin-aptos";
|
|
12
|
+
import { bip32 as qe } from "@okxweb3/crypto-lib";
|
|
13
|
+
import { PrivateKey as V, Client as Pe, utils as S } from "@hiveio/dhive";
|
|
14
|
+
import D from "dayjs";
|
|
15
|
+
import k from "hivesigner";
|
|
16
|
+
import { useCallback as Oe } from "react";
|
|
16
17
|
import * as A from "remeda";
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
var y = /* @__PURE__ */ ((e) => (e.BTC = "BTC", e.ETH = "ETH", e.APT = "APT", e.ATOM = "ATOM", e.TON = "TON", e.TRON = "TRX", e.SOL = "SOL", e))(y || {}), _ = /* @__PURE__ */ ((e) => (e.Points = "POINTS", e.HivePower = "HP", e.Hive = "HIVE", e.HiveDollar = "HBD", e.Spk = "SPK", e))(_ || {});
|
|
19
|
+
function St(e, t) {
|
|
20
|
+
return T({
|
|
20
21
|
queryKey: ["ecency-wallets", "external-wallet-balance", e, t],
|
|
21
22
|
queryFn: async () => {
|
|
23
|
+
const n = async () => {
|
|
24
|
+
const a = {
|
|
25
|
+
[y.BTC]: {
|
|
26
|
+
query: (u) => `{"query":"{ bitcoin { address(address: {is: "${u}"}) { balance } } }"}`,
|
|
27
|
+
parse: (u) => {
|
|
28
|
+
var m, h, w;
|
|
29
|
+
return (w = (h = (m = u.bitcoin) == null ? void 0 : m.address) == null ? void 0 : h[0]) == null ? void 0 : w.balance;
|
|
30
|
+
},
|
|
31
|
+
scale: 1e8
|
|
32
|
+
},
|
|
33
|
+
[y.ETH]: {
|
|
34
|
+
query: (u) => `{"query":"{ ethereum { address(address: {is: "${u}"}) { balance } } }"}`,
|
|
35
|
+
parse: (u) => {
|
|
36
|
+
var m, h, w;
|
|
37
|
+
return (w = (h = (m = u.ethereum) == null ? void 0 : m.address) == null ? void 0 : h[0]) == null ? void 0 : w.balance;
|
|
38
|
+
},
|
|
39
|
+
scale: 1e18
|
|
40
|
+
},
|
|
41
|
+
[y.SOL]: {
|
|
42
|
+
query: (u) => `{"query":"{ solana { account(address: {is: "${u}"}) { balance } } }"}`,
|
|
43
|
+
parse: (u) => {
|
|
44
|
+
var m, h, w;
|
|
45
|
+
return (w = (h = (m = u.solana) == null ? void 0 : m.account) == null ? void 0 : h[0]) == null ? void 0 : w.balance;
|
|
46
|
+
},
|
|
47
|
+
scale: 1e9
|
|
48
|
+
},
|
|
49
|
+
[y.TRON]: {
|
|
50
|
+
query: (u) => `{"query":"{ tron { address(address: {is: "${u}"}) { balance } } }"}`,
|
|
51
|
+
parse: (u) => {
|
|
52
|
+
var m, h, w;
|
|
53
|
+
return (w = (h = (m = u.tron) == null ? void 0 : m.address) == null ? void 0 : h[0]) == null ? void 0 : w.balance;
|
|
54
|
+
},
|
|
55
|
+
scale: 1e6
|
|
56
|
+
},
|
|
57
|
+
[y.TON]: {
|
|
58
|
+
query: (u) => `{"query":"{ ton { address(address: {is: "${u}"}) { balance } } }"}`,
|
|
59
|
+
parse: (u) => {
|
|
60
|
+
var m, h, w;
|
|
61
|
+
return (w = (h = (m = u.ton) == null ? void 0 : m.address) == null ? void 0 : h[0]) == null ? void 0 : w.balance;
|
|
62
|
+
},
|
|
63
|
+
scale: 1e9
|
|
64
|
+
},
|
|
65
|
+
[y.APT]: {
|
|
66
|
+
query: (u) => `{"query":"{ aptos { address(address: {is: "${u}"}) { balance } } }"}`,
|
|
67
|
+
parse: (u) => {
|
|
68
|
+
var m, h, w;
|
|
69
|
+
return (w = (h = (m = u.aptos) == null ? void 0 : m.address) == null ? void 0 : h[0]) == null ? void 0 : w.balance;
|
|
70
|
+
},
|
|
71
|
+
scale: 1e8
|
|
72
|
+
},
|
|
73
|
+
[y.ATOM]: {
|
|
74
|
+
query: (u) => `{"query":"{ cosmos { address(address: {is: "${u}"}) { balance } } }"}`,
|
|
75
|
+
parse: (u) => {
|
|
76
|
+
var m, h, w;
|
|
77
|
+
return (w = (h = (m = u.cosmos) == null ? void 0 : m.address) == null ? void 0 : h[0]) == null ? void 0 : w.balance;
|
|
78
|
+
},
|
|
79
|
+
scale: 1e6
|
|
80
|
+
}
|
|
81
|
+
}[e];
|
|
82
|
+
if (!a) throw new Error("Unsupported currency for Bitquery");
|
|
83
|
+
const o = await fetch("https://graphql.bitquery.io", {
|
|
84
|
+
method: "POST",
|
|
85
|
+
headers: {
|
|
86
|
+
"Content-Type": "application/json",
|
|
87
|
+
"X-API-KEY": p.bitqueryApiKey || ""
|
|
88
|
+
},
|
|
89
|
+
body: a.query(t)
|
|
90
|
+
});
|
|
91
|
+
if (!o.ok) throw new Error("Bitquery request failed");
|
|
92
|
+
const i = await o.json(), f = a.parse(i.data);
|
|
93
|
+
if (typeof f != "number")
|
|
94
|
+
throw new Error("Bitquery returned invalid balance");
|
|
95
|
+
return f / a.scale;
|
|
96
|
+
}, r = async (s) => {
|
|
97
|
+
try {
|
|
98
|
+
return await s();
|
|
99
|
+
} catch (a) {
|
|
100
|
+
try {
|
|
101
|
+
return await n();
|
|
102
|
+
} catch {
|
|
103
|
+
throw a;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
22
107
|
switch (e) {
|
|
23
|
-
case
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
)
|
|
32
|
-
case
|
|
33
|
-
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
108
|
+
case y.BTC:
|
|
109
|
+
return r(async () => {
|
|
110
|
+
const s = await fetch(
|
|
111
|
+
`https://mempool.space/api/address/${t}`
|
|
112
|
+
);
|
|
113
|
+
if (!s.ok) throw new Error("Mempool API request failed");
|
|
114
|
+
const a = await s.json();
|
|
115
|
+
return (a.chain_stats.funded_txo_sum - a.chain_stats.spent_txo_sum) / 1e8;
|
|
116
|
+
});
|
|
117
|
+
case y.ETH:
|
|
118
|
+
return r(async () => {
|
|
119
|
+
const s = await fetch(
|
|
120
|
+
`https://api.ethplorer.io/getAddressInfo/${t}?apiKey=freekey`
|
|
121
|
+
);
|
|
122
|
+
if (!s.ok)
|
|
123
|
+
throw new Error("Ethplorer API request failed");
|
|
124
|
+
return +(await s.json()).ETH.balance;
|
|
125
|
+
});
|
|
126
|
+
case y.SOL:
|
|
127
|
+
return r(async () => {
|
|
128
|
+
const s = await fetch(
|
|
129
|
+
`https://rpc.helius.xyz/?api-key=${p.heliusApiKey}`,
|
|
130
|
+
{
|
|
131
|
+
method: "POST",
|
|
132
|
+
body: JSON.stringify({
|
|
133
|
+
jsonrpc: "2.0",
|
|
134
|
+
id: "1",
|
|
135
|
+
method: "getBalance",
|
|
136
|
+
params: [t]
|
|
137
|
+
}),
|
|
138
|
+
headers: {
|
|
139
|
+
"Content-Type": "application/json"
|
|
140
|
+
}
|
|
45
141
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
)
|
|
142
|
+
);
|
|
143
|
+
if (!s.ok) throw new Error("Helius API request failed");
|
|
144
|
+
return (await s.json()).result.value / 1e9;
|
|
145
|
+
});
|
|
146
|
+
case y.TRON:
|
|
147
|
+
return r(async () => {
|
|
148
|
+
const s = await fetch(
|
|
149
|
+
`https://api.trongrid.io/v1/accounts/${t}`
|
|
150
|
+
);
|
|
151
|
+
if (!s.ok)
|
|
152
|
+
throw new Error("Trongrid API request failed");
|
|
153
|
+
return (await s.json()).data[0].balance / 1e6;
|
|
154
|
+
});
|
|
155
|
+
case y.TON:
|
|
156
|
+
return r(async () => {
|
|
157
|
+
const s = await fetch(
|
|
158
|
+
`https://tonapi.io/v1/blockchain/getAccount?account=${t}`
|
|
159
|
+
);
|
|
160
|
+
if (!s.ok) throw new Error("Ton API request failed");
|
|
161
|
+
return (await s.json()).balance / 1e9;
|
|
162
|
+
});
|
|
163
|
+
case y.APT:
|
|
164
|
+
return r(async () => {
|
|
165
|
+
const s = await fetch(
|
|
166
|
+
`https://fullnode.mainnet.aptoslabs.com/v1/accounts/${t}/resources`
|
|
167
|
+
);
|
|
168
|
+
if (!s.ok) throw new Error("Aptos API request failed");
|
|
169
|
+
const o = (await s.json()).find(
|
|
170
|
+
(i) => i.type.includes("coin::CoinStore")
|
|
171
|
+
);
|
|
172
|
+
return o ? parseInt(o.data.coin.value) / 1e8 : 0;
|
|
173
|
+
});
|
|
174
|
+
case y.ATOM:
|
|
175
|
+
return r(async () => {
|
|
176
|
+
const s = await fetch(
|
|
177
|
+
`https://rest.cosmos.directory/cosmoshub/auth/accounts/${t}`
|
|
178
|
+
);
|
|
179
|
+
if (!s.ok) throw new Error("Cosmos API request failed");
|
|
180
|
+
return +(await s.json()).result.value.coins[0].amount / 1e6;
|
|
181
|
+
});
|
|
67
182
|
}
|
|
68
183
|
}
|
|
69
184
|
});
|
|
70
185
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
186
|
+
function ee(e) {
|
|
187
|
+
return T({
|
|
73
188
|
queryKey: ["ecency-wallets", "seed", e],
|
|
74
|
-
queryFn: async () =>
|
|
189
|
+
queryFn: async () => pe.generateMnemonic(128)
|
|
75
190
|
});
|
|
76
191
|
}
|
|
77
|
-
const
|
|
192
|
+
const Se = {
|
|
78
193
|
max: 500,
|
|
79
194
|
// how long to live in ms
|
|
80
195
|
ttl: 1e3 * 60 * 5,
|
|
@@ -82,32 +197,32 @@ const ke = {
|
|
|
82
197
|
allowStale: !1,
|
|
83
198
|
updateAgeOnGet: !1,
|
|
84
199
|
updateAgeOnHas: !1
|
|
85
|
-
},
|
|
86
|
-
const t =
|
|
200
|
+
}, te = new he(Se), x = Symbol("undefined"), Ae = (e, t) => te.set(e, t === void 0 ? x : t), Te = (e) => {
|
|
201
|
+
const t = te.get(e);
|
|
87
202
|
return t === x ? void 0 : t;
|
|
88
203
|
};
|
|
89
|
-
function
|
|
90
|
-
return
|
|
204
|
+
function At(e) {
|
|
205
|
+
return T({
|
|
91
206
|
queryKey: ["ecency-wallets", "coingecko-price", e],
|
|
92
207
|
queryFn: async () => {
|
|
93
208
|
let t = e;
|
|
94
209
|
switch (e) {
|
|
95
|
-
case
|
|
210
|
+
case y.BTC:
|
|
96
211
|
t = "binance-wrapped-btc";
|
|
97
212
|
break;
|
|
98
|
-
case
|
|
213
|
+
case y.ETH:
|
|
99
214
|
t = "ethereum";
|
|
100
215
|
break;
|
|
101
|
-
case
|
|
216
|
+
case y.SOL:
|
|
102
217
|
t = "solana";
|
|
103
218
|
break;
|
|
104
|
-
case
|
|
219
|
+
case y.TON:
|
|
105
220
|
t = "trx";
|
|
106
221
|
break;
|
|
107
222
|
default:
|
|
108
223
|
t = e;
|
|
109
224
|
}
|
|
110
|
-
let n =
|
|
225
|
+
let n = Te("gecko"), r;
|
|
111
226
|
if (n)
|
|
112
227
|
r = n;
|
|
113
228
|
else {
|
|
@@ -123,119 +238,208 @@ function vt(e) {
|
|
|
123
238
|
})
|
|
124
239
|
}
|
|
125
240
|
)).json();
|
|
126
|
-
|
|
241
|
+
Ae("gecko", o === void 0 ? x : o), r = o;
|
|
127
242
|
}
|
|
128
243
|
return 1 / +r[Object.keys(r)[0]].usd;
|
|
129
244
|
},
|
|
130
245
|
enabled: !!e
|
|
131
246
|
});
|
|
132
247
|
}
|
|
133
|
-
function
|
|
134
|
-
|
|
135
|
-
|
|
248
|
+
function ne(e) {
|
|
249
|
+
return new Promise((t) => setTimeout(t, e));
|
|
250
|
+
}
|
|
251
|
+
function re(e) {
|
|
252
|
+
switch (e) {
|
|
253
|
+
case y.BTC:
|
|
254
|
+
return new de();
|
|
255
|
+
case y.ETH:
|
|
256
|
+
return new we();
|
|
257
|
+
case y.TRON:
|
|
258
|
+
return new ge();
|
|
259
|
+
case y.TON:
|
|
260
|
+
return new ve();
|
|
261
|
+
case y.SOL:
|
|
262
|
+
return new _e();
|
|
263
|
+
case y.ATOM:
|
|
264
|
+
return new ke();
|
|
265
|
+
case y.APT:
|
|
266
|
+
return new be();
|
|
267
|
+
default:
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
const Ke = {
|
|
272
|
+
owner: 0,
|
|
273
|
+
active: 1,
|
|
274
|
+
posting: 2,
|
|
275
|
+
memo: 3
|
|
276
|
+
};
|
|
277
|
+
function R(e, t, n = 0) {
|
|
278
|
+
const r = me(e), s = qe.fromSeed(r), a = `m/44'/3054'/${n}'/0'/${Ke[t]}'`, o = s.derivePath(a);
|
|
279
|
+
if (!o.privateKey)
|
|
280
|
+
throw new Error("[Ecency][Wallets] - hive key derivation failed");
|
|
281
|
+
const i = V.from(o.privateKey);
|
|
282
|
+
return {
|
|
283
|
+
privateKey: i.toString(),
|
|
284
|
+
publicKey: i.createPublic().toString()
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function se(e, t = 0) {
|
|
288
|
+
const n = R(e, "owner", t), r = R(e, "active", t), s = R(e, "posting", t), a = R(e, "memo", t);
|
|
289
|
+
return {
|
|
290
|
+
owner: n.privateKey,
|
|
291
|
+
active: r.privateKey,
|
|
292
|
+
posting: s.privateKey,
|
|
293
|
+
memo: a.privateKey,
|
|
294
|
+
ownerPubkey: n.publicKey,
|
|
295
|
+
activePubkey: r.publicKey,
|
|
296
|
+
postingPubkey: s.publicKey,
|
|
297
|
+
memoPubkey: a.publicKey
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
function j(e, t, n) {
|
|
301
|
+
const r = V.fromLogin(e, t, n);
|
|
302
|
+
return {
|
|
303
|
+
privateKey: r.toString(),
|
|
304
|
+
publicKey: r.createPublic().toString()
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
function Ne(e, t) {
|
|
308
|
+
const n = j(e, t, "owner"), r = j(e, t, "active"), s = j(
|
|
309
|
+
e,
|
|
310
|
+
t,
|
|
311
|
+
"posting"
|
|
312
|
+
), a = j(e, t, "memo");
|
|
313
|
+
return {
|
|
314
|
+
owner: n.privateKey,
|
|
315
|
+
active: r.privateKey,
|
|
316
|
+
posting: s.privateKey,
|
|
317
|
+
memo: a.privateKey,
|
|
318
|
+
ownerPubkey: n.publicKey,
|
|
319
|
+
activePubkey: r.publicKey,
|
|
320
|
+
postingPubkey: s.publicKey,
|
|
321
|
+
memoPubkey: a.publicKey
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
async function He(e, t, n = new Pe("https://api.hive.blog")) {
|
|
325
|
+
const [r] = await n.database.getAccounts([e]);
|
|
326
|
+
if (!r)
|
|
327
|
+
throw new Error(`[Ecency][Wallets] - account ${e} not found`);
|
|
328
|
+
const a = se(t).activePubkey;
|
|
329
|
+
if (r.active.key_auths.some(
|
|
330
|
+
([u]) => u.toString() === a
|
|
331
|
+
))
|
|
332
|
+
return "bip44";
|
|
333
|
+
const i = V.fromLogin(
|
|
334
|
+
e,
|
|
335
|
+
t,
|
|
336
|
+
"active"
|
|
337
|
+
).createPublic().toString();
|
|
338
|
+
return r.active.key_auths.some(
|
|
339
|
+
([u]) => u.toString() === i
|
|
340
|
+
) ? "master-password" : "unknown";
|
|
341
|
+
}
|
|
342
|
+
function Ee(e) {
|
|
343
|
+
const { data: t } = ee(e);
|
|
344
|
+
return T({
|
|
136
345
|
queryKey: ["ecencу-wallets", "hive-keys", e, t],
|
|
137
346
|
staleTime: 1 / 0,
|
|
138
347
|
queryFn: async () => {
|
|
139
348
|
if (!t)
|
|
140
349
|
throw new Error("[Ecency][Wallets] - no seed to create Hive account");
|
|
141
|
-
const
|
|
350
|
+
const r = await He(e, t).catch(
|
|
351
|
+
() => "bip44"
|
|
352
|
+
) === "master-password" ? Ne(e, t) : se(t);
|
|
142
353
|
return {
|
|
143
354
|
username: e,
|
|
144
|
-
|
|
145
|
-
active: r.toString(),
|
|
146
|
-
posting: s.toString(),
|
|
147
|
-
memo: a.toString(),
|
|
148
|
-
ownerPubkey: n.createPublic().toString(),
|
|
149
|
-
activePubkey: r.createPublic().toString(),
|
|
150
|
-
postingPubkey: s.createPublic().toString(),
|
|
151
|
-
memoPubkey: a.createPublic().toString()
|
|
355
|
+
...r
|
|
152
356
|
};
|
|
153
357
|
}
|
|
154
358
|
});
|
|
155
359
|
}
|
|
156
|
-
var
|
|
157
|
-
function
|
|
360
|
+
var ae = /* @__PURE__ */ ((e) => (e.HIVE = "HIVE", e.HBD = "HBD", e.VESTS = "VESTS", e.SPK = "SPK", e))(ae || {}), oe = /* @__PURE__ */ ((e) => (e["@@000000021"] = "HIVE", e["@@000000013"] = "HBD", e["@@000000037"] = "VESTS", e))(oe || {});
|
|
361
|
+
function g(e) {
|
|
158
362
|
if (typeof e == "string") {
|
|
159
363
|
const t = e.split(" ");
|
|
160
364
|
return {
|
|
161
365
|
amount: parseFloat(t[0]),
|
|
162
366
|
// @ts-ignore
|
|
163
|
-
symbol:
|
|
367
|
+
symbol: ae[t[1]]
|
|
164
368
|
};
|
|
165
369
|
} else
|
|
166
370
|
return {
|
|
167
371
|
amount: parseFloat(e.amount.toString()) / Math.pow(10, e.precision),
|
|
168
372
|
// @ts-ignore
|
|
169
|
-
symbol:
|
|
373
|
+
symbol: oe[e.nai]
|
|
170
374
|
};
|
|
171
375
|
}
|
|
172
|
-
function
|
|
376
|
+
function Tt(e) {
|
|
173
377
|
return e === void 0 ? !0 : parseInt(e.split("-")[0], 10) < 1980;
|
|
174
378
|
}
|
|
175
|
-
function
|
|
379
|
+
function J(e, t) {
|
|
176
380
|
return e / 1e6 * t;
|
|
177
381
|
}
|
|
178
|
-
function
|
|
382
|
+
function Qe(e, t) {
|
|
179
383
|
let n = 0, r = 0, s = 0, a = 0, o = e.head_block - e.spk_block;
|
|
180
384
|
if (e.spk_block) {
|
|
181
385
|
if (o < 28800)
|
|
182
386
|
return 0;
|
|
183
387
|
{
|
|
184
|
-
a = o / 28800, n = e.gov ?
|
|
388
|
+
a = o / 28800, n = e.gov ? i(e.gov, a, t.spk_rate_lgov) : 0, r = e.pow ? i(e.pow, a, t.spk_rate_lpow) : 0, s = i(
|
|
185
389
|
(e.granted.t > 0 ? e.granted.t : 0) + (e.granting.t && e.granting.t > 0 ? e.granting.t : 0),
|
|
186
390
|
a,
|
|
187
391
|
t.spk_rate_ldel
|
|
188
392
|
);
|
|
189
|
-
const
|
|
190
|
-
return
|
|
393
|
+
const f = n + r + s;
|
|
394
|
+
return f || 0;
|
|
191
395
|
}
|
|
192
396
|
} else return 0;
|
|
193
|
-
function
|
|
194
|
-
return (
|
|
397
|
+
function i(f, u, m) {
|
|
398
|
+
return (f * (1 + m / 365) - f) * u;
|
|
195
399
|
}
|
|
196
400
|
}
|
|
197
|
-
function
|
|
198
|
-
return
|
|
401
|
+
function O(e) {
|
|
402
|
+
return v({
|
|
199
403
|
queryKey: ["assets", "hive", "general-info", e],
|
|
200
404
|
staleTime: 6e4,
|
|
201
405
|
refetchInterval: 9e4,
|
|
202
406
|
queryFn: async () => {
|
|
203
|
-
await
|
|
204
|
-
|
|
407
|
+
await c().prefetchQuery(N()), await c().prefetchQuery(
|
|
408
|
+
q(e)
|
|
205
409
|
);
|
|
206
|
-
const t =
|
|
207
|
-
|
|
208
|
-
), n =
|
|
209
|
-
|
|
410
|
+
const t = c().getQueryData(
|
|
411
|
+
N().queryKey
|
|
412
|
+
), n = c().getQueryData(
|
|
413
|
+
q(e).queryKey
|
|
210
414
|
);
|
|
211
415
|
return {
|
|
212
416
|
name: "HIVE",
|
|
213
417
|
title: "Hive",
|
|
214
418
|
price: t ? t.base / t.quote : 0,
|
|
215
|
-
accountBalance: n ?
|
|
419
|
+
accountBalance: n ? g(n.balance).amount : 0
|
|
216
420
|
};
|
|
217
421
|
}
|
|
218
422
|
});
|
|
219
423
|
}
|
|
220
|
-
function
|
|
221
|
-
let
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
return (
|
|
424
|
+
function De(e) {
|
|
425
|
+
let f = 9.5 - (e.headBlock - 7e6) / 25e4 * 0.01;
|
|
426
|
+
f < 0.95 && (f = 0.95);
|
|
427
|
+
const u = e.vestingRewardPercent / 1e4, m = e.virtualSupply, h = e.totalVestingFund;
|
|
428
|
+
return (m * f * u / h).toFixed(3);
|
|
225
429
|
}
|
|
226
|
-
function
|
|
227
|
-
return
|
|
430
|
+
function ie(e) {
|
|
431
|
+
return v({
|
|
228
432
|
queryKey: ["assets", "hive-power", "general-info", e],
|
|
229
433
|
staleTime: 6e4,
|
|
230
434
|
refetchInterval: 9e4,
|
|
231
435
|
queryFn: async () => {
|
|
232
|
-
await
|
|
233
|
-
|
|
436
|
+
await c().prefetchQuery(N()), await c().prefetchQuery(
|
|
437
|
+
q(e)
|
|
234
438
|
);
|
|
235
|
-
const t =
|
|
236
|
-
|
|
237
|
-
), n =
|
|
238
|
-
|
|
439
|
+
const t = c().getQueryData(
|
|
440
|
+
N().queryKey
|
|
441
|
+
), n = c().getQueryData(
|
|
442
|
+
q(e).queryKey
|
|
239
443
|
);
|
|
240
444
|
return !t || !n ? {
|
|
241
445
|
name: "HP",
|
|
@@ -246,26 +450,26 @@ function ne(e) {
|
|
|
246
450
|
name: "HP",
|
|
247
451
|
title: "Hive Power",
|
|
248
452
|
price: t ? t.base / t.quote : 0,
|
|
249
|
-
accountBalance:
|
|
250
|
-
|
|
453
|
+
accountBalance: +J(
|
|
454
|
+
g(n.vesting_shares).amount,
|
|
251
455
|
// parseAsset(accountData.delegated_vesting_shares).amount +
|
|
252
456
|
// parseAsset(accountData.received_vesting_shares).amount -
|
|
253
457
|
// nextVestingSharesWithdrawal,
|
|
254
458
|
t.hivePerMVests
|
|
255
459
|
).toFixed(3),
|
|
256
|
-
apr:
|
|
460
|
+
apr: De(t),
|
|
257
461
|
parts: [
|
|
258
462
|
{
|
|
259
463
|
name: "delegating",
|
|
260
|
-
balance:
|
|
261
|
-
|
|
464
|
+
balance: +J(
|
|
465
|
+
g(n.delegated_vesting_shares).amount,
|
|
262
466
|
t.hivePerMVests
|
|
263
467
|
).toFixed(3)
|
|
264
468
|
},
|
|
265
469
|
{
|
|
266
470
|
name: "received",
|
|
267
|
-
balance:
|
|
268
|
-
|
|
471
|
+
balance: +J(
|
|
472
|
+
g(n.received_vesting_shares).amount,
|
|
269
473
|
t.hivePerMVests
|
|
270
474
|
).toFixed(3)
|
|
271
475
|
}
|
|
@@ -274,34 +478,34 @@ function ne(e) {
|
|
|
274
478
|
}
|
|
275
479
|
});
|
|
276
480
|
}
|
|
277
|
-
function
|
|
278
|
-
return
|
|
481
|
+
function Ce(e) {
|
|
482
|
+
return v({
|
|
279
483
|
queryKey: ["assets", "hbd", "general-info", e],
|
|
280
484
|
staleTime: 6e4,
|
|
281
485
|
refetchInterval: 9e4,
|
|
282
486
|
queryFn: async () => {
|
|
283
|
-
await
|
|
284
|
-
|
|
487
|
+
await c().prefetchQuery(N()), await c().prefetchQuery(
|
|
488
|
+
q(e)
|
|
285
489
|
);
|
|
286
|
-
const t =
|
|
287
|
-
|
|
288
|
-
), n =
|
|
289
|
-
|
|
490
|
+
const t = c().getQueryData(
|
|
491
|
+
q(e).queryKey
|
|
492
|
+
), n = c().getQueryData(
|
|
493
|
+
N().queryKey
|
|
290
494
|
);
|
|
291
495
|
return t ? {
|
|
292
496
|
name: "HBD",
|
|
293
497
|
title: "Hive-based dollar",
|
|
294
498
|
price: 1,
|
|
295
|
-
accountBalance:
|
|
499
|
+
accountBalance: g(t.hbd_balance).amount + g(t == null ? void 0 : t.savings_hbd_balance).amount,
|
|
296
500
|
apr: (((n == null ? void 0 : n.hbdInterestRate) ?? 0) / 100).toFixed(3),
|
|
297
501
|
parts: [
|
|
298
502
|
{
|
|
299
503
|
name: "account",
|
|
300
|
-
balance:
|
|
504
|
+
balance: g(t.hbd_balance).amount
|
|
301
505
|
},
|
|
302
506
|
{
|
|
303
507
|
name: "savings",
|
|
304
|
-
balance:
|
|
508
|
+
balance: g(t.savings_hbd_balance).amount
|
|
305
509
|
}
|
|
306
510
|
]
|
|
307
511
|
} : {
|
|
@@ -313,48 +517,48 @@ function Te(e) {
|
|
|
313
517
|
}
|
|
314
518
|
});
|
|
315
519
|
}
|
|
316
|
-
const
|
|
520
|
+
const d = S.operationOrders, C = {
|
|
317
521
|
transfers: [
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
522
|
+
d.transfer,
|
|
523
|
+
d.transfer_to_savings,
|
|
524
|
+
d.transfer_from_savings,
|
|
525
|
+
d.cancel_transfer_from_savings,
|
|
526
|
+
d.recurrent_transfer,
|
|
527
|
+
d.fill_recurrent_transfer,
|
|
528
|
+
d.escrow_transfer,
|
|
529
|
+
d.fill_recurrent_transfer
|
|
326
530
|
],
|
|
327
531
|
"market-orders": [
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
532
|
+
d.fill_convert_request,
|
|
533
|
+
d.fill_order,
|
|
534
|
+
d.fill_collateralized_convert_request,
|
|
535
|
+
d.limit_order_create2,
|
|
536
|
+
d.limit_order_create,
|
|
537
|
+
d.limit_order_cancel
|
|
334
538
|
],
|
|
335
|
-
interests: [
|
|
539
|
+
interests: [d.interest],
|
|
336
540
|
"stake-operations": [
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
541
|
+
d.return_vesting_delegation,
|
|
542
|
+
d.withdraw_vesting,
|
|
543
|
+
d.transfer_to_vesting,
|
|
544
|
+
d.set_withdraw_vesting_route,
|
|
545
|
+
d.update_proposal_votes,
|
|
546
|
+
d.fill_vesting_withdraw,
|
|
547
|
+
d.account_witness_proxy,
|
|
548
|
+
d.delegate_vesting_shares
|
|
345
549
|
],
|
|
346
550
|
rewards: [
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
551
|
+
d.author_reward,
|
|
552
|
+
d.curation_reward,
|
|
553
|
+
d.producer_reward,
|
|
554
|
+
d.claim_reward_balance,
|
|
555
|
+
d.comment_benefactor_reward,
|
|
556
|
+
d.liquidity_reward,
|
|
557
|
+
d.proposal_pay
|
|
354
558
|
]
|
|
355
559
|
};
|
|
356
|
-
function
|
|
357
|
-
return
|
|
560
|
+
function ce(e, t = 20, n) {
|
|
561
|
+
return I({
|
|
358
562
|
queryKey: ["assets", "hive", "transactions", e, t, n],
|
|
359
563
|
initialData: { pages: [], pageParams: [] },
|
|
360
564
|
initialPageParam: -1,
|
|
@@ -366,34 +570,34 @@ function re(e, t = 20, n) {
|
|
|
366
570
|
let s = [];
|
|
367
571
|
switch (n) {
|
|
368
572
|
case "transfers":
|
|
369
|
-
s =
|
|
370
|
-
|
|
573
|
+
s = S.makeBitMaskFilter(
|
|
574
|
+
C.transfers
|
|
371
575
|
);
|
|
372
576
|
break;
|
|
373
577
|
case "market-orders":
|
|
374
|
-
s =
|
|
375
|
-
|
|
578
|
+
s = S.makeBitMaskFilter(
|
|
579
|
+
C["market-orders"]
|
|
376
580
|
);
|
|
377
581
|
break;
|
|
378
582
|
case "interests":
|
|
379
|
-
s =
|
|
380
|
-
|
|
583
|
+
s = S.makeBitMaskFilter(
|
|
584
|
+
C.interests
|
|
381
585
|
);
|
|
382
586
|
break;
|
|
383
587
|
case "stake-operations":
|
|
384
|
-
s =
|
|
385
|
-
|
|
588
|
+
s = S.makeBitMaskFilter(
|
|
589
|
+
C["stake-operations"]
|
|
386
590
|
);
|
|
387
591
|
break;
|
|
388
592
|
case "rewards":
|
|
389
|
-
s =
|
|
390
|
-
|
|
593
|
+
s = S.makeBitMaskFilter(
|
|
594
|
+
C.rewards
|
|
391
595
|
);
|
|
392
596
|
break;
|
|
393
597
|
default:
|
|
394
|
-
s =
|
|
598
|
+
s = S.makeBitMaskFilter([]);
|
|
395
599
|
}
|
|
396
|
-
return (await
|
|
600
|
+
return (await p.hiveClient.call(
|
|
397
601
|
"condenser_api",
|
|
398
602
|
"get_account_history",
|
|
399
603
|
[e, r, t, ...s]
|
|
@@ -414,17 +618,17 @@ function re(e, t = 20, n) {
|
|
|
414
618
|
switch (o.type) {
|
|
415
619
|
case "author_reward":
|
|
416
620
|
case "comment_benefactor_reward":
|
|
417
|
-
return
|
|
621
|
+
return g(o.hive_payout).amount > 0;
|
|
418
622
|
case "transfer":
|
|
419
623
|
case "transfer_to_savings":
|
|
420
624
|
case "transfer_to_vesting":
|
|
421
625
|
case "recurrent_transfer":
|
|
422
626
|
return ["HIVE"].includes(o.amount);
|
|
423
627
|
case "fill_recurrent_transfer":
|
|
424
|
-
const
|
|
425
|
-
return ["HIVE"].includes(
|
|
628
|
+
const f = g(o.amount);
|
|
629
|
+
return ["HIVE"].includes(f.symbol);
|
|
426
630
|
case "claim_reward_balance":
|
|
427
|
-
return
|
|
631
|
+
return g(
|
|
428
632
|
o.reward_hive
|
|
429
633
|
).amount > 0;
|
|
430
634
|
case "cancel_transfer_from_savings":
|
|
@@ -448,9 +652,9 @@ function re(e, t = 20, n) {
|
|
|
448
652
|
})
|
|
449
653
|
});
|
|
450
654
|
}
|
|
451
|
-
function
|
|
452
|
-
return
|
|
453
|
-
...
|
|
655
|
+
function Kt(e, t = 20, n) {
|
|
656
|
+
return I({
|
|
657
|
+
...ce(e, t, n),
|
|
454
658
|
queryKey: ["assets", "hive-power", "transactions", e, t, n],
|
|
455
659
|
select: ({ pages: r, pageParams: s }) => ({
|
|
456
660
|
pageParams: s,
|
|
@@ -459,11 +663,11 @@ function bt(e, t = 20, n) {
|
|
|
459
663
|
switch (o.type) {
|
|
460
664
|
case "author_reward":
|
|
461
665
|
case "comment_benefactor_reward":
|
|
462
|
-
return
|
|
666
|
+
return g(
|
|
463
667
|
o.vesting_payout
|
|
464
668
|
).amount > 0;
|
|
465
669
|
case "claim_reward_balance":
|
|
466
|
-
return
|
|
670
|
+
return g(
|
|
467
671
|
o.reward_vests
|
|
468
672
|
).amount > 0;
|
|
469
673
|
case "transfer":
|
|
@@ -472,8 +676,8 @@ function bt(e, t = 20, n) {
|
|
|
472
676
|
case "recurrent_transfer":
|
|
473
677
|
return ["VESTS", "HP"].includes(o.amount);
|
|
474
678
|
case "fill_recurrent_transfer":
|
|
475
|
-
const
|
|
476
|
-
return ["VESTS", "HP"].includes(
|
|
679
|
+
const u = g(o.amount);
|
|
680
|
+
return ["VESTS", "HP"].includes(u.symbol);
|
|
477
681
|
case "curation_reward":
|
|
478
682
|
case "withdraw_vesting":
|
|
479
683
|
case "delegate_vesting_shares":
|
|
@@ -490,9 +694,9 @@ function bt(e, t = 20, n) {
|
|
|
490
694
|
})
|
|
491
695
|
});
|
|
492
696
|
}
|
|
493
|
-
function
|
|
494
|
-
return
|
|
495
|
-
...
|
|
697
|
+
function Nt(e, t = 20, n) {
|
|
698
|
+
return I({
|
|
699
|
+
...ce(e, t, n),
|
|
496
700
|
queryKey: ["assets", "hbd", "transactions", e, t, n],
|
|
497
701
|
select: ({ pages: r, pageParams: s }) => ({
|
|
498
702
|
pageParams: s,
|
|
@@ -501,9 +705,9 @@ function Pt(e, t = 20, n) {
|
|
|
501
705
|
switch (o.type) {
|
|
502
706
|
case "author_reward":
|
|
503
707
|
case "comment_benefactor_reward":
|
|
504
|
-
return
|
|
708
|
+
return g(o.hbd_payout).amount > 0;
|
|
505
709
|
case "claim_reward_balance":
|
|
506
|
-
return
|
|
710
|
+
return g(
|
|
507
711
|
o.reward_hbd
|
|
508
712
|
).amount > 0;
|
|
509
713
|
case "transfer":
|
|
@@ -512,8 +716,8 @@ function Pt(e, t = 20, n) {
|
|
|
512
716
|
case "recurrent_transfer":
|
|
513
717
|
return ["HBD"].includes(o.amount);
|
|
514
718
|
case "fill_recurrent_transfer":
|
|
515
|
-
const
|
|
516
|
-
return ["HBD"].includes(
|
|
719
|
+
const u = g(o.amount);
|
|
720
|
+
return ["HBD"].includes(u.symbol);
|
|
517
721
|
case "comment_reward":
|
|
518
722
|
case "effective_comment_vote":
|
|
519
723
|
return !0;
|
|
@@ -525,16 +729,16 @@ function Pt(e, t = 20, n) {
|
|
|
525
729
|
})
|
|
526
730
|
});
|
|
527
731
|
}
|
|
528
|
-
function
|
|
529
|
-
return
|
|
732
|
+
function Ht(e = 86400) {
|
|
733
|
+
return I({
|
|
530
734
|
queryKey: ["assets", "hive", "metrics", e],
|
|
531
|
-
queryFn: async ({ pageParam: [t, n] }) => (await
|
|
735
|
+
queryFn: async ({ pageParam: [t, n] }) => (await p.hiveClient.call(
|
|
532
736
|
"condenser_api",
|
|
533
737
|
"get_market_history",
|
|
534
738
|
[
|
|
535
739
|
e,
|
|
536
|
-
|
|
537
|
-
|
|
740
|
+
D(t).format("YYYY-MM-DDTHH:mm:ss"),
|
|
741
|
+
D(n).format("YYYY-MM-DDTHH:mm:ss")
|
|
538
742
|
]
|
|
539
743
|
)).map(({ hive: s, non_hive: a, open: o }) => ({
|
|
540
744
|
close: a.close / s.close,
|
|
@@ -546,40 +750,40 @@ function qt(e = 86400) {
|
|
|
546
750
|
})),
|
|
547
751
|
initialPageParam: [
|
|
548
752
|
// Fetch at least 8 hours or given interval
|
|
549
|
-
|
|
753
|
+
D().subtract(Math.max(100 * e, 28800), "second").toDate(),
|
|
550
754
|
/* @__PURE__ */ new Date()
|
|
551
755
|
],
|
|
552
756
|
getNextPageParam: (t, n, [r]) => [
|
|
553
|
-
|
|
554
|
-
|
|
757
|
+
D(r.getTime()).subtract(Math.max(100 * e, 28800), "second").toDate(),
|
|
758
|
+
D(r.getTime()).subtract(e, "second").toDate()
|
|
555
759
|
]
|
|
556
760
|
});
|
|
557
761
|
}
|
|
558
|
-
function
|
|
559
|
-
return
|
|
762
|
+
function Et(e) {
|
|
763
|
+
return v({
|
|
560
764
|
queryKey: ["assets", "hive", "withdrawal-routes", e],
|
|
561
|
-
queryFn: () =>
|
|
765
|
+
queryFn: () => p.hiveClient.database.call("get_withdraw_routes", [
|
|
562
766
|
e,
|
|
563
767
|
"outgoing"
|
|
564
768
|
])
|
|
565
769
|
});
|
|
566
770
|
}
|
|
567
|
-
function
|
|
568
|
-
return
|
|
771
|
+
function Qt(e, t = 50) {
|
|
772
|
+
return v({
|
|
569
773
|
queryKey: ["assets", "hive-power", "delegates", e],
|
|
570
774
|
enabled: !!e,
|
|
571
|
-
queryFn: () =>
|
|
775
|
+
queryFn: () => p.hiveClient.database.call("get_vesting_delegations", [
|
|
572
776
|
e,
|
|
573
777
|
"",
|
|
574
778
|
t
|
|
575
779
|
])
|
|
576
780
|
});
|
|
577
781
|
}
|
|
578
|
-
function
|
|
579
|
-
return
|
|
782
|
+
function Dt(e) {
|
|
783
|
+
return v({
|
|
580
784
|
queryKey: ["assets", "hive-power", "delegatings", e],
|
|
581
785
|
queryFn: async () => (await (await fetch(
|
|
582
|
-
|
|
786
|
+
p.privateApiHost + `/private-api/received-vesting/${e}`,
|
|
583
787
|
{
|
|
584
788
|
headers: {
|
|
585
789
|
"Content-Type": "application/json"
|
|
@@ -587,15 +791,15 @@ function Tt(e) {
|
|
|
587
791
|
}
|
|
588
792
|
)).json()).list,
|
|
589
793
|
select: (t) => t.sort(
|
|
590
|
-
(n, r) =>
|
|
794
|
+
(n, r) => g(r.vesting_shares).amount - g(n.vesting_shares).amount
|
|
591
795
|
)
|
|
592
796
|
});
|
|
593
797
|
}
|
|
594
|
-
async function
|
|
595
|
-
const n =
|
|
798
|
+
async function W(e) {
|
|
799
|
+
const n = g(e.amount).symbol;
|
|
596
800
|
if (e.type === "key" && "key" in e) {
|
|
597
801
|
const { key: r, type: s, ...a } = e;
|
|
598
|
-
return
|
|
802
|
+
return p.hiveClient.broadcast.transfer(
|
|
599
803
|
{
|
|
600
804
|
from: a.from,
|
|
601
805
|
to: a.to,
|
|
@@ -620,7 +824,7 @@ async function V(e) {
|
|
|
620
824
|
null
|
|
621
825
|
);
|
|
622
826
|
}
|
|
623
|
-
) :
|
|
827
|
+
) : k.sendOperation(
|
|
624
828
|
[
|
|
625
829
|
"transfer",
|
|
626
830
|
{
|
|
@@ -635,128 +839,105 @@ async function V(e) {
|
|
|
635
839
|
}
|
|
636
840
|
);
|
|
637
841
|
}
|
|
638
|
-
async function
|
|
842
|
+
async function Y(e) {
|
|
639
843
|
if (e.type === "key" && "key" in e) {
|
|
640
844
|
const { key: t, type: n, ...r } = e;
|
|
641
|
-
return
|
|
845
|
+
return p.hiveClient.broadcast.sendOperations(
|
|
642
846
|
[["transfer_to_savings", r]],
|
|
643
847
|
t
|
|
644
848
|
);
|
|
645
|
-
} else return e.type === "keychain" ?
|
|
849
|
+
} else return e.type === "keychain" ? P.broadcast(
|
|
646
850
|
e.from,
|
|
647
851
|
[["transfer_to_savings", e]],
|
|
648
852
|
"Active"
|
|
649
|
-
) :
|
|
853
|
+
) : k.sendOperation(
|
|
650
854
|
["transfer_to_savings", e],
|
|
651
855
|
{ callback: `https://ecency.com/@${e.from}/wallet` },
|
|
652
856
|
() => {
|
|
653
857
|
}
|
|
654
858
|
);
|
|
655
859
|
}
|
|
656
|
-
async function
|
|
860
|
+
async function Ie(e) {
|
|
657
861
|
if (e.type === "key" && "key" in e) {
|
|
658
862
|
const { key: t, type: n, ...r } = e;
|
|
659
|
-
return
|
|
863
|
+
return p.hiveClient.broadcast.sendOperations(
|
|
660
864
|
[["transfer_to_vesting", r]],
|
|
661
865
|
t
|
|
662
866
|
);
|
|
663
|
-
} else return e.type === "keychain" ?
|
|
867
|
+
} else return e.type === "keychain" ? P.broadcast(
|
|
664
868
|
e.from,
|
|
665
869
|
[["transfer_to_vesting", e]],
|
|
666
870
|
"Active"
|
|
667
|
-
) :
|
|
871
|
+
) : k.sendOperation(
|
|
668
872
|
["transfer_to_vesting", e],
|
|
669
873
|
{ callback: `https://ecency.com/@${e.from}/wallet` },
|
|
670
874
|
() => {
|
|
671
875
|
}
|
|
672
876
|
);
|
|
673
877
|
}
|
|
674
|
-
async function
|
|
878
|
+
async function Re(e) {
|
|
675
879
|
if (e.type === "key" && "key" in e) {
|
|
676
880
|
const { key: t, type: n, ...r } = e;
|
|
677
|
-
return
|
|
881
|
+
return p.hiveClient.broadcast.sendOperations(
|
|
678
882
|
[["delegate_vesting_shares", r]],
|
|
679
883
|
t
|
|
680
884
|
);
|
|
681
|
-
} else return e.type === "keychain" ?
|
|
885
|
+
} else return e.type === "keychain" ? P.broadcast(
|
|
682
886
|
e.from,
|
|
683
887
|
[["delegate_vesting_shares", e]],
|
|
684
888
|
"Active"
|
|
685
|
-
) :
|
|
889
|
+
) : k.sendOperation(
|
|
686
890
|
["delegate_vesting_shares", e],
|
|
687
891
|
{ callback: `https://ecency.com/@${e.from}/wallet` },
|
|
688
892
|
() => {
|
|
689
893
|
}
|
|
690
894
|
);
|
|
691
895
|
}
|
|
692
|
-
async function
|
|
896
|
+
async function je(e) {
|
|
693
897
|
if (e.type === "key" && "key" in e) {
|
|
694
898
|
const { key: t, type: n, ...r } = e;
|
|
695
|
-
return
|
|
899
|
+
return p.hiveClient.broadcast.sendOperations(
|
|
696
900
|
[["withdraw_vesting", r]],
|
|
697
901
|
t
|
|
698
902
|
);
|
|
699
|
-
} else return e.type === "keychain" ?
|
|
903
|
+
} else return e.type === "keychain" ? P.broadcast(
|
|
700
904
|
e.from,
|
|
701
905
|
[["withdraw_vesting", e]],
|
|
702
906
|
"Active"
|
|
703
|
-
) :
|
|
907
|
+
) : k.sendOperation(
|
|
704
908
|
["withdraw_vesting", e],
|
|
705
909
|
{ callback: `https://ecency.com/@${e.from}/wallet` },
|
|
706
910
|
() => {
|
|
707
911
|
}
|
|
708
912
|
);
|
|
709
913
|
}
|
|
710
|
-
async function
|
|
914
|
+
async function Fe(e) {
|
|
711
915
|
if (e.type === "key" && "key" in e) {
|
|
712
916
|
const { key: r, type: s, ...a } = e;
|
|
713
|
-
return
|
|
917
|
+
return p.hiveClient.broadcast.sendOperations(
|
|
714
918
|
[["set_withdraw_vesting_route", a]],
|
|
715
919
|
r
|
|
716
920
|
);
|
|
717
921
|
}
|
|
718
922
|
if (e.type === "keychain") {
|
|
719
923
|
const { type: r, ...s } = e;
|
|
720
|
-
return
|
|
924
|
+
return P.broadcast(
|
|
721
925
|
s.from_account,
|
|
722
926
|
[["set_withdraw_vesting_route", s]],
|
|
723
927
|
"Active"
|
|
724
928
|
);
|
|
725
929
|
}
|
|
726
930
|
const { type: t, ...n } = e;
|
|
727
|
-
return
|
|
931
|
+
return k.sendOperation(
|
|
728
932
|
["set_withdraw_vesting_route", n],
|
|
729
933
|
{ callback: `https://ecency.com/@${n.from_account}/wallet` },
|
|
730
934
|
() => {
|
|
731
935
|
}
|
|
732
936
|
);
|
|
733
937
|
}
|
|
734
|
-
function
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
function ae(e) {
|
|
738
|
-
switch (e) {
|
|
739
|
-
case f.BTC:
|
|
740
|
-
return new me();
|
|
741
|
-
case f.ETH:
|
|
742
|
-
return new pe();
|
|
743
|
-
case f.TRON:
|
|
744
|
-
return new he();
|
|
745
|
-
case f.TON:
|
|
746
|
-
return new ge();
|
|
747
|
-
case f.SOL:
|
|
748
|
-
return new we();
|
|
749
|
-
case f.ATOM:
|
|
750
|
-
return new de();
|
|
751
|
-
case f.APT:
|
|
752
|
-
return new _e();
|
|
753
|
-
default:
|
|
754
|
-
return;
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
function At(e, t) {
|
|
758
|
-
const { data: n } = N(b(e)), r = M();
|
|
759
|
-
return ce(
|
|
938
|
+
function Ct(e, t) {
|
|
939
|
+
const { data: n } = T(q(e)), r = $();
|
|
940
|
+
return le(
|
|
760
941
|
["assets", "hive", "claim-rewards", n == null ? void 0 : n.name],
|
|
761
942
|
e,
|
|
762
943
|
() => {
|
|
@@ -780,16 +961,16 @@ function At(e, t) {
|
|
|
780
961
|
];
|
|
781
962
|
},
|
|
782
963
|
async () => {
|
|
783
|
-
t(), await
|
|
784
|
-
queryKey:
|
|
964
|
+
t(), await ne(1e3), r.invalidateQueries({
|
|
965
|
+
queryKey: q(e).queryKey
|
|
785
966
|
}), r.invalidateQueries({
|
|
786
|
-
queryKey:
|
|
967
|
+
queryKey: ie(e).queryKey
|
|
787
968
|
});
|
|
788
969
|
}
|
|
789
970
|
);
|
|
790
971
|
}
|
|
791
|
-
var
|
|
792
|
-
async function
|
|
972
|
+
var l = /* @__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))(l || {});
|
|
973
|
+
async function Be(e) {
|
|
793
974
|
const t = JSON.stringify({
|
|
794
975
|
to: e.to,
|
|
795
976
|
amount: +e.amount * 1e3,
|
|
@@ -802,10 +983,10 @@ async function Qe(e) {
|
|
|
802
983
|
};
|
|
803
984
|
if (e.type === "key" && "key" in e) {
|
|
804
985
|
const { key: r } = e;
|
|
805
|
-
return
|
|
986
|
+
return p.hiveClient.broadcast.json(n, r);
|
|
806
987
|
} else {
|
|
807
988
|
if (e.type === "keychain")
|
|
808
|
-
return
|
|
989
|
+
return P.customJson(
|
|
809
990
|
e.from,
|
|
810
991
|
e.id,
|
|
811
992
|
"Active",
|
|
@@ -813,8 +994,8 @@ async function Qe(e) {
|
|
|
813
994
|
e.to
|
|
814
995
|
);
|
|
815
996
|
{
|
|
816
|
-
const { amount: r } =
|
|
817
|
-
return
|
|
997
|
+
const { amount: r } = g(e.amount);
|
|
998
|
+
return k.sign(
|
|
818
999
|
"custom_json",
|
|
819
1000
|
{
|
|
820
1001
|
authority: "active",
|
|
@@ -832,7 +1013,7 @@ async function Qe(e) {
|
|
|
832
1013
|
}
|
|
833
1014
|
}
|
|
834
1015
|
}
|
|
835
|
-
const
|
|
1016
|
+
const Le = async (e) => {
|
|
836
1017
|
const t = JSON.stringify({ amount: +e.amount * 1e3 }), n = {
|
|
837
1018
|
id: e.mode === "lock" ? "spkcc_gov_up" : "spkcc_gov_down",
|
|
838
1019
|
json: t,
|
|
@@ -841,10 +1022,10 @@ const De = async (e) => {
|
|
|
841
1022
|
};
|
|
842
1023
|
if (e.type === "key" && "key" in e) {
|
|
843
1024
|
const { key: r } = e;
|
|
844
|
-
return
|
|
1025
|
+
return p.hiveClient.broadcast.json(n, r);
|
|
845
1026
|
} else {
|
|
846
1027
|
if (e.type === "keychain")
|
|
847
|
-
return
|
|
1028
|
+
return P.customJson(
|
|
848
1029
|
e.from,
|
|
849
1030
|
n.id,
|
|
850
1031
|
"Active",
|
|
@@ -852,8 +1033,8 @@ const De = async (e) => {
|
|
|
852
1033
|
e.from
|
|
853
1034
|
);
|
|
854
1035
|
{
|
|
855
|
-
const { amount: r } =
|
|
856
|
-
return
|
|
1036
|
+
const { amount: r } = g(e.amount);
|
|
1037
|
+
return k.sign(
|
|
857
1038
|
"custom_json",
|
|
858
1039
|
{
|
|
859
1040
|
authority: "active",
|
|
@@ -867,7 +1048,7 @@ const De = async (e) => {
|
|
|
867
1048
|
}
|
|
868
1049
|
}
|
|
869
1050
|
};
|
|
870
|
-
async function
|
|
1051
|
+
async function Me(e) {
|
|
871
1052
|
const t = JSON.stringify({ amount: +e.amount * 1e3 }), n = {
|
|
872
1053
|
id: `spkcc_power_${e.mode}`,
|
|
873
1054
|
json: t,
|
|
@@ -876,10 +1057,10 @@ async function Ce(e) {
|
|
|
876
1057
|
};
|
|
877
1058
|
if (e.type === "key" && "key" in e) {
|
|
878
1059
|
const { key: r } = e;
|
|
879
|
-
return
|
|
1060
|
+
return p.hiveClient.broadcast.json(n, r);
|
|
880
1061
|
} else {
|
|
881
1062
|
if (e.type === "keychain")
|
|
882
|
-
return
|
|
1063
|
+
return P.customJson(
|
|
883
1064
|
e.from,
|
|
884
1065
|
`spkcc_power_${e.mode}`,
|
|
885
1066
|
"Active",
|
|
@@ -887,8 +1068,8 @@ async function Ce(e) {
|
|
|
887
1068
|
""
|
|
888
1069
|
);
|
|
889
1070
|
{
|
|
890
|
-
const { amount: r } =
|
|
891
|
-
return
|
|
1071
|
+
const { amount: r } = g(e.amount);
|
|
1072
|
+
return k.sign(
|
|
892
1073
|
"custom_json",
|
|
893
1074
|
{
|
|
894
1075
|
authority: "active",
|
|
@@ -902,13 +1083,13 @@ async function Ce(e) {
|
|
|
902
1083
|
}
|
|
903
1084
|
}
|
|
904
1085
|
}
|
|
905
|
-
function
|
|
906
|
-
return
|
|
1086
|
+
function H() {
|
|
1087
|
+
return v({
|
|
907
1088
|
queryKey: ["assets", "spk", "markets"],
|
|
908
1089
|
staleTime: 6e4,
|
|
909
1090
|
refetchInterval: 9e4,
|
|
910
1091
|
queryFn: async () => {
|
|
911
|
-
const t = await (await fetch(`${
|
|
1092
|
+
const t = await (await fetch(`${p.spkNode}/markets`)).json();
|
|
912
1093
|
return {
|
|
913
1094
|
list: Object.entries(t.markets.node).map(([n, r]) => ({
|
|
914
1095
|
name: n,
|
|
@@ -919,33 +1100,33 @@ function Q() {
|
|
|
919
1100
|
}
|
|
920
1101
|
});
|
|
921
1102
|
}
|
|
922
|
-
function
|
|
923
|
-
return
|
|
1103
|
+
function E(e) {
|
|
1104
|
+
return v({
|
|
924
1105
|
queryKey: ["assets", "spk", "wallet", e],
|
|
925
|
-
queryFn: async () => (await fetch(
|
|
1106
|
+
queryFn: async () => (await fetch(p.spkNode + `/@${e}`)).json(),
|
|
926
1107
|
enabled: !!e,
|
|
927
1108
|
staleTime: 6e4,
|
|
928
1109
|
refetchInterval: 9e4
|
|
929
1110
|
});
|
|
930
1111
|
}
|
|
931
|
-
function
|
|
1112
|
+
function X(e) {
|
|
932
1113
|
return e.toFixed(3);
|
|
933
1114
|
}
|
|
934
|
-
function
|
|
935
|
-
return
|
|
1115
|
+
function $e(e) {
|
|
1116
|
+
return v({
|
|
936
1117
|
queryKey: ["assets", "larynx", "general-info", e],
|
|
937
1118
|
staleTime: 6e4,
|
|
938
1119
|
refetchInterval: 9e4,
|
|
939
1120
|
queryFn: async () => {
|
|
940
|
-
await
|
|
941
|
-
|
|
1121
|
+
await c().prefetchQuery(E(e)), await c().prefetchQuery(H()), await c().prefetchQuery(
|
|
1122
|
+
O(e)
|
|
942
1123
|
);
|
|
943
|
-
const t =
|
|
944
|
-
|
|
945
|
-
), n =
|
|
946
|
-
|
|
947
|
-
), r =
|
|
948
|
-
|
|
1124
|
+
const t = c().getQueryData(
|
|
1125
|
+
E(e).queryKey
|
|
1126
|
+
), n = c().getQueryData(
|
|
1127
|
+
H().queryKey
|
|
1128
|
+
), r = c().getQueryData(
|
|
1129
|
+
O(e).queryKey
|
|
949
1130
|
);
|
|
950
1131
|
if (!t || !n)
|
|
951
1132
|
return {
|
|
@@ -954,9 +1135,9 @@ function Ee(e) {
|
|
|
954
1135
|
price: 1,
|
|
955
1136
|
accountBalance: 0
|
|
956
1137
|
};
|
|
957
|
-
const s = +
|
|
1138
|
+
const s = +X(
|
|
958
1139
|
t.balance / 1e3 * +t.tick * ((r == null ? void 0 : r.price) ?? 0)
|
|
959
|
-
), a = +
|
|
1140
|
+
), a = +X(t.balance / 1e3);
|
|
960
1141
|
return {
|
|
961
1142
|
name: "LARYNX",
|
|
962
1143
|
layer: "SPK",
|
|
@@ -967,24 +1148,24 @@ function Ee(e) {
|
|
|
967
1148
|
}
|
|
968
1149
|
});
|
|
969
1150
|
}
|
|
970
|
-
function
|
|
1151
|
+
function F(e) {
|
|
971
1152
|
return e.toFixed(3);
|
|
972
1153
|
}
|
|
973
|
-
function
|
|
974
|
-
return
|
|
1154
|
+
function Je(e) {
|
|
1155
|
+
return v({
|
|
975
1156
|
queryKey: ["assets", "spk", "general-info", e],
|
|
976
1157
|
staleTime: 6e4,
|
|
977
1158
|
refetchInterval: 9e4,
|
|
978
1159
|
queryFn: async () => {
|
|
979
|
-
await
|
|
980
|
-
|
|
1160
|
+
await c().prefetchQuery(E(e)), await c().prefetchQuery(H()), await c().prefetchQuery(
|
|
1161
|
+
O(e)
|
|
981
1162
|
);
|
|
982
|
-
const t =
|
|
983
|
-
|
|
984
|
-
), n =
|
|
985
|
-
|
|
986
|
-
), r =
|
|
987
|
-
|
|
1163
|
+
const t = c().getQueryData(
|
|
1164
|
+
E(e).queryKey
|
|
1165
|
+
), n = c().getQueryData(
|
|
1166
|
+
H().queryKey
|
|
1167
|
+
), r = c().getQueryData(
|
|
1168
|
+
O(e).queryKey
|
|
988
1169
|
);
|
|
989
1170
|
if (!t || !n)
|
|
990
1171
|
return {
|
|
@@ -993,17 +1174,17 @@ function Re(e) {
|
|
|
993
1174
|
price: 1,
|
|
994
1175
|
accountBalance: 0
|
|
995
1176
|
};
|
|
996
|
-
const s = +
|
|
1177
|
+
const s = +F(
|
|
997
1178
|
(t.gov + t.spk) / 1e3 * +t.tick * ((r == null ? void 0 : r.price) ?? 0)
|
|
998
|
-
), a = +
|
|
999
|
-
(t.spk +
|
|
1179
|
+
), a = +F(
|
|
1180
|
+
(t.spk + Qe(
|
|
1000
1181
|
t,
|
|
1001
1182
|
n.raw.stats || {
|
|
1002
1183
|
spk_rate_lgov: "0.001",
|
|
1003
|
-
spk_rate_lpow:
|
|
1184
|
+
spk_rate_lpow: F(
|
|
1004
1185
|
parseFloat(n.raw.stats.spk_rate_lpow) * 100
|
|
1005
1186
|
),
|
|
1006
|
-
spk_rate_ldel:
|
|
1187
|
+
spk_rate_ldel: F(
|
|
1007
1188
|
parseFloat(n.raw.stats.spk_rate_ldel) * 100
|
|
1008
1189
|
)
|
|
1009
1190
|
}
|
|
@@ -1018,25 +1199,25 @@ function Re(e) {
|
|
|
1018
1199
|
}
|
|
1019
1200
|
});
|
|
1020
1201
|
}
|
|
1021
|
-
function
|
|
1202
|
+
function B(e) {
|
|
1022
1203
|
return e.toFixed(3);
|
|
1023
1204
|
}
|
|
1024
|
-
function
|
|
1025
|
-
return
|
|
1205
|
+
function Ue(e) {
|
|
1206
|
+
return v({
|
|
1026
1207
|
queryKey: ["assets", "larynx-power", "general-info", e],
|
|
1027
1208
|
staleTime: 6e4,
|
|
1028
1209
|
refetchInterval: 9e4,
|
|
1029
1210
|
queryFn: async () => {
|
|
1030
|
-
var o,
|
|
1031
|
-
await
|
|
1032
|
-
|
|
1211
|
+
var o, i;
|
|
1212
|
+
await c().prefetchQuery(E(e)), await c().prefetchQuery(H()), await c().prefetchQuery(
|
|
1213
|
+
O(e)
|
|
1033
1214
|
);
|
|
1034
|
-
const t =
|
|
1035
|
-
|
|
1036
|
-
), n =
|
|
1037
|
-
|
|
1038
|
-
), r =
|
|
1039
|
-
|
|
1215
|
+
const t = c().getQueryData(
|
|
1216
|
+
E(e).queryKey
|
|
1217
|
+
), n = c().getQueryData(
|
|
1218
|
+
H().queryKey
|
|
1219
|
+
), r = c().getQueryData(
|
|
1220
|
+
O(e).queryKey
|
|
1040
1221
|
);
|
|
1041
1222
|
if (!t || !n)
|
|
1042
1223
|
return {
|
|
@@ -1045,9 +1226,9 @@ function Ie(e) {
|
|
|
1045
1226
|
price: 1,
|
|
1046
1227
|
accountBalance: 0
|
|
1047
1228
|
};
|
|
1048
|
-
const s = +
|
|
1229
|
+
const s = +B(
|
|
1049
1230
|
t.poweredUp / 1e3 * +t.tick * ((r == null ? void 0 : r.price) ?? 0)
|
|
1050
|
-
), a = +
|
|
1231
|
+
), a = +B(t.poweredUp / 1e3);
|
|
1051
1232
|
return {
|
|
1052
1233
|
name: "LP",
|
|
1053
1234
|
title: "LARYNX Power",
|
|
@@ -1057,11 +1238,11 @@ function Ie(e) {
|
|
|
1057
1238
|
parts: [
|
|
1058
1239
|
{
|
|
1059
1240
|
name: "delegating",
|
|
1060
|
-
balance: (o = t.granting) != null && o.t ? +
|
|
1241
|
+
balance: (o = t.granting) != null && o.t ? +B(t.granting.t / 1e3) : 0
|
|
1061
1242
|
},
|
|
1062
1243
|
{
|
|
1063
1244
|
name: "recieved",
|
|
1064
|
-
balance: (
|
|
1245
|
+
balance: (i = t.granted) != null && i.t ? +B(t.granted.t / 1e3) : 0
|
|
1065
1246
|
}
|
|
1066
1247
|
]
|
|
1067
1248
|
};
|
|
@@ -1069,12 +1250,12 @@ function Ie(e) {
|
|
|
1069
1250
|
});
|
|
1070
1251
|
}
|
|
1071
1252
|
function L(e) {
|
|
1072
|
-
return
|
|
1253
|
+
return v({
|
|
1073
1254
|
queryKey: ["assets", "hive-engine", "metadata-list", e],
|
|
1074
1255
|
staleTime: 6e4,
|
|
1075
1256
|
refetchInterval: 9e4,
|
|
1076
1257
|
queryFn: async () => (await (await fetch(
|
|
1077
|
-
`${
|
|
1258
|
+
`${p.privateApiHost}/private-api/engine-api`,
|
|
1078
1259
|
{
|
|
1079
1260
|
method: "POST",
|
|
1080
1261
|
body: JSON.stringify({
|
|
@@ -1094,7 +1275,7 @@ function L(e) {
|
|
|
1094
1275
|
)).json()).result
|
|
1095
1276
|
});
|
|
1096
1277
|
}
|
|
1097
|
-
const
|
|
1278
|
+
const M = [
|
|
1098
1279
|
"LEO",
|
|
1099
1280
|
"ARCHON",
|
|
1100
1281
|
"WAIV",
|
|
@@ -1120,13 +1301,13 @@ const B = [
|
|
|
1120
1301
|
"SPORTS",
|
|
1121
1302
|
"CURE"
|
|
1122
1303
|
];
|
|
1123
|
-
function
|
|
1124
|
-
return
|
|
1304
|
+
function G(e) {
|
|
1305
|
+
return v({
|
|
1125
1306
|
queryKey: ["assets", "hive-engine", "balances", e],
|
|
1126
1307
|
staleTime: 6e4,
|
|
1127
1308
|
refetchInterval: 9e4,
|
|
1128
1309
|
queryFn: async () => (await (await fetch(
|
|
1129
|
-
`${
|
|
1310
|
+
`${p.privateApiHost}/private-api/engine-api`,
|
|
1130
1311
|
{
|
|
1131
1312
|
method: "POST",
|
|
1132
1313
|
body: JSON.stringify({
|
|
@@ -1146,13 +1327,13 @@ function U(e) {
|
|
|
1146
1327
|
)).json()).result
|
|
1147
1328
|
});
|
|
1148
1329
|
}
|
|
1149
|
-
function
|
|
1150
|
-
return
|
|
1330
|
+
function Ve() {
|
|
1331
|
+
return v({
|
|
1151
1332
|
queryKey: ["assets", "hive-engine", "markets"],
|
|
1152
1333
|
staleTime: 6e4,
|
|
1153
1334
|
refetchInterval: 9e4,
|
|
1154
1335
|
queryFn: async () => (await (await fetch(
|
|
1155
|
-
`${
|
|
1336
|
+
`${p.privateApiHost}/private-api/engine-api`,
|
|
1156
1337
|
{
|
|
1157
1338
|
method: "POST",
|
|
1158
1339
|
body: JSON.stringify({
|
|
@@ -1170,8 +1351,8 @@ function je() {
|
|
|
1170
1351
|
)).json()).result
|
|
1171
1352
|
});
|
|
1172
1353
|
}
|
|
1173
|
-
function
|
|
1174
|
-
return
|
|
1354
|
+
function xe(e, t) {
|
|
1355
|
+
return v({
|
|
1175
1356
|
queryKey: ["assets", "hive-engine", t, "general-info", e],
|
|
1176
1357
|
enabled: !!t && !!e,
|
|
1177
1358
|
staleTime: 6e4,
|
|
@@ -1181,29 +1362,29 @@ function Fe(e, t) {
|
|
|
1181
1362
|
throw new Error(
|
|
1182
1363
|
"[SDK][Wallets] – hive engine token or username missed"
|
|
1183
1364
|
);
|
|
1184
|
-
const n =
|
|
1185
|
-
await
|
|
1186
|
-
const r =
|
|
1365
|
+
const n = O(e);
|
|
1366
|
+
await c().prefetchQuery(n);
|
|
1367
|
+
const r = c().getQueryData(
|
|
1187
1368
|
n.queryKey
|
|
1188
|
-
), s = L(
|
|
1189
|
-
await
|
|
1190
|
-
const a =
|
|
1191
|
-
await
|
|
1192
|
-
const
|
|
1193
|
-
await
|
|
1194
|
-
const
|
|
1369
|
+
), s = L(M);
|
|
1370
|
+
await c().prefetchQuery(s);
|
|
1371
|
+
const a = c().getQueryData(s.queryKey), o = G(e);
|
|
1372
|
+
await c().prefetchQuery(o);
|
|
1373
|
+
const i = c().getQueryData(o.queryKey), f = Ve();
|
|
1374
|
+
await c().prefetchQuery(f);
|
|
1375
|
+
const u = c().getQueryData(f.queryKey), m = a == null ? void 0 : a.find((Q) => Q.symbol === t), h = i == null ? void 0 : i.find((Q) => Q.symbol === t), w = u == null ? void 0 : u.find((Q) => Q.symbol === t), b = +((w == null ? void 0 : w.lastPrice) ?? "0");
|
|
1195
1376
|
return {
|
|
1196
1377
|
name: t,
|
|
1197
|
-
title: (
|
|
1198
|
-
price:
|
|
1199
|
-
accountBalance: parseFloat((
|
|
1378
|
+
title: (m == null ? void 0 : m.name) ?? "",
|
|
1379
|
+
price: b === 0 ? 0 : Number(b * ((r == null ? void 0 : r.price) ?? 0)),
|
|
1380
|
+
accountBalance: parseFloat((h == null ? void 0 : h.balance) ?? "0"),
|
|
1200
1381
|
layer: "ENGINE"
|
|
1201
1382
|
};
|
|
1202
1383
|
}
|
|
1203
1384
|
});
|
|
1204
1385
|
}
|
|
1205
|
-
function
|
|
1206
|
-
return
|
|
1386
|
+
function It(e, t, n = 20) {
|
|
1387
|
+
return I({
|
|
1207
1388
|
queryKey: ["assets", "hive-engine", t, "transactions", e],
|
|
1208
1389
|
enabled: !!t && !!e,
|
|
1209
1390
|
initialPageParam: 0,
|
|
@@ -1214,7 +1395,7 @@ function Nt(e, t, n = 20) {
|
|
|
1214
1395
|
"[SDK][Wallets] – hive engine token or username missed"
|
|
1215
1396
|
);
|
|
1216
1397
|
const s = new URL(
|
|
1217
|
-
`${
|
|
1398
|
+
`${p.privateApiHost}/private-api/engine-account-history`
|
|
1218
1399
|
);
|
|
1219
1400
|
return s.searchParams.set("account", e), s.searchParams.set("symbol", t), s.searchParams.set("limit", n.toString()), s.searchParams.set("offset", r.toString()), await (await fetch(s, {
|
|
1220
1401
|
method: "GET",
|
|
@@ -1223,14 +1404,14 @@ function Nt(e, t, n = 20) {
|
|
|
1223
1404
|
}
|
|
1224
1405
|
});
|
|
1225
1406
|
}
|
|
1226
|
-
function
|
|
1227
|
-
return
|
|
1407
|
+
function Rt(e, t = "daily") {
|
|
1408
|
+
return v({
|
|
1228
1409
|
queryKey: ["assets", "hive-engine", e],
|
|
1229
1410
|
staleTime: 6e4,
|
|
1230
1411
|
refetchInterval: 9e4,
|
|
1231
1412
|
queryFn: async () => {
|
|
1232
1413
|
const n = new URL(
|
|
1233
|
-
`${
|
|
1414
|
+
`${p.privateApiHost}/private-api/engine-chart-api`
|
|
1234
1415
|
);
|
|
1235
1416
|
return n.searchParams.set("symbol", e), n.searchParams.set("interval", t), await (await fetch(n, {
|
|
1236
1417
|
headers: { "Content-type": "application/json" }
|
|
@@ -1238,8 +1419,8 @@ function Ht(e, t = "daily") {
|
|
|
1238
1419
|
}
|
|
1239
1420
|
});
|
|
1240
1421
|
}
|
|
1241
|
-
async function
|
|
1242
|
-
const n =
|
|
1422
|
+
async function Ge(e) {
|
|
1423
|
+
const n = g(e.amount).amount.toString();
|
|
1243
1424
|
if (e.type === "key" && "key" in e) {
|
|
1244
1425
|
const { key: r, type: s, ...a } = e, o = {
|
|
1245
1426
|
id: "ssc-mainnet-hive",
|
|
@@ -1255,7 +1436,7 @@ async function Le(e) {
|
|
|
1255
1436
|
required_auths: [a.from],
|
|
1256
1437
|
required_posting_auths: []
|
|
1257
1438
|
};
|
|
1258
|
-
return
|
|
1439
|
+
return p.hiveClient.broadcast.json(o, r);
|
|
1259
1440
|
} else return e.type === "keychain" ? new Promise(
|
|
1260
1441
|
(r, s) => {
|
|
1261
1442
|
var a;
|
|
@@ -1278,7 +1459,7 @@ async function Le(e) {
|
|
|
1278
1459
|
}
|
|
1279
1460
|
);
|
|
1280
1461
|
}
|
|
1281
|
-
) :
|
|
1462
|
+
) : k.sendOperation(
|
|
1282
1463
|
[
|
|
1283
1464
|
"custom_json",
|
|
1284
1465
|
{
|
|
@@ -1301,8 +1482,8 @@ async function Le(e) {
|
|
|
1301
1482
|
}
|
|
1302
1483
|
);
|
|
1303
1484
|
}
|
|
1304
|
-
async function
|
|
1305
|
-
const n =
|
|
1485
|
+
async function We(e) {
|
|
1486
|
+
const n = g(e.amount).amount.toString();
|
|
1306
1487
|
if (e.type === "key" && "key" in e) {
|
|
1307
1488
|
const { key: r, type: s, ...a } = e, o = {
|
|
1308
1489
|
id: "ssc-mainnet-hive",
|
|
@@ -1318,7 +1499,7 @@ async function Be(e) {
|
|
|
1318
1499
|
required_auths: [a.from],
|
|
1319
1500
|
required_posting_auths: []
|
|
1320
1501
|
};
|
|
1321
|
-
return
|
|
1502
|
+
return p.hiveClient.broadcast.json(o, r);
|
|
1322
1503
|
} else return e.type === "keychain" ? new Promise(
|
|
1323
1504
|
(r, s) => {
|
|
1324
1505
|
var a;
|
|
@@ -1341,7 +1522,7 @@ async function Be(e) {
|
|
|
1341
1522
|
}
|
|
1342
1523
|
);
|
|
1343
1524
|
}
|
|
1344
|
-
) :
|
|
1525
|
+
) : k.sendOperation(
|
|
1345
1526
|
[
|
|
1346
1527
|
"custom_json",
|
|
1347
1528
|
{
|
|
@@ -1364,8 +1545,8 @@ async function Be(e) {
|
|
|
1364
1545
|
}
|
|
1365
1546
|
);
|
|
1366
1547
|
}
|
|
1367
|
-
async function
|
|
1368
|
-
const n =
|
|
1548
|
+
async function Ye(e) {
|
|
1549
|
+
const n = g(e.amount).amount.toString();
|
|
1369
1550
|
if (e.type === "key" && "key" in e) {
|
|
1370
1551
|
const { key: r, type: s, ...a } = e, o = {
|
|
1371
1552
|
id: "ssc-mainnet-hive",
|
|
@@ -1381,7 +1562,7 @@ async function Me(e) {
|
|
|
1381
1562
|
required_auths: [a.from],
|
|
1382
1563
|
required_posting_auths: []
|
|
1383
1564
|
};
|
|
1384
|
-
return
|
|
1565
|
+
return p.hiveClient.broadcast.json(o, r);
|
|
1385
1566
|
} else return e.type === "keychain" ? new Promise(
|
|
1386
1567
|
(r, s) => {
|
|
1387
1568
|
var a;
|
|
@@ -1404,7 +1585,7 @@ async function Me(e) {
|
|
|
1404
1585
|
}
|
|
1405
1586
|
);
|
|
1406
1587
|
}
|
|
1407
|
-
) :
|
|
1588
|
+
) : k.sendOperation(
|
|
1408
1589
|
[
|
|
1409
1590
|
"custom_json",
|
|
1410
1591
|
{
|
|
@@ -1427,8 +1608,8 @@ async function Me(e) {
|
|
|
1427
1608
|
}
|
|
1428
1609
|
);
|
|
1429
1610
|
}
|
|
1430
|
-
async function
|
|
1431
|
-
const n =
|
|
1611
|
+
async function Xe(e) {
|
|
1612
|
+
const n = g(e.amount).amount.toString();
|
|
1432
1613
|
if (e.type === "key" && "key" in e) {
|
|
1433
1614
|
const { key: r, type: s, ...a } = e, o = {
|
|
1434
1615
|
id: "ssc-mainnet-hive",
|
|
@@ -1444,7 +1625,7 @@ async function $e(e) {
|
|
|
1444
1625
|
required_auths: [a.from],
|
|
1445
1626
|
required_posting_auths: []
|
|
1446
1627
|
};
|
|
1447
|
-
return
|
|
1628
|
+
return p.hiveClient.broadcast.json(o, r);
|
|
1448
1629
|
} else return e.type === "keychain" ? new Promise(
|
|
1449
1630
|
(r, s) => {
|
|
1450
1631
|
var a;
|
|
@@ -1467,7 +1648,7 @@ async function $e(e) {
|
|
|
1467
1648
|
}
|
|
1468
1649
|
);
|
|
1469
1650
|
}
|
|
1470
|
-
) :
|
|
1651
|
+
) : k.sendOperation(
|
|
1471
1652
|
[
|
|
1472
1653
|
"custom_json",
|
|
1473
1654
|
{
|
|
@@ -1490,8 +1671,8 @@ async function $e(e) {
|
|
|
1490
1671
|
}
|
|
1491
1672
|
);
|
|
1492
1673
|
}
|
|
1493
|
-
async function
|
|
1494
|
-
const n =
|
|
1674
|
+
async function ze(e) {
|
|
1675
|
+
const n = g(e.amount).amount.toString();
|
|
1495
1676
|
if (e.type === "key" && "key" in e) {
|
|
1496
1677
|
const { key: r, type: s, ...a } = e, o = {
|
|
1497
1678
|
id: "ssc-mainnet-hive",
|
|
@@ -1508,7 +1689,7 @@ async function Je(e) {
|
|
|
1508
1689
|
required_auths: [a.from],
|
|
1509
1690
|
required_posting_auths: []
|
|
1510
1691
|
};
|
|
1511
|
-
return
|
|
1692
|
+
return p.hiveClient.broadcast.json(o, r);
|
|
1512
1693
|
} else return e.type === "keychain" ? new Promise(
|
|
1513
1694
|
(r, s) => {
|
|
1514
1695
|
var a;
|
|
@@ -1532,7 +1713,7 @@ async function Je(e) {
|
|
|
1532
1713
|
}
|
|
1533
1714
|
);
|
|
1534
1715
|
}
|
|
1535
|
-
) :
|
|
1716
|
+
) : k.sendOperation(
|
|
1536
1717
|
[
|
|
1537
1718
|
"custom_json",
|
|
1538
1719
|
{
|
|
@@ -1556,8 +1737,8 @@ async function Je(e) {
|
|
|
1556
1737
|
}
|
|
1557
1738
|
);
|
|
1558
1739
|
}
|
|
1559
|
-
function
|
|
1560
|
-
return
|
|
1740
|
+
function U(e) {
|
|
1741
|
+
return v({
|
|
1561
1742
|
queryKey: ["assets", "points", e],
|
|
1562
1743
|
queryFn: async () => {
|
|
1563
1744
|
if (!e)
|
|
@@ -1565,7 +1746,7 @@ function J(e) {
|
|
|
1565
1746
|
"[SDK][Wallets][Assets][Points][Query] – username wasn`t provided"
|
|
1566
1747
|
);
|
|
1567
1748
|
const n = await (await fetch(
|
|
1568
|
-
|
|
1749
|
+
p.privateApiHost + "/private-api/points",
|
|
1569
1750
|
{
|
|
1570
1751
|
method: "POST",
|
|
1571
1752
|
headers: {
|
|
@@ -1585,15 +1766,15 @@ function J(e) {
|
|
|
1585
1766
|
enabled: !!e
|
|
1586
1767
|
});
|
|
1587
1768
|
}
|
|
1588
|
-
function
|
|
1589
|
-
return
|
|
1769
|
+
function Ze(e) {
|
|
1770
|
+
return v({
|
|
1590
1771
|
queryKey: ["assets", "points", "general-info", e],
|
|
1591
1772
|
staleTime: 6e4,
|
|
1592
1773
|
refetchInterval: 9e4,
|
|
1593
1774
|
queryFn: async () => {
|
|
1594
|
-
await
|
|
1595
|
-
const t =
|
|
1596
|
-
|
|
1775
|
+
await c().prefetchQuery(U(e));
|
|
1776
|
+
const t = c().getQueryData(
|
|
1777
|
+
U(e).queryKey
|
|
1597
1778
|
);
|
|
1598
1779
|
return {
|
|
1599
1780
|
name: "POINTS",
|
|
@@ -1604,11 +1785,11 @@ function xe(e) {
|
|
|
1604
1785
|
}
|
|
1605
1786
|
});
|
|
1606
1787
|
}
|
|
1607
|
-
function
|
|
1608
|
-
return
|
|
1788
|
+
function jt(e, t) {
|
|
1789
|
+
return v({
|
|
1609
1790
|
queryKey: ["assets", "points", "transactions", e, t],
|
|
1610
1791
|
queryFn: async () => (await (await fetch(
|
|
1611
|
-
`${
|
|
1792
|
+
`${p.privateApiHost}/private-api/point-list`,
|
|
1612
1793
|
{
|
|
1613
1794
|
method: "POST",
|
|
1614
1795
|
body: JSON.stringify({
|
|
@@ -1616,7 +1797,7 @@ function Kt(e, t) {
|
|
|
1616
1797
|
type: t ?? 0
|
|
1617
1798
|
})
|
|
1618
1799
|
}
|
|
1619
|
-
)).json()).map(({ created: s, type: a, amount: o, id:
|
|
1800
|
+
)).json()).map(({ created: s, type: a, amount: o, id: i }) => ({
|
|
1620
1801
|
created: new Date(s),
|
|
1621
1802
|
type: a,
|
|
1622
1803
|
results: [
|
|
@@ -1625,33 +1806,33 @@ function Kt(e, t) {
|
|
|
1625
1806
|
asset: "POINTS"
|
|
1626
1807
|
}
|
|
1627
1808
|
],
|
|
1628
|
-
id:
|
|
1809
|
+
id: i
|
|
1629
1810
|
}))
|
|
1630
1811
|
});
|
|
1631
1812
|
}
|
|
1632
|
-
function
|
|
1633
|
-
const { mutateAsync: r } =
|
|
1813
|
+
function Ft(e, t, n) {
|
|
1814
|
+
const { mutateAsync: r } = Z.useRecordActivity(
|
|
1634
1815
|
e,
|
|
1635
1816
|
"points-claimed"
|
|
1636
1817
|
);
|
|
1637
|
-
return
|
|
1818
|
+
return K({
|
|
1638
1819
|
mutationFn: async () => {
|
|
1639
1820
|
if (!e)
|
|
1640
1821
|
throw new Error(
|
|
1641
1822
|
"[SDK][Wallets][Assets][Points][Claim] – username wasn`t provided"
|
|
1642
1823
|
);
|
|
1643
|
-
return fetch(
|
|
1824
|
+
return fetch(p.privateApiHost + "/private-api/points-claim", {
|
|
1644
1825
|
method: "POST",
|
|
1645
1826
|
headers: {
|
|
1646
1827
|
"Content-Type": "application/json"
|
|
1647
1828
|
},
|
|
1648
|
-
body: JSON.stringify({ code:
|
|
1829
|
+
body: JSON.stringify({ code: ye(e) })
|
|
1649
1830
|
});
|
|
1650
1831
|
},
|
|
1651
1832
|
onError: n,
|
|
1652
1833
|
onSuccess: () => {
|
|
1653
|
-
r(),
|
|
1654
|
-
|
|
1834
|
+
r(), p.queryClient.setQueryData(
|
|
1835
|
+
U(e).queryKey,
|
|
1655
1836
|
(s) => s && {
|
|
1656
1837
|
points: (parseFloat(s.points) + parseFloat(s.uPoints)).toFixed(3),
|
|
1657
1838
|
uPoints: "0"
|
|
@@ -1660,7 +1841,7 @@ function Qt(e, t, n) {
|
|
|
1660
1841
|
}
|
|
1661
1842
|
});
|
|
1662
1843
|
}
|
|
1663
|
-
async function
|
|
1844
|
+
async function et({
|
|
1664
1845
|
from: e,
|
|
1665
1846
|
to: t,
|
|
1666
1847
|
amount: n,
|
|
@@ -1683,98 +1864,98 @@ async function Ue({
|
|
|
1683
1864
|
}
|
|
1684
1865
|
];
|
|
1685
1866
|
if (s === "key" && "key" in a) {
|
|
1686
|
-
const { key:
|
|
1687
|
-
return
|
|
1867
|
+
const { key: i } = a;
|
|
1868
|
+
return p.hiveClient.broadcast.sendOperations([o], i);
|
|
1688
1869
|
}
|
|
1689
|
-
return s === "keychain" ?
|
|
1870
|
+
return s === "keychain" ? P.broadcast(e, [o], "Active") : k.sendOperation(
|
|
1690
1871
|
o,
|
|
1691
1872
|
{ callback: `https://ecency.com/@${e}/wallet` },
|
|
1692
1873
|
() => {
|
|
1693
1874
|
}
|
|
1694
1875
|
);
|
|
1695
1876
|
}
|
|
1696
|
-
var
|
|
1697
|
-
function
|
|
1698
|
-
return
|
|
1877
|
+
var tt = /* @__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))(tt || {});
|
|
1878
|
+
function Bt(e) {
|
|
1879
|
+
return v({
|
|
1699
1880
|
queryKey: ["ecency-wallets", "all-tokens-list", e],
|
|
1700
1881
|
queryFn: async () => {
|
|
1701
|
-
await
|
|
1702
|
-
L(
|
|
1882
|
+
await c().prefetchQuery(
|
|
1883
|
+
L(M)
|
|
1703
1884
|
);
|
|
1704
|
-
const t =
|
|
1885
|
+
const t = c().getQueryData(L(M).queryKey);
|
|
1705
1886
|
return {
|
|
1706
1887
|
basic: [
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1888
|
+
_.Points,
|
|
1889
|
+
_.Hive,
|
|
1890
|
+
_.HivePower,
|
|
1891
|
+
_.HiveDollar
|
|
1711
1892
|
].filter((n) => n.toLowerCase().includes(e.toLowerCase())),
|
|
1712
|
-
external: Object.values(
|
|
1893
|
+
external: Object.values(y).filter(
|
|
1713
1894
|
(n) => n.toLowerCase().includes(e.toLowerCase())
|
|
1714
1895
|
),
|
|
1715
|
-
spk: [
|
|
1896
|
+
spk: [_.Spk, "LARYNX", "LP"],
|
|
1716
1897
|
layer2: t
|
|
1717
1898
|
};
|
|
1718
1899
|
}
|
|
1719
1900
|
});
|
|
1720
1901
|
}
|
|
1721
|
-
function
|
|
1722
|
-
return
|
|
1902
|
+
function nt(e) {
|
|
1903
|
+
return v({
|
|
1723
1904
|
queryKey: ["ecency-wallets", "list", e],
|
|
1724
1905
|
enabled: !!e,
|
|
1725
1906
|
queryFn: async () => {
|
|
1726
1907
|
var r;
|
|
1727
|
-
const t =
|
|
1728
|
-
await
|
|
1908
|
+
const t = q(e);
|
|
1909
|
+
await c().fetchQuery({
|
|
1729
1910
|
queryKey: t.queryKey
|
|
1730
1911
|
});
|
|
1731
|
-
const n =
|
|
1912
|
+
const n = c().getQueryData(
|
|
1732
1913
|
t.queryKey
|
|
1733
1914
|
);
|
|
1734
1915
|
if (((r = n == null ? void 0 : n.profile) == null ? void 0 : r.tokens) instanceof Array) {
|
|
1735
1916
|
const s = [
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1917
|
+
_.Points,
|
|
1918
|
+
_.Hive,
|
|
1919
|
+
_.HivePower,
|
|
1920
|
+
_.HiveDollar,
|
|
1740
1921
|
...n.profile.tokens.map((a) => a.symbol)
|
|
1741
1922
|
];
|
|
1742
1923
|
return Array.from(new Set(s).values());
|
|
1743
1924
|
}
|
|
1744
1925
|
return [
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1926
|
+
_.Points,
|
|
1927
|
+
_.Hive,
|
|
1928
|
+
_.HivePower,
|
|
1929
|
+
_.HiveDollar,
|
|
1930
|
+
_.Spk
|
|
1750
1931
|
];
|
|
1751
1932
|
}
|
|
1752
1933
|
});
|
|
1753
1934
|
}
|
|
1754
|
-
function
|
|
1755
|
-
const r = async (s) => (n.refetch ? await
|
|
1935
|
+
function rt(e, t, n = { refetch: !1 }) {
|
|
1936
|
+
const r = async (s) => (n.refetch ? await c().fetchQuery(s) : await c().prefetchQuery(s), c().getQueryData(
|
|
1756
1937
|
s.queryKey
|
|
1757
1938
|
));
|
|
1758
|
-
return
|
|
1939
|
+
return v({
|
|
1759
1940
|
queryKey: ["ecency-wallets", "asset-info", e, t],
|
|
1760
1941
|
queryFn: async () => {
|
|
1761
1942
|
if (t === "HIVE")
|
|
1762
|
-
return r(
|
|
1943
|
+
return r(O(e));
|
|
1763
1944
|
if (t === "HP")
|
|
1764
|
-
return r(
|
|
1945
|
+
return r(ie(e));
|
|
1765
1946
|
if (t === "HBD")
|
|
1766
|
-
return r(
|
|
1947
|
+
return r(Ce(e));
|
|
1767
1948
|
if (t === "SPK")
|
|
1768
|
-
return r(
|
|
1949
|
+
return r(Je(e));
|
|
1769
1950
|
if (t === "LARYNX")
|
|
1770
|
-
return r(
|
|
1951
|
+
return r($e(e));
|
|
1771
1952
|
if (t === "LP")
|
|
1772
|
-
return r(
|
|
1953
|
+
return r(Ue(e));
|
|
1773
1954
|
if (t === "POINTS")
|
|
1774
|
-
return r(
|
|
1775
|
-
if (
|
|
1955
|
+
return r(Ze(e));
|
|
1956
|
+
if (M.includes(t))
|
|
1776
1957
|
return await r(
|
|
1777
|
-
|
|
1958
|
+
xe(e, t)
|
|
1778
1959
|
);
|
|
1779
1960
|
throw new Error(
|
|
1780
1961
|
"[SDK][Wallets] – has requested unrecognized asset info"
|
|
@@ -1782,105 +1963,105 @@ function We(e, t, n = { refetch: !1 }) {
|
|
|
1782
1963
|
}
|
|
1783
1964
|
});
|
|
1784
1965
|
}
|
|
1785
|
-
function
|
|
1786
|
-
return
|
|
1966
|
+
function Lt(e, t, n = !1) {
|
|
1967
|
+
return v({
|
|
1787
1968
|
queryKey: ["wallets", "token-operations", e, t, n],
|
|
1788
1969
|
queryFn: async () => {
|
|
1789
1970
|
switch (e) {
|
|
1790
|
-
case
|
|
1971
|
+
case _.Hive:
|
|
1791
1972
|
return [
|
|
1792
|
-
|
|
1973
|
+
l.Transfer,
|
|
1793
1974
|
...n ? [
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1975
|
+
l.TransferToSavings,
|
|
1976
|
+
l.PowerUp,
|
|
1977
|
+
l.Swap
|
|
1797
1978
|
] : []
|
|
1798
1979
|
];
|
|
1799
|
-
case
|
|
1980
|
+
case _.HivePower:
|
|
1800
1981
|
return [
|
|
1801
|
-
|
|
1802
|
-
...n ? [
|
|
1982
|
+
l.Delegate,
|
|
1983
|
+
...n ? [l.PowerDown, l.WithdrawRoutes] : [l.PowerUp]
|
|
1803
1984
|
];
|
|
1804
|
-
case
|
|
1985
|
+
case _.HiveDollar:
|
|
1805
1986
|
return [
|
|
1806
|
-
|
|
1807
|
-
...n ? [
|
|
1987
|
+
l.Transfer,
|
|
1988
|
+
...n ? [l.TransferToSavings, l.Swap] : []
|
|
1808
1989
|
];
|
|
1809
|
-
case
|
|
1990
|
+
case _.Points:
|
|
1810
1991
|
return [
|
|
1811
|
-
|
|
1992
|
+
l.Gift,
|
|
1812
1993
|
...n ? [
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1994
|
+
l.Promote,
|
|
1995
|
+
l.Claim,
|
|
1996
|
+
l.Buy
|
|
1816
1997
|
] : []
|
|
1817
1998
|
];
|
|
1818
|
-
case
|
|
1819
|
-
return [
|
|
1999
|
+
case _.Spk:
|
|
2000
|
+
return [l.Transfer];
|
|
1820
2001
|
case "LARYNX":
|
|
1821
2002
|
return [
|
|
1822
|
-
|
|
1823
|
-
...n ? [
|
|
2003
|
+
l.Transfer,
|
|
2004
|
+
...n ? [l.PowerUp, l.LockLiquidity] : []
|
|
1824
2005
|
];
|
|
1825
2006
|
case "LP":
|
|
1826
2007
|
return [
|
|
1827
|
-
|
|
1828
|
-
...n ? [
|
|
2008
|
+
l.Delegate,
|
|
2009
|
+
...n ? [l.PowerDown] : []
|
|
1829
2010
|
];
|
|
1830
2011
|
}
|
|
1831
|
-
const r =
|
|
1832
|
-
await
|
|
1833
|
-
const s =
|
|
2012
|
+
const r = G(t);
|
|
2013
|
+
await c().prefetchQuery(r);
|
|
2014
|
+
const s = c().getQueryData(
|
|
1834
2015
|
r.queryKey
|
|
1835
2016
|
), a = L(
|
|
1836
|
-
(s == null ? void 0 : s.map((
|
|
2017
|
+
(s == null ? void 0 : s.map((b) => b.symbol)) ?? []
|
|
1837
2018
|
);
|
|
1838
|
-
await
|
|
1839
|
-
const o =
|
|
2019
|
+
await c().prefetchQuery(a);
|
|
2020
|
+
const o = c().getQueryData(a.queryKey), i = s == null ? void 0 : s.find((b) => b.symbol === e), f = o == null ? void 0 : o.find((b) => b.symbol === e), u = n && (f == null ? void 0 : f.delegationEnabled) && i && parseFloat(i.delegationsOut) !== parseFloat(i.balance), m = n && parseFloat((i == null ? void 0 : i.delegationsOut) ?? "0") > 0, h = n && (f == null ? void 0 : f.stakingEnabled), w = n && parseFloat((i == null ? void 0 : i.stake) ?? "0") > 0;
|
|
1840
2021
|
return [
|
|
1841
|
-
|
|
1842
|
-
...
|
|
1843
|
-
...
|
|
1844
|
-
...
|
|
1845
|
-
...
|
|
2022
|
+
l.Transfer,
|
|
2023
|
+
...u ? [l.Delegate] : [],
|
|
2024
|
+
...m ? [l.Undelegate] : [],
|
|
2025
|
+
...h ? [l.Stake] : [],
|
|
2026
|
+
...w ? [l.Unstake] : []
|
|
1846
2027
|
];
|
|
1847
2028
|
}
|
|
1848
2029
|
});
|
|
1849
2030
|
}
|
|
1850
|
-
const
|
|
1851
|
-
[
|
|
2031
|
+
const st = {
|
|
2032
|
+
[y.BTC]: "m/44'/0'/0'/0/0",
|
|
1852
2033
|
// Bitcoin (BIP44)
|
|
1853
|
-
[
|
|
2034
|
+
[y.ETH]: "m/44'/60'/0'/0/0",
|
|
1854
2035
|
// Ethereum (BIP44)
|
|
1855
|
-
[
|
|
2036
|
+
[y.SOL]: "m/44'/501'/0'/0'",
|
|
1856
2037
|
// Solana (BIP44)
|
|
1857
|
-
[
|
|
2038
|
+
[y.TON]: "m/44'/607'/0'",
|
|
1858
2039
|
// TON (BIP44)
|
|
1859
|
-
[
|
|
2040
|
+
[y.TRON]: "m/44'/195'/0'/0/0",
|
|
1860
2041
|
// Tron (BIP44)
|
|
1861
|
-
[
|
|
2042
|
+
[y.APT]: "m/44'/637'/0'/0'/0'",
|
|
1862
2043
|
// Aptos (BIP44)
|
|
1863
|
-
[
|
|
2044
|
+
[y.ATOM]: "m/44'/118'/0'/0/0"
|
|
1864
2045
|
// Cosmos (BIP44)
|
|
1865
2046
|
};
|
|
1866
|
-
function
|
|
1867
|
-
const { data: n } =
|
|
2047
|
+
function Mt(e, t) {
|
|
2048
|
+
const { data: n } = ee(e), r = $(), s = K({
|
|
1868
2049
|
mutationKey: ["ecency-wallets", "create-wallet", e, t],
|
|
1869
2050
|
mutationFn: async () => {
|
|
1870
2051
|
if (!n)
|
|
1871
2052
|
throw new Error("[Ecency][Wallets] - No seed to create a wallet");
|
|
1872
|
-
const o =
|
|
2053
|
+
const o = re(t), i = await (o == null ? void 0 : o.getDerivedPrivateKey({
|
|
1873
2054
|
mnemonic: n,
|
|
1874
|
-
hdPath:
|
|
2055
|
+
hdPath: st[t]
|
|
1875
2056
|
}));
|
|
1876
|
-
await
|
|
1877
|
-
const
|
|
1878
|
-
privateKey:
|
|
2057
|
+
await ne(1e3);
|
|
2058
|
+
const f = await (o == null ? void 0 : o.getNewAddress({
|
|
2059
|
+
privateKey: i
|
|
1879
2060
|
}));
|
|
1880
2061
|
return {
|
|
1881
|
-
privateKey:
|
|
1882
|
-
address:
|
|
1883
|
-
publicKey:
|
|
2062
|
+
privateKey: i,
|
|
2063
|
+
address: f.address,
|
|
2064
|
+
publicKey: f.publicKey,
|
|
1884
2065
|
username: e,
|
|
1885
2066
|
currency: t
|
|
1886
2067
|
};
|
|
@@ -1888,26 +2069,26 @@ function Et(e, t) {
|
|
|
1888
2069
|
onSuccess: (o) => {
|
|
1889
2070
|
r.setQueryData(
|
|
1890
2071
|
["ecency-wallets", "wallets", o.username],
|
|
1891
|
-
(
|
|
2072
|
+
(i) => new Map(i ? Array.from(i.entries()) : []).set(
|
|
1892
2073
|
o.currency,
|
|
1893
2074
|
o
|
|
1894
2075
|
)
|
|
1895
2076
|
);
|
|
1896
2077
|
}
|
|
1897
|
-
}), a =
|
|
2078
|
+
}), a = Oe(() => {
|
|
1898
2079
|
}, []);
|
|
1899
2080
|
return {
|
|
1900
2081
|
createWallet: s,
|
|
1901
2082
|
importWallet: a
|
|
1902
2083
|
};
|
|
1903
2084
|
}
|
|
1904
|
-
function
|
|
1905
|
-
const { data: t } =
|
|
2085
|
+
function at(e) {
|
|
2086
|
+
const { data: t } = T({
|
|
1906
2087
|
queryKey: ["ecency-wallets", "wallets", e]
|
|
1907
|
-
}), { data: n } =
|
|
1908
|
-
return
|
|
2088
|
+
}), { data: n } = Ee(e);
|
|
2089
|
+
return K({
|
|
1909
2090
|
mutationKey: ["ecency-wallets", "create-account-with-wallets", e],
|
|
1910
|
-
mutationFn: ({ currency: r, address: s }) => fetch(
|
|
2091
|
+
mutationFn: ({ currency: r, address: s }) => fetch(p.privateApiHost + "/private-api/wallets-add", {
|
|
1911
2092
|
method: "POST",
|
|
1912
2093
|
headers: {
|
|
1913
2094
|
"Content-Type": "application/json"
|
|
@@ -1922,9 +2103,9 @@ function Xe(e) {
|
|
|
1922
2103
|
postingPublicKey: n == null ? void 0 : n.postingPubkey,
|
|
1923
2104
|
memoPublicKey: n == null ? void 0 : n.memoPubkey,
|
|
1924
2105
|
...Array.from((t == null ? void 0 : t.entries()) ?? []).reduce(
|
|
1925
|
-
(a, [o,
|
|
2106
|
+
(a, [o, i]) => ({
|
|
1926
2107
|
...a,
|
|
1927
|
-
[o]:
|
|
2108
|
+
[o]: i.address
|
|
1928
2109
|
}),
|
|
1929
2110
|
{}
|
|
1930
2111
|
)
|
|
@@ -1933,11 +2114,11 @@ function Xe(e) {
|
|
|
1933
2114
|
})
|
|
1934
2115
|
});
|
|
1935
2116
|
}
|
|
1936
|
-
function
|
|
1937
|
-
return
|
|
2117
|
+
function ue() {
|
|
2118
|
+
return K({
|
|
1938
2119
|
mutationKey: ["ecency-wallets", "check-wallet-existence"],
|
|
1939
2120
|
mutationFn: async ({ address: e, currency: t }) => (await (await fetch(
|
|
1940
|
-
|
|
2121
|
+
p.privateApiHost + "/private-api/wallets-exist",
|
|
1941
2122
|
{
|
|
1942
2123
|
method: "POST",
|
|
1943
2124
|
headers: {
|
|
@@ -1951,30 +2132,30 @@ function oe() {
|
|
|
1951
2132
|
)).json()).length === 0
|
|
1952
2133
|
});
|
|
1953
2134
|
}
|
|
1954
|
-
const
|
|
2135
|
+
const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1955
2136
|
__proto__: null,
|
|
1956
|
-
useCheckWalletExistence:
|
|
1957
|
-
useCreateAccountWithWallets:
|
|
1958
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1959
|
-
[
|
|
1960
|
-
[
|
|
2137
|
+
useCheckWalletExistence: ue,
|
|
2138
|
+
useCreateAccountWithWallets: at
|
|
2139
|
+
}, Symbol.toStringTag, { value: "Module" })), ot = {
|
|
2140
|
+
[y.BTC]: ["m/84'/0'/0'/0/0"],
|
|
2141
|
+
[y.ETH]: ["m/84'/60'/0'/0/0"],
|
|
1961
2142
|
// its not working for Trust, Exodus, todo: check others below
|
|
1962
|
-
[
|
|
1963
|
-
[
|
|
1964
|
-
[
|
|
1965
|
-
[
|
|
2143
|
+
[y.SOL]: ["m/84'/501'/0'/0/0"],
|
|
2144
|
+
[y.TRON]: ["m/44'/195'/0'/0'/0'"],
|
|
2145
|
+
[y.APT]: ["m/84'/637'/0'/0/0"],
|
|
2146
|
+
[y.TON]: [],
|
|
1966
2147
|
// Disabled
|
|
1967
|
-
[
|
|
2148
|
+
[y.ATOM]: ["m/84'/118'/0'/0'/0"]
|
|
1968
2149
|
};
|
|
1969
|
-
async function
|
|
1970
|
-
for (const r of
|
|
2150
|
+
async function it(e, t, n) {
|
|
2151
|
+
for (const r of ot[n] || [])
|
|
1971
2152
|
try {
|
|
1972
2153
|
const s = await t.getDerivedPrivateKey({
|
|
1973
2154
|
mnemonic: e,
|
|
1974
2155
|
hdPath: r
|
|
1975
2156
|
}), a = await t.getNewAddress({
|
|
1976
2157
|
privateKey: s,
|
|
1977
|
-
addressType: n ===
|
|
2158
|
+
addressType: n === y.BTC ? "segwit_native" : void 0
|
|
1978
2159
|
});
|
|
1979
2160
|
return [s.toString(), a.address];
|
|
1980
2161
|
} catch {
|
|
@@ -1982,43 +2163,43 @@ async function Ze(e, t, n) {
|
|
|
1982
2163
|
}
|
|
1983
2164
|
return [];
|
|
1984
2165
|
}
|
|
1985
|
-
function
|
|
1986
|
-
const n =
|
|
1987
|
-
return
|
|
2166
|
+
function Jt(e, t) {
|
|
2167
|
+
const n = $(), { mutateAsync: r } = ue();
|
|
2168
|
+
return K({
|
|
1988
2169
|
mutationKey: ["ecency-wallets", "import-wallet", e, t],
|
|
1989
2170
|
mutationFn: async ({ privateKeyOrSeed: s }) => {
|
|
1990
|
-
const a =
|
|
2171
|
+
const a = re(t);
|
|
1991
2172
|
if (!a)
|
|
1992
2173
|
throw new Error("Cannot find token for this currency");
|
|
1993
2174
|
const o = s.split(" ").length === 12;
|
|
1994
|
-
let
|
|
1995
|
-
if (o ? [
|
|
2175
|
+
let i, f = s;
|
|
2176
|
+
if (o ? [f, i] = await it(
|
|
1996
2177
|
s,
|
|
1997
2178
|
a,
|
|
1998
2179
|
t
|
|
1999
|
-
) :
|
|
2180
|
+
) : i = (await a.getNewAddress({
|
|
2000
2181
|
privateKey: s
|
|
2001
|
-
})).address, !
|
|
2182
|
+
})).address, !i || !s)
|
|
2002
2183
|
throw new Error(
|
|
2003
2184
|
"Private key/seed phrase isn't matching with public key or token"
|
|
2004
2185
|
);
|
|
2005
2186
|
if (!await r({
|
|
2006
|
-
address:
|
|
2187
|
+
address: i,
|
|
2007
2188
|
currency: t
|
|
2008
2189
|
}))
|
|
2009
2190
|
throw new Error(
|
|
2010
2191
|
"This wallet has already in use by Hive account. Please, try another one"
|
|
2011
2192
|
);
|
|
2012
2193
|
return {
|
|
2013
|
-
privateKey:
|
|
2014
|
-
address:
|
|
2194
|
+
privateKey: f,
|
|
2195
|
+
address: i,
|
|
2015
2196
|
publicKey: ""
|
|
2016
2197
|
};
|
|
2017
2198
|
},
|
|
2018
2199
|
onSuccess: ({ privateKey: s, publicKey: a, address: o }) => {
|
|
2019
2200
|
n.setQueryData(
|
|
2020
2201
|
["ecency-wallets", "wallets", e],
|
|
2021
|
-
(
|
|
2202
|
+
(i) => new Map(i ? Array.from(i.entries()) : []).set(t, {
|
|
2022
2203
|
privateKey: s,
|
|
2023
2204
|
publicKey: a,
|
|
2024
2205
|
address: o,
|
|
@@ -2031,7 +2212,7 @@ function It(e, t) {
|
|
|
2031
2212
|
}
|
|
2032
2213
|
});
|
|
2033
2214
|
}
|
|
2034
|
-
function
|
|
2215
|
+
function z(e, t = !1) {
|
|
2035
2216
|
return e ? A.pipe(
|
|
2036
2217
|
e,
|
|
2037
2218
|
A.filter(({ type: n }) => n === "CHAIN"),
|
|
@@ -2039,101 +2220,101 @@ function Y(e, t = !1) {
|
|
|
2039
2220
|
A.groupByProp("symbol")
|
|
2040
2221
|
) : {};
|
|
2041
2222
|
}
|
|
2042
|
-
function
|
|
2043
|
-
const t =
|
|
2044
|
-
return
|
|
2223
|
+
function Ut(e) {
|
|
2224
|
+
const t = $(), { data: n } = T(q(e)), { mutateAsync: r } = fe(e);
|
|
2225
|
+
return K({
|
|
2045
2226
|
mutationKey: ["ecency-wallets", "save-wallet-to-metadata", n],
|
|
2046
2227
|
mutationFn: async (s) => {
|
|
2047
|
-
var
|
|
2228
|
+
var m;
|
|
2048
2229
|
if (!n)
|
|
2049
2230
|
throw new Error("[SDK][Wallets] – no account data to save wallets");
|
|
2050
|
-
const a =
|
|
2051
|
-
(
|
|
2052
|
-
), o = s.map(({ currency:
|
|
2053
|
-
symbol:
|
|
2054
|
-
type:
|
|
2055
|
-
meta:
|
|
2056
|
-
})) ?? [],
|
|
2057
|
-
({ type:
|
|
2058
|
-
),
|
|
2231
|
+
const a = z(
|
|
2232
|
+
(m = n.profile) == null ? void 0 : m.tokens
|
|
2233
|
+
), o = s.map(({ currency: h, type: w, ...b }) => ({
|
|
2234
|
+
symbol: h,
|
|
2235
|
+
type: w,
|
|
2236
|
+
meta: b
|
|
2237
|
+
})) ?? [], i = z(o, !0), f = o.filter(
|
|
2238
|
+
({ type: h }) => h !== "CHAIN"
|
|
2239
|
+
), u = A.pipe(
|
|
2059
2240
|
a,
|
|
2060
|
-
A.mergeDeep(
|
|
2241
|
+
A.mergeDeep(i),
|
|
2061
2242
|
A.values()
|
|
2062
2243
|
);
|
|
2063
2244
|
return r({
|
|
2064
2245
|
tokens: [
|
|
2065
|
-
...
|
|
2066
|
-
...
|
|
2246
|
+
...f,
|
|
2247
|
+
...u
|
|
2067
2248
|
]
|
|
2068
2249
|
});
|
|
2069
2250
|
},
|
|
2070
2251
|
onSuccess: () => t.invalidateQueries({
|
|
2071
|
-
queryKey:
|
|
2252
|
+
queryKey: nt(e).queryKey
|
|
2072
2253
|
})
|
|
2073
2254
|
});
|
|
2074
2255
|
}
|
|
2075
|
-
const
|
|
2256
|
+
const ct = {
|
|
2076
2257
|
HIVE: {
|
|
2077
|
-
[
|
|
2078
|
-
[
|
|
2079
|
-
[
|
|
2258
|
+
[l.Transfer]: W,
|
|
2259
|
+
[l.TransferToSavings]: Y,
|
|
2260
|
+
[l.PowerUp]: Ie
|
|
2080
2261
|
},
|
|
2081
2262
|
HBD: {
|
|
2082
|
-
[
|
|
2083
|
-
[
|
|
2263
|
+
[l.Transfer]: W,
|
|
2264
|
+
[l.TransferToSavings]: Y
|
|
2084
2265
|
},
|
|
2085
2266
|
HP: {
|
|
2086
|
-
[
|
|
2087
|
-
[
|
|
2088
|
-
[
|
|
2267
|
+
[l.PowerDown]: je,
|
|
2268
|
+
[l.Delegate]: Re,
|
|
2269
|
+
[l.WithdrawRoutes]: Fe
|
|
2089
2270
|
},
|
|
2090
2271
|
POINTS: {
|
|
2091
|
-
[
|
|
2272
|
+
[l.Gift]: et
|
|
2092
2273
|
},
|
|
2093
2274
|
SPK: {
|
|
2094
|
-
[
|
|
2275
|
+
[l.Transfer]: Be
|
|
2095
2276
|
},
|
|
2096
2277
|
LARYNX: {
|
|
2097
|
-
[
|
|
2098
|
-
[
|
|
2278
|
+
[l.LockLiquidity]: Le,
|
|
2279
|
+
[l.PowerUp]: Me
|
|
2099
2280
|
}
|
|
2100
|
-
},
|
|
2101
|
-
[
|
|
2102
|
-
[
|
|
2103
|
-
[
|
|
2104
|
-
[
|
|
2105
|
-
[
|
|
2281
|
+
}, ut = {
|
|
2282
|
+
[l.Transfer]: ze,
|
|
2283
|
+
[l.Stake]: Ye,
|
|
2284
|
+
[l.Unstake]: Xe,
|
|
2285
|
+
[l.Delegate]: Ge,
|
|
2286
|
+
[l.Undelegate]: We
|
|
2106
2287
|
};
|
|
2107
|
-
function
|
|
2108
|
-
const { mutateAsync: r } =
|
|
2288
|
+
function Vt(e, t, n) {
|
|
2289
|
+
const { mutateAsync: r } = Z.useRecordActivity(
|
|
2109
2290
|
e,
|
|
2110
2291
|
n
|
|
2111
2292
|
);
|
|
2112
|
-
return
|
|
2293
|
+
return K({
|
|
2113
2294
|
mutationKey: ["ecency-wallets", t, n],
|
|
2114
2295
|
mutationFn: async (s) => {
|
|
2115
|
-
const a =
|
|
2296
|
+
const a = ct[t][n];
|
|
2116
2297
|
if (a)
|
|
2117
2298
|
return a(s);
|
|
2118
|
-
const o =
|
|
2119
|
-
await
|
|
2120
|
-
const
|
|
2299
|
+
const o = G(e);
|
|
2300
|
+
await c().prefetchQuery(o);
|
|
2301
|
+
const i = c().getQueryData(
|
|
2121
2302
|
o.queryKey
|
|
2122
2303
|
);
|
|
2123
|
-
if (
|
|
2124
|
-
const
|
|
2125
|
-
if (
|
|
2126
|
-
return
|
|
2304
|
+
if (i != null && i.some((f) => f.symbol === t)) {
|
|
2305
|
+
const f = ut[n];
|
|
2306
|
+
if (f)
|
|
2307
|
+
return f({ ...s, asset: t });
|
|
2127
2308
|
}
|
|
2128
2309
|
throw new Error("[SDK][Wallets] – no operation for given asset");
|
|
2129
2310
|
},
|
|
2130
2311
|
onSuccess: () => {
|
|
2131
2312
|
r();
|
|
2132
|
-
const s =
|
|
2313
|
+
const s = rt(e, t, {
|
|
2133
2314
|
refetch: !0
|
|
2134
2315
|
});
|
|
2135
2316
|
setTimeout(
|
|
2136
|
-
() =>
|
|
2317
|
+
() => c().invalidateQueries({
|
|
2137
2318
|
queryKey: s.queryKey
|
|
2138
2319
|
}),
|
|
2139
2320
|
5e3
|
|
@@ -2142,67 +2323,67 @@ function Ft(e, t, n) {
|
|
|
2142
2323
|
});
|
|
2143
2324
|
}
|
|
2144
2325
|
export {
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2326
|
+
l as AssetOperation,
|
|
2327
|
+
_ as EcencyWalletBasicTokens,
|
|
2328
|
+
y as EcencyWalletCurrency,
|
|
2329
|
+
$t as EcencyWalletsPrivateApi,
|
|
2330
|
+
oe as NaiMap,
|
|
2331
|
+
tt as PointTransactionType,
|
|
2332
|
+
ae as Symbol,
|
|
2333
|
+
Ge as delegateEngineToken,
|
|
2334
|
+
Re as delegateHive,
|
|
2335
|
+
rt as getAccountWalletAssetInfoQueryOptions,
|
|
2336
|
+
nt as getAccountWalletListQueryOptions,
|
|
2337
|
+
Bt as getAllTokensListQueryOptions,
|
|
2338
|
+
Ce as getHbdAssetGeneralInfoQueryOptions,
|
|
2339
|
+
Nt as getHbdAssetTransactionsQueryOptions,
|
|
2340
|
+
O as getHiveAssetGeneralInfoQueryOptions,
|
|
2341
|
+
Ht as getHiveAssetMetricQueryOptions,
|
|
2342
|
+
ce as getHiveAssetTransactionsQueryOptions,
|
|
2343
|
+
Et as getHiveAssetWithdrawalRoutesQueryOptions,
|
|
2344
|
+
xe as getHiveEngineTokenGeneralInfoQueryOptions,
|
|
2345
|
+
It as getHiveEngineTokenTransactionsQueryOptions,
|
|
2346
|
+
G as getHiveEngineTokensBalancesQueryOptions,
|
|
2347
|
+
Ve as getHiveEngineTokensMarketQueryOptions,
|
|
2167
2348
|
L as getHiveEngineTokensMetadataQueryOptions,
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2349
|
+
Rt as getHiveEngineTokensMetricsQueryOptions,
|
|
2350
|
+
ie as getHivePowerAssetGeneralInfoQueryOptions,
|
|
2351
|
+
Kt as getHivePowerAssetTransactionsQueryOptions,
|
|
2352
|
+
Qt as getHivePowerDelegatesInfiniteQueryOptions,
|
|
2353
|
+
Dt as getHivePowerDelegatingsQueryOptions,
|
|
2354
|
+
$e as getLarynxAssetGeneralInfoQueryOptions,
|
|
2355
|
+
Ue as getLarynxPowerAssetGeneralInfoQueryOptions,
|
|
2356
|
+
Ze as getPointsAssetGeneralInfoQueryOptions,
|
|
2357
|
+
jt as getPointsAssetTransactionsQueryOptions,
|
|
2358
|
+
U as getPointsQueryOptions,
|
|
2359
|
+
Je as getSpkAssetGeneralInfoQueryOptions,
|
|
2360
|
+
H as getSpkMarketsQueryOptions,
|
|
2361
|
+
Lt as getTokenOperationsQueryOptions,
|
|
2362
|
+
Tt as isEmptyDate,
|
|
2363
|
+
Le as lockLarynx,
|
|
2364
|
+
g as parseAsset,
|
|
2365
|
+
je as powerDownHive,
|
|
2366
|
+
Ie as powerUpHive,
|
|
2367
|
+
Me as powerUpLarynx,
|
|
2368
|
+
Qe as rewardSpk,
|
|
2369
|
+
Ye as stakeEngineToken,
|
|
2370
|
+
ze as transferEngineToken,
|
|
2371
|
+
W as transferHive,
|
|
2372
|
+
et as transferPoint,
|
|
2373
|
+
Be as transferSpk,
|
|
2374
|
+
Y as transferToSavingsHive,
|
|
2375
|
+
We as undelegateEngineToken,
|
|
2376
|
+
Xe as unstakeEngineToken,
|
|
2377
|
+
Ft as useClaimPoints,
|
|
2378
|
+
Ct as useClaimRewards,
|
|
2379
|
+
At as useCoinGeckoPriceQuery,
|
|
2380
|
+
St as useGetExternalWalletBalanceQuery,
|
|
2381
|
+
Ee as useHiveKeysQuery,
|
|
2382
|
+
Jt as useImportWallet,
|
|
2383
|
+
Ut as useSaveWalletInformationToMetadata,
|
|
2384
|
+
ee as useSeedPhrase,
|
|
2385
|
+
Mt as useWalletCreate,
|
|
2386
|
+
Vt as useWalletOperation,
|
|
2387
|
+
J as vestsToHp,
|
|
2388
|
+
Fe as withdrawVestingRouteHive
|
|
2208
2389
|
};
|