@ecency/sdk 1.1.0 → 1.1.1

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.
@@ -65,20 +65,20 @@ function R(e) {
65
65
  if (t[0] === "{")
66
66
  return JSON.parse(t);
67
67
  }
68
- var A = /* @__PURE__ */ ((e) => (e.HIVE = "HIVE", e.HBD = "HBD", e.VESTS = "VESTS", e.SPK = "SPK", e))(A || {}), Q = /* @__PURE__ */ ((e) => (e["@@000000021"] = "HIVE", e["@@000000013"] = "HBD", e["@@000000037"] = "VESTS", e))(Q || {});
68
+ var Q = /* @__PURE__ */ ((e) => (e.HIVE = "HIVE", e.HBD = "HBD", e.VESTS = "VESTS", e.SPK = "SPK", e))(Q || {}), A = /* @__PURE__ */ ((e) => (e["@@000000021"] = "HIVE", e["@@000000013"] = "HBD", e["@@000000037"] = "VESTS", e))(A || {});
69
69
  function g(e) {
70
70
  if (typeof e == "string") {
71
71
  const t = e.split(" ");
72
72
  return {
73
73
  amount: parseFloat(t[0]),
74
74
  // @ts-ignore
75
- symbol: A[t[1]]
75
+ symbol: Q[t[1]]
76
76
  };
77
77
  } else
78
78
  return {
79
79
  amount: parseFloat(e.amount.toString()) / Math.pow(10, e.precision),
80
80
  // @ts-ignore
81
- symbol: Q[e.nai]
81
+ symbol: A[e.nai]
82
82
  };
83
83
  }
84
84
  const _ = (e) => {
@@ -261,11 +261,11 @@ function he() {
261
261
  ), o = await i.hiveClient.database.call(
262
262
  "get_reward_fund",
263
263
  ["post"]
264
- ), r = g(e.total_vesting_fund_hive).amount / g(e.total_vesting_shares).amount * 1e6, c = g(t.current_median_history.base).amount, a = g(t.current_median_history.quote).amount, s = parseFloat(o.recent_claims), f = g(o.reward_balance).amount, w = e.hbd_print_rate, P = e.hbd_interest_rate, E = e.head_block_number, I = g(
264
+ ), r = g(e.total_vesting_fund_hive).amount / g(e.total_vesting_shares).amount * 1e6, c = g(t.current_median_history.base).amount, a = g(t.current_median_history.quote).amount, s = parseFloat(o.recent_claims), f = g(o.reward_balance).amount, w = e.hbd_print_rate, P = e.hbd_interest_rate, E = e.head_block_number, H = g(
265
265
  e.total_vesting_fund_hive
266
- ).amount, M = g(
266
+ ).amount, I = g(
267
267
  e.total_vesting_shares
268
- ).amount, B = g(e.virtual_supply).amount, H = e.vesting_reward_percent, J = n.account_creation_fee;
268
+ ).amount, M = g(e.virtual_supply).amount, B = e.vesting_reward_percent, J = n.account_creation_fee;
269
269
  return {
270
270
  hivePerMVests: r,
271
271
  base: c,
@@ -275,10 +275,10 @@ function he() {
275
275
  hbdPrintRate: w,
276
276
  hbdInterestRate: P,
277
277
  headBlock: E,
278
- totalVestingFund: I,
279
- totalVestingShares: M,
280
- virtualSupply: B,
281
- vestingRewardPercent: H,
278
+ totalVestingFund: H,
279
+ totalVestingShares: I,
280
+ virtualSupply: M,
281
+ vestingRewardPercent: B,
282
282
  accountCreationFee: J
283
283
  };
284
284
  }
@@ -515,7 +515,7 @@ function be(e, t, n, o) {
515
515
  }
516
516
  });
517
517
  }
