@ecency/wallets 1.3.4 → 1.3.6

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,22 +1,22 @@
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";
1
+ import { CONFIG as y, getQueryClient as i, getDynamicPropsQueryOptions as K, 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 H } from "@tanstack/react-query";
3
+ import fe from "bip39";
4
+ import { LRUCache as ye } from "lru-cache";
5
5
  import { PrivateKey as I, utils as T } from "@hiveio/dhive";
6
6
  import C from "dayjs";
7
7
  import d from "hivesigner";
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";
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";
16
16
  import * as A from "remeda";
17
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({
18
+ function _t(e, t) {
19
+ return N({
20
20
  queryKey: ["ecency-wallets", "external-wallet-balance", e, t],
21
21
  queryFn: async () => {
22
22
  switch (e) {
@@ -54,12 +54,12 @@ function dt(e, t) {
54
54
  `https://tonapi.io/v1/blockchain/getAccount?account=${t}`
55
55
  )).json()).balance / 1e9;
56
56
  case f.APT:
57
- const q = (await (await fetch(
57
+ const O = (await (await fetch(
58
58
  `https://fullnode.mainnet.aptoslabs.com/v1/accounts/${t}/resources`
59
59
  )).json()).find(
60
- (ae) => ae.type.includes("coin::CoinStore")
60
+ (ie) => ie.type.includes("coin::CoinStore")
61
61
  );
62
- return q ? parseInt(q.data.coin.value) / 1e8 : 0;
62
+ return O ? parseInt(O.data.coin.value) / 1e8 : 0;
63
63
  case f.ATOM:
64
64
  return +(await (await fetch(
65
65
  `https://rest.cosmos.directory/cosmoshub/auth/accounts/${t}`
@@ -69,12 +69,12 @@ function dt(e, t) {
69
69
  });
70
70
  }
71
71
  function z(e) {
72
- return D({
72
+ return N({
73
73
  queryKey: ["ecency-wallets", "seed", e],
74
- queryFn: async () => ce.generateMnemonic(128)
74
+ queryFn: async () => fe.generateMnemonic(128)
75
75
  });
76
76
  }
77
- const de = {
77
+ const ke = {
78
78
  max: 500,
79
79
  // how long to live in ms
80
80
  ttl: 1e3 * 60 * 5,
@@ -82,12 +82,12 @@ const de = {
82
82
  allowStale: !1,
83
83
  updateAgeOnGet: !1,
84
84
  updateAgeOnHas: !1
85
- }, Z = new ue(de), x = Symbol("undefined"), _e = (e, t) => Z.set(e, t === void 0 ? x : t), ve = (e) => {
85
+ }, Z = new ye(ke), x = Symbol("undefined"), be = (e, t) => Z.set(e, t === void 0 ? x : t), Pe = (e) => {
86
86
  const t = Z.get(e);
87
87
  return t === x ? void 0 : t;
88
88
  };
89
- function _t(e) {
90
- return D({
89
+ function vt(e) {
90
+ return N({
91
91
  queryKey: ["ecency-wallets", "coingecko-price", e],
92
92
  queryFn: async () => {
93
93
  let t = e;
@@ -107,7 +107,7 @@ function _t(e) {
107
107
  default:
108
108
  t = e;
109
109
  }
110
- let n = ve("gecko"), r;
110
+ let n = Pe("gecko"), r;
111
111
  if (n)
112
112
  r = n;
113
113
  else {
@@ -123,16 +123,16 @@ function _t(e) {
123
123
  })
124
124
  }
125
125
  )).json();
126
- _e("gecko", o === void 0 ? x : o), r = o;
126
+ be("gecko", o === void 0 ? x : o), r = o;
127
127
  }
128
128
  return 1 / +r[Object.keys(r)[0]].usd;
129
129
  },
130
130
  enabled: !!e
131
131
  });
132
132
  }
133
- function ke(e) {
133
+ function qe(e) {
134
134
  const { data: t } = z(e);
135
- return D({
135
+ return N({
136
136
  queryKey: ["ecencу-wallets", "hive-keys", e, t],
137
137
  staleTime: 1 / 0,
138
138
  queryFn: async () => {
@@ -169,13 +169,13 @@ function p(e) {
169
169
  symbol: te[e.nai]
170
170
  };
171
171
  }
172
- function vt(e) {
172
+ function kt(e) {
173
173
  return e === void 0 ? !0 : parseInt(e.split("-")[0], 10) < 1980;
174
174
  }
175
- function M(e, t) {
175
+ function $(e, t) {
176
176
  return e / 1e6 * t;
177
177
  }
178
- function be(e, t) {
178
+ function Oe(e, t) {
179
179
  let n = 0, r = 0, s = 0, a = 0, o = e.head_block - e.spk_block;
180
180
  if (e.spk_block) {
181
181
  if (o < 28800)
@@ -194,19 +194,19 @@ function be(e, t) {
194
194
  return (l * (1 + _ / 365) - l) * w;
195
195
  }
196
196
  }
197
- function O(e) {
197
+ function S(e) {
198
198
  return h({
199
199
  queryKey: ["assets", "hive", "general-info", e],
200
200
  staleTime: 6e4,
201
201
  refetchInterval: 9e4,
202
202
  queryFn: async () => {
203
- await i().prefetchQuery(H()), await i().prefetchQuery(
204
- S(e)
203
+ await i().prefetchQuery(K()), await i().prefetchQuery(
204
+ b(e)
205
205
  );
206
206
  const t = i().getQueryData(
207
- H().queryKey
207
+ K().queryKey
208
208
  ), n = i().getQueryData(
209
- S(e).queryKey
209
+ b(e).queryKey
210
210
  );
211
211
  return {
212
212
  name: "HIVE",
@@ -217,25 +217,25 @@ function O(e) {
217
217
  }
218
218
  });
219
219
  }
220
- function Pe(e) {
220
+ function Se(e) {
221
221
  let l = 9.5 - (e.headBlock - 7e6) / 25e4 * 0.01;
222
222
  l < 0.95 && (l = 0.95);
223
223
  const w = e.vestingRewardPercent / 1e4, _ = e.virtualSupply, v = e.totalVestingFund;
224
224
  return (_ * l * w / v).toFixed(3);
225
225
  }
226
- function qe(e) {
226
+ function ne(e) {
227
227
  return h({
228
228
  queryKey: ["assets", "hive-power", "general-info", e],
229
229
  staleTime: 6e4,
230
230
  refetchInterval: 9e4,
231
231
  queryFn: async () => {
232
- await i().prefetchQuery(H()), await i().prefetchQuery(
233
- S(e)
232
+ await i().prefetchQuery(K()), await i().prefetchQuery(
233
+ b(e)
234
234
  );
235
235
  const t = i().getQueryData(
236
- H().queryKey
236
+ K().queryKey
237
237
  ), n = i().getQueryData(
238
- S(e).queryKey
238
+ b(e).queryKey
239
239
  );
240
240
  return !t || !n ? {
241
241
  name: "HP",
@@ -246,25 +246,25 @@ function qe(e) {
246
246
  name: "HP",
247
247
  title: "Hive Power",
248
248
  price: t ? t.base / t.quote : 0,
249
- accountBalance: +M(
249
+ accountBalance: +$(
250
250
  p(n.vesting_shares).amount,
251
251
  // parseAsset(accountData.delegated_vesting_shares).amount +
252
252
  // parseAsset(accountData.received_vesting_shares).amount -
253
253
  // nextVestingSharesWithdrawal,
254
254
  t.hivePerMVests
255
255
  ).toFixed(3),
256
- apr: Pe(t),
256
+ apr: Se(t),
257
257
  parts: [
258
258
  {
259
259
  name: "delegating",
260
- balance: +M(
260
+ balance: +$(
261
261
  p(n.delegated_vesting_shares).amount,
262
262
  t.hivePerMVests
263
263
  ).toFixed(3)
264
264
  },
265
265
  {
266
266
  name: "received",
267
- balance: +M(
267
+ balance: +$(
268
268
  p(n.received_vesting_shares).amount,
269
269
  t.hivePerMVests
270
270
  ).toFixed(3)
@@ -274,19 +274,19 @@ function qe(e) {
274
274
  }
275
275
  });
276
276
  }
277
- function Se(e) {
277
+ function Te(e) {
278
278
  return h({
279
279
  queryKey: ["assets", "hbd", "general-info", e],
280
280
  staleTime: 6e4,
281
281
  refetchInterval: 9e4,
282
282
  queryFn: async () => {
283
- await i().prefetchQuery(H()), await i().prefetchQuery(
284
- S(e)
283
+ await i().prefetchQuery(K()), await i().prefetchQuery(
284
+ b(e)
285
285
  );
286
286
  const t = i().getQueryData(
287
- S(e).queryKey
287
+ b(e).queryKey
288
288
  ), n = i().getQueryData(
289
- H().queryKey
289
+ K().queryKey
290
290
  );
291
291
  return t ? {
292
292
  name: "HBD",
@@ -353,7 +353,7 @@ const m = T.operationOrders, E = {
353
353
  m.proposal_pay
354
354
  ]
355
355
  };
356
- function ne(e, t = 20, n) {
356
+ function re(e, t = 20, n) {
357
357
  return R({
358
358
  queryKey: ["assets", "hive", "transactions", e, t, n],
359
359
  initialData: { pages: [], pageParams: [] },
@@ -448,9 +448,9 @@ function ne(e, t = 20, n) {
448
448
  })
449
449
  });
450
450
  }
451
- function kt(e, t = 20, n) {
451
+ function bt(e, t = 20, n) {
452
452
  return R({
453
- ...ne(e, t, n),
453
+ ...re(e, t, n),
454
454
  queryKey: ["assets", "hive-power", "transactions", e, t, n],
455
455
  select: ({ pages: r, pageParams: s }) => ({
456
456
  pageParams: s,
@@ -490,9 +490,9 @@ function kt(e, t = 20, n) {
490
490
  })
491
491
  });
492
492
  }
493
- function bt(e, t = 20, n) {
493
+ function Pt(e, t = 20, n) {
494
494
  return R({
495
- ...ne(e, t, n),
495
+ ...re(e, t, n),
496
496
  queryKey: ["assets", "hbd", "transactions", e, t, n],
497
497
  select: ({ pages: r, pageParams: s }) => ({
498
498
  pageParams: s,
@@ -525,7 +525,7 @@ function bt(e, t = 20, n) {
525
525
  })
526
526
  });
527
527
  }
528
- function Pt(e = 86400) {
528
+ function qt(e = 86400) {
529
529
  return R({
530
530
  queryKey: ["assets", "hive", "metrics", e],
531
531
  queryFn: async ({ pageParam: [t, n] }) => (await y.hiveClient.call(
@@ -555,7 +555,7 @@ function Pt(e = 86400) {
555
555
  ]
556
556
  });
557
557
  }
558
- function qt(e) {
558
+ function Ot(e) {
559
559
  return h({
560
560
  queryKey: ["assets", "hive", "withdrawal-routes", e],
561
561
  queryFn: () => y.hiveClient.database.call("get_withdraw_routes", [
@@ -564,6 +564,33 @@ function qt(e) {
564
564
  ])
565
565
  });
566
566
  }
567
+ function St(e, t = 50) {
568
+ return h({
569
+ queryKey: ["assets", "hive-power", "delegates", e],
570
+ enabled: !!e,
571
+ queryFn: () => y.hiveClient.database.call("get_vesting_delegations", [
572
+ e,
573
+ "",
574
+ t
575
+ ])
576
+ });
577
+ }
578
+ function Tt(e) {
579
+ return h({
580
+ queryKey: ["assets", "hive-power", "delegatings", e],
581
+ queryFn: async () => (await (await fetch(
582
+ y.privateApiHost + `/private-api/received-vesting/${e}`,
583
+ {
584
+ headers: {
585
+ "Content-Type": "application/json"
586
+ }
587
+ }
588
+ )).json()).list,
589
+ select: (t) => t.sort(
590
+ (n, r) => p(r.vesting_shares).amount - p(n.vesting_shares).amount
591
+ )
592
+ });
593
+ }
567
594
  async function V(e) {
568
595
  const n = p(e.amount).symbol;
569
596
  if (e.type === "key" && "key" in e) {
@@ -615,7 +642,7 @@ async function G(e) {
615
642
  [["transfer_to_savings", r]],
616
643
  t
617
644
  );
618
- } else return e.type === "keychain" ? P.broadcast(
645
+ } else return e.type === "keychain" ? q.broadcast(
619
646
  e.from,
620
647
  [["transfer_to_savings", e]],
621
648
  "Active"
@@ -626,14 +653,14 @@ async function G(e) {
626
653
  }
627
654
  );
628
655
  }
629
- async function Oe(e) {
656
+ async function Ae(e) {
630
657
  if (e.type === "key" && "key" in e) {
631
658
  const { key: t, type: n, ...r } = e;
632
659
  return y.hiveClient.broadcast.sendOperations(
633
660
  [["transfer_to_vesting", r]],
634
661
  t
635
662
  );
636
- } else return e.type === "keychain" ? P.broadcast(
663
+ } else return e.type === "keychain" ? q.broadcast(
637
664
  e.from,
638
665
  [["transfer_to_vesting", e]],
639
666
  "Active"
@@ -644,14 +671,14 @@ async function Oe(e) {
644
671
  }
645
672
  );
646
673
  }
647
- async function Te(e) {
674
+ async function Ne(e) {
648
675
  if (e.type === "key" && "key" in e) {
649
676
  const { key: t, type: n, ...r } = e;
650
677
  return y.hiveClient.broadcast.sendOperations(
651
678
  [["delegate_vesting_shares", r]],
652
679
  t
653
680
  );
654
- } else return e.type === "keychain" ? P.broadcast(
681
+ } else return e.type === "keychain" ? q.broadcast(
655
682
  e.from,
656
683
  [["delegate_vesting_shares", e]],
657
684
  "Active"
@@ -662,14 +689,14 @@ async function Te(e) {
662
689
  }
663
690
  );
664
691
  }
665
- async function Ae(e) {
692
+ async function He(e) {
666
693
  if (e.type === "key" && "key" in e) {
667
694
  const { key: t, type: n, ...r } = e;
668
695
  return y.hiveClient.broadcast.sendOperations(
669
696
  [["withdraw_vesting", r]],
670
697
  t
671
698
  );
672
- } else return e.type === "keychain" ? P.broadcast(
699
+ } else return e.type === "keychain" ? q.broadcast(
673
700
  e.from,
674
701
  [["withdraw_vesting", e]],
675
702
  "Active"
@@ -680,7 +707,7 @@ async function Ae(e) {
680
707
  }
681
708
  );
682
709
  }
683
- async function Ne(e) {
710
+ async function Ke(e) {
684
711
  if (e.type === "key" && "key" in e) {
685
712
  const { key: r, type: s, ...a } = e;
686
713
  return y.hiveClient.broadcast.sendOperations(
@@ -690,7 +717,7 @@ async function Ne(e) {
690
717
  }
691
718
  if (e.type === "keychain") {
692
719
  const { type: r, ...s } = e;
693
- return P.broadcast(
720
+ return q.broadcast(
694
721
  s.from_account,
695
722
  [["set_withdraw_vesting_route", s]],
696
723
  "Active"
@@ -704,8 +731,65 @@ async function Ne(e) {
704
731
  }
705
732
  );
706
733
  }
734
+ function se(e) {
735
+ return new Promise((t) => setTimeout(t, e));
736
+ }
737
+ function ae(e) {
738
+ switch (e) {
739
+ case f.BTC:
740
+ return new me();
741
+ case f.ETH:
742
+ return new pe();
743
+ case f.TRON:
744
+ return new he();
745
+ case f.TON:
746
+ return new ge();
747
+ case f.SOL:
748
+ return new we();
749
+ case f.ATOM:
750
+ return new de();
751
+ case f.APT:
752
+ return new _e();
753
+ default:
754
+ return;
755
+ }
756
+ }
757
+ function At(e, t) {
758
+ const { data: n } = N(b(e)), r = M();
759
+ return ce(
760
+ ["assets", "hive", "claim-rewards", n == null ? void 0 : n.name],
761
+ e,
762
+ () => {
763
+ if (!n)
764
+ throw new Error("Failed to fetch account while claiming balance");
765
+ const {
766
+ reward_hive_balance: s,
767
+ reward_hbd_balance: a,
768
+ reward_vesting_balance: o
769
+ } = n;
770
+ return [
771
+ [
772
+ "claim_reward_balance",
773
+ {
774
+ account: e,
775
+ reward_hive: s,
776
+ reward_hbd: a,
777
+ reward_vests: o
778
+ }
779
+ ]
780
+ ];
781
+ },
782
+ async () => {
783
+ t(), await se(1e3), r.invalidateQueries({
784
+ queryKey: b(e).queryKey
785
+ }), r.invalidateQueries({
786
+ queryKey: ne(e).queryKey
787
+ });
788
+ }
789
+ );
790
+ }
707
791
  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 || {});
708
- async function He(e) {
792
+ async function Qe(e) {
709
793
  const t = JSON.stringify({
710
794
  to: e.to,
711
795
  amount: +e.amount * 1e3,
@@ -721,7 +805,7 @@ async function He(e) {
721
805
  return y.hiveClient.broadcast.json(n, r);
722
806
  } else {
723
807
  if (e.type === "keychain")
724
- return P.customJson(
808
+ return q.customJson(
725
809
  e.from,
726
810
  e.id,
727
811
  "Active",
@@ -748,7 +832,7 @@ async function He(e) {
748
832
  }
749
833
  }
750
834
  }
751
- const Ke = async (e) => {
835
+ const De = async (e) => {
752
836
  const t = JSON.stringify({ amount: +e.amount * 1e3 }), n = {
753
837
  id: e.mode === "lock" ? "spkcc_gov_up" : "spkcc_gov_down",
754
838
  json: t,
@@ -760,7 +844,7 @@ const Ke = async (e) => {
760
844
  return y.hiveClient.broadcast.json(n, r);
761
845
  } else {
762
846
  if (e.type === "keychain")
763
- return P.customJson(
847
+ return q.customJson(
764
848
  e.from,
765
849
  n.id,
766
850
  "Active",
@@ -783,7 +867,7 @@ const Ke = async (e) => {
783
867
  }
784
868
  }
785
869
  };
786
- async function Qe(e) {
870
+ async function Ce(e) {
787
871
  const t = JSON.stringify({ amount: +e.amount * 1e3 }), n = {
788
872
  id: `spkcc_power_${e.mode}`,
789
873
  json: t,
@@ -795,7 +879,7 @@ async function Qe(e) {
795
879
  return y.hiveClient.broadcast.json(n, r);
796
880
  } else {
797
881
  if (e.type === "keychain")
798
- return P.customJson(
882
+ return q.customJson(
799
883
  e.from,
800
884
  `spkcc_power_${e.mode}`,
801
885
  "Active",
@@ -818,7 +902,7 @@ async function Qe(e) {
818
902
  }
819
903
  }
820
904
  }
821
- function K() {
905
+ function Q() {
822
906
  return h({
823
907
  queryKey: ["assets", "spk", "markets"],
824
908
  staleTime: 6e4,
@@ -835,7 +919,7 @@ function K() {
835
919
  }
836
920
  });
837
921
  }
838
- function Q(e) {
922
+ function D(e) {
839
923
  return h({
840
924
  queryKey: ["assets", "spk", "wallet", e],
841
925
  queryFn: async () => (await fetch(y.spkNode + `/@${e}`)).json(),
@@ -847,21 +931,21 @@ function Q(e) {
847
931
  function W(e) {
848
932
  return e.toFixed(3);
849
933
  }
850
- function De(e) {
934
+ function Ee(e) {
851
935
  return h({
852
936
  queryKey: ["assets", "larynx", "general-info", e],
853
937
  staleTime: 6e4,
854
938
  refetchInterval: 9e4,
855
939
  queryFn: async () => {
856
- await i().prefetchQuery(Q(e)), await i().prefetchQuery(K()), await i().prefetchQuery(
857
- O(e)
940
+ await i().prefetchQuery(D(e)), await i().prefetchQuery(Q()), await i().prefetchQuery(
941
+ S(e)
858
942
  );
859
943
  const t = i().getQueryData(
860
- Q(e).queryKey
944
+ D(e).queryKey
861
945
  ), n = i().getQueryData(
862
- K().queryKey
946
+ Q().queryKey
863
947
  ), r = i().getQueryData(
864
- O(e).queryKey
948
+ S(e).queryKey
865
949
  );
866
950
  if (!t || !n)
867
951
  return {
@@ -886,21 +970,21 @@ function De(e) {
886
970
  function j(e) {
887
971
  return e.toFixed(3);
888
972
  }
889
- function Ce(e) {
973
+ function Re(e) {
890
974
  return h({
891
975
  queryKey: ["assets", "spk", "general-info", e],
892
976
  staleTime: 6e4,
893
977
  refetchInterval: 9e4,
894
978
  queryFn: async () => {
895
- await i().prefetchQuery(Q(e)), await i().prefetchQuery(K()), await i().prefetchQuery(
896
- O(e)
979
+ await i().prefetchQuery(D(e)), await i().prefetchQuery(Q()), await i().prefetchQuery(
980
+ S(e)
897
981
  );
898
982
  const t = i().getQueryData(
899
- Q(e).queryKey
983
+ D(e).queryKey
900
984
  ), n = i().getQueryData(
901
- K().queryKey
985
+ Q().queryKey
902
986
  ), r = i().getQueryData(
903
- O(e).queryKey
987
+ S(e).queryKey
904
988
  );
905
989
  if (!t || !n)
906
990
  return {
@@ -912,7 +996,7 @@ function Ce(e) {
912
996
  const s = +j(
913
997
  (t.gov + t.spk) / 1e3 * +t.tick * ((r == null ? void 0 : r.price) ?? 0)
914
998
  ), a = +j(
915
- (t.spk + be(
999
+ (t.spk + Oe(
916
1000
  t,
917
1001
  n.raw.stats || {
918
1002
  spk_rate_lgov: "0.001",
@@ -937,22 +1021,22 @@ function Ce(e) {
937
1021
  function F(e) {
938
1022
  return e.toFixed(3);
939
1023
  }
940
- function Ee(e) {
1024
+ function Ie(e) {
941
1025
  return h({
942
1026
  queryKey: ["assets", "larynx-power", "general-info", e],
943
1027
  staleTime: 6e4,
944
1028
  refetchInterval: 9e4,
945
1029
  queryFn: async () => {
946
1030
  var o, c;
947
- await i().prefetchQuery(Q(e)), await i().prefetchQuery(K()), await i().prefetchQuery(
948
- O(e)
1031
+ await i().prefetchQuery(D(e)), await i().prefetchQuery(Q()), await i().prefetchQuery(
1032
+ S(e)
949
1033
  );
950
1034
  const t = i().getQueryData(
951
- Q(e).queryKey
1035
+ D(e).queryKey
952
1036
  ), n = i().getQueryData(
953
- K().queryKey
1037
+ Q().queryKey
954
1038
  ), r = i().getQueryData(
955
- O(e).queryKey
1039
+ S(e).queryKey
956
1040
  );
957
1041
  if (!t || !n)
958
1042
  return {
@@ -1062,7 +1146,7 @@ function U(e) {
1062
1146
  )).json()).result
1063
1147
  });
1064
1148
  }
1065
- function Re() {
1149
+ function je() {
1066
1150
  return h({
1067
1151
  queryKey: ["assets", "hive-engine", "markets"],
1068
1152
  staleTime: 6e4,
@@ -1086,7 +1170,7 @@ function Re() {
1086
1170
  )).json()).result
1087
1171
  });
1088
1172
  }
1089
- function Ie(e, t) {
1173
+ function Fe(e, t) {
1090
1174
  return h({
1091
1175
  queryKey: ["assets", "hive-engine", t, "general-info", e],
1092
1176
  enabled: !!t && !!e,
@@ -1097,7 +1181,7 @@ function Ie(e, t) {
1097
1181
  throw new Error(
1098
1182
  "[SDK][Wallets] – hive engine token or username missed"
1099
1183
  );
1100
- const n = O(e);
1184
+ const n = S(e);
1101
1185
  await i().prefetchQuery(n);
1102
1186
  const r = i().getQueryData(
1103
1187
  n.queryKey
@@ -1105,9 +1189,9 @@ function Ie(e, t) {
1105
1189
  await i().prefetchQuery(s);
1106
1190
  const a = i().getQueryData(s.queryKey), o = U(e);
1107
1191
  await i().prefetchQuery(o);
1108
- const c = i().getQueryData(o.queryKey), l = Re();
1192
+ const c = i().getQueryData(o.queryKey), l = je();
1109
1193
  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");
1194
+ const w = i().getQueryData(l.queryKey), _ = a == null ? void 0 : a.find((O) => O.symbol === t), v = c == null ? void 0 : c.find((O) => O.symbol === t), P = w == null ? void 0 : w.find((O) => O.symbol === t), k = +((P == null ? void 0 : P.lastPrice) ?? "0");
1111
1195
  return {
1112
1196
  name: t,
1113
1197
  title: (_ == null ? void 0 : _.name) ?? "",
@@ -1118,7 +1202,7 @@ function Ie(e, t) {
1118
1202
  }
1119
1203
  });
1120
1204
  }
1121
- function St(e, t, n = 20) {
1205
+ function Nt(e, t, n = 20) {
1122
1206
  return R({
1123
1207
  queryKey: ["assets", "hive-engine", t, "transactions", e],
1124
1208
  enabled: !!t && !!e,
@@ -1139,7 +1223,7 @@ function St(e, t, n = 20) {
1139
1223
  }
1140
1224
  });
1141
1225
  }
1142
- function Ot(e, t = "daily") {
1226
+ function Ht(e, t = "daily") {
1143
1227
  return h({
1144
1228
  queryKey: ["assets", "hive-engine", e],
1145
1229
  staleTime: 6e4,
@@ -1154,7 +1238,7 @@ function Ot(e, t = "daily") {
1154
1238
  }
1155
1239
  });
1156
1240
  }
1157
- async function je(e) {
1241
+ async function Le(e) {
1158
1242
  const n = p(e.amount).amount.toString();
1159
1243
  if (e.type === "key" && "key" in e) {
1160
1244
  const { key: r, type: s, ...a } = e, o = {
@@ -1217,7 +1301,7 @@ async function je(e) {
1217
1301
  }
1218
1302
  );
1219
1303
  }
1220
- async function Fe(e) {
1304
+ async function Be(e) {
1221
1305
  const n = p(e.amount).amount.toString();
1222
1306
  if (e.type === "key" && "key" in e) {
1223
1307
  const { key: r, type: s, ...a } = e, o = {
@@ -1280,7 +1364,7 @@ async function Fe(e) {
1280
1364
  }
1281
1365
  );
1282
1366
  }
1283
- async function Le(e) {
1367
+ async function Me(e) {
1284
1368
  const n = p(e.amount).amount.toString();
1285
1369
  if (e.type === "key" && "key" in e) {
1286
1370
  const { key: r, type: s, ...a } = e, o = {
@@ -1343,7 +1427,7 @@ async function Le(e) {
1343
1427
  }
1344
1428
  );
1345
1429
  }
1346
- async function Be(e) {
1430
+ async function $e(e) {
1347
1431
  const n = p(e.amount).amount.toString();
1348
1432
  if (e.type === "key" && "key" in e) {
1349
1433
  const { key: r, type: s, ...a } = e, o = {
@@ -1406,7 +1490,7 @@ async function Be(e) {
1406
1490
  }
1407
1491
  );
1408
1492
  }
1409
- async function Me(e) {
1493
+ async function Je(e) {
1410
1494
  const n = p(e.amount).amount.toString();
1411
1495
  if (e.type === "key" && "key" in e) {
1412
1496
  const { key: r, type: s, ...a } = e, o = {
@@ -1501,7 +1585,7 @@ function J(e) {
1501
1585
  enabled: !!e
1502
1586
  });
1503
1587
  }
1504
- function Je(e) {
1588
+ function xe(e) {
1505
1589
  return h({
1506
1590
  queryKey: ["assets", "points", "general-info", e],
1507
1591
  staleTime: 6e4,
@@ -1520,7 +1604,7 @@ function Je(e) {
1520
1604
  }
1521
1605
  });
1522
1606
  }
1523
- function Tt(e, t) {
1607
+ function Kt(e, t) {
1524
1608
  return h({
1525
1609
  queryKey: ["assets", "points", "transactions", e, t],
1526
1610
  queryFn: async () => (await (await fetch(
@@ -1545,12 +1629,12 @@ function Tt(e, t) {
1545
1629
  }))
1546
1630
  });
1547
1631
  }
1548
- function At(e, t, n) {
1632
+ function Qt(e, t, n) {
1549
1633
  const { mutateAsync: r } = X.useRecordActivity(
1550
1634
  e,
1551
1635
  "points-claimed"
1552
1636
  );
1553
- return N({
1637
+ return H({
1554
1638
  mutationFn: async () => {
1555
1639
  if (!e)
1556
1640
  throw new Error(
@@ -1561,7 +1645,7 @@ function At(e, t, n) {
1561
1645
  headers: {
1562
1646
  "Content-Type": "application/json"
1563
1647
  },
1564
- body: JSON.stringify({ code: oe(e) })
1648
+ body: JSON.stringify({ code: ue(e) })
1565
1649
  });
1566
1650
  },
1567
1651
  onError: n,
@@ -1576,7 +1660,7 @@ function At(e, t, n) {
1576
1660
  }
1577
1661
  });
1578
1662
  }
1579
- async function $e({
1663
+ async function Ue({
1580
1664
  from: e,
1581
1665
  to: t,
1582
1666
  amount: n,
@@ -1602,15 +1686,15 @@ async function $e({
1602
1686
  const { key: c } = a;
1603
1687
  return y.hiveClient.broadcast.sendOperations([o], c);
1604
1688
  }
1605
- return s === "keychain" ? P.broadcast(e, [o], "Active") : d.sendOperation(
1689
+ return s === "keychain" ? q.broadcast(e, [o], "Active") : d.sendOperation(
1606
1690
  o,
1607
1691
  { callback: `https://ecency.com/@${e}/wallet` },
1608
1692
  () => {
1609
1693
  }
1610
1694
  );
1611
1695
  }
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) {
1696
+ 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 || {});
1697
+ function Dt(e) {
1614
1698
  return h({
1615
1699
  queryKey: ["ecency-wallets", "all-tokens-list", e],
1616
1700
  queryFn: async () => {
@@ -1634,13 +1718,13 @@ function Nt(e) {
1634
1718
  }
1635
1719
  });
1636
1720
  }
1637
- function Ue(e) {
1721
+ function Ge(e) {
1638
1722
  return h({
1639
1723
  queryKey: ["ecency-wallets", "list", e],
1640
1724
  enabled: !!e,
1641
1725
  queryFn: async () => {
1642
1726
  var r;
1643
- const t = S(e);
1727
+ const t = b(e);
1644
1728
  await i().fetchQuery({
1645
1729
  queryKey: t.queryKey
1646
1730
  });
@@ -1667,7 +1751,7 @@ function Ue(e) {
1667
1751
  }
1668
1752
  });
1669
1753
  }
1670
- function Ve(e, t, n = { refetch: !1 }) {
1754
+ function We(e, t, n = { refetch: !1 }) {
1671
1755
  const r = async (s) => (n.refetch ? await i().fetchQuery(s) : await i().prefetchQuery(s), i().getQueryData(
1672
1756
  s.queryKey
1673
1757
  ));
@@ -1675,22 +1759,22 @@ function Ve(e, t, n = { refetch: !1 }) {
1675
1759
  queryKey: ["ecency-wallets", "asset-info", e, t],
1676
1760
  queryFn: async () => {
1677
1761
  if (t === "HIVE")
1678
- return r(O(e));
1762
+ return r(S(e));
1679
1763
  if (t === "HP")
1680
- return r(qe(e));
1764
+ return r(ne(e));
1681
1765
  if (t === "HBD")
1682
- return r(Se(e));
1766
+ return r(Te(e));
1683
1767
  if (t === "SPK")
1684
- return r(Ce(e));
1768
+ return r(Re(e));
1685
1769
  if (t === "LARYNX")
1686
- return r(De(e));
1687
- if (t === "LP")
1688
1770
  return r(Ee(e));
1771
+ if (t === "LP")
1772
+ return r(Ie(e));
1689
1773
  if (t === "POINTS")
1690
- return r(Je(e));
1774
+ return r(xe(e));
1691
1775
  if (B.includes(t))
1692
1776
  return await r(
1693
- Ie(e, t)
1777
+ Fe(e, t)
1694
1778
  );
1695
1779
  throw new Error(
1696
1780
  "[SDK][Wallets] – has requested unrecognized asset info"
@@ -1698,7 +1782,7 @@ function Ve(e, t, n = { refetch: !1 }) {
1698
1782
  }
1699
1783
  });
1700
1784
  }
1701
- function Ht(e, t, n = !1) {
1785
+ function Ct(e, t, n = !1) {
1702
1786
  return h({
1703
1787
  queryKey: ["wallets", "token-operations", e, t, n],
1704
1788
  queryFn: async () => {
@@ -1752,41 +1836,18 @@ function Ht(e, t, n = !1) {
1752
1836
  (s == null ? void 0 : s.map((k) => k.symbol)) ?? []
1753
1837
  );
1754
1838
  await i().prefetchQuery(a);
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;
1839
+ 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;
1756
1840
  return [
1757
1841
  u.Transfer,
1758
1842
  ...w ? [u.Delegate] : [],
1759
1843
  ..._ ? [u.Undelegate] : [],
1760
1844
  ...v ? [u.Stake] : [],
1761
- ...b ? [u.Unstake] : []
1845
+ ...P ? [u.Unstake] : []
1762
1846
  ];
1763
1847
  }
1764
1848
  });
1765
1849
  }
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 = {
1850
+ const Ye = {
1790
1851
  [f.BTC]: "m/44'/0'/0'/0/0",
1791
1852
  // Bitcoin (BIP44)
1792
1853
  [f.ETH]: "m/44'/60'/0'/0/0",
@@ -1802,17 +1863,17 @@ const We = {
1802
1863
  [f.ATOM]: "m/44'/118'/0'/0/0"
1803
1864
  // Cosmos (BIP44)
1804
1865
  };
1805
- function Kt(e, t) {
1806
- const { data: n } = z(e), r = $(), s = N({
1866
+ function Et(e, t) {
1867
+ const { data: n } = z(e), r = M(), s = H({
1807
1868
  mutationKey: ["ecency-wallets", "create-wallet", e, t],
1808
1869
  mutationFn: async () => {
1809
1870
  if (!n)
1810
1871
  throw new Error("[Ecency][Wallets] - No seed to create a wallet");
1811
- const o = re(t), c = await (o == null ? void 0 : o.getDerivedPrivateKey({
1872
+ const o = ae(t), c = await (o == null ? void 0 : o.getDerivedPrivateKey({
1812
1873
  mnemonic: n,
1813
- hdPath: We[t]
1874
+ hdPath: Ye[t]
1814
1875
  }));
1815
- await Ge(1e3);
1876
+ await se(1e3);
1816
1877
  const l = await (o == null ? void 0 : o.getNewAddress({
1817
1878
  privateKey: c
1818
1879
  }));
@@ -1833,18 +1894,18 @@ function Kt(e, t) {
1833
1894
  )
1834
1895
  );
1835
1896
  }
1836
- }), a = we(() => {
1897
+ }), a = ve(() => {
1837
1898
  }, []);
1838
1899
  return {
1839
1900
  createWallet: s,
1840
1901
  importWallet: a
1841
1902
  };
1842
1903
  }
1843
- function Ye(e) {
1844
- const { data: t } = D({
1904
+ function Xe(e) {
1905
+ const { data: t } = N({
1845
1906
  queryKey: ["ecency-wallets", "wallets", e]
1846
- }), { data: n } = ke(e);
1847
- return N({
1907
+ }), { data: n } = qe(e);
1908
+ return H({
1848
1909
  mutationKey: ["ecency-wallets", "create-account-with-wallets", e],
1849
1910
  mutationFn: ({ currency: r, address: s }) => fetch(y.privateApiHost + "/private-api/wallets-add", {
1850
1911
  method: "POST",
@@ -1872,8 +1933,8 @@ function Ye(e) {
1872
1933
  })
1873
1934
  });
1874
1935
  }
1875
- function se() {
1876
- return N({
1936
+ function oe() {
1937
+ return H({
1877
1938
  mutationKey: ["ecency-wallets", "check-wallet-existence"],
1878
1939
  mutationFn: async ({ address: e, currency: t }) => (await (await fetch(
1879
1940
  y.privateApiHost + "/private-api/wallets-exist",
@@ -1890,11 +1951,11 @@ function se() {
1890
1951
  )).json()).length === 0
1891
1952
  });
1892
1953
  }
1893
- const Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1954
+ const Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1894
1955
  __proto__: null,
1895
- useCheckWalletExistence: se,
1896
- useCreateAccountWithWallets: Ye
1897
- }, Symbol.toStringTag, { value: "Module" })), Xe = {
1956
+ useCheckWalletExistence: oe,
1957
+ useCreateAccountWithWallets: Xe
1958
+ }, Symbol.toStringTag, { value: "Module" })), ze = {
1898
1959
  [f.BTC]: ["m/84'/0'/0'/0/0"],
1899
1960
  [f.ETH]: ["m/84'/60'/0'/0/0"],
1900
1961
  // its not working for Trust, Exodus, todo: check others below
@@ -1905,8 +1966,8 @@ const Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1905
1966
  // Disabled
1906
1967
  [f.ATOM]: ["m/84'/118'/0'/0'/0"]
1907
1968
  };
1908
- async function ze(e, t, n) {
1909
- for (const r of Xe[n] || [])
1969
+ async function Ze(e, t, n) {
1970
+ for (const r of ze[n] || [])
1910
1971
  try {
1911
1972
  const s = await t.getDerivedPrivateKey({
1912
1973
  mnemonic: e,
@@ -1921,17 +1982,17 @@ async function ze(e, t, n) {
1921
1982
  }
1922
1983
  return [];
1923
1984
  }
1924
- function Dt(e, t) {
1925
- const n = $(), { mutateAsync: r } = se();
1926
- return N({
1985
+ function It(e, t) {
1986
+ const n = M(), { mutateAsync: r } = oe();
1987
+ return H({
1927
1988
  mutationKey: ["ecency-wallets", "import-wallet", e, t],
1928
1989
  mutationFn: async ({ privateKeyOrSeed: s }) => {
1929
- const a = re(t);
1990
+ const a = ae(t);
1930
1991
  if (!a)
1931
1992
  throw new Error("Cannot find token for this currency");
1932
1993
  const o = s.split(" ").length === 12;
1933
1994
  let c, l = s;
1934
- if (o ? [l, c] = await ze(
1995
+ if (o ? [l, c] = await Ze(
1935
1996
  s,
1936
1997
  a,
1937
1998
  t
@@ -1978,9 +2039,9 @@ function Y(e, t = !1) {
1978
2039
  A.groupByProp("symbol")
1979
2040
  ) : {};
1980
2041
  }
1981
- function Ct(e) {
1982
- const t = $(), { data: n } = D(S(e)), { mutateAsync: r } = ie(e);
1983
- return N({
2042
+ function jt(e) {
2043
+ const t = M(), { data: n } = N(b(e)), { mutateAsync: r } = le(e);
2044
+ return H({
1984
2045
  mutationKey: ["ecency-wallets", "save-wallet-to-metadata", n],
1985
2046
  mutationFn: async (s) => {
1986
2047
  var _;
@@ -1988,9 +2049,9 @@ function Ct(e) {
1988
2049
  throw new Error("[SDK][Wallets] – no account data to save wallets");
1989
2050
  const a = Y(
1990
2051
  (_ = n.profile) == null ? void 0 : _.tokens
1991
- ), o = s.map(({ currency: v, type: b, ...k }) => ({
2052
+ ), o = s.map(({ currency: v, type: P, ...k }) => ({
1992
2053
  symbol: v,
1993
- type: b,
2054
+ type: P,
1994
2055
  meta: k
1995
2056
  })) ?? [], c = Y(o, !0), l = o.filter(
1996
2057
  ({ type: v }) => v !== "CHAIN"
@@ -2007,51 +2068,51 @@ function Ct(e) {
2007
2068
  });
2008
2069
  },
2009
2070
  onSuccess: () => t.invalidateQueries({
2010
- queryKey: Ue(e).queryKey
2071
+ queryKey: Ge(e).queryKey
2011
2072
  })
2012
2073
  });
2013
2074
  }
2014
- const Ze = {
2075
+ const et = {
2015
2076
  HIVE: {
2016
2077
  [u.Transfer]: V,
2017
2078
  [u.TransferToSavings]: G,
2018
- [u.PowerUp]: Oe
2079
+ [u.PowerUp]: Ae
2019
2080
  },
2020
2081
  HBD: {
2021
2082
  [u.Transfer]: V,
2022
2083
  [u.TransferToSavings]: G
2023
2084
  },
2024
2085
  HP: {
2025
- [u.PowerDown]: Ae,
2026
- [u.Delegate]: Te,
2027
- [u.WithdrawRoutes]: Ne
2086
+ [u.PowerDown]: He,
2087
+ [u.Delegate]: Ne,
2088
+ [u.WithdrawRoutes]: Ke
2028
2089
  },
2029
2090
  POINTS: {
2030
- [u.Gift]: $e
2091
+ [u.Gift]: Ue
2031
2092
  },
2032
2093
  SPK: {
2033
- [u.Transfer]: He
2094
+ [u.Transfer]: Qe
2034
2095
  },
2035
2096
  LARYNX: {
2036
- [u.LockLiquidity]: Ke,
2037
- [u.PowerUp]: Qe
2097
+ [u.LockLiquidity]: De,
2098
+ [u.PowerUp]: Ce
2038
2099
  }
2039
- }, et = {
2040
- [u.Transfer]: Me,
2041
- [u.Stake]: Le,
2042
- [u.Unstake]: Be,
2043
- [u.Delegate]: je,
2044
- [u.Undelegate]: Fe
2100
+ }, tt = {
2101
+ [u.Transfer]: Je,
2102
+ [u.Stake]: Me,
2103
+ [u.Unstake]: $e,
2104
+ [u.Delegate]: Le,
2105
+ [u.Undelegate]: Be
2045
2106
  };
2046
- function Et(e, t, n) {
2107
+ function Ft(e, t, n) {
2047
2108
  const { mutateAsync: r } = X.useRecordActivity(
2048
2109
  e,
2049
2110
  n
2050
2111
  );
2051
- return N({
2112
+ return H({
2052
2113
  mutationKey: ["ecency-wallets", t, n],
2053
2114
  mutationFn: async (s) => {
2054
- const a = Ze[t][n];
2115
+ const a = et[t][n];
2055
2116
  if (a)
2056
2117
  return a(s);
2057
2118
  const o = U(e);
@@ -2060,7 +2121,7 @@ function Et(e, t, n) {
2060
2121
  o.queryKey
2061
2122
  );
2062
2123
  if (c != null && c.some((l) => l.symbol === t)) {
2063
- const l = et[n];
2124
+ const l = tt[n];
2064
2125
  if (l)
2065
2126
  return l({ ...s, asset: t });
2066
2127
  }
@@ -2068,7 +2129,7 @@ function Et(e, t, n) {
2068
2129
  },
2069
2130
  onSuccess: () => {
2070
2131
  r();
2071
- const s = Ve(e, t, {
2132
+ const s = We(e, t, {
2072
2133
  refetch: !0
2073
2134
  });
2074
2135
  setTimeout(
@@ -2084,61 +2145,64 @@ export {
2084
2145
  u as AssetOperation,
2085
2146
  g as EcencyWalletBasicTokens,
2086
2147
  f as EcencyWalletCurrency,
2087
- Qt as EcencyWalletsPrivateApi,
2148
+ Rt as EcencyWalletsPrivateApi,
2088
2149
  te as NaiMap,
2089
- xe as PointTransactionType,
2150
+ Ve as PointTransactionType,
2090
2151
  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,
2152
+ Le as delegateEngineToken,
2153
+ Ne as delegateHive,
2154
+ We as getAccountWalletAssetInfoQueryOptions,
2155
+ Ge as getAccountWalletListQueryOptions,
2156
+ Dt as getAllTokensListQueryOptions,
2157
+ Te as getHbdAssetGeneralInfoQueryOptions,
2158
+ Pt as getHbdAssetTransactionsQueryOptions,
2159
+ S as getHiveAssetGeneralInfoQueryOptions,
2160
+ qt as getHiveAssetMetricQueryOptions,
2161
+ re as getHiveAssetTransactionsQueryOptions,
2162
+ Ot as getHiveAssetWithdrawalRoutesQueryOptions,
2163
+ Fe as getHiveEngineTokenGeneralInfoQueryOptions,
2164
+ Nt as getHiveEngineTokenTransactionsQueryOptions,
2104
2165
  U as getHiveEngineTokensBalancesQueryOptions,
2105
- Re as getHiveEngineTokensMarketQueryOptions,
2166
+ je as getHiveEngineTokensMarketQueryOptions,
2106
2167
  L as getHiveEngineTokensMetadataQueryOptions,
2107
- Ot as getHiveEngineTokensMetricsQueryOptions,
2108
- qe as getHivePowerAssetGeneralInfoQueryOptions,
2109
- kt as getHivePowerAssetTransactionsQueryOptions,
2110
- De as getLarynxAssetGeneralInfoQueryOptions,
2111
- Ee as getLarynxPowerAssetGeneralInfoQueryOptions,
2112
- Je as getPointsAssetGeneralInfoQueryOptions,
2113
- Tt as getPointsAssetTransactionsQueryOptions,
2168
+ Ht as getHiveEngineTokensMetricsQueryOptions,
2169
+ ne as getHivePowerAssetGeneralInfoQueryOptions,
2170
+ bt as getHivePowerAssetTransactionsQueryOptions,
2171
+ St as getHivePowerDelegatesInfiniteQueryOptions,
2172
+ Tt as getHivePowerDelegatingsQueryOptions,
2173
+ Ee as getLarynxAssetGeneralInfoQueryOptions,
2174
+ Ie as getLarynxPowerAssetGeneralInfoQueryOptions,
2175
+ xe as getPointsAssetGeneralInfoQueryOptions,
2176
+ Kt as getPointsAssetTransactionsQueryOptions,
2114
2177
  J as getPointsQueryOptions,
2115
- Ce as getSpkAssetGeneralInfoQueryOptions,
2116
- K as getSpkMarketsQueryOptions,
2117
- Ht as getTokenOperationsQueryOptions,
2118
- vt as isEmptyDate,
2119
- Ke as lockLarynx,
2178
+ Re as getSpkAssetGeneralInfoQueryOptions,
2179
+ Q as getSpkMarketsQueryOptions,
2180
+ Ct as getTokenOperationsQueryOptions,
2181
+ kt as isEmptyDate,
2182
+ De as lockLarynx,
2120
2183
  p as parseAsset,
2121
- Ae as powerDownHive,
2122
- Oe as powerUpHive,
2123
- Qe as powerUpLarynx,
2124
- be as rewardSpk,
2125
- Le as stakeEngineToken,
2126
- Me as transferEngineToken,
2184
+ He as powerDownHive,
2185
+ Ae as powerUpHive,
2186
+ Ce as powerUpLarynx,
2187
+ Oe as rewardSpk,
2188
+ Me as stakeEngineToken,
2189
+ Je as transferEngineToken,
2127
2190
  V as transferHive,
2128
- $e as transferPoint,
2129
- He as transferSpk,
2191
+ Ue as transferPoint,
2192
+ Qe as transferSpk,
2130
2193
  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,
2194
+ Be as undelegateEngineToken,
2195
+ $e as unstakeEngineToken,
2196
+ Qt as useClaimPoints,
2197
+ At as useClaimRewards,
2198
+ vt as useCoinGeckoPriceQuery,
2199
+ _t as useGetExternalWalletBalanceQuery,
2200
+ qe as useHiveKeysQuery,
2201
+ It as useImportWallet,
2202
+ jt as useSaveWalletInformationToMetadata,
2139
2203
  z as useSeedPhrase,
2140
- Kt as useWalletCreate,
2141
- Et as useWalletOperation,
2142
- M as vestsToHp,
2143
- Ne as withdrawVestingRouteHive
2204
+ Et as useWalletCreate,
2205
+ Ft as useWalletOperation,
2206
+ $ as vestsToHp,
2207
+ Ke as withdrawVestingRouteHive
2144
2208
  };
@@ -0,0 +1 @@
1
+ export declare function useClaimRewards(username: string, onSuccess: () => void): import('@tanstack/react-query').UseMutationResult<unknown, Error, unknown, unknown>;
@@ -4,3 +4,4 @@ export * from './power-up';
4
4
  export * from './delegate';
5
5
  export * from './power-down';
6
6
  export * from './withdraw-route';
7
+ export * from './claim-rewards';
@@ -0,0 +1,9 @@
1
+ import { DelegatedVestingShare } from '../types';
2
+ export declare function getHivePowerDelegatesInfiniteQueryOptions(username: string, limit?: number): import('@tanstack/query-core').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<DelegatedVestingShare[], Error, DelegatedVestingShare[], string[]>, "queryFn"> & {
3
+ queryFn?: import('@tanstack/query-core').QueryFunction<DelegatedVestingShare[], string[], never> | undefined;
4
+ } & {
5
+ queryKey: string[] & {
6
+ [dataTagSymbol]: DelegatedVestingShare[];
7
+ [dataTagErrorSymbol]: Error;
8
+ };
9
+ };
@@ -0,0 +1,9 @@
1
+ import { ReceivedVestingShare } from '../types';
2
+ export declare function getHivePowerDelegatingsQueryOptions(username: string): import('@tanstack/query-core').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<ReceivedVestingShare[], Error, ReceivedVestingShare[], string[]>, "queryFn"> & {
3
+ queryFn?: import('@tanstack/query-core').QueryFunction<ReceivedVestingShare[], string[], never> | undefined;
4
+ } & {
5
+ queryKey: string[] & {
6
+ [dataTagSymbol]: ReceivedVestingShare[];
7
+ [dataTagErrorSymbol]: Error;
8
+ };
9
+ };
@@ -6,3 +6,5 @@ export * from './get-hive-power-asset-transactions-query-options';
6
6
  export * from './get-hbd-asset-transactions-query-options';
7
7
  export * from './get-hive-asset-metric-query-options';
8
8
  export * from './get-hive-asset-withdrawal-routes-query-options.ts';
9
+ export * from './get-hive-power-delegates-query-options.ts';
10
+ export * from './get-hive-power-delegatings-query-options.ts';
@@ -0,0 +1,7 @@
1
+ export interface DelegatedVestingShare {
2
+ id: number;
3
+ delegatee: string;
4
+ delegator: string;
5
+ min_delegation_time: string;
6
+ vesting_shares: string;
7
+ }
@@ -1,4 +1,6 @@
1
1
  export * from './hive-operation-group';
2
2
  export * from './hive-transaction';
3
3
  export * from './hive-market-metric';
4
- export * from './hive-withdraw-route.ts';
4
+ export * from './hive-withdraw-route';
5
+ export * from './delegated-vesting-share';
6
+ export * from './received-vesting-share';
@@ -0,0 +1,6 @@
1
+ export interface ReceivedVestingShare {
2
+ delegatee: string;
3
+ delegator: string;
4
+ timestamp: string;
5
+ vesting_shares: string;
6
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ecency/wallets",
3
3
  "private": false,
4
- "version": "1.3.4",
4
+ "version": "1.3.6",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "./dist/ecency-sdk.umd.js",