@ecency/sdk 1.0.21 → 1.0.22

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,5 +1,5 @@
1
1
  import { useMemo as K, useCallback as R } from "react";
2
- import { useQuery as m, queryOptions as g, useQueryClient as v, useMutation as u } from "@tanstack/react-query";
2
+ import { useQuery as h, queryOptions as g, useQueryClient as v, useMutation as u } from "@tanstack/react-query";
3
3
  import { BtcWallet as C } from "@okxweb3/coin-bitcoin";
4
4
  import { EthWallet as H } from "@okxweb3/coin-ethereum";
5
5
  import { TrxWallet as N } from "@okxweb3/coin-tron";
@@ -11,7 +11,7 @@ import _, { mnemonicToSeedSync as F } from "bip39";
11
11
  import { Client as B, PrivateKey as l, cryptoUtils as E } from "@hiveio/dhive";
12
12
  import { LRUCache as q } from "lru-cache";
13
13
  import b from "hivesigner";
14
- var a = /* @__PURE__ */ ((e) => (e.BTC = "BTC", e.ETH = "ETH", e.APT = "APT", e.ATOM = "ATOM", e.TON = "TON", e.TRON = "TRX", e.SOL = "SOL", e))(a || {}), h = /* @__PURE__ */ ((e) => (e.Points = "POINTS", e.HivePower = "HP", e.Hive = "HIVE", e.HiveDollar = "HBD", e.Spk = "SPK", e))(h || {});
14
+ var a = /* @__PURE__ */ ((e) => (e.BTC = "BTC", e.ETH = "ETH", e.APT = "APT", e.ATOM = "ATOM", e.TON = "TON", e.TRON = "TRX", e.SOL = "SOL", e))(a || {}), m = /* @__PURE__ */ ((e) => (e.Points = "POINTS", e.HivePower = "HP", e.Hive = "HIVE", e.HiveDollar = "HBD", e.Spk = "SPK", e))(m || {});
15
15
  function M(e) {
16
16
  return new Promise((t) => setTimeout(t, e));
17
17
  }
@@ -65,7 +65,7 @@ const p = {
65
65
  heliusApiKey: "fb1e2935-f911-4b1d-8e1c-3863f6879d42"
66
66
  };
