@ecency/wallets 1.3.1 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,59 +1,37 @@
1
- import { useCallback as se } from "react";
2
- import { useQuery as E, queryOptions as h, infiniteQueryOptions as R, useMutation as O, useQueryClient as G } from "@tanstack/react-query";
3
- import { BtcWallet as ae } from "@okxweb3/coin-bitcoin";
4
- import { EthWallet as oe } from "@okxweb3/coin-ethereum";
5
- import { TrxWallet as ie } from "@okxweb3/coin-tron";
6
- import { TonWallet as ce } from "@okxweb3/coin-ton";
7
- import { SolWallet as ue } from "@okxweb3/coin-solana";
8
- import { AtomWallet as le } from "@okxweb3/coin-cosmos";
9
- import { AptosWallet as fe } from "@okxweb3/coin-aptos";
10
- import me from "bip39";
11
- import { CONFIG as l, getQueryClient as i, getDynamicPropsQueryOptions as N, getAccountFullQueryOptions as T, Keychain as b, EcencyAnalytics as W, getAccessToken as ye, useAccountUpdate as pe } from "@ecency/sdk";
12
- import { LRUCache as he } from "lru-cache";
13
- import { PrivateKey as C, utils as A } from "@hiveio/dhive";
14
- import Q from "dayjs";
1
+ import { CONFIG as y, getQueryClient as i, getDynamicPropsQueryOptions as H, getAccountFullQueryOptions as S, Keychain as P, EcencyAnalytics as X, getAccessToken as oe, useAccountUpdate as ie } from "@ecency/sdk";
2
+ import { useQuery as D, queryOptions as h, infiniteQueryOptions as R, useMutation as N, useQueryClient as $ } from "@tanstack/react-query";
3
+ import ce from "bip39";
4
+ import { LRUCache as ue } from "lru-cache";
5
+ import { PrivateKey as I, utils as T } from "@hiveio/dhive";
6
+ import C from "dayjs";
15
7
  import d from "hivesigner";
