@ecency/sdk 1.0.46 → 1.0.48

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,7 +1,7 @@
1
1
  var _ = Object.defineProperty;
2
2
  var T = (e, t, n) => t in e ? _(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var C = (e, t, n) => T(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { QueryClient as q, useMutation as y, useQuery as j, useInfiniteQuery as k, queryOptions as p, infiniteQueryOptions as A } from "@tanstack/react-query";
4
+ import { QueryClient as O, useMutation as y, useQuery as j, useInfiniteQuery as k, queryOptions as p, infiniteQueryOptions as A } from "@tanstack/react-query";
5
5
  import { Client as F, PrivateKey as h, cryptoUtils as D, RCAPI as P } from "@hiveio/dhive";
6
6
  import d from "hivesigner";
7
7
  class I {
@@ -49,16 +49,16 @@ const a = {
49
49
  }
50
50
  ),
51
51
  heliusApiKey: void 0,
52
- queryClient: new q(),
52
+ queryClient: new O(),
53
53
  plausibleHost: "https://pl.ecency.com"
54
54
  };
55
- var O;
55
+ var b;
56
56
  ((e) => {
57
57
  function t(n) {
58
58
  a.queryClient = n;
59
59
  }
60
60
  e.setQueryClient = t;
61
- })(O || (O = {}));
61
+ })(b || (b = {}));
62
62
  function N(e) {
63
63
  let t = atob(e);
64
64
  if (t[0] === "{")
@@ -74,8 +74,8 @@ const f = (e) => {
74
74
  console.error(t);
75
75
  return;
76
76
  }
77
- }, l = (e) => f(e) && f(e).accessToken, K = (e) => f(e) && f(e).postingKey, b = (e) => f(e) && f(e).loginType, X = (e) => f(e) && f(e).refreshToken;
78
- function J() {
77
+ }, l = (e) => f(e) && f(e).accessToken, K = (e) => f(e) && f(e).postingKey, S = (e) => f(e) && f(e).loginType, Z = (e) => f(e) && f(e).refreshToken;
78
+ function M() {
79
79
  return new Promise((e) => {
80
80
  var t;
81
81
  (t = window.hive_keychain) == null || t.requestHandshake(() => {
@@ -83,23 +83,23 @@ function J() {
83
83
  });
84
84
  });
85
85
  }
86
- const g = (e, t, n, o = null) => new Promise((s, u) => {
87
- var i;
88
- (i = window.hive_keychain) == null || i.requestBroadcast(
86
+ const g = (e, t, n, o = null) => new Promise((i, c) => {
87
+ var s;
88
+ (s = window.hive_keychain) == null || s.requestBroadcast(
89
89
  e,
90
90
  t,
91
91
  n,
92
92
  (r) => {
93
- r.success || u({ message: "Operation cancelled" }), s(r);
93
+ r.success || c({ message: "Operation cancelled" }), i(r);
94
94
  },
95
95
  o
96
96
  );
97
- }), Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
97
+ }), L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
98
98
  __proto__: null,
99
99
  broadcast: g,
100
- handshake: J
100
+ handshake: M
101
101
  }, Symbol.toStringTag, { value: "Module" }));