518
- function Se(e, t, n) {
518
+ function Ce(e, t, n) {
519
519
  return d({
520
520
  mutationKey: ["accounts", "bookmarks", "add", e],
521
521
  mutationFn: async ({ author: o, permlink: r }) => {
@@ -544,7 +544,7 @@ function Se(e, t, n) {
544
544
  onError: n
545
545
  });
546
546
  }
547
- function Ce(e, t, n) {
547
+ function Se(e, t, n) {
548
548
  return d({
549
549
  mutationKey: ["accounts", "bookmarks", "delete", e],
550
550
  mutationFn: async (o) => {
@@ -664,13 +664,13 @@ function Te(e = "/") {
664
664
  })
665
665
  });
666
666
  }
667
- function Ae() {
667
+ function Qe() {
668
668
  return p({
669
669
  queryKey: ["operations", "chain-properties"],
670
670
  queryFn: async () => await i.hiveClient.database.getChainProperties()
671
671
  });
672
672
  }
673
- function Qe(e = 20) {
673
+ function Ae(e = 20) {
674
674
  return V({
675
675
  queryKey: ["posts", "trending-tags"],
676
676
  queryFn: async ({ pageParam: { afterTag: t } }) => i.hiveClient.database.call("get_trending_tags", [t, e]).then(
@@ -684,7 +684,7 @@ function Qe(e = 20) {
684
684
  refetchOnMount: !0
685
685
  });
686
686
  }
687
- function C(e) {
687
+ function S(e) {
688
688
  return p({
689
689
  queryKey: ["posts", "fragments", e],
690
690
  queryFn: async () => (await fetch(
@@ -737,7 +737,7 @@ function Fe(e) {
737
737
  )).json(),
738
738
  onSuccess(t) {
739
739
  u().setQueryData(
740
- C(e).queryKey,
740
+ S(e).queryKey,
741
741
  (n) => [t, ...n ?? []]
742
742
  );
743
743
  }
@@ -763,7 +763,7 @@ function De(e, t) {
763
763
  )).json(),
764
764
  onSuccess(n) {
765
765
  u().setQueryData(
766
- C(e).queryKey,
766
+ S(e).queryKey,
767
767
  (o) => {
768
768
  if (!o)
769
769
  return [];
@@ -789,7 +789,7 @@ function Pe(e, t) {
789
789
  }),
790
790
  onSuccess() {
791
791
  u().setQueryData(
792
- C(e).queryKey,
792
+ S(e).queryKey,
793
793
  (n) => [...n ?? []].filter(({ id: o }) => o !== t)
794
794
  );
795
795
  }
@@ -840,7 +840,7 @@ const oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
840
840
  }, Symbol.toStringTag, { value: "Module" })), re = {
841
841
  queries: oe
842
842
  };
843
- function S(e) {
843
+ function C(e) {
844
844
  return p({
845
845
  queryKey: ["integrations", "3speak", "authenticate", e],
846
846
  enabled: !!e,
@@ -872,10 +872,10 @@ function ie(e) {
872
872
  enabled: !!e,
873
873
  queryFn: async () => {
874
874
  await u().prefetchQuery(
875
- S(e)
875
+ C(e)
876
876
  );
877
877
  const t = u().getQueryData(
878
- S(e).queryKey
878
+ C(e).queryKey
879
879
  );
880
880
  return await (await fetch(
881
881
  "https://studio.3speak.tv/mobile/api/my-videos",
@@ -891,11 +891,36 @@ function ie(e) {
891
891
  }
892
892
  const se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
893
893
  __proto__: null,
894
- getAccountTokenQueryOptions: S,
894
+ getAccountTokenQueryOptions: C,
895
895
  getAccountVideosQueryOptions: ie
896
- }, Symbol.toStringTag, { value: "Module" })), Ie = {
896
+ }, Symbol.toStringTag, { value: "Module" })), He = {
897
897
  queries: se
898
898
  };
899
+ function Ie(e) {
900
+ return p({
901
+ queryKey: ["integrations", "hiveposh", "links", e],
902
+ queryFn: async () => {
903
+ const n = await (await fetch(
904
+ `https://hiveposh.com/api/v0/linked-accounts/${e}`,
905
+ {
906
+ headers: {
907
+ "Content-Type": "application/json"
908
+ }
909
+ }
910
+ )).json();
911
+ return {
912
+ twitter: {
913
+ username: n.twitter_username,
914
+ profile: n.twitter_profile
915
+ },
916
+ reddit: {
917
+ username: n.reddit_username,
918
+ profile: n.reddit_profile
919
+ }
920
+ };
921
+ }
922
+ });
923
+ }
899
924
  function Me() {
900
925
  return p({
901
926
  queryKey: ["resource-credits", "stats"],
@@ -913,7 +938,7 @@ function Be(e) {
913
938
  enabled: !!e
914
939
  });
915
940
  }
916
- function He(e, t) {
941
+ function Je(e, t) {
917
942
  return p({
918
943
  queryKey: ["games", "status-check", t, e],
919
944
  enabled: !!e,
@@ -936,7 +961,7 @@ function He(e, t) {
936
961
  }
937
962
  });
938
963
  }
939
- function Je(e, t, n) {
964
+ function Ne(e, t, n) {
940
965
  const { mutateAsync: o } = D(
941
966
  e,
942
967
  "spin-rolled"
@@ -966,7 +991,7 @@ function Je(e, t, n) {
966
991
  }
967
992
  });
968
993
  }
969
- function Ne(e, t, n = 100, o = void 0, r = !0) {
994
+ function xe(e, t, n = 100, o = void 0, r = !0) {
970
995
  return p({
971
996
  queryKey: ["communities", "list", e, t, n],
972
997
  enabled: r,
@@ -986,7 +1011,7 @@ function Ne(e, t, n = 100, o = void 0, r = !0) {
986
1011
  }
987
1012
  });
988
1013
  }
989
- function xe(e, t) {
1014
+ function Ge(e, t) {
990
1015
  return p({
991
1016
  queryKey: ["community", "context", e, t],
992
1017
  enabled: !!e && !!t,
@@ -1007,7 +1032,7 @@ function xe(e, t) {
1007
1032
  });
1008
1033
  }
1009
1034
  var l = /* @__PURE__ */ ((e) => (e.OWNER = "owner", e.ADMIN = "admin", e.MOD = "mod", e.MEMBER = "member", e.GUEST = "guest", e.MUTED = "muted", e))(l || {});
1010
- const Ge = {
1035
+ const Ve = {
1011
1036
  owner: [
1012
1037
  "admin",
1013
1038
  "mod",
@@ -1030,10 +1055,10 @@ const Ge = {
1030
1055
  /* MUTED */
1031
1056
  ]
1032
1057
  };
1033
- function Ve(e, t) {
1058
+ function We(e, t) {
1034
1059
  return e.startsWith("hive-3") || t === 3 ? "Council" : e.startsWith("hive-2") || t === 2 ? "Journal" : "Topic";
1035
1060
  }
1036
- function We({
1061
+ function ze({
1037
1062
  communityType: e,
1038
1063
  userRole: t,
1039
1064
  subscribed: n
@@ -1065,7 +1090,7 @@ export {
1065
1090
  re as HiveSignerIntegration,
1066
1091
  de as Keychain,
1067
1092
  l as ROLES,
1068
- Ie as ThreeSpeakIntegration,
1093
+ He as ThreeSpeakIntegration,
1069
1094
  L as broadcastJson,
1070
1095
  ge as checkUsernameWalletsPendingQueryOptions,
1071
1096
  y as getAccessToken,
@@ -1074,14 +1099,15 @@ export {
1074
1099
  _e as getAccountSubscriptionsQueryOptions,
1075
1100
  ve as getActiveAccountBookmarksQueryOptions,
1076
1101
  we as getActiveAccountFavouritesQueryOptions,
1077
- Ae as getChainPropertiesQueryOptions,
1078
- Ne as getCommunitiesQueryOptions,
1079
- xe as getCommunityContextQueryOptions,
1080
- We as getCommunityPermissions,
1081
- Ve as getCommunityType,
1102
+ Qe as getChainPropertiesQueryOptions,
1103
+ xe as getCommunitiesQueryOptions,
1104
+ Ge as getCommunityContextQueryOptions,
1105
+ ze as getCommunityPermissions,
1106
+ We as getCommunityType,
1082
1107
  he as getDynamicPropsQueryOptions,
1083
- C as getFragmentsQueryOptions,
1084
- He as getGameStatusCheckQueryOptions,
1108
+ S as getFragmentsQueryOptions,
1109
+ Je as getGameStatusCheckQueryOptions,
1110
+ Ie as getHivePoshLinksQueryOptions,
1085
1111
  F as getLoginType,
1086
1112
  j as getPostingKey,
1087
1113
  je as getPromotedPostsQuery,
@@ -1090,20 +1116,20 @@ export {
1090
1116
  ye as getRefreshToken,
1091
1117
  te as getRelationshipBetweenAccountsQueryOptions,
1092
1118
  fe as getSearchAccountsByUsernameQueryOptions,
1093
- Qe as getTrendingTagsQueryOptions,
1119
+ Ae as getTrendingTagsQueryOptions,
1094
1120
  _ as getUser,
1095
1121
  le as makeQueryClient,
1096
- Ge as roleMap,
1122
+ Ve as roleMap,
1097
1123
  Oe as useAccountFavouriteAdd,
1098
1124
  ke as useAccountFavouriteDelete,
1099
1125
  be as useAccountRelationsUpdate,
1100
1126
  me as useAccountUpdate,
1101
1127
  Fe as useAddFragment,
1102
- Se as useBookmarkAdd,
1103
- Ce as useBookmarkDelete,
1128
+ Ce as useBookmarkAdd,
1129
+ Se as useBookmarkDelete,
1104
1130
  Z as useBroadcastMutation,
1105
1131
  De as useEditFragment,
1106
- Je as useGameClaim,
1132
+ Ne as useGameClaim,
1107
1133
  Pe as useRemoveFragment,
1108
1134
  Te as useSignOperationByHivesigner,
1109
1135
  Ke as useSignOperationByKey,
@@ -0,0 +1 @@
1
+ export * from './queries';
@@ -0,0 +1,44 @@
1
+ export declare function getHivePoshLinksQueryOptions(username: string | undefined): import('@tanstack/query-core').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<{
2
+ twitter: {
3
+ username: any;
4
+ profile: any;
5
+ };
6
+ reddit: {
7
+ username: any;
8
+ profile: any;
9
+ };
10
+ }, Error, {
11
+ twitter: {
12
+ username: any;
13
+ profile: any;
14
+ };
15
+ reddit: {
16
+ username: any;
17
+ profile: any;
18
+ };
19
+ }, (string | undefined)[]>, "queryFn"> & {
20
+ queryFn?: import('@tanstack/query-core').QueryFunction<{
21
+ twitter: {
22
+ username: any;
23
+ profile: any;
24
+ };
25
+ reddit: {
26
+ username: any;
27
+ profile: any;
28
+ };
29
+ }, (string | undefined)[], never> | undefined;
30
+ } & {
31
+ queryKey: (string | undefined)[] & {
32
+ [dataTagSymbol]: {
33
+ twitter: {
34
+ username: any;
35
+ profile: any;
36
+ };
37
+ reddit: {
38
+ username: any;
39
+ profile: any;
40
+ };
41
+ };
42
+ [dataTagErrorSymbol]: Error;
43
+ };
44
+ };
@@ -0,0 +1 @@
1
+ export * from './get-hiveposh-links-query-options';
@@ -1,2 +1,3 @@
1
1
  export * from './3speak';
2
2
  export * from './hivesigner';
3
+ export * from './hiveposh';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ecency/sdk",
3
3
  "private": false,
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "./dist/ecency-sdk.umd.js",