16
- var m = /* @__PURE__ */ ((e) => (e.BTC = "BTC", e.ETH = "ETH", e.APT = "APT", e.ATOM = "ATOM", e.TON = "TON", e.TRON = "TRX", e.SOL = "SOL", e))(m || {}), w = /* @__PURE__ */ ((e) => (e.Points = "POINTS", e.HivePower = "HP", e.Hive = "HIVE", e.HiveDollar = "HBD", e.Spk = "SPK", e))(w || {});
17
- function ge(e) {
18
- return new Promise((t) => setTimeout(t, e));
19
- }
20
- function Y(e) {
21
- switch (e) {
22
- case m.BTC:
23
- return new ae();
24
- case m.ETH:
25
- return new oe();
26
- case m.TRON:
27
- return new ie();
28
- case m.TON:
29
- return new ce();
30
- case m.SOL:
31
- return new ue();
32
- case m.ATOM:
33
- return new le();
34
- case m.APT:
35
- return new fe();
36
- default:
37
- return;
38
- }
39
- }
40
- function gt(e, t) {
41
- return E({
8
+ import { BtcWallet as le } from "@okxweb3/coin-bitcoin";
9
+ import { EthWallet as fe } from "@okxweb3/coin-ethereum";
10
+ import { TrxWallet as ye } from "@okxweb3/coin-tron";
11
+ import { TonWallet as me } from "@okxweb3/coin-ton";
12
+ import { SolWallet as pe } from "@okxweb3/coin-solana";
13
+ import { AtomWallet as he } from "@okxweb3/coin-cosmos";
14
+ import { AptosWallet as ge } from "@okxweb3/coin-aptos";
15
+ import { useCallback as we } from "react";
16
+ 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 dt(e, t) {
19
+ return D({
42
20
  queryKey: ["ecency-wallets", "external-wallet-balance", e, t],
43
21
  queryFn: async () => {
44
22
  switch (e) {
45
- case m.BTC:
23
+ case f.BTC:
46
24
  const r = await (await fetch(
47
25
  `https://mempool.space/api/address/${t}`
48
26
  )).json();
49
27
  return (r.chain_stats.funded_txo_sum - r.chain_stats.spent_txo_sum) / 1e8;
50
- case m.ETH:
28
+ case f.ETH:
51
29
  return +(await (await fetch(
52
30
  `https://api.ethplorer.io/getAddressInfo/${t}?apiKey=freekey`
53
31
  )).json()).ETH.balance;
54
- case m.SOL:
32
+ case f.SOL:
55
33
  return (await (await fetch(
56
- `https://rpc.helius.xyz/?api-key=${l.heliusApiKey}`,
34
+ `https://rpc.helius.xyz/?api-key=${y.heliusApiKey}`,
57
35
  {
58
36
  method: "POST",
59
37
  body: JSON.stringify({
@@ -67,22 +45,22 @@ function gt(e, t) {
67
45
  }
68
46
  }
69
47
  )).json()).result.value / 1e9;
70
- case m.TRON:
48
+ case f.TRON:
71
49
  return (await (await fetch(
72
50
  `https://api.trongrid.io/v1/accounts/${t}`
73
51
  )).json()).data[0].balance / 1e6;
74
- case m.TON:
52
+ case f.TON:
75
53
  return (await (await fetch(
76
54
  `https://tonapi.io/v1/blockchain/getAccount?account=${t}`
77
55
  )).json()).balance / 1e9;
78
- case m.APT:
79
- const P = (await (await fetch(
56
+ case f.APT:
57
+ const q = (await (await fetch(
80
58
  `https://fullnode.mainnet.aptoslabs.com/v1/accounts/${t}/resources`
81
59
  )).json()).find(
82
- (re) => re.type.includes("coin::CoinStore")
60
+ (ae) => ae.type.includes("coin::CoinStore")
83
61
  );
84
- return P ? parseInt(P.data.coin.value) / 1e8 : 0;
85
- case m.ATOM:
62
+ return q ? parseInt(q.data.coin.value) / 1e8 : 0;
63
+ case f.ATOM:
86
64
  return +(await (await fetch(
87
65
  `https://rest.cosmos.directory/cosmoshub/auth/accounts/${t}`
88
66
  )).json()).result.value.coins[0].amount / 1e6;
@@ -90,13 +68,13 @@ function gt(e, t) {
90
68
  }
91
69
  });
92
70
  }
93
- function X(e) {
94
- return E({
71
+ function z(e) {
72
+ return D({
95
73
  queryKey: ["ecency-wallets", "seed", e],
96
- queryFn: async () => me.generateMnemonic(128)
74
+ queryFn: async () => ce.generateMnemonic(128)
97
75
  });
98
76
  }
99
- const we = {
77
+ const de = {
100
78
  max: 500,
101
79
  // how long to live in ms
102
80
  ttl: 1e3 * 60 * 5,
@@ -104,32 +82,32 @@ const we = {
104
82
  allowStale: !1,
105
83
  updateAgeOnGet: !1,
106
84
  updateAgeOnHas: !1
107
- }, z = new he(we), J = Symbol("undefined"), de = (e, t) => z.set(e, t === void 0 ? J : t), _e = (e) => {
108
- const t = z.get(e);
109
- return t === J ? void 0 : t;
85
+ }, Z = new ue(de), x = Symbol("undefined"), _e = (e, t) => Z.set(e, t === void 0 ? x : t), ve = (e) => {
86
+ const t = Z.get(e);
87
+ return t === x ? void 0 : t;
110
88
  };
111
- function wt(e) {
112
- return E({
89
+ function _t(e) {
90
+ return D({
113
91
  queryKey: ["ecency-wallets", "coingecko-price", e],
114
92
  queryFn: async () => {
115
93
  let t = e;
116
94
  switch (e) {
117
- case m.BTC:
95
+ case f.BTC:
118
96
  t = "binance-wrapped-btc";
119
97
  break;
120
- case m.ETH:
98
+ case f.ETH:
121
99
  t = "ethereum";
122
100
  break;
123
- case m.SOL:
101
+ case f.SOL:
124
102
  t = "solana";
125
103
  break;
126
- case m.TON:
104
+ case f.TON:
127
105
  t = "trx";
128
106
  break;
129
107
  default:
130
108
  t = e;
131
109
  }
132
- let n = _e("gecko"), r;
110
+ let n = ve("gecko"), r;
133
111
  if (n)
134
112
  r = n;
135
113
  else {
@@ -145,22 +123,22 @@ function wt(e) {
145
123
  })
146
124
  }
147
125
  )).json();
148
- de("gecko", o === void 0 ? J : o), r = o;
126
+ _e("gecko", o === void 0 ? x : o), r = o;
149
127
  }
150
128
  return 1 / +r[Object.keys(r)[0]].usd;
151
129
  },
152
130
  enabled: !!e
153
131
  });
154
132
  }
155
- function ve(e) {
156
- const { data: t } = X(e);
157
- return E({
133
+ function ke(e) {
134
+ const { data: t } = z(e);
135
+ return D({
158
136
  queryKey: ["ecencу-wallets", "hive-keys", e, t],
159
137
  staleTime: 1 / 0,
160
138
  queryFn: async () => {
161
139
  if (!t)
162
140
  throw new Error("[Ecency][Wallets] - no seed to create Hive account");
163
- const n = C.fromLogin(e, t, "owner"), r = C.fromLogin(e, t, "active"), s = C.fromLogin(e, t, "posting"), a = C.fromLogin(e, t, "memo");
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");
164
142
  return {
165
143
  username: e,
166
144
  owner: n.toString(),
@@ -175,29 +153,29 @@ function ve(e) {
175
153
  }
176
154
  });
177
155
  }
178
- var Z = /* @__PURE__ */ ((e) => (e.HIVE = "HIVE", e.HBD = "HBD", e.VESTS = "VESTS", e.SPK = "SPK", e))(Z || {}), ee = /* @__PURE__ */ ((e) => (e["@@000000021"] = "HIVE", e["@@000000013"] = "HBD", e["@@000000037"] = "VESTS", e))(ee || {});
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 || {});
179
157
  function p(e) {
180
158
  if (typeof e == "string") {
181
159
  const t = e.split(" ");
182
160
  return {
183
161
  amount: parseFloat(t[0]),
184
162
  // @ts-ignore
185
- symbol: Z[t[1]]
163
+ symbol: ee[t[1]]
186
164
  };
187
165
  } else
188
166
  return {
189
167
  amount: parseFloat(e.amount.toString()) / Math.pow(10, e.precision),
190
168
  // @ts-ignore
191
- symbol: ee[e.nai]
169
+ symbol: te[e.nai]
192
170
  };
193
171
  }
194
- function dt(e) {
172
+ function vt(e) {
195
173
  return e === void 0 ? !0 : parseInt(e.split("-")[0], 10) < 1980;
196
174
  }
197
- function B(e, t) {
175
+ function M(e, t) {
198
176
  return e / 1e6 * t;
199
177
  }
200
- function ke(e, t) {
178
+ function be(e, t) {
201
179
  let n = 0, r = 0, s = 0, a = 0, o = e.head_block - e.spk_block;
202
180
  if (e.spk_block) {
203
181
  if (o < 28800)
@@ -208,27 +186,27 @@ function ke(e, t) {
208
186
  a,
209
187
  t.spk_rate_ldel
210
188
  );
211
- const f = n + r + s;
212
- return f || 0;
189
+ const l = n + r + s;
190
+ return l || 0;
213
191
  }
214
192
  } else return 0;
215
- function c(f, g, _) {
216
- return (f * (1 + _ / 365) - f) * g;
193
+ function c(l, w, _) {
194
+ return (l * (1 + _ / 365) - l) * w;
217
195
  }
218
196
  }
219
- function q(e) {
197
+ function O(e) {
220
198
  return h({
221
199
  queryKey: ["assets", "hive", "general-info", e],
222
200
  staleTime: 6e4,
223
201
  refetchInterval: 9e4,
224
202
  queryFn: async () => {
225
- await i().prefetchQuery(N()), await i().prefetchQuery(
226
- T(e)
203
+ await i().prefetchQuery(H()), await i().prefetchQuery(
204
+ S(e)
227
205
  );
228
206
  const t = i().getQueryData(
229
- N().queryKey
207
+ H().queryKey
230
208
  ), n = i().getQueryData(
231
- T(e).queryKey
209
+ S(e).queryKey
232
210
  );
233
211
  return {
234
212
  name: "HIVE",
@@ -239,25 +217,25 @@ function q(e) {
239
217
  }
240
218
  });
241
219
  }
242
- function be(e) {
243
- let f = 9.5 - (e.headBlock - 7e6) / 25e4 * 0.01;
244
- f < 0.95 && (f = 0.95);
245
- const g = e.vestingRewardPercent / 1e4, _ = e.virtualSupply, v = e.totalVestingFund;
246
- return (_ * f * g / v).toFixed(3);
247
- }
248
220
  function Pe(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);
225
+ }
226
+ function qe(e) {
249
227
  return h({
250
228
  queryKey: ["assets", "hive-power", "general-info", e],
251
229
  staleTime: 6e4,
252
230
  refetchInterval: 9e4,
253
231
  queryFn: async () => {
254
- await i().prefetchQuery(N()), await i().prefetchQuery(
255
- T(e)
232
+ await i().prefetchQuery(H()), await i().prefetchQuery(
233
+ S(e)
256
234
  );
257
235
  const t = i().getQueryData(
258
- N().queryKey
236
+ H().queryKey
259
237
  ), n = i().getQueryData(
260
- T(e).queryKey
238
+ S(e).queryKey
261
239
  );
262
240
  return !t || !n ? {
263
241
  name: "HP",
@@ -268,25 +246,25 @@ function Pe(e) {
268
246
  name: "HP",
269
247
  title: "Hive Power",
270
248
  price: t ? t.base / t.quote : 0,
271
- accountBalance: +B(
249
+ accountBalance: +M(
272
250
  p(n.vesting_shares).amount,
273
251
  // parseAsset(accountData.delegated_vesting_shares).amount +
274
252
  // parseAsset(accountData.received_vesting_shares).amount -
275
253
  // nextVestingSharesWithdrawal,
276
254
  t.hivePerMVests
277
255
  ).toFixed(3),
278
- apr: be(t),
256
+ apr: Pe(t),
279
257
  parts: [
280
258
  {
281
259
  name: "delegating",
282
- balance: +B(
260
+ balance: +M(
283
261
  p(n.delegated_vesting_shares).amount,
284
262
  t.hivePerMVests
285
263
  ).toFixed(3)
286
264
  },
287
265
  {
288
266
  name: "received",
289
- balance: +B(
267
+ balance: +M(
290
268
  p(n.received_vesting_shares).amount,
291
269
  t.hivePerMVests
292
270
  ).toFixed(3)
@@ -296,19 +274,19 @@ function Pe(e) {
296
274
  }
297
275
  });
298
276
  }
299
- function qe(e) {
277
+ function Se(e) {
300
278
  return h({
301
279
  queryKey: ["assets", "hbd", "general-info", e],
302
280
  staleTime: 6e4,
303
281
  refetchInterval: 9e4,
304
282
  queryFn: async () => {
305
- await i().prefetchQuery(N()), await i().prefetchQuery(
306
- T(e)
283
+ await i().prefetchQuery(H()), await i().prefetchQuery(
284
+ S(e)
307
285
  );
308
286
  const t = i().getQueryData(
309
- T(e).queryKey
287
+ S(e).queryKey
310
288
  ), n = i().getQueryData(
311
- N().queryKey
289
+ H().queryKey
312
290
  );
313
291
  return t ? {
314
292
  name: "HBD",
@@ -335,47 +313,47 @@ function qe(e) {
335
313
  }
336
314
  });
337
315
  }
338
- const y = A.operationOrders, D = {
316
+ const m = T.operationOrders, E = {
339
317
  transfers: [
340
- y.transfer,
341
- y.transfer_to_savings,
342
- y.transfer_from_savings,
343
- y.cancel_transfer_from_savings,
344
- y.recurrent_transfer,
345
- y.fill_recurrent_transfer,
346
- y.escrow_transfer,
347
- y.fill_recurrent_transfer
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
348
326
  ],
349
327
  "market-orders": [
350
- y.fill_convert_request,
351
- y.fill_order,
352
- y.fill_collateralized_convert_request,
353
- y.limit_order_create2,
354
- y.limit_order_create,
355
- y.limit_order_cancel
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
356
334
  ],
357
- interests: [y.interest],
335
+ interests: [m.interest],
358
336
  "stake-operations": [
359
- y.return_vesting_delegation,
360
- y.withdraw_vesting,
361
- y.transfer_to_vesting,
362
- y.set_withdraw_vesting_route,
363
- y.update_proposal_votes,
364
- y.fill_vesting_withdraw,
365
- y.account_witness_proxy,
366
- y.delegate_vesting_shares
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
367
345
  ],
368
346
  rewards: [
369
- y.author_reward,
370
- y.curation_reward,
371
- y.producer_reward,
372
- y.claim_reward_balance,
373
- y.comment_benefactor_reward,
374
- y.liquidity_reward,
375
- y.proposal_pay
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
376
354
  ]
377
355
  };
378
- function te(e, t = 20, n) {
356
+ function ne(e, t = 20, n) {
379
357
  return R({
380
358
  queryKey: ["assets", "hive", "transactions", e, t, n],
381
359
  initialData: { pages: [], pageParams: [] },
@@ -388,34 +366,34 @@ function te(e, t = 20, n) {
388
366
  let s = [];
389
367
  switch (n) {
390
368
  case "transfers":
391
- s = A.makeBitMaskFilter(
392
- D.transfers
369
+ s = T.makeBitMaskFilter(
370
+ E.transfers
393
371
  );
394
372
  break;
395
373
  case "market-orders":
396
- s = A.makeBitMaskFilter(
397
- D["market-orders"]
374
+ s = T.makeBitMaskFilter(
375
+ E["market-orders"]
398
376
  );
399
377
  break;
400
378
  case "interests":
401
- s = A.makeBitMaskFilter(
402
- D.interests
379
+ s = T.makeBitMaskFilter(
380
+ E.interests
403
381
  );
404
382
  break;
405
383
  case "stake-operations":
406
- s = A.makeBitMaskFilter(
407
- D["stake-operations"]
384
+ s = T.makeBitMaskFilter(
385
+ E["stake-operations"]
408
386
  );
409
387
  break;
410
388
  case "rewards":
411
- s = A.makeBitMaskFilter(
412
- D.rewards
389
+ s = T.makeBitMaskFilter(
390
+ E.rewards
413
391
  );
414
392
  break;
415
393
  default:
416
- s = A.makeBitMaskFilter([]);
394
+ s = T.makeBitMaskFilter([]);
417
395
  }
418
- return (await l.hiveClient.call(
396
+ return (await y.hiveClient.call(
419
397
  "condenser_api",
420
398
  "get_account_history",
421
399
  [e, r, t, ...s]
@@ -443,8 +421,8 @@ function te(e, t = 20, n) {
443
421
  case "recurrent_transfer":
444
422
  return ["HIVE"].includes(o.amount);
445
423
  case "fill_recurrent_transfer":
446
- const f = p(o.amount);
447
- return ["HIVE"].includes(f.symbol);
424
+ const l = p(o.amount);
425
+ return ["HIVE"].includes(l.symbol);
448
426
  case "claim_reward_balance":
449
427
  return p(
450
428
  o.reward_hive
@@ -470,9 +448,9 @@ function te(e, t = 20, n) {
470
448
  })
471
449
  });
472
450
  }
473
- function _t(e, t = 20, n) {
451
+ function kt(e, t = 20, n) {
474
452
  return R({
475
- ...te(e, t, n),
453
+ ...ne(e, t, n),
476
454
  queryKey: ["assets", "hive-power", "transactions", e, t, n],
477
455
  select: ({ pages: r, pageParams: s }) => ({
478
456
  pageParams: s,
@@ -494,8 +472,8 @@ function _t(e, t = 20, n) {
494
472
  case "recurrent_transfer":
495
473
  return ["VESTS", "HP"].includes(o.amount);
496
474
  case "fill_recurrent_transfer":
497
- const g = p(o.amount);
498
- return ["VESTS", "HP"].includes(g.symbol);
475
+ const w = p(o.amount);
476
+ return ["VESTS", "HP"].includes(w.symbol);
499
477
  case "curation_reward":
500
478
  case "withdraw_vesting":
501
479
  case "delegate_vesting_shares":
@@ -512,9 +490,9 @@ function _t(e, t = 20, n) {
512
490
  })
513
491
  });
514
492
  }
515
- function vt(e, t = 20, n) {
493
+ function bt(e, t = 20, n) {
516
494
  return R({
517
- ...te(e, t, n),
495
+ ...ne(e, t, n),
518
496
  queryKey: ["assets", "hbd", "transactions", e, t, n],
519
497
  select: ({ pages: r, pageParams: s }) => ({
520
498
  pageParams: s,
@@ -534,8 +512,8 @@ function vt(e, t = 20, n) {
534
512
  case "recurrent_transfer":
535
513
  return ["HBD"].includes(o.amount);
536
514
  case "fill_recurrent_transfer":
537
- const g = p(o.amount);
538
- return ["HBD"].includes(g.symbol);
515
+ const w = p(o.amount);
516
+ return ["HBD"].includes(w.symbol);
539
517
  case "comment_reward":
540
518
  case "effective_comment_vote":
541
519
  return !0;
@@ -547,16 +525,16 @@ function vt(e, t = 20, n) {
547
525
  })
548
526
  });
549
527
  }
550
- function kt(e = 86400) {
528
+ function Pt(e = 86400) {
551
529
  return R({
552
530
  queryKey: ["assets", "hive", "metrics", e],
553
- queryFn: async ({ pageParam: [t, n] }) => (await l.hiveClient.call(
531
+ queryFn: async ({ pageParam: [t, n] }) => (await y.hiveClient.call(
554
532
  "condenser_api",
555
533
  "get_market_history",
556
534
  [
557
535
  e,
558
- Q(t).format("YYYY-MM-DDTHH:mm:ss"),
559
- Q(n).format("YYYY-MM-DDTHH:mm:ss")
536
+ C(t).format("YYYY-MM-DDTHH:mm:ss"),
537
+ C(n).format("YYYY-MM-DDTHH:mm:ss")
560
538
  ]
561
539
  )).map(({ hive: s, non_hive: a, open: o }) => ({
562
540
  close: a.close / s.close,
@@ -568,29 +546,29 @@ function kt(e = 86400) {
568
546
  })),
569
547
  initialPageParam: [
570
548
  // Fetch at least 8 hours or given interval
571
- Q().subtract(Math.max(100 * e, 28800), "second").toDate(),
549
+ C().subtract(Math.max(100 * e, 28800), "second").toDate(),
572
550
  /* @__PURE__ */ new Date()
573
551
  ],
574
552
  getNextPageParam: (t, n, [r]) => [
575
- Q(r.getTime()).subtract(Math.max(100 * e, 28800), "second").toDate(),
576
- Q(r.getTime()).subtract(e, "second").toDate()
553
+ C(r.getTime()).subtract(Math.max(100 * e, 28800), "second").toDate(),
554
+ C(r.getTime()).subtract(e, "second").toDate()
577
555
  ]
578
556
  });
579
557
  }
580
- function bt(e) {
558
+ function qt(e) {
581
559
  return h({
582
560
  queryKey: ["assets", "hive", "withdrawal-routes", e],
583
- queryFn: () => l.hiveClient.database.call("get_withdraw_routes", [
561
+ queryFn: () => y.hiveClient.database.call("get_withdraw_routes", [
584
562
  e,
585
563
  "outgoing"
586
564
  ])
587
565
  });
588
566
  }
589
- async function x(e) {
567
+ async function V(e) {
590
568
  const n = p(e.amount).symbol;
591
569
  if (e.type === "key" && "key" in e) {
592
570
  const { key: r, type: s, ...a } = e;
593
- return l.hiveClient.broadcast.transfer(
571
+ return y.hiveClient.broadcast.transfer(
594
572
  {
595
573
  from: a.from,
596
574
  to: a.to,
@@ -630,14 +608,14 @@ async function x(e) {
630
608
  }
631
609
  );
632
610
  }
633
- async function U(e) {
611
+ async function G(e) {
634
612
  if (e.type === "key" && "key" in e) {
635
613
  const { key: t, type: n, ...r } = e;
636
- return l.hiveClient.broadcast.sendOperations(
614
+ return y.hiveClient.broadcast.sendOperations(
637
615
  [["transfer_to_savings", r]],
638
616
  t
639
617
  );
640
- } else return e.type === "keychain" ? b.broadcast(
618
+ } else return e.type === "keychain" ? P.broadcast(
641
619
  e.from,
642
620
  [["transfer_to_savings", e]],
643
621
  "Active"
@@ -651,11 +629,11 @@ async function U(e) {
651
629
  async function Oe(e) {
652
630
  if (e.type === "key" && "key" in e) {
653
631
  const { key: t, type: n, ...r } = e;
654
- return l.hiveClient.broadcast.sendOperations(
632
+ return y.hiveClient.broadcast.sendOperations(
655
633
  [["transfer_to_vesting", r]],
656
634
  t
657
635
  );
658
- } else return e.type === "keychain" ? b.broadcast(
636
+ } else return e.type === "keychain" ? P.broadcast(
659
637
  e.from,
660
638
  [["transfer_to_vesting", e]],
661
639
  "Active"
@@ -666,14 +644,14 @@ async function Oe(e) {
666
644
  }
667
645
  );
668
646
  }
669
- async function Se(e) {
647
+ async function Te(e) {
670
648
  if (e.type === "key" && "key" in e) {
671
649
  const { key: t, type: n, ...r } = e;
672
- return l.hiveClient.broadcast.sendOperations(
650
+ return y.hiveClient.broadcast.sendOperations(
673
651
  [["delegate_vesting_shares", r]],
674
652
  t
675
653
  );
676
- } else return e.type === "keychain" ? b.broadcast(
654
+ } else return e.type === "keychain" ? P.broadcast(
677
655
  e.from,
678
656
  [["delegate_vesting_shares", e]],
679
657
  "Active"
@@ -687,11 +665,11 @@ async function Se(e) {
687
665
  async function Ae(e) {
688
666
  if (e.type === "key" && "key" in e) {
689
667
  const { key: t, type: n, ...r } = e;
690
- return l.hiveClient.broadcast.sendOperations(
668
+ return y.hiveClient.broadcast.sendOperations(
691
669
  [["withdraw_vesting", r]],
692
670
  t
693
671
  );
694
- } else return e.type === "keychain" ? b.broadcast(
672
+ } else return e.type === "keychain" ? P.broadcast(
695
673
  e.from,
696
674
  [["withdraw_vesting", e]],
697
675
  "Active"
@@ -705,14 +683,14 @@ async function Ae(e) {
705
683
  async function Ne(e) {
706
684
  if (e.type === "key" && "key" in e) {
707
685
  const { key: r, type: s, ...a } = e;
708
- return l.hiveClient.broadcast.sendOperations(
686
+ return y.hiveClient.broadcast.sendOperations(
709
687
  [["set_withdraw_vesting_route", a]],
710
688
  r
711
689
  );
712
690
  }
713
691
  if (e.type === "keychain") {
714
692
  const { type: r, ...s } = e;
715
- return b.broadcast(
693
+ return P.broadcast(
716
694
  s.from_account,
717
695
  [["set_withdraw_vesting_route", s]],
718
696
  "Active"
@@ -727,7 +705,7 @@ async function Ne(e) {
727
705
  );
728
706
  }
729
707
  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 || {});
730
- async function Te(e) {
708
+ async function He(e) {
731
709
  const t = JSON.stringify({
732
710
  to: e.to,
733
711
  amount: +e.amount * 1e3,
@@ -740,10 +718,10 @@ async function Te(e) {
740
718
  };
741
719
  if (e.type === "key" && "key" in e) {
742
720
  const { key: r } = e;
743
- return l.hiveClient.broadcast.json(n, r);
721
+ return y.hiveClient.broadcast.json(n, r);
744
722
  } else {
745
723
  if (e.type === "keychain")
746
- return b.customJson(
724
+ return P.customJson(
747
725
  e.from,
748
726
  e.id,
749
727
  "Active",
@@ -770,7 +748,7 @@ async function Te(e) {
770
748
  }
771
749
  }
772
750
  }
773
- const He = async (e) => {
751
+ const Ke = async (e) => {
774
752
  const t = JSON.stringify({ amount: +e.amount * 1e3 }), n = {
775
753
  id: e.mode === "lock" ? "spkcc_gov_up" : "spkcc_gov_down",
776
754
  json: t,
@@ -779,10 +757,10 @@ const He = async (e) => {
779
757
  };
780
758
  if (e.type === "key" && "key" in e) {
781
759
  const { key: r } = e;
782
- return l.hiveClient.broadcast.json(n, r);
760
+ return y.hiveClient.broadcast.json(n, r);
783
761
  } else {
784
762
  if (e.type === "keychain")
785
- return b.customJson(
763
+ return P.customJson(
786
764
  e.from,
787
765
  n.id,
788
766
  "Active",
@@ -805,7 +783,7 @@ const He = async (e) => {
805
783
  }
806
784
  }
807
785
  };
808
- async function Ke(e) {
786
+ async function Qe(e) {
809
787
  const t = JSON.stringify({ amount: +e.amount * 1e3 }), n = {
810
788
  id: `spkcc_power_${e.mode}`,
811
789
  json: t,
@@ -814,10 +792,10 @@ async function Ke(e) {
814
792
  };
815
793
  if (e.type === "key" && "key" in e) {
816
794
  const { key: r } = e;
817
- return l.hiveClient.broadcast.json(n, r);
795
+ return y.hiveClient.broadcast.json(n, r);
818
796
  } else {
819
797
  if (e.type === "keychain")
820
- return b.customJson(
798
+ return P.customJson(
821
799
  e.from,
822
800
  `spkcc_power_${e.mode}`,
823
801
  "Active",
@@ -840,13 +818,13 @@ async function Ke(e) {
840
818
  }
841
819
  }
842
820
  }
843
- function H() {
821
+ function K() {
844
822
  return h({
845
823
  queryKey: ["assets", "spk", "markets"],
846
824
  staleTime: 6e4,
847
825
  refetchInterval: 9e4,
848
826
  queryFn: async () => {
849
- const t = await (await fetch(`${l.spkNode}/markets`)).json();
827
+ const t = await (await fetch(`${y.spkNode}/markets`)).json();
850
828
  return {
851
829
  list: Object.entries(t.markets.node).map(([n, r]) => ({
852
830
  name: n,
@@ -857,33 +835,33 @@ function H() {
857
835
  }
858
836
  });
859
837
  }
860
- function K(e) {
838
+ function Q(e) {
861
839
  return h({
862
840
  queryKey: ["assets", "spk", "wallet", e],
863
- queryFn: async () => (await fetch(l.spkNode + `/@${e}`)).json(),
841
+ queryFn: async () => (await fetch(y.spkNode + `/@${e}`)).json(),
864
842
  enabled: !!e,
865
843
  staleTime: 6e4,
866
844
  refetchInterval: 9e4
867
845
  });
868
846
  }
869
- function V(e) {
847
+ function W(e) {
870
848
  return e.toFixed(3);
871
849
  }
872
- function Qe(e) {
850
+ function De(e) {
873
851
  return h({
874
852
  queryKey: ["assets", "larynx", "general-info", e],
875
853
  staleTime: 6e4,
876
854
  refetchInterval: 9e4,
877
855
  queryFn: async () => {
878
- await i().prefetchQuery(K(e)), await i().prefetchQuery(H()), await i().prefetchQuery(
879
- q(e)
856
+ await i().prefetchQuery(Q(e)), await i().prefetchQuery(K()), await i().prefetchQuery(
857
+ O(e)
880
858
  );
881
859
  const t = i().getQueryData(
882
- K(e).queryKey
860
+ Q(e).queryKey
883
861
  ), n = i().getQueryData(
884
- H().queryKey
862
+ K().queryKey
885
863
  ), r = i().getQueryData(
886
- q(e).queryKey
864
+ O(e).queryKey
887
865
  );
888
866
  if (!t || !n)
889
867
  return {
@@ -892,9 +870,9 @@ function Qe(e) {
892
870
  price: 1,
893
871
  accountBalance: 0
894
872
  };
895
- const s = +V(
873
+ const s = +W(
896
874
  t.balance / 1e3 * +t.tick * ((r == null ? void 0 : r.price) ?? 0)
897
- ), a = +V(t.balance / 1e3);
875
+ ), a = +W(t.balance / 1e3);
898
876
  return {
899
877
  name: "LARYNX",
900
878
  layer: "SPK",
@@ -905,24 +883,24 @@ function Qe(e) {
905
883
  }
906
884
  });
907
885
  }
908
- function I(e) {
886
+ function j(e) {
909
887
  return e.toFixed(3);
910
888
  }
911
- function De(e) {
889
+ function Ce(e) {
912
890
  return h({
913
891
  queryKey: ["assets", "spk", "general-info", e],
914
892
  staleTime: 6e4,
915
893
  refetchInterval: 9e4,
916
894
  queryFn: async () => {
917
- await i().prefetchQuery(K(e)), await i().prefetchQuery(H()), await i().prefetchQuery(
918
- q(e)
895
+ await i().prefetchQuery(Q(e)), await i().prefetchQuery(K()), await i().prefetchQuery(
896
+ O(e)
919
897
  );
920
898
  const t = i().getQueryData(
921
- K(e).queryKey
899
+ Q(e).queryKey
922
900
  ), n = i().getQueryData(
923
- H().queryKey
901
+ K().queryKey
924
902
  ), r = i().getQueryData(
925
- q(e).queryKey
903
+ O(e).queryKey
926
904
  );
927
905
  if (!t || !n)
928
906
  return {
@@ -931,17 +909,17 @@ function De(e) {
931
909
  price: 1,
932
910
  accountBalance: 0
933
911
  };
934
- const s = +I(
912
+ const s = +j(
935
913
  (t.gov + t.spk) / 1e3 * +t.tick * ((r == null ? void 0 : r.price) ?? 0)
936
- ), a = +I(
937
- (t.spk + ke(
914
+ ), a = +j(
915
+ (t.spk + be(
938
916
  t,
939
917
  n.raw.stats || {
940
918
  spk_rate_lgov: "0.001",
941
- spk_rate_lpow: I(
919
+ spk_rate_lpow: j(
942
920
  parseFloat(n.raw.stats.spk_rate_lpow) * 100
943
921
  ),
944
- spk_rate_ldel: I(
922
+ spk_rate_ldel: j(
945
923
  parseFloat(n.raw.stats.spk_rate_ldel) * 100
946
924
  )
947
925
  }
@@ -956,7 +934,7 @@ function De(e) {
956
934
  }
957
935
  });
958
936
  }
959
- function j(e) {
937
+ function F(e) {
960
938
  return e.toFixed(3);
961
939
  }
962
940
  function Ee(e) {
@@ -966,15 +944,15 @@ function Ee(e) {
966
944
  refetchInterval: 9e4,
967
945
  queryFn: async () => {
968
946
  var o, c;
969
- await i().prefetchQuery(K(e)), await i().prefetchQuery(H()), await i().prefetchQuery(
970
- q(e)
947
+ await i().prefetchQuery(Q(e)), await i().prefetchQuery(K()), await i().prefetchQuery(
948
+ O(e)
971
949
  );
972
950
  const t = i().getQueryData(
973
- K(e).queryKey
951
+ Q(e).queryKey
974
952
  ), n = i().getQueryData(
975
- H().queryKey
953
+ K().queryKey
976
954
  ), r = i().getQueryData(
977
- q(e).queryKey
955
+ O(e).queryKey
978
956
  );
979
957
  if (!t || !n)
980
958
  return {
@@ -983,9 +961,9 @@ function Ee(e) {
983
961
  price: 1,
984
962
  accountBalance: 0
985
963
  };
986
- const s = +j(
964
+ const s = +F(
987
965
  t.poweredUp / 1e3 * +t.tick * ((r == null ? void 0 : r.price) ?? 0)
988
- ), a = +j(t.poweredUp / 1e3);
966
+ ), a = +F(t.poweredUp / 1e3);
989
967
  return {
990
968
  name: "LP",
991
969
  title: "LARYNX Power",
@@ -995,24 +973,24 @@ function Ee(e) {
995
973
  parts: [
996
974
  {
997
975
  name: "delegating",
998
- balance: (o = t.granting) != null && o.t ? +j(t.granting.t / 1e3) : 0
976
+ balance: (o = t.granting) != null && o.t ? +F(t.granting.t / 1e3) : 0
999
977
  },
1000
978
  {
1001
979
  name: "recieved",
1002
- balance: (c = t.granted) != null && c.t ? +j(t.granted.t / 1e3) : 0
980
+ balance: (c = t.granted) != null && c.t ? +F(t.granted.t / 1e3) : 0
1003
981
  }
1004
982
  ]
1005
983
  };
1006
984
  }
1007
985
  });
1008
986
  }
1009
- function F(e) {
987
+ function L(e) {
1010
988
  return h({
1011
989
  queryKey: ["assets", "hive-engine", "metadata-list", e],
1012
990
  staleTime: 6e4,
1013
991
  refetchInterval: 9e4,
1014
992
  queryFn: async () => (await (await fetch(
1015
- `${l.privateApiHost}/private-api/engine-api`,
993
+ `${y.privateApiHost}/private-api/engine-api`,
1016
994
  {
1017
995
  method: "POST",
1018
996
  body: JSON.stringify({
@@ -1032,7 +1010,7 @@ function F(e) {
1032
1010
  )).json()).result
1033
1011
  });
1034
1012
  }
1035
- const L = [
1013
+ const B = [
1036
1014
  "LEO",
1037
1015
  "ARCHON",
1038
1016
  "WAIV",
@@ -1058,13 +1036,13 @@ const L = [
1058
1036
  "SPORTS",
1059
1037
  "CURE"
1060
1038
  ];
1061
- function $(e) {
1039
+ function U(e) {
1062
1040
  return h({
1063
1041
  queryKey: ["assets", "hive-engine", "balances", e],
1064
1042
  staleTime: 6e4,
1065
1043
  refetchInterval: 9e4,
1066
1044
  queryFn: async () => (await (await fetch(
1067
- `${l.privateApiHost}/private-api/engine-api`,
1045
+ `${y.privateApiHost}/private-api/engine-api`,
1068
1046
  {
1069
1047
  method: "POST",
1070
1048
  body: JSON.stringify({
@@ -1090,7 +1068,7 @@ function Re() {
1090
1068
  staleTime: 6e4,
1091
1069
  refetchInterval: 9e4,
1092
1070
  queryFn: async () => (await (await fetch(
1093
- `${l.privateApiHost}/private-api/engine-api`,
1071
+ `${y.privateApiHost}/private-api/engine-api`,
1094
1072
  {
1095
1073
  method: "POST",
1096
1074
  body: JSON.stringify({
@@ -1108,7 +1086,7 @@ function Re() {
1108
1086
  )).json()).result
1109
1087
  });
1110
1088
  }
1111
- function Ce(e, t) {
1089
+ function Ie(e, t) {
1112
1090
  return h({
1113
1091
  queryKey: ["assets", "hive-engine", t, "general-info", e],
1114
1092
  enabled: !!t && !!e,
@@ -1119,17 +1097,17 @@ function Ce(e, t) {
1119
1097
  throw new Error(
1120
1098
  "[SDK][Wallets] – hive engine token or username missed"
1121
1099
  );
1122
- const n = q(e);
1100
+ const n = O(e);
1123
1101
  await i().prefetchQuery(n);
1124
1102
  const r = i().getQueryData(
1125
1103
  n.queryKey
1126
- ), s = F(L);
1104
+ ), s = L(B);
1127
1105
  await i().prefetchQuery(s);
1128
- const a = i().getQueryData(s.queryKey), o = $(e);
1106
+ const a = i().getQueryData(s.queryKey), o = U(e);
1129
1107
  await i().prefetchQuery(o);
1130
- const c = i().getQueryData(o.queryKey), f = Re();
1131
- await i().prefetchQuery(f);
1132
- const g = i().getQueryData(f.queryKey), _ = a == null ? void 0 : a.find((P) => P.symbol === t), v = c == null ? void 0 : c.find((P) => P.symbol === t), S = g == null ? void 0 : g.find((P) => P.symbol === t), k = +((S == null ? void 0 : S.lastPrice) ?? "0");
1108
+ const c = i().getQueryData(o.queryKey), l = Re();
1109
+ await i().prefetchQuery(l);
1110
+ const w = i().getQueryData(l.queryKey), _ = a == null ? void 0 : a.find((q) => q.symbol === t), v = c == null ? void 0 : c.find((q) => q.symbol === t), b = w == null ? void 0 : w.find((q) => q.symbol === t), k = +((b == null ? void 0 : b.lastPrice) ?? "0");
1133
1111
  return {
1134
1112
  name: t,
1135
1113
  title: (_ == null ? void 0 : _.name) ?? "",
@@ -1140,7 +1118,7 @@ function Ce(e, t) {
1140
1118
  }
1141
1119
  });
1142
1120
  }
1143
- function Pt(e, t, n = 20) {
1121
+ function St(e, t, n = 20) {
1144
1122
  return R({
1145
1123
  queryKey: ["assets", "hive-engine", t, "transactions", e],
1146
1124
  enabled: !!t && !!e,
@@ -1152,7 +1130,7 @@ function Pt(e, t, n = 20) {
1152
1130
  "[SDK][Wallets] – hive engine token or username missed"
1153
1131
  );
1154
1132
  const s = new URL(
1155
- `${l.privateApiHost}/private-api/engine-account-history`
1133
+ `${y.privateApiHost}/private-api/engine-account-history`
1156
1134
  );
1157
1135
  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, {
1158
1136
  method: "GET",
@@ -1161,14 +1139,14 @@ function Pt(e, t, n = 20) {
1161
1139
  }
1162
1140
  });
1163
1141
  }
1164
- function qt(e, t = "daily") {
1142
+ function Ot(e, t = "daily") {
1165
1143
  return h({
1166
1144
  queryKey: ["assets", "hive-engine", e],
1167
1145
  staleTime: 6e4,
1168
1146
  refetchInterval: 9e4,
1169
1147
  queryFn: async () => {
1170
1148
  const n = new URL(
1171
- `${l.privateApiHost}/private-api/engine-chart-api`
1149
+ `${y.privateApiHost}/private-api/engine-chart-api`
1172
1150
  );
1173
1151
  return n.searchParams.set("symbol", e), n.searchParams.set("interval", t), await (await fetch(n, {
1174
1152
  headers: { "Content-type": "application/json" }
@@ -1176,7 +1154,7 @@ function qt(e, t = "daily") {
1176
1154
  }
1177
1155
  });
1178
1156
  }
1179
- async function Ie(e) {
1157
+ async function je(e) {
1180
1158
  const n = p(e.amount).amount.toString();
1181
1159
  if (e.type === "key" && "key" in e) {
1182
1160
  const { key: r, type: s, ...a } = e, o = {
@@ -1193,7 +1171,7 @@ async function Ie(e) {
1193
1171
  required_auths: [a.from],
1194
1172
  required_posting_auths: []
1195
1173
  };
1196
- return l.hiveClient.broadcast.json(o, r);
1174
+ return y.hiveClient.broadcast.json(o, r);
1197
1175
  } else return e.type === "keychain" ? new Promise(
1198
1176
  (r, s) => {
1199
1177
  var a;
@@ -1239,7 +1217,7 @@ async function Ie(e) {
1239
1217
  }
1240
1218
  );
1241
1219
  }
1242
- async function je(e) {
1220
+ async function Fe(e) {
1243
1221
  const n = p(e.amount).amount.toString();
1244
1222
  if (e.type === "key" && "key" in e) {
1245
1223
  const { key: r, type: s, ...a } = e, o = {
@@ -1256,7 +1234,7 @@ async function je(e) {
1256
1234
  required_auths: [a.from],
1257
1235
  required_posting_auths: []
1258
1236
  };
1259
- return l.hiveClient.broadcast.json(o, r);
1237
+ return y.hiveClient.broadcast.json(o, r);
1260
1238
  } else return e.type === "keychain" ? new Promise(
1261
1239
  (r, s) => {
1262
1240
  var a;
@@ -1302,7 +1280,7 @@ async function je(e) {
1302
1280
  }
1303
1281
  );
1304
1282
  }
1305
- async function Fe(e) {
1283
+ async function Le(e) {
1306
1284
  const n = p(e.amount).amount.toString();
1307
1285
  if (e.type === "key" && "key" in e) {
1308
1286
  const { key: r, type: s, ...a } = e, o = {
@@ -1319,7 +1297,7 @@ async function Fe(e) {
1319
1297
  required_auths: [a.from],
1320
1298
  required_posting_auths: []
1321
1299
  };
1322
- return l.hiveClient.broadcast.json(o, r);
1300
+ return y.hiveClient.broadcast.json(o, r);
1323
1301
  } else return e.type === "keychain" ? new Promise(
1324
1302
  (r, s) => {
1325
1303
  var a;
@@ -1365,7 +1343,7 @@ async function Fe(e) {
1365
1343
  }
1366
1344
  );
1367
1345
  }
1368
- async function Le(e) {
1346
+ async function Be(e) {
1369
1347
  const n = p(e.amount).amount.toString();
1370
1348
  if (e.type === "key" && "key" in e) {
1371
1349
  const { key: r, type: s, ...a } = e, o = {
@@ -1382,7 +1360,7 @@ async function Le(e) {
1382
1360
  required_auths: [a.from],
1383
1361
  required_posting_auths: []
1384
1362
  };
1385
- return l.hiveClient.broadcast.json(o, r);
1363
+ return y.hiveClient.broadcast.json(o, r);
1386
1364
  } else return e.type === "keychain" ? new Promise(
1387
1365
  (r, s) => {
1388
1366
  var a;
@@ -1428,7 +1406,7 @@ async function Le(e) {
1428
1406
  }
1429
1407
  );
1430
1408
  }
1431
- async function Be(e) {
1409
+ async function Me(e) {
1432
1410
  const n = p(e.amount).amount.toString();
1433
1411
  if (e.type === "key" && "key" in e) {
1434
1412
  const { key: r, type: s, ...a } = e, o = {
@@ -1446,7 +1424,7 @@ async function Be(e) {
1446
1424
  required_auths: [a.from],
1447
1425
  required_posting_auths: []
1448
1426
  };
1449
- return l.hiveClient.broadcast.json(o, r);
1427
+ return y.hiveClient.broadcast.json(o, r);
1450
1428
  } else return e.type === "keychain" ? new Promise(
1451
1429
  (r, s) => {
1452
1430
  var a;
@@ -1494,7 +1472,7 @@ async function Be(e) {
1494
1472
  }
1495
1473
  );
1496
1474
  }
1497
- function M(e) {
1475
+ function J(e) {
1498
1476
  return h({
1499
1477
  queryKey: ["assets", "points", e],
1500
1478
  queryFn: async () => {
@@ -1503,7 +1481,7 @@ function M(e) {
1503
1481
  "[SDK][Wallets][Assets][Points][Query] – username wasn`t provided"
1504
1482
  );
1505
1483
  const n = await (await fetch(
1506
- l.privateApiHost + "/private-api/points",
1484
+ y.privateApiHost + "/private-api/points",
1507
1485
  {
1508
1486
  method: "POST",
1509
1487
  headers: {
@@ -1523,15 +1501,15 @@ function M(e) {
1523
1501
  enabled: !!e
1524
1502
  });
1525
1503
  }
1526
- function Me(e) {
1504
+ function Je(e) {
1527
1505
  return h({
1528
1506
  queryKey: ["assets", "points", "general-info", e],
1529
1507
  staleTime: 6e4,
1530
1508
  refetchInterval: 9e4,
1531
1509
  queryFn: async () => {
1532
- await i().prefetchQuery(M(e));
1510
+ await i().prefetchQuery(J(e));
1533
1511
  const t = i().getQueryData(
1534
- M(e).queryKey
1512
+ J(e).queryKey
1535
1513
  );
1536
1514
  return {
1537
1515
  name: "POINTS",
@@ -1542,11 +1520,11 @@ function Me(e) {
1542
1520
  }
1543
1521
  });
1544
1522
  }
1545
- function Ot(e, t) {
1523
+ function Tt(e, t) {
1546
1524
  return h({
1547
- queryKey: ["assets", "points", "transactions", e],
1525
+ queryKey: ["assets", "points", "transactions", e, t],
1548
1526
  queryFn: async () => (await (await fetch(
1549
- `${l.privateApiHost}/private-api/point-list`,
1527
+ `${y.privateApiHost}/private-api/point-list`,
1550
1528
  {
1551
1529
  method: "POST",
1552
1530
  body: JSON.stringify({
@@ -1567,29 +1545,29 @@ function Ot(e, t) {
1567
1545
  }))
1568
1546
  });
1569
1547
  }
1570
- function St(e, t, n) {
1571
- const { mutateAsync: r } = W.useRecordActivity(
1548
+ function At(e, t, n) {
1549
+ const { mutateAsync: r } = X.useRecordActivity(
1572
1550
  e,
1573
1551
  "points-claimed"
1574
1552
  );
1575
- return O({
1553
+ return N({
1576
1554
  mutationFn: async () => {
1577
1555
  if (!e)
1578
1556
  throw new Error(
1579
1557
  "[SDK][Wallets][Assets][Points][Claim] – username wasn`t provided"
1580
1558
  );
1581
- return fetch(l.privateApiHost + "/private-api/points-claim", {
1559
+ return fetch(y.privateApiHost + "/private-api/points-claim", {
1582
1560
  method: "POST",
1583
1561
  headers: {
1584
1562
  "Content-Type": "application/json"
1585
1563
  },
1586
- body: JSON.stringify({ code: ye(e) })
1564
+ body: JSON.stringify({ code: oe(e) })
1587
1565
  });
1588
1566
  },
1589
1567
  onError: n,
1590
1568
  onSuccess: () => {
1591
- r(), l.queryClient.setQueryData(
1592
- M(e).queryKey,
1569
+ r(), y.queryClient.setQueryData(
1570
+ J(e).queryKey,
1593
1571
  (s) => s && {
1594
1572
  points: (parseFloat(s.points) + parseFloat(s.uPoints)).toFixed(3),
1595
1573
  uPoints: "0"
@@ -1598,7 +1576,7 @@ function St(e, t, n) {
1598
1576
  }
1599
1577
  });
1600
1578
  }
1601
- async function Je({
1579
+ async function $e({
1602
1580
  from: e,
1603
1581
  to: t,
1604
1582
  amount: n,
@@ -1622,61 +1600,74 @@ async function Je({
1622
1600
  ];
1623
1601
  if (s === "key" && "key" in a) {
1624
1602
  const { key: c } = a;
1625
- return l.hiveClient.broadcast.sendOperations([o], c);
1603
+ return y.hiveClient.broadcast.sendOperations([o], c);
1626
1604
  }
1627
- return s === "keychain" ? b.broadcast(e, [o], "Active") : d.sendOperation(
1605
+ return s === "keychain" ? P.broadcast(e, [o], "Active") : d.sendOperation(
1628
1606
  o,
1629
1607
  { callback: `https://ecency.com/@${e}/wallet` },
1630
1608
  () => {
1631
1609
  }
1632
1610
  );
1633
1611
  }
1634
- var $e = /* @__PURE__ */ ((e) => (e[e.CHECKIN = 10] = "CHECKIN", e[e.LOGIN = 20] = "LOGIN", e[e.CHECKIN_EXTRA = 30] = "CHECKIN_EXTRA", e[e.POST = 100] = "POST", e[e.COMMENT = 110] = "COMMENT", e[e.VOTE = 120] = "VOTE", e[e.REBLOG = 130] = "REBLOG", e[e.DELEGATION = 150] = "DELEGATION", e[e.REFERRAL = 160] = "REFERRAL", e[e.COMMUNITY = 170] = "COMMUNITY", e[e.TRANSFER_SENT = 998] = "TRANSFER_SENT", e[e.TRANSFER_INCOMING = 999] = "TRANSFER_INCOMING", e[e.MINTED = 991] = "MINTED", e))($e || {});
1635
- function At(e) {
1612
+ var xe = /* @__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))(xe || {});
1613
+ function Nt(e) {
1636
1614
  return h({
1637
1615
  queryKey: ["ecency-wallets", "all-tokens-list", e],
1638
1616
  queryFn: async () => {
1639
1617
  await i().prefetchQuery(
1640
- F(L)
1618
+ L(B)
1641
1619
  );
1642
- const t = i().getQueryData(F(L).queryKey);
1620
+ const t = i().getQueryData(L(B).queryKey);
1643
1621
  return {
1644
1622
  basic: [
1645
- w.Points,
1646
- w.Hive,
1647
- w.HivePower,
1648
- w.HiveDollar,
1649
- w.Spk,
1650
- "LARYNX",
1651
- "LP"
1623
+ g.Points,
1624
+ g.Hive,
1625
+ g.HivePower,
1626
+ g.HiveDollar
1652
1627
  ].filter((n) => n.toLowerCase().includes(e.toLowerCase())),
1653
- external: Object.values(m).filter(
1628
+ external: Object.values(f).filter(
1654
1629
  (n) => n.toLowerCase().includes(e.toLowerCase())
1655
1630
  ),
1631
+ spk: [g.Spk, "LARYNX", "LP"],
1656
1632
  layer2: t
1657
1633
  };
1658
1634
  }
1659
1635
  });
1660
1636
  }
1661
- function xe(e) {
1637
+ function Ue(e) {
1662
1638
  return h({
1663
1639
  queryKey: ["ecency-wallets", "list", e],
1664
1640
  enabled: !!e,
1665
1641
  queryFn: async () => {
1666
- const t = l.storage.getItem(
1667
- l.storagePrefix + "_wallet_assets_list"
1642
+ var r;
1643
+ const t = S(e);
1644
+ await i().fetchQuery({
1645
+ queryKey: t.queryKey
1646
+ });
1647
+ const n = i().getQueryData(
1648
+ t.queryKey
1668
1649
  );
1669
- return t ? JSON.parse(t) : [
1670
- w.Points,
1671
- w.Hive,
1672
- w.HivePower,
1673
- w.HiveDollar,
1674
- w.Spk
1650
+ if (((r = n == null ? void 0 : n.profile) == null ? void 0 : r.tokens) instanceof Array) {
1651
+ const s = [
1652
+ g.Points,
1653
+ g.Hive,
1654
+ g.HivePower,
1655
+ g.HiveDollar,
1656
+ ...n.profile.tokens.map((a) => a.symbol)
1657
+ ];
1658
+ return Array.from(new Set(s).values());
1659
+ }
1660
+ return [
1661
+ g.Points,
1662
+ g.Hive,
1663
+ g.HivePower,
1664
+ g.HiveDollar,
1665
+ g.Spk
1675
1666
  ];
1676
1667
  }
1677
1668
  });
1678
1669
  }
1679
- function Ue(e, t, n = { refetch: !1 }) {
1670
+ function Ve(e, t, n = { refetch: !1 }) {
1680
1671
  const r = async (s) => (n.refetch ? await i().fetchQuery(s) : await i().prefetchQuery(s), i().getQueryData(
1681
1672
  s.queryKey
1682
1673
  ));
@@ -1684,22 +1675,22 @@ function Ue(e, t, n = { refetch: !1 }) {
1684
1675
  queryKey: ["ecency-wallets", "asset-info", e, t],
1685
1676
  queryFn: async () => {
1686
1677
  if (t === "HIVE")
1687
- return r(q(e));
1678
+ return r(O(e));
1688
1679
  if (t === "HP")
1689
- return r(Pe(e));
1690
- if (t === "HBD")
1691
1680
  return r(qe(e));
1681
+ if (t === "HBD")
1682
+ return r(Se(e));
1692
1683
  if (t === "SPK")
1693
- return r(De(e));
1684
+ return r(Ce(e));
1694
1685
  if (t === "LARYNX")
1695
- return r(Qe(e));
1686
+ return r(De(e));
1696
1687
  if (t === "LP")
1697
1688
  return r(Ee(e));
1698
1689
  if (t === "POINTS")
1699
- return r(Me(e));
1700
- if (L.includes(t))
1690
+ return r(Je(e));
1691
+ if (B.includes(t))
1701
1692
  return await r(
1702
- Ce(e, t)
1693
+ Ie(e, t)
1703
1694
  );
1704
1695
  throw new Error(
1705
1696
  "[SDK][Wallets] – has requested unrecognized asset info"
@@ -1707,12 +1698,12 @@ function Ue(e, t, n = { refetch: !1 }) {
1707
1698
  }
1708
1699
  });
1709
1700
  }
1710
- function Nt(e, t, n = !1) {
1701
+ function Ht(e, t, n = !1) {
1711
1702
  return h({
1712
1703
  queryKey: ["wallets", "token-operations", e, t, n],
1713
1704
  queryFn: async () => {
1714
1705
  switch (e) {
1715
- case w.Hive:
1706
+ case g.Hive:
1716
1707
  return [
1717
1708
  u.Transfer,
1718
1709
  ...n ? [
@@ -1721,17 +1712,17 @@ function Nt(e, t, n = !1) {
1721
1712
  u.Swap
1722
1713
  ] : []
1723
1714
  ];
1724
- case w.HivePower:
1715
+ case g.HivePower:
1725
1716
  return [
1726
1717
  u.Delegate,
1727
1718
  ...n ? [u.PowerDown, u.WithdrawRoutes] : [u.PowerUp]
1728
1719
  ];
1729
- case w.HiveDollar:
1720
+ case g.HiveDollar:
1730
1721
  return [
1731
1722
  u.Transfer,
1732
1723
  ...n ? [u.TransferToSavings, u.Swap] : []
1733
1724
  ];
1734
- case w.Points:
1725
+ case g.Points:
1735
1726
  return [
1736
1727
  u.Gift,
1737
1728
  ...n ? [
@@ -1740,7 +1731,7 @@ function Nt(e, t, n = !1) {
1740
1731
  u.Buy
1741
1732
  ] : []
1742
1733
  ];
1743
- case w.Spk:
1734
+ case g.Spk:
1744
1735
  return [u.Transfer];
1745
1736
  case "LARYNX":
1746
1737
  return [
@@ -1753,59 +1744,82 @@ function Nt(e, t, n = !1) {
1753
1744
  ...n ? [u.PowerDown] : []
1754
1745
  ];
1755
1746
  }
1756
- const r = $(t);
1747
+ const r = U(t);
1757
1748
  await i().prefetchQuery(r);
1758
1749
  const s = i().getQueryData(
1759
1750
  r.queryKey
1760
- ), a = F(
1751
+ ), a = L(
1761
1752
  (s == null ? void 0 : s.map((k) => k.symbol)) ?? []
1762
1753
  );
1763
1754
  await i().prefetchQuery(a);
1764
- const o = i().getQueryData(a.queryKey), c = s == null ? void 0 : s.find((k) => k.symbol === e), f = o == null ? void 0 : o.find((k) => k.symbol === e), g = n && (f == null ? void 0 : f.delegationEnabled) && c && parseFloat(c.delegationsOut) !== parseFloat(c.balance), _ = n && parseFloat((c == null ? void 0 : c.delegationsOut) ?? "0") > 0, v = n && (f == null ? void 0 : f.stakingEnabled), S = n && parseFloat((c == null ? void 0 : c.stake) ?? "0") > 0;
1755
+ 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), b = n && parseFloat((c == null ? void 0 : c.stake) ?? "0") > 0;
1765
1756
  return [
1766
1757
  u.Transfer,
1767
- ...g ? [u.Delegate] : [],
1758
+ ...w ? [u.Delegate] : [],
1768
1759
  ..._ ? [u.Undelegate] : [],
1769
1760
  ...v ? [u.Stake] : [],
1770
- ...S ? [u.Unstake] : []
1761
+ ...b ? [u.Unstake] : []
1771
1762
  ];
1772
1763
  }
1773
1764
  });
1774
1765
  }
1775
- const Ve = {
1776
- [m.BTC]: "m/44'/0'/0'/0/0",
1766
+ function Ge(e) {
1767
+ return new Promise((t) => setTimeout(t, e));
1768
+ }
1769
+ function re(e) {
1770
+ switch (e) {
1771
+ case f.BTC:
1772
+ return new le();
1773
+ case f.ETH:
1774
+ return new fe();
1775
+ case f.TRON:
1776
+ return new ye();
1777
+ case f.TON:
1778
+ return new me();
1779
+ case f.SOL:
1780
+ return new pe();
1781
+ case f.ATOM:
1782
+ return new he();
1783
+ case f.APT:
1784
+ return new ge();
1785
+ default:
1786
+ return;
1787
+ }
1788
+ }
1789
+ const We = {
1790
+ [f.BTC]: "m/44'/0'/0'/0/0",
1777
1791
  // Bitcoin (BIP44)
1778
- [m.ETH]: "m/44'/60'/0'/0/0",
1792
+ [f.ETH]: "m/44'/60'/0'/0/0",
1779
1793
  // Ethereum (BIP44)
1780
- [m.SOL]: "m/44'/501'/0'/0'",
1794
+ [f.SOL]: "m/44'/501'/0'/0'",
1781
1795
  // Solana (BIP44)
1782
- [m.TON]: "m/44'/607'/0'",
1796
+ [f.TON]: "m/44'/607'/0'",
1783
1797
  // TON (BIP44)
1784
- [m.TRON]: "m/44'/195'/0'/0/0",
1798
+ [f.TRON]: "m/44'/195'/0'/0/0",
1785
1799
  // Tron (BIP44)
1786
- [m.APT]: "m/44'/637'/0'/0'/0'",
1800
+ [f.APT]: "m/44'/637'/0'/0'/0'",
1787
1801
  // Aptos (BIP44)
1788
- [m.ATOM]: "m/44'/118'/0'/0/0"
1802
+ [f.ATOM]: "m/44'/118'/0'/0/0"
1789
1803
  // Cosmos (BIP44)
1790
1804
  };
1791
- function Tt(e, t) {
1792
- const { data: n } = X(e), r = G(), s = O({
1805
+ function Kt(e, t) {
1806
+ const { data: n } = z(e), r = $(), s = N({
1793
1807
  mutationKey: ["ecency-wallets", "create-wallet", e, t],
1794
1808
  mutationFn: async () => {
1795
1809
  if (!n)
1796
1810
  throw new Error("[Ecency][Wallets] - No seed to create a wallet");
1797
- const o = Y(t), c = await (o == null ? void 0 : o.getDerivedPrivateKey({
1811
+ const o = re(t), c = await (o == null ? void 0 : o.getDerivedPrivateKey({
1798
1812
  mnemonic: n,
1799
- hdPath: Ve[t]
1813
+ hdPath: We[t]
1800
1814
  }));
1801
- await ge(1e3);
1802
- const f = await (o == null ? void 0 : o.getNewAddress({
1815
+ await Ge(1e3);
1816
+ const l = await (o == null ? void 0 : o.getNewAddress({
1803
1817
  privateKey: c
1804
1818
  }));
1805
1819
  return {
1806
1820
  privateKey: c,
1807
- address: f.address,
1808
- publicKey: f.publicKey,
1821
+ address: l.address,
1822
+ publicKey: l.publicKey,
1809
1823
  username: e,
1810
1824
  currency: t
1811
1825
  };
@@ -1813,23 +1827,26 @@ function Tt(e, t) {
1813
1827
  onSuccess: (o) => {
1814
1828
  r.setQueryData(
1815
1829
  ["ecency-wallets", "wallets", o.username],
1816
- (c) => new Map(c ? Array.from(c.entries()) : []).set(o.currency, o)
1830
+ (c) => new Map(c ? Array.from(c.entries()) : []).set(
1831
+ o.currency,
1832
+ o
1833
+ )
1817
1834
  );
1818
1835
  }
1819
- }), a = se(() => {
1836
+ }), a = we(() => {
1820
1837
  }, []);
1821
1838
  return {
1822
1839
  createWallet: s,
1823
1840
  importWallet: a
1824
1841
  };
1825
1842
  }
1826
- function Ge(e) {
1827
- const { data: t } = E({
1843
+ function Ye(e) {
1844
+ const { data: t } = D({
1828
1845
  queryKey: ["ecency-wallets", "wallets", e]
1829
- }), { data: n } = ve(e);
1830
- return O({
1846
+ }), { data: n } = ke(e);
1847
+ return N({
1831
1848
  mutationKey: ["ecency-wallets", "create-account-with-wallets", e],
1832
- mutationFn: ({ currency: r, address: s }) => fetch(l.privateApiHost + "/private-api/wallets-add", {
1849
+ mutationFn: ({ currency: r, address: s }) => fetch(y.privateApiHost + "/private-api/wallets-add", {
1833
1850
  method: "POST",
1834
1851
  headers: {
1835
1852
  "Content-Type": "application/json"
@@ -1855,11 +1872,11 @@ function Ge(e) {
1855
1872
  })
1856
1873
  });
1857
1874
  }
1858
- function ne() {
1859
- return O({
1875
+ function se() {
1876
+ return N({
1860
1877
  mutationKey: ["ecency-wallets", "check-wallet-existence"],
1861
1878
  mutationFn: async ({ address: e, currency: t }) => (await (await fetch(
1862
- l.privateApiHost + "/private-api/wallets-exist",
1879
+ y.privateApiHost + "/private-api/wallets-exist",
1863
1880
  {
1864
1881
  method: "POST",
1865
1882
  headers: {
@@ -1873,30 +1890,30 @@ function ne() {
1873
1890
  )).json()).length === 0
1874
1891
  });
1875
1892
  }
1876
- const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1893
+ const Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1877
1894
  __proto__: null,
1878
- useCheckWalletExistence: ne,
1879
- useCreateAccountWithWallets: Ge
1880
- }, Symbol.toStringTag, { value: "Module" })), We = {
1881
- [m.BTC]: ["m/84'/0'/0'/0/0"],
1882
- [m.ETH]: ["m/84'/60'/0'/0/0"],
1895
+ useCheckWalletExistence: se,
1896
+ useCreateAccountWithWallets: Ye
1897
+ }, Symbol.toStringTag, { value: "Module" })), Xe = {
1898
+ [f.BTC]: ["m/84'/0'/0'/0/0"],
1899
+ [f.ETH]: ["m/84'/60'/0'/0/0"],
1883
1900
  // its not working for Trust, Exodus, todo: check others below
1884
- [m.SOL]: ["m/84'/501'/0'/0/0"],
1885
- [m.TRON]: ["m/44'/195'/0'/0'/0'"],
1886
- [m.APT]: ["m/84'/637'/0'/0/0"],
1887
- [m.TON]: [],
1901
+ [f.SOL]: ["m/84'/501'/0'/0/0"],
1902
+ [f.TRON]: ["m/44'/195'/0'/0'/0'"],
1903
+ [f.APT]: ["m/84'/637'/0'/0/0"],
1904
+ [f.TON]: [],
1888
1905
  // Disabled
1889
- [m.ATOM]: ["m/84'/118'/0'/0'/0"]
1906
+ [f.ATOM]: ["m/84'/118'/0'/0'/0"]
1890
1907
  };
1891
- async function Ye(e, t, n) {
1892
- for (const r of We[n] || [])
1908
+ async function ze(e, t, n) {
1909
+ for (const r of Xe[n] || [])
1893
1910
  try {
1894
1911
  const s = await t.getDerivedPrivateKey({
1895
1912
  mnemonic: e,
1896
1913
  hdPath: r
1897
1914
  }), a = await t.getNewAddress({
1898
1915
  privateKey: s,
1899
- addressType: n === m.BTC ? "segwit_native" : void 0
1916
+ addressType: n === f.BTC ? "segwit_native" : void 0
1900
1917
  });
1901
1918
  return [s.toString(), a.address];
1902
1919
  } catch {
@@ -1904,17 +1921,17 @@ async function Ye(e, t, n) {
1904
1921
  }
1905
1922
  return [];
1906
1923
  }
1907
- function Kt(e, t) {
1908
- const n = G(), { mutateAsync: r } = ne();
1909
- return O({
1924
+ function Dt(e, t) {
1925
+ const n = $(), { mutateAsync: r } = se();
1926
+ return N({
1910
1927
  mutationKey: ["ecency-wallets", "import-wallet", e, t],
1911
1928
  mutationFn: async ({ privateKeyOrSeed: s }) => {
1912
- const a = Y(t);
1929
+ const a = re(t);
1913
1930
  if (!a)
1914
1931
  throw new Error("Cannot find token for this currency");
1915
1932
  const o = s.split(" ").length === 12;
1916
- let c, f = s;
1917
- if (o ? [f, c] = await Ye(
1933
+ let c, l = s;
1934
+ if (o ? [l, c] = await ze(
1918
1935
  s,
1919
1936
  a,
1920
1937
  t
@@ -1932,7 +1949,7 @@ function Kt(e, t) {
1932
1949
  "This wallet has already in use by Hive account. Please, try another one"
1933
1950
  );
1934
1951
  return {
1935
- privateKey: f,
1952
+ privateKey: l,
1936
1953
  address: c,
1937
1954
  publicKey: ""
1938
1955
  };
@@ -1946,102 +1963,112 @@ function Kt(e, t) {
1946
1963
  address: o,
1947
1964
  username: e,
1948
1965
  currency: t,
1966
+ type: "CHAIN",
1949
1967
  custom: !0
1950
1968
  })
1951
1969
  );
1952
1970
  }
1953
1971
  });
1954
1972
  }
1955
- function Qt(e) {
1956
- const { mutateAsync: t } = pe(e);
1957
- return O({
1958
- mutationKey: ["ecency-wallets", "save-wallet-to-metadata", e],
1959
- mutationFn: ({
1960
- wallets: n
1961
- }) => t({
1962
- profile: {},
1963
- tokens: Array.from(n.entries() ?? []).map(([r, s]) => ({
1964
- symbol: r,
1965
- type: "CHAIN",
1966
- meta: {
1967
- address: s.address
1968
- }
1969
- }))
1970
- })
1971
- });
1973
+ function Y(e, t = !1) {
1974
+ return e ? A.pipe(
1975
+ e,
1976
+ A.filter(({ type: n }) => n === "CHAIN"),
1977
+ A.map((n) => (n.meta.show = t, n)),
1978
+ A.groupByProp("symbol")
1979
+ ) : {};
1972
1980
  }
1973
- function Dt(e) {
1974
- return O({
1975
- mutationKey: ["wallets", "assets-list", e],
1976
- mutationFn: async (t) => (l.storage.setItem(
1977
- l.storagePrefix + "_wallet_assets_list",
1978
- JSON.stringify(t)
1979
- ), t),
1980
- onSuccess() {
1981
- i().invalidateQueries({
1982
- queryKey: xe(e).queryKey
1981
+ function Ct(e) {
1982
+ const t = $(), { data: n } = D(S(e)), { mutateAsync: r } = ie(e);
1983
+ return N({
1984
+ mutationKey: ["ecency-wallets", "save-wallet-to-metadata", n],
1985
+ mutationFn: async (s) => {
1986
+ var _;
1987
+ if (!n)
1988
+ throw new Error("[SDK][Wallets] – no account data to save wallets");
1989
+ const a = Y(
1990
+ (_ = n.profile) == null ? void 0 : _.tokens
1991
+ ), o = s.map(({ currency: v, type: b, ...k }) => ({
1992
+ symbol: v,
1993
+ type: b,
1994
+ meta: k
1995
+ })) ?? [], c = Y(o, !0), l = o.filter(
1996
+ ({ type: v }) => v !== "CHAIN"
1997
+ ), w = A.pipe(
1998
+ a,
1999
+ A.mergeDeep(c),
2000
+ A.values()
2001
+ );
2002
+ return r({
2003
+ tokens: [
2004
+ ...l,
2005
+ ...w
2006
+ ]
1983
2007
  });
1984
- }
2008
+ },
2009
+ onSuccess: () => t.invalidateQueries({
2010
+ queryKey: Ue(e).queryKey
2011
+ })
1985
2012
  });
1986
2013
  }
1987
- const Xe = {
2014
+ const Ze = {
1988
2015
  HIVE: {
1989
- [u.Transfer]: x,
1990
- [u.TransferToSavings]: U,
2016
+ [u.Transfer]: V,
2017
+ [u.TransferToSavings]: G,
1991
2018
  [u.PowerUp]: Oe
1992
2019
  },
1993
2020
  HBD: {
1994
- [u.Transfer]: x,
1995
- [u.TransferToSavings]: U
2021
+ [u.Transfer]: V,
2022
+ [u.TransferToSavings]: G
1996
2023
  },
1997
2024
  HP: {
1998
2025
  [u.PowerDown]: Ae,
1999
- [u.Delegate]: Se,
2026
+ [u.Delegate]: Te,
2000
2027
  [u.WithdrawRoutes]: Ne
2001
2028
  },
2002
2029
  POINTS: {
2003
- [u.Gift]: Je
2030
+ [u.Gift]: $e
2004
2031
  },
2005
2032
  SPK: {
2006
- [u.Transfer]: Te
2033
+ [u.Transfer]: He
2007
2034
  },
2008
2035
  LARYNX: {
2009
- [u.LockLiquidity]: He,
2010
- [u.PowerUp]: Ke
2036
+ [u.LockLiquidity]: Ke,
2037
+ [u.PowerUp]: Qe
2011
2038
  }
2012
- }, ze = {
2013
- [u.Transfer]: Be,
2014
- [u.Stake]: Fe,
2015
- [u.Unstake]: Le,
2016
- [u.Delegate]: Ie,
2017
- [u.Undelegate]: je
2039
+ }, et = {
2040
+ [u.Transfer]: Me,
2041
+ [u.Stake]: Le,
2042
+ [u.Unstake]: Be,
2043
+ [u.Delegate]: je,
2044
+ [u.Undelegate]: Fe
2018
2045
  };
2019
2046
  function Et(e, t, n) {
2020
- const { mutateAsync: r } = W.useRecordActivity(
2047
+ const { mutateAsync: r } = X.useRecordActivity(
2021
2048
  e,
2022
2049
  n
2023
2050
  );
2024
- return O({
2051
+ return N({
2025
2052
  mutationKey: ["ecency-wallets", t, n],
2026
2053
  mutationFn: async (s) => {
2027
- const a = Xe[t][n];
2054
+ const a = Ze[t][n];
2028
2055
  if (a)
2029
2056
  return a(s);
2030
- const o = $(e);
2057
+ const o = U(e);
2031
2058
  await i().prefetchQuery(o);
2032
2059
  const c = i().getQueryData(
2033
2060
  o.queryKey
2034
2061
  );
2035
- if (c != null && c.some((f) => f.symbol === t)) {
2036
- const f = ze[n];
2037
- if (f)
2038
- return f({ ...s, asset: t });
2062
+ if (c != null && c.some((l) => l.symbol === t)) {
2063
+ const l = et[n];
2064
+ if (l)
2065
+ return l({ ...s, asset: t });
2039
2066
  }
2040
2067
  throw new Error("[SDK][Wallets] – no operation for given asset");
2041
2068
  },
2042
2069
  onSuccess: () => {
2043
2070
  r();
2044
- const s = Ue(e, t, {
2071
+ const s = Ve(e, t, {
2045
2072
  refetch: !0
2046
2073
  });
2047
2074
  setTimeout(
@@ -2055,64 +2082,63 @@ function Et(e, t, n) {
2055
2082
  }
2056
2083
  export {
2057
2084
  u as AssetOperation,
2058
- w as EcencyWalletBasicTokens,
2059
- m as EcencyWalletCurrency,
2060
- Ht as EcencyWalletsPrivateApi,
2061
- ee as NaiMap,
2062
- $e as PointTransactionType,
2063
- Z as Symbol,
2064
- Ie as delegateEngineToken,
2065
- Se as delegateHive,
2066
- Ue as getAccountWalletAssetInfoQueryOptions,
2067
- xe as getAccountWalletListQueryOptions,
2068
- At as getAllTokensListQueryOptions,
2069
- qe as getHbdAssetGeneralInfoQueryOptions,
2070
- vt as getHbdAssetTransactionsQueryOptions,
2071
- q as getHiveAssetGeneralInfoQueryOptions,
2072
- kt as getHiveAssetMetricQueryOptions,
2073
- te as getHiveAssetTransactionsQueryOptions,
2074
- bt as getHiveAssetWithdrawalRoutesQueryOptions,
2075
- Ce as getHiveEngineTokenGeneralInfoQueryOptions,
2076
- Pt as getHiveEngineTokenTransactionsQueryOptions,
2077
- $ as getHiveEngineTokensBalancesQueryOptions,
2085
+ g as EcencyWalletBasicTokens,
2086
+ f as EcencyWalletCurrency,
2087
+ Qt as EcencyWalletsPrivateApi,
2088
+ te as NaiMap,
2089
+ xe as PointTransactionType,
2090
+ ee as Symbol,
2091
+ je as delegateEngineToken,
2092
+ Te as delegateHive,
2093
+ Ve as getAccountWalletAssetInfoQueryOptions,
2094
+ Ue as getAccountWalletListQueryOptions,
2095
+ Nt as getAllTokensListQueryOptions,
2096
+ Se as getHbdAssetGeneralInfoQueryOptions,
2097
+ bt as getHbdAssetTransactionsQueryOptions,
2098
+ O as getHiveAssetGeneralInfoQueryOptions,
2099
+ Pt as getHiveAssetMetricQueryOptions,
2100
+ ne as getHiveAssetTransactionsQueryOptions,
2101
+ qt as getHiveAssetWithdrawalRoutesQueryOptions,
2102
+ Ie as getHiveEngineTokenGeneralInfoQueryOptions,
2103
+ St as getHiveEngineTokenTransactionsQueryOptions,
2104
+ U as getHiveEngineTokensBalancesQueryOptions,
2078
2105
  Re as getHiveEngineTokensMarketQueryOptions,
2079
- F as getHiveEngineTokensMetadataQueryOptions,
2080
- qt as getHiveEngineTokensMetricsQueryOptions,
2081
- Pe as getHivePowerAssetGeneralInfoQueryOptions,
2082
- _t as getHivePowerAssetTransactionsQueryOptions,
2083
- Qe as getLarynxAssetGeneralInfoQueryOptions,
2106
+ L as getHiveEngineTokensMetadataQueryOptions,
2107
+ Ot as getHiveEngineTokensMetricsQueryOptions,
2108
+ qe as getHivePowerAssetGeneralInfoQueryOptions,
2109
+ kt as getHivePowerAssetTransactionsQueryOptions,
2110
+ De as getLarynxAssetGeneralInfoQueryOptions,
2084
2111
  Ee as getLarynxPowerAssetGeneralInfoQueryOptions,
2085
- Me as getPointsAssetGeneralInfoQueryOptions,
2086
- Ot as getPointsAssetTransactionsQueryOptions,
2087
- M as getPointsQueryOptions,
2088
- De as getSpkAssetGeneralInfoQueryOptions,
2089
- H as getSpkMarketsQueryOptions,
2090
- Nt as getTokenOperationsQueryOptions,
2091
- dt as isEmptyDate,
2092
- He as lockLarynx,
2112
+ Je as getPointsAssetGeneralInfoQueryOptions,
2113
+ Tt as getPointsAssetTransactionsQueryOptions,
2114
+ J as getPointsQueryOptions,
2115
+ Ce as getSpkAssetGeneralInfoQueryOptions,
2116
+ K as getSpkMarketsQueryOptions,
2117
+ Ht as getTokenOperationsQueryOptions,
2118
+ vt as isEmptyDate,
2119
+ Ke as lockLarynx,
2093
2120
  p as parseAsset,
2094
2121
  Ae as powerDownHive,
2095
2122
  Oe as powerUpHive,
2096
- Ke as powerUpLarynx,
2097
- ke as rewardSpk,
2098
- Fe as stakeEngineToken,
2099
- Be as transferEngineToken,
2100
- x as transferHive,
2101
- Je as transferPoint,
2102
- Te as transferSpk,
2103
- U as transferToSavingsHive,
2104
- je as undelegateEngineToken,
2105
- Le as unstakeEngineToken,
2106
- Dt as useChangeAssetsList,
2107
- St as useClaimPoints,
2108
- wt as useCoinGeckoPriceQuery,
2109
- gt as useGetExternalWalletBalanceQuery,
2110
- ve as useHiveKeysQuery,
2111
- Kt as useImportWallet,
2112
- Qt as useSaveWalletInformationToMetadata,
2113
- X as useSeedPhrase,
2114
- Tt as useWalletCreate,
2123
+ Qe as powerUpLarynx,
2124
+ be as rewardSpk,
2125
+ Le as stakeEngineToken,
2126
+ Me as transferEngineToken,
2127
+ V as transferHive,
2128
+ $e as transferPoint,
2129
+ He as transferSpk,
2130
+ G as transferToSavingsHive,
2131
+ Fe as undelegateEngineToken,
2132
+ Be as unstakeEngineToken,
2133
+ At as useClaimPoints,
2134
+ _t as useCoinGeckoPriceQuery,
2135
+ dt as useGetExternalWalletBalanceQuery,
2136
+ ke as useHiveKeysQuery,
2137
+ Dt as useImportWallet,
2138
+ Ct as useSaveWalletInformationToMetadata,
2139
+ z as useSeedPhrase,
2140
+ Kt as useWalletCreate,
2115
2141
  Et as useWalletOperation,
2116
- B as vestsToHp,
2142
+ M as vestsToHp,
2117
2143
  Ne as withdrawVestingRouteHive
2118
2144
  };