67
67
  function Se(e, t) {
68
- return m({
68
+ return h({
69
69
  queryKey: ["ecency-wallets", "external-wallet-balance", e, t],
70
70
  queryFn: async () => {
71
71
  switch (e) {
@@ -118,7 +118,7 @@ function Se(e, t) {
118
118
  });
119
119
  }
120
120
  function P(e) {
121
- return m({
121
+ return h({
122
122
  queryKey: ["ecency-wallets", "seed", e],
123
123
  queryFn: async () => _.generateMnemonic(128)
124
124
  });
@@ -136,7 +136,7 @@ const W = {
136
136
  return t === y ? void 0 : t;
137
137
  };
138
138
  function Oe(e) {
139
- return m({
139
+ return h({
140
140
  queryKey: ["ecency-wallets", "coingecko-price", e],
141
141
  queryFn: async () => {
142
142
  let t = e;
@@ -181,7 +181,7 @@ function Oe(e) {
181
181
  }
182
182
  function J(e) {
183
183
  const { data: t } = P(e);
184
- return m({
184
+ return h({
185
185
  queryKey: ["ecencу-wallets", "hive-keys", e, t],
186
186
  queryFn: async () => {
187
187
  if (!t)
@@ -244,17 +244,17 @@ function $(e, t) {
244
244
  });
245
245
  }
246
246
  function ke(e) {
247
- const { data: t } = m($());
247
+ const { data: t } = h($());
248
248
  return K(
249
249
  () => {
250
250
  var n;
251
251
  return {
252
252
  basic: [
253
- h.Points,
254
- h.Hive,
255
- h.HivePower,
256
- h.HiveDollar,
257
- h.Spk
253
+ m.Points,
254
+ m.Hive,
255
+ m.HivePower,
256
+ m.HiveDollar,
257
+ m.Spk
258
258
  ].filter((o) => o.toLowerCase().includes(e.toLowerCase())),
259
259
  external: Object.values(a).filter(
260
260
  (o) => o.toLowerCase().includes(e.toLowerCase())
@@ -319,7 +319,7 @@ function Ke(e, t) {
319
319
  };
320
320
  }
321
321
  function V(e) {
322
- const { data: t } = m({
322
+ const { data: t } = h({
323
323
  queryKey: ["ecency-wallets", "wallets", e]
324
324
  }), { data: n } = J(e);
325
325
  return u({
@@ -494,14 +494,18 @@ function te(e) {
494
494
  return ee(
495
495
  ["accounts", "update"],
496
496
  e,
497
- (t) => [
497
+ ({
498
+ profile: t,
499
+ tokens: n
500
+ }) => [
498
501
  [
499
502
  "account_update2",
500
503
  {
501
504
  account: e,
502
505
  json_metadata: "",
503
506
  posting_json_metadata: JSON.stringify({
504
- profile: { ...t, version: 2 }
507
+ profile: { ...t, version: 2 },
508
+ tokens: n
505
509
  }),
506
510
  extensions: []
507
511
  }
@@ -515,15 +519,15 @@ function He(e) {
515
519
  mutationKey: ["ecency-wallets", "save-wallet-to-metadata", e],
516
520
  mutationFn: ({
517
521
  wallets: n
518
- }) => t(
519
- Array.from(n.entries() ?? []).reduce(
520
- (o, [s, r]) => ({
521
- ...o,
522
- [s]: r.address
523
- }),
524
- {}
525
- )
526
- )
522
+ }) => t({
523
+ profile: {},
524
+ tokens: Array.from(n.entries() ?? []).map(([o, s]) => ({
525
+ symbol: o,
526
+ meta: {
527
+ address: s.address
528
+ }
529
+ }))
530
+ })
527
531
  });
528
532
  }
529
533
  function Ne(e) {
@@ -575,7 +579,7 @@ function De(e = "/") {
575
579
  });
576
580
  }
577
581
  export {
578
- h as EcencyWalletBasicTokens,
582
+ m as EcencyWalletBasicTokens,
579
583
  a as EcencyWalletCurrency,
580
584
  Re as EcencyWalletsPrivateApi,
581
585
  M as delay,
@@ -1 +1,9 @@
1
- export declare function useAccountUpdate(username: string): import('@tanstack/react-query').UseMutationResult<any, Error, any, unknown>;
1
+ export declare function useAccountUpdate(username: string): import('@tanstack/react-query').UseMutationResult<any, Error, {
2
+ profile: Record<string, any>;
3
+ tokens: {
4
+ symbol: string;
5
+ meta: {
6
+ address: string;
7
+ };
8
+ }[];
9
+ }, unknown>;
@@ -1,2 +1,9 @@
1
1
  import { EcencyWalletBasicTokens } from '../enums';
2
- export declare function useGetAccountWalletListQuery(username: string): import('@tanstack/react-query').UseQueryResult<EcencyWalletBasicTokens[], Error>;
2
+ export declare function getAccountWalletListQueryOptions(username: string): import('@tanstack/query-core').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<EcencyWalletBasicTokens[], Error, EcencyWalletBasicTokens[], string[]>, "queryFn"> & {
3
+ queryFn?: import('@tanstack/query-core').QueryFunction<EcencyWalletBasicTokens[], string[], never> | undefined;
4
+ } & {
5
+ queryKey: string[] & {
6
+ [dataTagSymbol]: EcencyWalletBasicTokens[];
7
+ [dataTagErrorSymbol]: Error;
8
+ };
9
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ecency/sdk",
3
3
  "private": false,
4
- "version": "1.0.21",
4
+ "version": "1.0.22",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "./dist/ecency-sdk.umd.js",