@ecency/sdk 1.1.9 → 1.1.11

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.
@@ -93,7 +93,7 @@ const _ = (e) => {
93
93
  console.error(t);
94
94
  return;
95
95
  }
96
- }, y = (e) => _(e) && _(e).accessToken, P = (e) => _(e) && _(e).postingKey, E = (e) => _(e) && _(e).loginType, he = (e) => _(e) && _(e).refreshToken;
96
+ }, y = (e) => _(e) && _(e).accessToken, P = (e) => _(e) && _(e).postingKey, E = (e) => _(e) && _(e).loginType, fe = (e) => _(e) && _(e).refreshToken;
97
97
  function ee() {
98
98
  return new Promise((e) => {
99
99
  var t;
@@ -126,7 +126,7 @@ const b = (e, t, n, o = null) => new Promise((r, c) => {
126
126
  },
127
127
  c
128
128
  );
129
- }), fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
129
+ }), ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
130
130
  __proto__: null,
131
131
  broadcast: b,
132
132
  customJson: te,
@@ -198,7 +198,7 @@ async function oe(e, t, n) {
198
198
  "[SDK][Broadcast] – cannot broadcast w/o posting key or token"
199
199
  );
200
200
  }
201
- function ge() {
201
+ function _e() {
202
202
  return new A({
203
203
  defaultOptions: {
204
204
  queries: {
@@ -249,7 +249,7 @@ var q;
249
249
  }
250
250
  e.generateClientServerInfiniteQuery = s;
251
251
  })(q || (q = {}));
252
- function _e() {
252
+ function ve() {
253
253
  return p({
254
254
  queryKey: ["core", "dynamic-props"],
255
255
  refetchInterval: 6e4,
@@ -269,7 +269,7 @@ function _e() {
269
269
  ), o = await i.hiveClient.database.call(
270
270
  "get_reward_fund",
271
271
  ["post"]
272
- ), r = g(e.total_vesting_fund_hive).amount / g(e.total_vesting_shares).amount * 1e6, c = g(t.current_median_history.base).amount, s = g(t.current_median_history.quote).amount, a = parseFloat(o.recent_claims), l = g(o.reward_balance).amount, w = e.hbd_print_rate, H = e.hbd_interest_rate, I = e.head_block_number, M = g(
272
+ ), r = g(e.total_vesting_fund_hive).amount / g(e.total_vesting_shares).amount * 1e6, c = g(t.current_median_history.base).amount, s = g(t.current_median_history.quote).amount, a = parseFloat(o.recent_claims), l = g(o.reward_balance).amount, w = e.hbd_print_rate, B = e.hbd_interest_rate, H = e.head_block_number, I = g(
273
273
  e.total_vesting_fund_hive
274
274
  ).amount, J = g(
275
275
  e.total_vesting_shares
@@ -281,9 +281,9 @@ function _e() {
281
281
  fundRecentClaims: a,
282
282
  fundRewardBalance: l,
283
283
  hbdPrintRate: w,
284
- hbdInterestRate: H,
285
- headBlock: I,
286
- totalVestingFund: M,
284
+ hbdInterestRate: B,
285
+ headBlock: H,
286
+ totalVestingFund: I,
287
287
  totalVestingShares: J,
288
288
  virtualSupply: N,
289
289
  vestingRewardPercent: x,
@@ -367,7 +367,7 @@ function T(e) {
367
367
  staleTime: 6e4
368
368
  });
369
369
  }
370
- function ve(e, t = 5, n = []) {
370
+ function we(e, t = 5, n = []) {
371
371
  return p({
372
372
  queryKey: ["accounts", "search", e, n],
373
373
  enabled: !!e,
@@ -379,7 +379,7 @@ function ve(e, t = 5, n = []) {
379
379
  )
380
380
  });
381
381
  }
382
- function we(e) {
382
+ function me(e) {
383
383
  return p({
384
384
  queryKey: ["accounts", "check-wallet-pending", e],
385
385
  queryFn: async () => await (await fetch(
@@ -411,7 +411,7 @@ function re(e, t) {
411
411
  )
412
412
  });
413
413
  }
414
- function me(e) {
414
+ function be(e) {
415
415
  return p({
416
416
  queryKey: ["accounts", "subscriptions", e],
417
417
  enabled: !!e,
@@ -424,7 +424,7 @@ function me(e) {
424
424
  ) ?? []
425
425
  });
426
426
  }
427
- function be(e) {
427
+ function Ce(e) {
428
428
  return p({
429
429
  queryKey: ["accounts", "bookmarks", e],
430
430
  enabled: !!e,
@@ -444,7 +444,7 @@ function be(e) {
444
444
  }
445
445
  });
446
446
  }
447
- function Ce(e) {
447
+ function Se(e) {
448
448
  return p({
449
449
  queryKey: ["accounts", "favourites", e],
450
450
  enabled: !!e,
@@ -464,6 +464,14 @@ function Ce(e) {
464
464
  }
465
465
  });
466
466
  }
467
+ function ie(e) {
468
+ return e == null ? void 0 : e.map(({ meta: t, ...n }) => {
469
+ if (!t || typeof t != "object")
470
+ return { ...n, meta: t };
471
+ const { privateKey: o, username: r, ...c } = t;
472
+ return { ...n, meta: c };
473
+ });
474
+ }
467
475
  function Q({
468
476
  profile: e,
469
477
  tokens: t,
@@ -473,9 +481,9 @@ function Q({
473
481
  JSON.parse((n == null ? void 0 : n.posting_json_metadata) || "{}"),
474
482
  C.mergeDeep(e ?? {})
475
483
  );
476
- return t && t.length > 0 && (o.tokens = t), o;
484
+ return t && t.length > 0 && (o.tokens = t), o.tokens = ie(o.tokens), o;
477
485
  }
478
- function Se(e) {
486
+ function Oe(e) {
479
487
  const t = U(), { data: n } = j(T(e));
480
488
  return ne(
481
489
  ["accounts", "update", n == null ? void 0 : n.name],
@@ -508,7 +516,7 @@ function Se(e) {
508
516
  )
509
517
  );
510
518
  }
511
- function Oe(e, t, n, o) {
519
+ function Ke(e, t, n, o) {
512
520
  return d({
513
521
  mutationKey: [],
514
522
  mutationFn: async (r) => {
@@ -545,7 +553,7 @@ function Oe(e, t, n, o) {
545
553
  }
546
554
  });
547
555
  }
548
- function Ke(e, t, n) {
556
+ function ke(e, t, n) {
549
557
  return d({
550
558
  mutationKey: ["accounts", "bookmarks", "add", e],
551
559
  mutationFn: async ({ author: o, permlink: r }) => {
@@ -574,7 +582,7 @@ function Ke(e, t, n) {
574
582
  onError: n
575
583
  });
576
584
  }
577
- function ke(e, t, n) {
585
+ function qe(e, t, n) {
578
586
  return d({
579
587
  mutationKey: ["accounts", "bookmarks", "delete", e],
580
588
  mutationFn: async (o) => {
@@ -602,7 +610,7 @@ function ke(e, t, n) {
602
610
  onError: n
603
611
  });
604
612
  }
605
- function qe(e, t, n) {
613
+ function Te(e, t, n) {
606
614
  return d({
607
615
  mutationKey: ["accounts", "favourites", "add", e],
608
616
  mutationFn: async (o) => {
@@ -630,7 +638,7 @@ function qe(e, t, n) {
630
638
  onError: n
631
639
  });
632
640
  }
633
- function Te(e, t, n) {
641
+ function Qe(e, t, n) {
634
642
  return d({
635
643
  mutationKey: ["accounts", "favourites", "add", e],
636
644
  mutationFn: async (o) => {
@@ -658,7 +666,7 @@ function Te(e, t, n) {
658
666
  onError: n
659
667
  });
660
668
  }
661
- function Qe(e) {
669
+ function Ae(e) {
662
670
  return d({
663
671
  mutationKey: ["operations", "sign", e],
664
672
  mutationFn: ({
@@ -675,7 +683,7 @@ function Qe(e) {
675
683
  }
676
684
  });
677
685
  }
678
- function Ae(e, t = "Active") {
686
+ function je(e, t = "Active") {
679
687
  return d({
680
688
  mutationKey: ["operations", "sign-keychain", e],
681
689
  mutationFn: ({ operation: n }) => {
@@ -687,20 +695,20 @@ function Ae(e, t = "Active") {
687
695
  }
688
696
  });
689
697
  }
690
- function je(e = "/") {
698
+ function De(e = "/") {
691
699
  return d({
692
700
  mutationKey: ["operations", "sign-hivesigner", e],
693
701
  mutationFn: async ({ operation: t }) => m.sendOperation(t, { callback: e }, () => {
694
702
  })
695
703
  });
696
704
  }
697
- function De() {
705
+ function Fe() {
698
706
  return p({
699
707
  queryKey: ["operations", "chain-properties"],
700
708
  queryFn: async () => await i.hiveClient.database.getChainProperties()
701
709
  });
702
710
  }
703
- function Fe(e = 20) {
711
+ function Pe(e = 20) {
704
712
  return $({
705
713
  queryKey: ["posts", "trending-tags"],
706
714
  queryFn: async ({ pageParam: { afterTag: t } }) => i.hiveClient.database.call("get_trending_tags", [t, e]).then(
@@ -732,7 +740,7 @@ function O(e) {
732
740
  enabled: !!e
733
741
  });
734
742
  }
735
- function Pe(e = "feed") {
743
+ function Ee(e = "feed") {
736
744
  return p({
737
745
  queryKey: ["posts", "promoted", e],
738
746
  queryFn: async () => {
@@ -748,7 +756,7 @@ function Pe(e = "feed") {
748
756
  }
749
757
  });
750
758
  }
751
- function Ee(e) {
759
+ function Me(e) {
752
760
  return d({
753
761
  mutationKey: ["posts", "add-fragment", e],
754
762
  mutationFn: async ({ title: t, body: n }) => (await fetch(
@@ -825,7 +833,7 @@ function He(e, t) {
825
833
  }
826
834
  });
827
835
  }
828
- function B(e, t) {
836
+ function M(e, t) {
829
837
  return d({
830
838
  mutationKey: ["analytics", t],
831
839
  mutationFn: async () => {
@@ -850,9 +858,9 @@ function B(e, t) {
850
858
  }
851
859
  const Ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
852
860
  __proto__: null,
853
- useRecordActivity: B
861
+ useRecordActivity: M
854
862
  }, Symbol.toStringTag, { value: "Module" }));
855
- function ie(e, t) {
863
+ function se(e, t) {
856
864
  return p({
857
865
  queryKey: ["integrations", "hivesigner", "decode-memo", e],
858
866
  queryFn: async () => {
@@ -864,11 +872,11 @@ function ie(e, t) {
864
872
  }
865
873
  });
866
874
  }
867
- const se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
875
+ const ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
868
876
  __proto__: null,
869
- getDecodeMemoQueryOptions: ie
870
- }, Symbol.toStringTag, { value: "Module" })), ae = {
871
- queries: se
877
+ getDecodeMemoQueryOptions: se
878
+ }, Symbol.toStringTag, { value: "Module" })), ce = {
879
+ queries: ae
872
880
  };
873
881
  function S(e) {
874
882
  return p({
@@ -884,7 +892,7 @@ function S(e) {
884
892
  "Content-Type": "application/json"
885
893
  }
886
894
  }
887
- ), n = ae.queries.getDecodeMemoQueryOptions(
895
+ ), n = ce.queries.getDecodeMemoQueryOptions(
888
896
  e,
889
897
  (await t.json()).memo
890
898
  );
@@ -896,7 +904,7 @@ function S(e) {
896
904
  }
897
905
  });
898
906
  }
899
- function ce(e) {
907
+ function ue(e) {
900
908
  return p({
901
909
  queryKey: ["integrations", "3speak", "videos", e],
902
910
  enabled: !!e,
@@ -919,14 +927,14 @@ function ce(e) {
919
927
  }
920
928
  });
921
929
  }
922
- const ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
930
+ const pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
923
931
  __proto__: null,
924
932
  getAccountTokenQueryOptions: S,
925
- getAccountVideosQueryOptions: ce
926
- }, Symbol.toStringTag, { value: "Module" })), Me = {
927
- queries: ue
933
+ getAccountVideosQueryOptions: ue
934
+ }, Symbol.toStringTag, { value: "Module" })), Je = {
935
+ queries: pe
928
936
  };
929
- function Je(e) {
937
+ function Ne(e) {
930
938
  return p({
931
939
  queryKey: ["integrations", "hiveposh", "links", e],
932
940
  queryFn: async () => {
@@ -951,7 +959,7 @@ function Je(e) {
951
959
  }
952
960
  });
953
961
  }
954
- function Ne() {
962
+ function xe() {
955
963
  return p({
956
964
  queryKey: ["resource-credits", "stats"],
957
965
  queryFn: async () => (await i.hiveClient.call(
@@ -961,14 +969,14 @@ function Ne() {
961
969
  )).rc_stats
962
970
  });
963
971
  }
964
- function xe(e) {
972
+ function Ge(e) {
965
973
  return p({
966
974
  queryKey: ["resource-credits", "account", e],
967
975
  queryFn: async () => new Y(i.hiveClient).findRCAccounts([e]),
968
976
  enabled: !!e
969
977
  });
970
978
  }
971
- function Ge(e, t) {
979
+ function Ve(e, t) {
972
980
  return p({
973
981
  queryKey: ["games", "status-check", t, e],
974
982
  enabled: !!e,
@@ -991,8 +999,8 @@ function Ge(e, t) {
991
999
  }
992
1000
  });
993
1001
  }
994
- function Ve(e, t, n) {
995
- const { mutateAsync: o } = B(
1002
+ function We(e, t, n) {
1003
+ const { mutateAsync: o } = M(
996
1004
  e,
997
1005
  "spin-rolled"
998
1006
  );
@@ -1021,7 +1029,7 @@ function Ve(e, t, n) {
1021
1029
  }
1022
1030
  });
1023
1031
  }
1024
- function We(e, t, n = 100, o = void 0, r = !0) {
1032
+ function ze(e, t, n = 100, o = void 0, r = !0) {
1025
1033
  return p({
1026
1034
  queryKey: ["communities", "list", e, t, n],
1027
1035
  enabled: r,
@@ -1041,7 +1049,7 @@ function We(e, t, n = 100, o = void 0, r = !0) {
1041
1049
  }
1042
1050
  });
1043
1051
  }
1044
- function ze(e, t) {
1052
+ function Ue(e, t) {
1045
1053
  return p({
1046
1054
  queryKey: ["community", "context", e, t],
1047
1055
  enabled: !!e && !!t,
@@ -1062,7 +1070,7 @@ function ze(e, t) {
1062
1070
  });
1063
1071
  }
1064
1072
  var h = /* @__PURE__ */ ((e) => (e.OWNER = "owner", e.ADMIN = "admin", e.MOD = "mod", e.MEMBER = "member", e.GUEST = "guest", e.MUTED = "muted", e))(h || {});
1065
- const Ue = {
1073
+ const $e = {
1066
1074
  owner: [
1067
1075
  "admin",
1068
1076
  "mod",
@@ -1085,10 +1093,10 @@ const Ue = {
1085
1093
  /* MUTED */
1086
1094
  ]
1087
1095
  };
1088
- function $e(e, t) {
1096
+ function Re(e, t) {
1089
1097
  return e.startsWith("hive-3") || t === 3 ? "Council" : e.startsWith("hive-2") || t === 2 ? "Journal" : "Topic";
1090
1098
  }
1091
- function Re({
1099
+ function Xe({
1092
1100
  communityType: e,
1093
1101
  userRole: t,
1094
1102
  subscribed: n
@@ -1117,51 +1125,51 @@ export {
1117
1125
  k as ConfigManager,
1118
1126
  Ie as EcencyAnalytics,
1119
1127
  q as EcencyQueriesManager,
1120
- ae as HiveSignerIntegration,
1121
- fe as Keychain,
1128
+ ce as HiveSignerIntegration,
1129
+ ge as Keychain,
1122
1130
  h as ROLES,
1123
- Me as ThreeSpeakIntegration,
1131
+ Je as ThreeSpeakIntegration,
1124
1132
  oe as broadcastJson,
1125
- we as checkUsernameWalletsPendingQueryOptions,
1133
+ me as checkUsernameWalletsPendingQueryOptions,
1126
1134
  y as getAccessToken,
1127
1135
  T as getAccountFullQueryOptions,
1128
- xe as getAccountRcQueryOptions,
1129
- me as getAccountSubscriptionsQueryOptions,
1130
- be as getActiveAccountBookmarksQueryOptions,
1131
- Ce as getActiveAccountFavouritesQueryOptions,
1132
- De as getChainPropertiesQueryOptions,
1133
- We as getCommunitiesQueryOptions,
1134
- ze as getCommunityContextQueryOptions,
1135
- Re as getCommunityPermissions,
1136
- $e as getCommunityType,
1137
- _e as getDynamicPropsQueryOptions,
1136
+ Ge as getAccountRcQueryOptions,
1137
+ be as getAccountSubscriptionsQueryOptions,
1138
+ Ce as getActiveAccountBookmarksQueryOptions,
1139
+ Se as getActiveAccountFavouritesQueryOptions,
1140
+ Fe as getChainPropertiesQueryOptions,
1141
+ ze as getCommunitiesQueryOptions,
1142
+ Ue as getCommunityContextQueryOptions,
1143
+ Xe as getCommunityPermissions,
1144
+ Re as getCommunityType,
1145
+ ve as getDynamicPropsQueryOptions,
1138
1146
  O as getFragmentsQueryOptions,
1139
- Ge as getGameStatusCheckQueryOptions,
1140
- Je as getHivePoshLinksQueryOptions,
1147
+ Ve as getGameStatusCheckQueryOptions,
1148
+ Ne as getHivePoshLinksQueryOptions,
1141
1149
  E as getLoginType,
1142
1150
  P as getPostingKey,
1143
- Pe as getPromotedPostsQuery,
1151
+ Ee as getPromotedPostsQuery,
1144
1152
  u as getQueryClient,
1145
- Ne as getRcStatsQueryOptions,
1146
- he as getRefreshToken,
1153
+ xe as getRcStatsQueryOptions,
1154
+ fe as getRefreshToken,
1147
1155
  re as getRelationshipBetweenAccountsQueryOptions,
1148
- ve as getSearchAccountsByUsernameQueryOptions,
1149
- Fe as getTrendingTagsQueryOptions,
1156
+ we as getSearchAccountsByUsernameQueryOptions,
1157
+ Pe as getTrendingTagsQueryOptions,
1150
1158
  _ as getUser,
1151
- ge as makeQueryClient,
1152
- Ue as roleMap,
1153
- qe as useAccountFavouriteAdd,
1154
- Te as useAccountFavouriteDelete,
1155
- Oe as useAccountRelationsUpdate,
1156
- Se as useAccountUpdate,
1157
- Ee as useAddFragment,
1158
- Ke as useBookmarkAdd,
1159
- ke as useBookmarkDelete,
1159
+ _e as makeQueryClient,
1160
+ $e as roleMap,
1161
+ Te as useAccountFavouriteAdd,
1162
+ Qe as useAccountFavouriteDelete,
1163
+ Ke as useAccountRelationsUpdate,
1164
+ Oe as useAccountUpdate,
1165
+ Me as useAddFragment,
1166
+ ke as useBookmarkAdd,
1167
+ qe as useBookmarkDelete,
1160
1168
  ne as useBroadcastMutation,
1161
1169
  Be as useEditFragment,
1162
- Ve as useGameClaim,
1170
+ We as useGameClaim,
1163
1171
  He as useRemoveFragment,
1164
- je as useSignOperationByHivesigner,
1165
- Qe as useSignOperationByKey,
1166
- Ae as useSignOperationByKeychain
1172
+ De as useSignOperationByHivesigner,
1173
+ Ae as useSignOperationByKey,
1174
+ je as useSignOperationByKeychain
1167
1175
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ecency/sdk",
3
3
  "private": false,
4
- "version": "1.1.9",
4
+ "version": "1.1.11",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "./dist/ecency-sdk.umd.js",