102
- function H(e = [], t, n) {
102
+ function J(e = [], t, n) {
103
103
  return y({
104
104
  mutationKey: [...e, t],
105
105
  mutationFn: async (o) => {
@@ -107,21 +107,21 @@ function H(e = [], t, n) {
107
107
  throw new Error(
108
108
  "[Core][Broadcast] Attempted to call broadcast API with anon user"
109
109
  );
110
- const s = K(t);
111
- if (s) {
112
- const r = h.fromString(s);
110
+ const i = K(t);
111
+ if (i) {
112
+ const r = h.fromString(i);
113
113
  return a.hiveClient.broadcast.sendOperations(
114
114
  n(o),
115
115
  r
116
116
  );
117
117
  }
118
- const u = b(t);
119
- if (u && u == "keychain")
118
+ const c = S(t);
119
+ if (c && c == "keychain")
120
120
  return g(t, n(o), "Posting").then((r) => r.result);
121
- let i = l(t);
122
- if (i)
121
+ let s = l(t);
122
+ if (s)
123
123
  return (await new d.Client({
124
- accessToken: i
124
+ accessToken: s
125
125
  }).broadcast(n(o))).result;
126
126
  throw new Error(
127
127
  "[SDK][Broadcast] – cannot broadcast w/o posting key or token"
@@ -129,7 +129,7 @@ function H(e = [], t, n) {
129
129
  }
130
130
  });
131
131
  }
132
- async function E(e, t, n) {
132
+ async function H(e, t, n) {
133
133
  if (!e)
134
134
  throw new Error(
135
135
  "[Core][Broadcast] Attempted to call broadcast API with anon user"
@@ -139,28 +139,28 @@ async function E(e, t, n) {
139
139
  required_auths: [],
140
140
  required_posting_auths: [e],
141
141
  json: JSON.stringify(n)
142
- }, s = K(e);
143
- if (s) {
144
- const r = h.fromString(s);
142
+ }, i = K(e);
143
+ if (i) {
144
+ const r = h.fromString(i);
145
145
  return a.hiveClient.broadcast.json(
146
146
  o,
147
147
  r
148
148
  );
149
149
  }
150
- const u = b(e);
151
- if (u && u == "keychain")
150
+ const c = S(e);
151
+ if (c && c == "keychain")
152
152
  return g(e, [["custom_json", o]], "Posting").then((r) => r.result);
153
- let i = l(e);
154
- if (i)
153
+ let s = l(e);
154
+ if (s)
155
155
  return (await new d.Client({
156
- accessToken: i
156
+ accessToken: s
157
157
  }).customJson([], [e], t, JSON.stringify(n))).result;
158
158
  throw new Error(
159
159
  "[SDK][Broadcast] – cannot broadcast w/o posting key or token"
160
160
  );
161
161
  }
162
- function Z() {
163
- return new q({
162
+ function R() {
163
+ return new O({
164
164
  defaultOptions: {
165
165
  queries: {
166
166
  // With SSR, we usually want to set some default staleTime
@@ -172,46 +172,46 @@ function Z() {
172
172
  }
173
173
  });
174
174
  }
175
- const c = () => a.queryClient;
176
- var S;
175
+ const u = () => a.queryClient;
176
+ var q;
177
177
  ((e) => {
178
178
  function t(r) {
179
- return c().getQueryData(r);
179
+ return u().getQueryData(r);
180
180
  }
181
181
  e.getQueryData = t;
182
182
  function n(r) {
183
- return c().getQueryData(r);
183
+ return u().getQueryData(r);
184
184
  }
185
185
  e.getInfiniteQueryData = n;
186
186
  async function o(r) {
187
- return await c().prefetchQuery(r), t(r.queryKey);
187
+ return await u().prefetchQuery(r), t(r.queryKey);
188
188
  }
189
189
  e.prefetchQuery = o;
190
- async function s(r) {
191
- return await c().prefetchInfiniteQuery(r), n(r.queryKey);
190
+ async function i(r) {
191
+ return await u().prefetchInfiniteQuery(r), n(r.queryKey);
192
192
  }
193
- e.prefetchInfiniteQuery = s;
194
- function u(r) {
193
+ e.prefetchInfiniteQuery = i;
194
+ function c(r) {
195
195
  return {
196
196
  prefetch: () => o(r),
197
197
  getData: () => t(r.queryKey),
198
198
  useClientQuery: () => j(r),
199
- fetchAndGet: () => c().fetchQuery(r)
199
+ fetchAndGet: () => u().fetchQuery(r)
200
200
  };
201
201
  }
202
- e.generateClientServerQuery = u;
203
- function i(r) {
202
+ e.generateClientServerQuery = c;
203
+ function s(r) {
204
204
  return {
205
- prefetch: () => s(r),
205
+ prefetch: () => i(r),
206
206
  getData: () => n(r.queryKey),
207
207
  useClientQuery: () => k(r),
208
- fetchAndGet: () => c().fetchInfiniteQuery(r)
208
+ fetchAndGet: () => u().fetchInfiniteQuery(r)
209
209
  };
210
210
  }
211
- e.generateClientServerInfiniteQuery = i;
212
- })(S || (S = {}));
213
- function R(e) {
214
- return H(
211
+ e.generateClientServerInfiniteQuery = s;
212
+ })(q || (q = {}));
213
+ function ee(e) {
214
+ return J(
215
215
  ["accounts", "update"],
216
216
  e,
217
217
  ({
@@ -233,7 +233,7 @@ function R(e) {
233
233
  ]
234
234
  );
235
235
  }
236
- function ee(e) {
236
+ function te(e) {
237
237
  return p({
238
238
  queryKey: ["get-account-full", e],
239
239
  queryFn: async () => {
@@ -251,7 +251,7 @@ function ee(e) {
251
251
  );
252
252
  } catch {
253
253
  }
254
- const s = await a.hiveClient.call(
254
+ const i = await a.hiveClient.call(
255
255
  "condenser_api",
256
256
  "get_account_reputations",
257
257
  [e, 1]
@@ -259,10 +259,10 @@ function ee(e) {
259
259
  return {
260
260
  ...t,
261
261
  follow_stats: o,
262
- reputation: s[0].reputation,
262
+ reputation: i[0].reputation,
263
263
  profile: {
264
264
  ...n,
265
- reputation: s[0].reputation
265
+ reputation: i[0].reputation
266
266
  }
267
267
  };
268
268
  },
@@ -270,7 +270,7 @@ function ee(e) {
270
270
  staleTime: 6e4
271
271
  });
272
272
  }
273
- function te(e, t = 5, n = []) {
273
+ function ne(e, t = 5, n = []) {
274
274
  return p({
275
275
  queryKey: ["accounts", "search", e, n],
276
276
  enabled: !!e,
@@ -278,11 +278,11 @@ function te(e, t = 5, n = []) {
278
278
  "lookup_accounts",
279
279
  [e, t]
280
280
  )).filter(
281
- (s) => n.length > 0 ? !n.includes(s) : !0
281
+ (i) => n.length > 0 ? !n.includes(i) : !0
282
282
  )
283
283
  });
284
284
  }
285
- function ne(e) {
285
+ function oe(e) {
286
286
  return p({
287
287
  queryKey: ["accounts", "check-wallet-pending", e],
288
288
  queryFn: async () => await (await fetch(
@@ -314,44 +314,57 @@ function B(e, t) {
314
314
  )
315
315
  });
316
316
  }
317
- function oe(e, t, n, o) {
317
+ function re(e) {
318
+ return p({
319
+ queryKey: ["accounts", "subscriptions", e],
320
+ enabled: !!e,
321
+ queryFn: async () => await a.hiveClient.call(
322
+ "bridge",
323
+ "list_all_subscriptions",
324
+ {
325
+ account: e
326
+ }
327
+ ) ?? []
328
+ });
329
+ }
330
+ function ie(e, t, n, o) {
318
331
  return y({
319
332
  mutationKey: [],
320
- mutationFn: async (s) => {
321
- const u = B(
333
+ mutationFn: async (i) => {
334
+ const c = B(
322
335
  e,
323
336
  t
324
337
  );
325
- await c().prefetchQuery(u);
326
- const i = c().getQueryData(
327
- u.queryKey
338
+ await u().prefetchQuery(c);
339
+ const s = u().getQueryData(
340
+ c.queryKey
328
341
  );
329
- return await E(e, "follow", [
342
+ return await H(e, "follow", [
330
343
  "follow",
331
344
  {
332
345
  follower: e,
333
346
  following: t,
334
347
  what: [
335
- ...s === "toggle-ignore" && !(i != null && i.ignores) ? ["ignore"] : [],
336
- ...s === "toggle-follow" && !(i != null && i.follows) ? ["blog"] : []
348
+ ...i === "toggle-ignore" && !(s != null && s.ignores) ? ["ignore"] : [],
349
+ ...i === "toggle-follow" && !(s != null && s.follows) ? ["blog"] : []
337
350
  ]
338
351
  }
339
352
  ]), {
340
- ...i,
341
- ignores: s === "toggle-ignore" ? !(i != null && i.ignores) : i == null ? void 0 : i.ignores,
342
- follows: s === "toggle-follow" ? !(i != null && i.follows) : i == null ? void 0 : i.follows
353
+ ...s,
354
+ ignores: i === "toggle-ignore" ? !(s != null && s.ignores) : s == null ? void 0 : s.ignores,
355
+ follows: i === "toggle-follow" ? !(s != null && s.follows) : s == null ? void 0 : s.follows
343
356
  };
344
357
  },
345
358
  onError: o,
346
- onSuccess(s) {
347
- n(s), c().setQueryData(
359
+ onSuccess(i) {
360
+ n(i), u().setQueryData(
348
361
  ["accounts", "relations", e, t],
349
- s
362
+ i
350
363
  );
351
364
  }
352
365
  });
353
366
  }
354
- function re(e) {
367
+ function se(e) {
355
368
  return y({
356
369
  mutationKey: ["operations", "sign", e],
357
370
  mutationFn: ({
@@ -368,7 +381,7 @@ function re(e) {
368
381
  }
369
382
  });
370
383
  }
371
- function ie(e, t = "Active") {
384
+ function ae(e, t = "Active") {
372
385
  return y({
373
386
  mutationKey: ["operations", "sign-keychain", e],
374
387
  mutationFn: ({ operation: n }) => {
@@ -380,20 +393,20 @@ function ie(e, t = "Active") {
380
393
  }
381
394
  });
382
395
  }
383
- function se(e = "/") {
396
+ function ce(e = "/") {
384
397
  return y({
385
398
  mutationKey: ["operations", "sign-hivesigner", e],
386
399
  mutationFn: async ({ operation: t }) => d.sendOperation(t, { callback: e }, () => {
387
400
  })
388
401
  });
389
402
  }
390
- function ae() {
403
+ function ue() {
391
404
  return p({
392
405
  queryKey: ["operations", "chain-properties"],
393
406
  queryFn: async () => await a.hiveClient.database.getChainProperties()
394
407
  });
395
408
  }
396
- function ce(e, t) {
409
+ function pe(e, t) {
397
410
  return p({
398
411
  queryKey: ["hive-engine", "tokens-list", e, t],
399
412
  queryFn: async () => (await (await fetch(
@@ -418,7 +431,7 @@ function ce(e, t) {
418
431
  )).json()).result
419
432
  });
420
433
  }
421
- function ue(e = 20) {
434
+ function ye(e = 20) {
422
435
  return A({
423
436
  queryKey: ["posts", "trending-tags"],
424
437
  queryFn: async ({ pageParam: { afterTag: t } }) => a.hiveClient.database.call("get_trending_tags", [t, e]).then(
@@ -432,7 +445,7 @@ function ue(e = 20) {
432
445
  refetchOnMount: !0
433
446
  });
434
447
  }
435
- function m(e) {
448
+ function v(e) {
436
449
  return p({
437
450
  queryKey: ["posts", "fragments", e],
438
451
  queryFn: async () => (await fetch(
@@ -450,7 +463,7 @@ function m(e) {
450
463
  enabled: !!e
451
464
  });
452
465
  }
453
- function pe(e = "feed") {
466
+ function le(e = "feed") {
454
467
  return p({
455
468
  queryKey: ["posts", "promoted", e],
456
469
  queryFn: async () => {
@@ -466,7 +479,7 @@ function pe(e = "feed") {
466
479
  }
467
480
  });
468
481
  }
469
- function ye(e) {
482
+ function fe(e) {
470
483
  return y({
471
484
  mutationKey: ["posts", "add-fragment", e],
472
485
  mutationFn: async ({ title: t, body: n }) => (await fetch(
@@ -484,14 +497,14 @@ function ye(e) {
484
497
  }
485
498
  )).json(),
486
499
  onSuccess(t) {
487
- c().setQueryData(
488
- m(e).queryKey,
500
+ u().setQueryData(
501
+ v(e).queryKey,
489
502
  (n) => [t, ...n ?? []]
490
503
  );
491
504
  }
492
505
  });
493
506
  }
494
- function le(e, t) {
507
+ function he(e, t) {
495
508
  return y({
496
509
  mutationKey: ["posts", "edit-fragment", e, t],
497
510
  mutationFn: async ({ title: n, body: o }) => (await fetch(
@@ -510,19 +523,19 @@ function le(e, t) {
510
523
  }
511
524
  )).json(),
512
525
  onSuccess(n) {
513
- c().setQueryData(
514
- m(e).queryKey,
526
+ u().setQueryData(
527
+ v(e).queryKey,
515
528
  (o) => {
516
529
  if (!o)
517
530
  return [];
518
- const s = o.findIndex(({ id: u }) => u === t);
519
- return s >= 0 && (o[s] = n), [...o];
531
+ const i = o.findIndex(({ id: c }) => c === t);
532
+ return i >= 0 && (o[i] = n), [...o];
520
533
  }
521
534
  );
522
535
  }
523
536
  });
524
537
  }
525
- function fe(e, t) {
538
+ function de(e, t) {
526
539
  return y({
527
540
  mutationKey: ["posts", "remove-fragment", e],
528
541
  mutationFn: async () => fetch(a.privateApiHost + "/private-api/fragments-delete", {
@@ -536,8 +549,8 @@ function fe(e, t) {
536
549
  }
537
550
  }),
538
551
  onSuccess() {
539
- c().setQueryData(
540
- m(e).queryKey,
552
+ u().setQueryData(
553
+ v(e).queryKey,
541
554
  (n) => [...n ?? []].filter(({ id: o }) => o !== t)
542
555
  );
543
556
  }
@@ -566,11 +579,11 @@ function Q(e, t) {
566
579
  }
567
580
  });
568
581
  }
569
- const he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
582
+ const ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
570
583
  __proto__: null,
571
584
  useRecordActivity: Q
572
585
  }, Symbol.toStringTag, { value: "Module" }));
573
- function M(e, t) {
586
+ function E(e, t) {
574
587
  return p({
575
588
  queryKey: ["integrations", "hivesigner", "decode-memo", e],
576
589
  queryFn: async () => {
@@ -582,13 +595,13 @@ function M(e, t) {
582
595
  }
583
596
  });
584
597
  }
585
- const x = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
598
+ const G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
586
599
  __proto__: null,
587
- getDecodeMemoQueryOptions: M
588
- }, Symbol.toStringTag, { value: "Module" })), G = {
589
- queries: x
600
+ getDecodeMemoQueryOptions: E
601
+ }, Symbol.toStringTag, { value: "Module" })), U = {
602
+ queries: G
590
603
  };
591
- function v(e) {
604
+ function m(e) {
592
605
  return p({
593
606
  queryKey: ["integrations", "3speak", "authenticate", e],
594
607
  enabled: !!e,
@@ -602,28 +615,28 @@ function v(e) {
602
615
  "Content-Type": "application/json"
603
616
  }
604
617
  }
605
- ), n = G.queries.getDecodeMemoQueryOptions(
618
+ ), n = U.queries.getDecodeMemoQueryOptions(
606
619
  e,
607
620
  (await t.json()).memo
608
621
  );
609
- await c().prefetchQuery(n);
610
- const { memoDecoded: o } = c().getQueryData(
622
+ await u().prefetchQuery(n);
623
+ const { memoDecoded: o } = u().getQueryData(
611
624
  n.queryKey
612
625
  );
613
626
  return o.replace("#", "");
614
627
  }
615
628
  });
616
629
  }
617
- function U(e) {
630
+ function x(e) {
618
631
  return p({
619
632
  queryKey: ["integrations", "3speak", "videos", e],
620
633
  enabled: !!e,
621
634
  queryFn: async () => {
622
- await c().prefetchQuery(
623
- v(e)
635
+ await u().prefetchQuery(
636
+ m(e)
624
637
  );
625
- const t = c().getQueryData(
626
- v(e).queryKey
638
+ const t = u().getQueryData(
639
+ m(e).queryKey
627
640
  );
628
641
  return await (await fetch(
629
642
  "https://studio.3speak.tv/mobile/api/my-videos",
@@ -639,12 +652,12 @@ function U(e) {
639
652
  }
640
653
  const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
641
654
  __proto__: null,
642
- getAccountTokenQueryOptions: v,
643
- getAccountVideosQueryOptions: U
644
- }, Symbol.toStringTag, { value: "Module" })), de = {
655
+ getAccountTokenQueryOptions: m,
656
+ getAccountVideosQueryOptions: x
657
+ }, Symbol.toStringTag, { value: "Module" })), we = {
645
658
  queries: z
646
659
  };
647
- function ge() {
660
+ function me() {
648
661
  return p({
649
662
  queryKey: ["resource-credits", "stats"],
650
663
  queryFn: async () => (await a.hiveClient.call(
@@ -654,14 +667,14 @@ function ge() {
654
667
  )).rc_stats
655
668
  });
656
669
  }
657
- function we(e) {
670
+ function ve(e) {
658
671
  return p({
659
672
  queryKey: ["resource-credits", "account", e],
660
673
  queryFn: async () => new P(a.hiveClient).findRCAccounts([e]),
661
674
  enabled: !!e
662
675
  });
663
676
  }
664
- function ve(e, t) {
677
+ function Ce(e, t) {
665
678
  return p({
666
679
  queryKey: ["games", "status-check", t, e],
667
680
  enabled: !!e,
@@ -684,7 +697,7 @@ function ve(e, t) {
684
697
  }
685
698
  });
686
699
  }
687
- function me(e, t, n) {
700
+ function be(e, t, n) {
688
701
  const { mutateAsync: o } = Q(
689
702
  e,
690
703
  "spin-rolled"
@@ -714,42 +727,90 @@ function me(e, t, n) {
714
727
  }
715
728
  });
716
729
  }
730
+ function qe(e, t, n = 100, o = void 0, i = !0) {
731
+ return p({
732
+ queryKey: ["communities", "list", e, t, n],
733
+ enabled: i,
734
+ queryFn: async () => {
735
+ const c = await a.hiveClient.call(
736
+ "bridge",
737
+ "list_communities",
738
+ {
739
+ last: "",
740
+ limit: n,
741
+ sort: e,
742
+ query: t,
743
+ observer: o
744
+ }
745
+ );
746
+ return c ? e === "hot" ? c.sort(() => Math.random() - 0.5) : c : [];
747
+ }
748
+ });
749
+ }
750
+ var W = /* @__PURE__ */ ((e) => (e.OWNER = "owner", e.ADMIN = "admin", e.MOD = "mod", e.MEMBER = "member", e.GUEST = "guest", e.MUTED = "muted", e))(W || {});
751
+ const Oe = {
752
+ owner: [
753
+ "admin",
754
+ "mod",
755
+ "member",
756
+ "guest",
757
+ "muted"
758
+ /* MUTED */
759
+ ],
760
+ admin: [
761
+ "mod",
762
+ "member",
763
+ "guest",
764
+ "muted"
765
+ /* MUTED */
766
+ ],
767
+ mod: [
768
+ "member",
769
+ "guest",
770
+ "muted"
771
+ /* MUTED */
772
+ ]
773
+ };
717
774
  export {
718
775
  a as CONFIG,
719
- O as ConfigManager,
720
- he as EcencyAnalytics,
721
- S as EcencyQueriesManager,
722
- G as HiveSignerIntegration,
723
- Y as Keychain,
724
- de as ThreeSpeakIntegration,
725
- E as broadcastJson,
726
- ne as checkUsernameWalletsPendingQueryOptions,
776
+ b as ConfigManager,
777
+ ge as EcencyAnalytics,
778
+ q as EcencyQueriesManager,
779
+ U as HiveSignerIntegration,
780
+ L as Keychain,
781
+ W as ROLES,
782
+ we as ThreeSpeakIntegration,
783
+ H as broadcastJson,
784
+ oe as checkUsernameWalletsPendingQueryOptions,
727
785
  l as getAccessToken,
728
- ee as getAccountFullQueryOptions,
729
- we as getAccountRcQueryOptions,
730
- ae as getChainPropertiesQueryOptions,
731
- m as getFragmentsQueryOptions,
732
- ve as getGameStatusCheckQueryOptions,
733
- ce as getHiveEngineTokensListQueryOptions,
734
- b as getLoginType,
786
+ te as getAccountFullQueryOptions,
787
+ ve as getAccountRcQueryOptions,
788
+ re as getAccountSubscriptionsQueryOptions,
789
+ ue as getChainPropertiesQueryOptions,
790
+ qe as getCommunitiesQueryOptions,
791
+ v as getFragmentsQueryOptions,
792
+ Ce as getGameStatusCheckQueryOptions,
793
+ pe as getHiveEngineTokensListQueryOptions,
794
+ S as getLoginType,
735
795
  K as getPostingKey,
736
- pe as getPromotedPostsQuery,
737
- c as getQueryClient,
738
- ge as getRcStatsQueryOptions,
739
- X as getRefreshToken,
796
+ le as getPromotedPostsQuery,
797
+ u as getQueryClient,
798
+ me as getRcStatsQueryOptions,
799
+ Z as getRefreshToken,
740
800
  B as getRelationshipBetweenAccountsQueryOptions,
741
- te as getSearchAccountsByUsernameQueryOptions,
742
- ue as getTrendingTagsQueryOptions,
801
+ ne as getSearchAccountsByUsernameQueryOptions,
802
+ ye as getTrendingTagsQueryOptions,
743
803
  f as getUser,
744
- Z as makeQueryClient,
745
- oe as useAccountRelationsUpdate,
746
- R as useAccountUpdate,
747
- ye as useAddFragment,
748
- H as useBroadcastMutation,
749
- le as useEditFragment,
750
- me as useGameClaim,
751
- fe as useRemoveFragment,
752
- se as useSignOperationByHivesigner,
753
- re as useSignOperationByKey,
754
- ie as useSignOperationByKeychain
804
+ R as makeQueryClient,
805
+ Oe as roleMap,
806
+ ie as useAccountRelationsUpdate,
807
+ ee as useAccountUpdate,
808
+ fe as useAddFragment,
809
+ J as useBroadcastMutation,
810
+ he as useEditFragment,
811
+ be as useGameClaim,
812
+ de as useRemoveFragment,
813
+ ce as useSignOperationByHivesigner,
814
+ se as useSignOperationByKey,
815
+ ae as useSignOperationByKeychain
755
816
  };
package/dist/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from './modules/analytics';
8
8
  export * from './modules/integrations';
9
9
  export * from './modules/resource-credits';
10
10
  export * from './modules/games';
11
+ export * from './modules/communities';
@@ -0,0 +1,10 @@
1
+ type Subscriptions = string[];
2
+ export declare function getAccountSubscriptionsQueryOptions(username: string | undefined): import('@tanstack/query-core').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<Subscriptions, Error, Subscriptions, (string | undefined)[]>, "queryFn"> & {
3
+ queryFn?: import('@tanstack/query-core').QueryFunction<Subscriptions, (string | undefined)[], never> | undefined;
4
+ } & {
5
+ queryKey: (string | undefined)[] & {
6
+ [dataTagSymbol]: Subscriptions;
7
+ [dataTagErrorSymbol]: Error;
8
+ };
9
+ };
10
+ export {};
@@ -2,3 +2,4 @@ export * from './get-account-full-query-options';
2
2
  export * from './search-accounts-by-username-query-options';
3
3
  export * from './check-username-wallets-pending-query-options';
4
4
  export * from './get-relationship-between-accounts-query-options';
5
+ export * from './get-account-subscriptions-query-options';
@@ -0,0 +1,2 @@
1
+ export * from './queries';
2
+ export * from './types';
@@ -0,0 +1,9 @@
1
+ import { Communities } from '../types';
2
+ export declare function getCommunitiesQueryOptions(sort: string, query?: string, limit?: number, observer?: string | undefined, enabled?: boolean): import('@tanstack/query-core').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<Communities, Error, Communities, (string | number | undefined)[]>, "queryFn"> & {
3
+ queryFn?: import('@tanstack/query-core').QueryFunction<Communities, (string | number | undefined)[], never> | undefined;
4
+ } & {
5
+ queryKey: (string | number | undefined)[] & {
6
+ [dataTagSymbol]: Communities;
7
+ [dataTagErrorSymbol]: Error;
8
+ };
9
+ };
@@ -0,0 +1 @@
1
+ export * from './get-communities-query-options';
@@ -0,0 +1,31 @@
1
+ export declare enum ROLES {
2
+ OWNER = "owner",
3
+ ADMIN = "admin",
4
+ MOD = "mod",
5
+ MEMBER = "member",
6
+ GUEST = "guest",
7
+ MUTED = "muted"
8
+ }
9
+ export declare const roleMap: Record<string, string[]>;
10
+ export type CommunityTeam = Array<Array<string>>;
11
+ export interface Community {
12
+ about: string;
13
+ admins?: string[];
14
+ avatar_url: string;
15
+ created_at: string;
16
+ description: string;
17
+ flag_text: string;
18
+ id: number;
19
+ is_nsfw: boolean;
20
+ lang: string;
21
+ name: string;
22
+ num_authors: number;
23
+ num_pending: number;
24
+ subscribers: number;
25
+ sum_pending: number;
26
+ settings?: any;
27
+ team: CommunityTeam;
28
+ title: string;
29
+ type_id: number;
30
+ }
31
+ export type Communities = Community[];
@@ -0,0 +1 @@
1
+ export * from './community';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ecency/sdk",
3
3
  "private": false,
4
- "version": "1.0.46",
4
+ "version": "1.0.48",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "./dist/ecency-sdk.umd.js",