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