@ecency/sdk 1.0.55 → 1.1.0

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,12 +1,12 @@
1
- var Q = Object.defineProperty;
2
- var _ = (e, t, n) => t in e ? Q(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var S = (e, t, n) => _(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { QueryClient as K, useMutation as l, useQuery as q, useInfiniteQuery as j, queryOptions as p, infiniteQueryOptions as F } from "@tanstack/react-query";
5
- import { Client as D, PrivateKey as h, cryptoUtils as P, RCAPI as N } from "@hiveio/dhive";
6
- import g from "hivesigner";
7
- class M {
1
+ var N = Object.defineProperty;
2
+ var x = (e, t, n) => t in e ? N(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var O = (e, t, n) => x(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { QueryClient as q, useMutation as d, useQuery as T, useInfiniteQuery as G, queryOptions as p, infiniteQueryOptions as V } from "@tanstack/react-query";
5
+ import { Client as W, PrivateKey as v, cryptoUtils as z, RCAPI as U } from "@hiveio/dhive";
6
+ import m from "hivesigner";
7
+ class $ {
8
8
  constructor() {
9
- S(this, "length", 0);
9
+ O(this, "length", 0);
10
10
  }
11
11
  clear() {
12
12
  throw new Error("Method not implemented.");
@@ -26,9 +26,9 @@ class M {
26
26
  }
27
27
  const i = {
28
28
  privateApiHost: "https://ecency.com",
29
- storage: typeof window > "u" ? new M() : window.localStorage,
29
+ storage: typeof window > "u" ? new $() : window.localStorage,
30
30
  storagePrefix: "ecency",
31
- hiveClient: new D(
31
+ hiveClient: new W(
32
32
  [
33
33
  "https://api.hive.blog",
34
34
  "https://api.deathwing.me",
@@ -49,33 +49,50 @@ const i = {
49
49
  }
50
50
  ),
51
51
  heliusApiKey: void 0,
52
- queryClient: new K(),
53
- plausibleHost: "https://pl.ecency.com"
52
+ queryClient: new q(),
53
+ plausibleHost: "https://pl.ecency.com",
54
+ spkNode: "https://spk.good-karma.xyz"
54
55
  };
55
- var C;
56
+ var k;
56
57
  ((e) => {
57
58
  function t(n) {
58
59
  i.queryClient = n;
59
60
  }
60
61
  e.setQueryClient = t;
61
- })(C || (C = {}));
62
- function E(e) {
62
+ })(k || (k = {}));
63
+ function R(e) {
63
64
  let t = atob(e);
64
65
  if (t[0] === "{")
65
66
  return JSON.parse(t);
66
67
  }
67
- const f = (e) => {
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 || {});
69
+ function g(e) {
70
+ if (typeof e == "string") {
71
+ const t = e.split(" ");
72
+ return {
73
+ amount: parseFloat(t[0]),
74
+ // @ts-ignore
75
+ symbol: A[t[1]]
76
+ };
77
+ } else
78
+ return {
79
+ amount: parseFloat(e.amount.toString()) / Math.pow(10, e.precision),
80
+ // @ts-ignore
81
+ symbol: Q[e.nai]
82
+ };
83
+ }
84
+ const _ = (e) => {
68
85
  try {
69
86
  const t = i.storage.getItem(
70
87
  i.storagePrefix + "_user_" + e
71
88
  );
72
- return E(JSON.parse(t));
89
+ return R(JSON.parse(t));
73
90
  } catch (t) {
74
91
  console.error(t);
75
92
  return;
76
93
  }
77
- }, y = (e) => f(e) && f(e).accessToken, k = (e) => f(e) && f(e).postingKey, T = (e) => f(e) && f(e).loginType, L = (e) => f(e) && f(e).refreshToken;
78
- function J() {
94
+ }, y = (e) => _(e) && _(e).accessToken, j = (e) => _(e) && _(e).postingKey, F = (e) => _(e) && _(e).loginType, ye = (e) => _(e) && _(e).refreshToken;
95
+ function X() {
79
96
  return new Promise((e) => {
80
97
  var t;
81
98
  (t = window.hive_keychain) == null || t.requestHandshake(() => {
@@ -83,7 +100,7 @@ function J() {
83
100
  });
84
101
  });
85
102
  }
86
- const w = (e, t, n, o = null) => new Promise((r, c) => {
103
+ const b = (e, t, n, o = null) => new Promise((r, c) => {
87
104
  var a;
88
105
  (a = window.hive_keychain) == null || a.requestBroadcast(
89
106
  e,
@@ -94,33 +111,47 @@ const w = (e, t, n, o = null) => new Promise((r, c) => {
94
111
  },
95
112
  o
96
113
  );
97
- }), R = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
114
+ }), Y = (e, t, n, o, r, c = null) => new Promise((a, s) => {
115
+ var f;
116
+ (f = window.hive_keychain) == null || f.requestCustomJson(
117
+ e,
118
+ t,
119
+ n,
120
+ o,
121
+ r,
122
+ (w) => {
123
+ w.success || s({ message: "Operation cancelled" }), a(w);
124
+ },
125
+ c
126
+ );
127
+ }), de = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
98
128
  __proto__: null,
99
- broadcast: w,
100
- handshake: J
129
+ broadcast: b,
130
+ customJson: Y,
131
+ handshake: X
101
132
  }, Symbol.toStringTag, { value: "Module" }));
102
- function I(e = [], t, n) {
103
- return l({
133
+ function Z(e = [], t, n) {
134
+ return d({
104
135
  mutationKey: [...e, t],
105
136
  mutationFn: async (o) => {
106
137
  if (!t)
107
138
  throw new Error(
108
139
  "[Core][Broadcast] Attempted to call broadcast API with anon user"
109
140
  );
110
- const r = k(t);
141
+ const r = j(t);
111
142
  if (r) {
112
- const s = h.fromString(r);
143
+ const s = v.fromString(r);
113
144
  return i.hiveClient.broadcast.sendOperations(
114
145
  n(o),
115
146
  s
116
147
  );
117
148
  }
118
- const c = T(t);
149
+ const c = F(t);
119
150
  if (c && c == "keychain")
120
- return w(t, n(o), "Posting").then((s) => s.result);
151
+ return b(t, n(o), "Posting").then((s) => s.result);
121
152
  let a = y(t);
122
153
  if (a)
123
- return (await new g.Client({
154
+ return (await new m.Client({
124
155
  accessToken: a
125
156
  }).broadcast(n(o))).result;
126
157
  throw new Error(
@@ -129,7 +160,7 @@ function I(e = [], t, n) {
129
160
  }
130
161
  });
131
162
  }
132
- async function B(e, t, n) {
163
+ async function L(e, t, n) {
133
164
  if (!e)
134
165
  throw new Error(
135
166
  "[Core][Broadcast] Attempted to call broadcast API with anon user"
@@ -139,28 +170,28 @@ async function B(e, t, n) {
139
170
  required_auths: [],
140
171
  required_posting_auths: [e],
141
172
  json: JSON.stringify(n)
142
- }, r = k(e);
173
+ }, r = j(e);
143
174
  if (r) {
144
- const s = h.fromString(r);
175
+ const s = v.fromString(r);
145
176
  return i.hiveClient.broadcast.json(
146
177
  o,
147
178
  s
148
179
  );
149
180
  }
150
- const c = T(e);
181
+ const c = F(e);
151
182
  if (c && c == "keychain")
152
- return w(e, [["custom_json", o]], "Posting").then((s) => s.result);
183
+ return b(e, [["custom_json", o]], "Posting").then((s) => s.result);
153
184
  let a = y(e);
154
185
  if (a)
155
- return (await new g.Client({
186
+ return (await new m.Client({
156
187
  accessToken: a
157
188
  }).customJson([], [e], t, JSON.stringify(n))).result;
158
189
  throw new Error(
159
190
  "[SDK][Broadcast] – cannot broadcast w/o posting key or token"
160
191
  );
161
192
  }
162
- function ee() {
163
- return new K({
193
+ function le() {
194
+ return new q({
164
195
  defaultOptions: {
165
196
  queries: {
166
197
  // With SSR, we usually want to set some default staleTime
@@ -173,7 +204,7 @@ function ee() {
173
204
  });
174
205
  }
175
206
  const u = () => i.queryClient;
176
- var b;
207
+ var K;
177
208
  ((e) => {
178
209
  function t(s) {
179
210
  return u().getQueryData(s);
@@ -195,7 +226,7 @@ var b;
195
226
  return {
196
227
  prefetch: () => o(s),
197
228
  getData: () => t(s.queryKey),
198
- useClientQuery: () => q(s),
229
+ useClientQuery: () => T(s),
199
230
  fetchAndGet: () => u().fetchQuery(s)
200
231
  };
201
232
  }
@@ -204,19 +235,64 @@ var b;
204
235
  return {
205
236
  prefetch: () => r(s),
206
237
  getData: () => n(s.queryKey),
207
- useClientQuery: () => j(s),
238
+ useClientQuery: () => G(s),
208
239
  fetchAndGet: () => u().fetchInfiniteQuery(s)
209
240
  };
210
241
  }
211
242
  e.generateClientServerInfiniteQuery = a;
212
- })(b || (b = {}));
213
- function H(e) {
243
+ })(K || (K = {}));
244
+ function he() {
245
+ return p({
246
+ queryKey: ["core", "dynamic-props"],
247
+ refetchInterval: 6e4,
248
+ staleTime: 6e4,
249
+ refetchOnMount: !0,
250
+ queryFn: async () => {
251
+ const e = await i.hiveClient.database.getDynamicGlobalProperties().then((h) => ({
252
+ total_vesting_fund_hive: h.total_vesting_fund_hive || h.total_vesting_fund_steem,
253
+ total_vesting_shares: h.total_vesting_shares,
254
+ hbd_print_rate: h.hbd_print_rate || h.sbd_print_rate,
255
+ hbd_interest_rate: h.hbd_interest_rate,
256
+ head_block_number: h.head_block_number,
257
+ vesting_reward_percent: h.vesting_reward_percent,
258
+ virtual_supply: h.virtual_supply
259
+ })), t = await i.hiveClient.database.call("get_feed_history"), n = await i.hiveClient.database.call(
260
+ "get_chain_properties"
261
+ ), o = await i.hiveClient.database.call(
262
+ "get_reward_fund",
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(
265
+ e.total_vesting_fund_hive
266
+ ).amount, M = g(
267
+ e.total_vesting_shares
268
+ ).amount, B = g(e.virtual_supply).amount, H = e.vesting_reward_percent, J = n.account_creation_fee;
269
+ return {
270
+ hivePerMVests: r,
271
+ base: c,
272
+ quote: a,
273
+ fundRecentClaims: s,
274
+ fundRewardBalance: f,
275
+ hbdPrintRate: w,
276
+ hbdInterestRate: P,
277
+ headBlock: E,
278
+ totalVestingFund: I,
279
+ totalVestingShares: M,
280
+ virtualSupply: B,
281
+ vestingRewardPercent: H,
282
+ accountCreationFee: J
283
+ };
284
+ }
285
+ });
286
+ }
287
+ function ee(e) {
214
288
  return p({
215
289
  queryKey: ["get-account-full", e],
216
290
  queryFn: async () => {
217
291
  if (!e)
218
292
  throw new Error("[SDK] Username is empty");
219
- const t = await i.hiveClient.database.getAccounts([e]);
293
+ const t = await i.hiveClient.database.getAccounts([
294
+ e
295
+ ]);
220
296
  if (!t[0])
221
297
  throw new Error("[SDK] No account with given username");
222
298
  const n = JSON.parse(t[0].posting_json_metadata).profile;
@@ -234,7 +310,43 @@ function H(e) {
234
310
  [e, 1]
235
311
  );
236
312
  return {
237
- ...t[0],
313
+ name: t[0].name,
314
+ owner: t[0].owner,
315
+ active: t[0].active,
316
+ posting: t[0].posting,
317
+ memo_key: t[0].memo_key,
318
+ post_count: t[0].post_count,
319
+ created: t[0].created,
320
+ posting_json_metadata: t[0].posting_json_metadata,
321
+ last_vote_time: t[0].last_vote_time,
322
+ last_post: t[0].last_post,
323
+ json_metadata: t[0].json_metadata,
324
+ reward_hive_balance: t[0].reward_hive_balance,
325
+ reward_hbd_balance: t[0].reward_hbd_balance,
326
+ reward_vesting_hive: t[0].reward_vesting_hive,
327
+ reward_vesting_balance: t[0].reward_vesting_balance,
328
+ balance: t[0].balance,
329
+ hbd_balance: t[0].hbd_balance,
330
+ savings_balance: t[0].savings_balance,
331
+ savings_hbd_balance: t[0].savings_hbd_balance,
332
+ savings_hbd_last_interest_payment: t[0].savings_hbd_last_interest_payment,
333
+ savings_hbd_seconds_last_update: t[0].savings_hbd_seconds_last_update,
334
+ savings_hbd_seconds: t[0].savings_hbd_seconds,
335
+ next_vesting_withdrawal: t[0].next_vesting_withdrawal,
336
+ pending_claimed_accounts: t[0].pending_claimed_accounts,
337
+ vesting_shares: t[0].vesting_shares,
338
+ delegated_vesting_shares: t[0].delegated_vesting_shares,
339
+ received_vesting_shares: t[0].received_vesting_shares,
340
+ vesting_withdraw_rate: t[0].vesting_withdraw_rate,
341
+ to_withdraw: t[0].to_withdraw,
342
+ withdrawn: t[0].withdrawn,
343
+ witness_votes: t[0].witness_votes,
344
+ proxy: t[0].proxy,
345
+ recovery_account: t[0].recovery_account,
346
+ proxied_vsf_votes: t[0].proxied_vsf_votes,
347
+ voting_manabar: t[0].voting_manabar,
348
+ voting_power: t[0].voting_power,
349
+ downvote_manabar: t[0].downvote_manabar,
238
350
  follow_stats: o,
239
351
  reputation: r[0].reputation,
240
352
  profile: {
@@ -247,7 +359,7 @@ function H(e) {
247
359
  staleTime: 6e4
248
360
  });
249
361
  }
250
- function te(e, t = 5, n = []) {
362
+ function fe(e, t = 5, n = []) {
251
363
  return p({
252
364
  queryKey: ["accounts", "search", e, n],
253
365
  enabled: !!e,
@@ -259,7 +371,7 @@ function te(e, t = 5, n = []) {
259
371
  )
260
372
  });
261
373
  }
262
- function ne(e) {
374
+ function ge(e) {
263
375
  return p({
264
376
  queryKey: ["accounts", "check-wallet-pending", e],
265
377
  queryFn: async () => await (await fetch(
@@ -278,7 +390,7 @@ function ne(e) {
278
390
  refetchOnMount: !0
279
391
  });
280
392
  }
281
- function x(e, t) {
393
+ function te(e, t) {
282
394
  return p({
283
395
  queryKey: ["accounts", "relations", e, t],
284
396
  enabled: !!e && !!t,
@@ -291,7 +403,7 @@ function x(e, t) {
291
403
  )
292
404
  });
293
405
  }
294
- function oe(e) {
406
+ function _e(e) {
295
407
  return p({
296
408
  queryKey: ["accounts", "subscriptions", e],
297
409
  enabled: !!e,
@@ -304,7 +416,7 @@ function oe(e) {
304
416
  ) ?? []
305
417
  });
306
418
  }
307
- function re(e) {
419
+ function ve(e) {
308
420
  return p({
309
421
  queryKey: ["accounts", "bookmarks", e],
310
422
  enabled: !!e,
@@ -324,7 +436,7 @@ function re(e) {
324
436
  }
325
437
  });
326
438
  }
327
- function ie(e) {
439
+ function we(e) {
328
440
  return p({
329
441
  queryKey: ["accounts", "favourites", e],
330
442
  enabled: !!e,
@@ -344,40 +456,33 @@ function ie(e) {
344
456
  }
345
457
  });
346
458
  }
347
- function se(e) {
348
- const { data: t } = q(H(e));
349
- return I(
459
+ function me(e) {
460
+ const { data: t } = T(ee(e));
461
+ return Z(
350
462
  ["accounts", "update", t],
351
463
  e,
352
- ({ profile: n, tokens: o, beneficiary: r }) => [
353
- [
354
- "account_update2",
355
- {
356
- account: e,
357
- json_metadata: "",
358
- posting_json_metadata: JSON.stringify({
359
- ...JSON.parse((t == null ? void 0 : t.posting_json_metadata) || "{}"),
360
- profile: { ...n, version: 2 },
361
- tokens: o,
362
- // See https://docs.ecency.com/communities/default-beneficiary/
363
- ...r ? {
364
- beneficiary: {
365
- account: r == null ? void 0 : r.username,
366
- weight: r == null ? void 0 : r.reward
367
- }
368
- } : {}
369
- }),
370
- extensions: []
371
- }
372
- ]
373
- ]
464
+ ({ profile: n, tokens: o }) => {
465
+ const r = {
466
+ ...JSON.parse((t == null ? void 0 : t.posting_json_metadata) || "{}"),
467
+ profile: { ...t == null ? void 0 : t.profile, ...n, version: 2 }
468
+ };
469
+ return o && o.length > 0 && (r.tokens = o), [
470
+ [
471
+ "account_update2",
472
+ {
473
+ account: e,
474
+ posting_json_metadata: JSON.stringify(r)
475
+ }
476
+ ]
477
+ ];
478
+ }
374
479
  );
375
480
  }
376
- function ae(e, t, n, o) {
377
- return l({
481
+ function be(e, t, n, o) {
482
+ return d({
378
483
  mutationKey: [],
379
484
  mutationFn: async (r) => {
380
- const c = x(
485
+ const c = te(
381
486
  e,
382
487
  t
383
488
  );
@@ -385,7 +490,7 @@ function ae(e, t, n, o) {
385
490
  const a = u().getQueryData(
386
491
  c.queryKey
387
492
  );
388
- return await B(e, "follow", [
493
+ return await L(e, "follow", [
389
494
  "follow",
390
495
  {
391
496
  follower: e,
@@ -410,8 +515,8 @@ function ae(e, t, n, o) {
410
515
  }
411
516
  });
412
517
  }
413
- function ce(e, t, n) {
414
- return l({
518
+ function Se(e, t, n) {
519
+ return d({
415
520
  mutationKey: ["accounts", "bookmarks", "add", e],
416
521
  mutationFn: async ({ author: o, permlink: r }) => {
417
522
  if (!e)
@@ -439,8 +544,8 @@ function ce(e, t, n) {
439
544
  onError: n
440
545
  });
441
546
  }
442
- function ue(e, t, n) {
443
- return l({
547
+ function Ce(e, t, n) {
548
+ return d({
444
549
  mutationKey: ["accounts", "bookmarks", "delete", e],
445
550
  mutationFn: async (o) => {
446
551
  if (!e)
@@ -467,8 +572,8 @@ function ue(e, t, n) {
467
572
  onError: n
468
573
  });
469
574
  }
470
- function pe(e, t, n) {
471
- return l({
575
+ function Oe(e, t, n) {
576
+ return d({
472
577
  mutationKey: ["accounts", "favourites", "add", e],
473
578
  mutationFn: async (o) => {
474
579
  if (!e)
@@ -495,8 +600,8 @@ function pe(e, t, n) {
495
600
  onError: n
496
601
  });
497
602
  }
498
- function ye(e, t, n) {
499
- return l({
603
+ function ke(e, t, n) {
604
+ return d({
500
605
  mutationKey: ["accounts", "favourites", "add", e],
501
606
  mutationFn: async (o) => {
502
607
  if (!e)
@@ -523,8 +628,8 @@ function ye(e, t, n) {
523
628
  onError: n
524
629
  });
525
630
  }
526
- function le(e) {
527
- return l({
631
+ function Ke(e) {
632
+ return d({
528
633
  mutationKey: ["operations", "sign", e],
529
634
  mutationFn: ({
530
635
  operation: t,
@@ -533,65 +638,40 @@ function le(e) {
533
638
  if (!e)
534
639
  throw new Error("[Operations][Sign] – cannot sign op with anon user");
535
640
  let o;
536
- return n.split(" ").length === 12 ? o = h.fromLogin(e, n, "active") : P.isWif(n) ? o = h.fromString(n) : o = h.from(n), i.hiveClient.broadcast.sendOperations(
641
+ return n.split(" ").length === 12 ? o = v.fromLogin(e, n, "active") : z.isWif(n) ? o = v.fromString(n) : o = v.from(n), i.hiveClient.broadcast.sendOperations(
537
642
  [t],
538
643
  o
539
644
  );
540
645
  }
541
646
  });
542
647
  }
543
- function de(e, t = "Active") {
544
- return l({
648
+ function qe(e, t = "Active") {
649
+ return d({
545
650
  mutationKey: ["operations", "sign-keychain", e],
546
651
  mutationFn: ({ operation: n }) => {
547
652
  if (!e)
548
653
  throw new Error(
549
654
  "[SDK][Keychain] – cannot sign operation with anon user"
550
655
  );
551
- return w(e, [n], t);
656
+ return b(e, [n], t);
552
657
  }
553
658
  });
554
659
  }
555
- function fe(e = "/") {
556
- return l({
660
+ function Te(e = "/") {
661
+ return d({
557
662
  mutationKey: ["operations", "sign-hivesigner", e],
558
- mutationFn: async ({ operation: t }) => g.sendOperation(t, { callback: e }, () => {
663
+ mutationFn: async ({ operation: t }) => m.sendOperation(t, { callback: e }, () => {
559
664
  })
560
665
  });
561
666
  }
562
- function he() {
667
+ function Ae() {
563
668
  return p({
564
669
  queryKey: ["operations", "chain-properties"],
565
670
  queryFn: async () => await i.hiveClient.database.getChainProperties()
566
671
  });
567
672
  }
568
- function ge(e, t) {
569
- return p({
570
- queryKey: ["hive-engine", "tokens-list", e, t],
571
- queryFn: async () => (await (await fetch(
572
- `${i.privateApiHost}/private-api/engine-api`,
573
- {
574
- method: "POST",
575
- body: JSON.stringify({
576
- jsonrpc: "2.0",
577
- method: "find",
578
- params: {
579
- contract: "market",
580
- table: "metrics",
581
- query: {
582
- symbol: t,
583
- account: e
584
- }
585
- },
586
- id: 1
587
- }),
588
- headers: { "Content-type": "application/json" }
589
- }
590
- )).json()).result
591
- });
592
- }
593
- function we(e = 20) {
594
- return F({
673
+ function Qe(e = 20) {
674
+ return V({
595
675
  queryKey: ["posts", "trending-tags"],
596
676
  queryFn: async ({ pageParam: { afterTag: t } }) => i.hiveClient.database.call("get_trending_tags", [t, e]).then(
597
677
  (n) => n.filter((o) => o.name !== "").filter((o) => !o.name.startsWith("hive-")).map((o) => o.name)
@@ -604,7 +684,7 @@ function we(e = 20) {
604
684
  refetchOnMount: !0
605
685
  });
606
686
  }
607
- function O(e) {
687
+ function C(e) {
608
688
  return p({
609
689
  queryKey: ["posts", "fragments", e],
610
690
  queryFn: async () => (await fetch(
@@ -622,7 +702,7 @@ function O(e) {
622
702
  enabled: !!e
623
703
  });
624
704
  }
625
- function ve(e = "feed") {
705
+ function je(e = "feed") {
626
706
  return p({
627
707
  queryKey: ["posts", "promoted", e],
628
708
  queryFn: async () => {
@@ -638,8 +718,8 @@ function ve(e = "feed") {
638
718
  }
639
719
  });
640
720
  }
641
- function me(e) {
642
- return l({
721
+ function Fe(e) {
722
+ return d({
643
723
  mutationKey: ["posts", "add-fragment", e],
644
724
  mutationFn: async ({ title: t, body: n }) => (await fetch(
645
725
  i.privateApiHost + "/private-api/fragments-add",
@@ -657,14 +737,14 @@ function me(e) {
657
737
  )).json(),
658
738
  onSuccess(t) {
659
739
  u().setQueryData(
660
- O(e).queryKey,
740
+ C(e).queryKey,
661
741
  (n) => [t, ...n ?? []]
662
742
  );
663
743
  }
664
744
  });
665
745
  }
666
- function Oe(e, t) {
667
- return l({
746
+ function De(e, t) {
747
+ return d({
668
748
  mutationKey: ["posts", "edit-fragment", e, t],
669
749
  mutationFn: async ({ title: n, body: o }) => (await fetch(
670
750
  i.privateApiHost + "/private-api/fragments-update",
@@ -683,7 +763,7 @@ function Oe(e, t) {
683
763
  )).json(),
684
764
  onSuccess(n) {
685
765
  u().setQueryData(
686
- O(e).queryKey,
766
+ C(e).queryKey,
687
767
  (o) => {
688
768
  if (!o)
689
769
  return [];
@@ -694,8 +774,8 @@ function Oe(e, t) {
694
774
  }
695
775
  });
696
776
  }
697
- function Se(e, t) {
698
- return l({
777
+ function Pe(e, t) {
778
+ return d({
699
779
  mutationKey: ["posts", "remove-fragment", e],
700
780
  mutationFn: async () => fetch(i.privateApiHost + "/private-api/fragments-delete", {
701
781
  method: "POST",
@@ -709,14 +789,14 @@ function Se(e, t) {
709
789
  }),
710
790
  onSuccess() {
711
791
  u().setQueryData(
712
- O(e).queryKey,
792
+ C(e).queryKey,
713
793
  (n) => [...n ?? []].filter(({ id: o }) => o !== t)
714
794
  );
715
795
  }
716
796
  });
717
797
  }
718
- function A(e, t) {
719
- return l({
798
+ function D(e, t) {
799
+ return d({
720
800
  mutationKey: ["analytics", t],
721
801
  mutationFn: async () => {
722
802
  if (!t)
@@ -738,29 +818,29 @@ function A(e, t) {
738
818
  }
739
819
  });
740
820
  }
741
- const Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
821
+ const Ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
742
822
  __proto__: null,
743
- useRecordActivity: A
823
+ useRecordActivity: D
744
824
  }, Symbol.toStringTag, { value: "Module" }));
745
- function G(e, t) {
825
+ function ne(e, t) {
746
826
  return p({
747
827
  queryKey: ["integrations", "hivesigner", "decode-memo", e],
748
828
  queryFn: async () => {
749
829
  const n = y(e);
750
830
  if (n)
751
- return new g.Client({
831
+ return new m.Client({
752
832
  accessToken: n
753
833
  }).decode(t);
754
834
  }
755
835
  });
756
836
  }
757
- const W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
837
+ const oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
758
838
  __proto__: null,
759
- getDecodeMemoQueryOptions: G
760
- }, Symbol.toStringTag, { value: "Module" })), U = {
761
- queries: W
839
+ getDecodeMemoQueryOptions: ne
840
+ }, Symbol.toStringTag, { value: "Module" })), re = {
841
+ queries: oe
762
842
  };
763
- function m(e) {
843
+ function S(e) {
764
844
  return p({
765
845
  queryKey: ["integrations", "3speak", "authenticate", e],
766
846
  enabled: !!e,
@@ -774,7 +854,7 @@ function m(e) {
774
854
  "Content-Type": "application/json"
775
855
  }
776
856
  }
777
- ), n = U.queries.getDecodeMemoQueryOptions(
857
+ ), n = re.queries.getDecodeMemoQueryOptions(
778
858
  e,
779
859
  (await t.json()).memo
780
860
  );
@@ -786,16 +866,16 @@ function m(e) {
786
866
  }
787
867
  });
788
868
  }
789
- function z(e) {
869
+ function ie(e) {
790
870
  return p({
791
871
  queryKey: ["integrations", "3speak", "videos", e],
792
872
  enabled: !!e,
793
873
  queryFn: async () => {
794
874
  await u().prefetchQuery(
795
- m(e)
875
+ S(e)
796
876
  );
797
877
  const t = u().getQueryData(
798
- m(e).queryKey
878
+ S(e).queryKey
799
879
  );
800
880
  return await (await fetch(
801
881
  "https://studio.3speak.tv/mobile/api/my-videos",
@@ -809,14 +889,14 @@ function z(e) {
809
889
  }
810
890
  });
811
891
  }
812
- const $ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
892
+ const se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
813
893
  __proto__: null,
814
- getAccountTokenQueryOptions: m,
815
- getAccountVideosQueryOptions: z
816
- }, Symbol.toStringTag, { value: "Module" })), be = {
817
- queries: $
894
+ getAccountTokenQueryOptions: S,
895
+ getAccountVideosQueryOptions: ie
896
+ }, Symbol.toStringTag, { value: "Module" })), Ie = {
897
+ queries: se
818
898
  };
819
- function Ke() {
899
+ function Me() {
820
900
  return p({
821
901
  queryKey: ["resource-credits", "stats"],
822
902
  queryFn: async () => (await i.hiveClient.call(
@@ -826,14 +906,14 @@ function Ke() {
826
906
  )).rc_stats
827
907
  });
828
908
  }
829
- function qe(e) {
909
+ function Be(e) {
830
910
  return p({
831
911
  queryKey: ["resource-credits", "account", e],
832
- queryFn: async () => new N(i.hiveClient).findRCAccounts([e]),
912
+ queryFn: async () => new U(i.hiveClient).findRCAccounts([e]),
833
913
  enabled: !!e
834
914
  });
835
915
  }
836
- function ke(e, t) {
916
+ function He(e, t) {
837
917
  return p({
838
918
  queryKey: ["games", "status-check", t, e],
839
919
  enabled: !!e,
@@ -856,12 +936,12 @@ function ke(e, t) {
856
936
  }
857
937
  });
858
938
  }
859
- function Te(e, t, n) {
860
- const { mutateAsync: o } = A(
939
+ function Je(e, t, n) {
940
+ const { mutateAsync: o } = D(
861
941
  e,
862
942
  "spin-rolled"
863
943
  );
864
- return l({
944
+ return d({
865
945
  mutationKey: ["games", "post", t, e],
866
946
  mutationFn: async () => {
867
947
  if (!e)
@@ -886,7 +966,7 @@ function Te(e, t, n) {
886
966
  }
887
967
  });
888
968
  }
889
- function Ae(e, t, n = 100, o = void 0, r = !0) {
969
+ function Ne(e, t, n = 100, o = void 0, r = !0) {
890
970
  return p({
891
971
  queryKey: ["communities", "list", e, t, n],
892
972
  enabled: r,
@@ -906,7 +986,7 @@ function Ae(e, t, n = 100, o = void 0, r = !0) {
906
986
  }
907
987
  });
908
988
  }
909
- function Qe(e, t) {
989
+ function xe(e, t) {
910
990
  return p({
911
991
  queryKey: ["community", "context", e, t],
912
992
  enabled: !!e && !!t,
@@ -926,8 +1006,8 @@ function Qe(e, t) {
926
1006
  }
927
1007
  });
928
1008
  }
929
- var d = /* @__PURE__ */ ((e) => (e.OWNER = "owner", e.ADMIN = "admin", e.MOD = "mod", e.MEMBER = "member", e.GUEST = "guest", e.MUTED = "muted", e))(d || {});
930
- const _e = {
1009
+ 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 = {
931
1011
  owner: [
932
1012
  "admin",
933
1013
  "mod",
@@ -950,27 +1030,27 @@ const _e = {
950
1030
  /* MUTED */
951
1031
  ]
952
1032
  };
953
- function je(e, t) {
1033
+ function Ve(e, t) {
954
1034
  return e.startsWith("hive-3") || t === 3 ? "Council" : e.startsWith("hive-2") || t === 2 ? "Journal" : "Topic";
955
1035
  }
956
- function Fe({
1036
+ function We({
957
1037
  communityType: e,
958
1038
  userRole: t,
959
1039
  subscribed: n
960
1040
  }) {
961
- const o = t === d.MUTED ? !1 : e === "Topic" ? !0 : [d.OWNER, d.ADMIN, d.MOD, d.MEMBER].includes(
1041
+ const o = t === l.MUTED ? !1 : e === "Topic" ? !0 : [l.OWNER, l.ADMIN, l.MOD, l.MEMBER].includes(
962
1042
  t
963
1043
  ), r = (() => {
964
- if (t === d.MUTED) return !1;
1044
+ if (t === l.MUTED) return !1;
965
1045
  switch (e) {
966
1046
  case "Topic":
967
1047
  return !0;
968
1048
  case "Journal":
969
- return t !== d.GUEST || n;
1049
+ return t !== l.GUEST || n;
970
1050
  case "Council":
971
1051
  return o;
972
1052
  }
973
- })(), c = [d.OWNER, d.ADMIN, d.MOD].includes(t);
1053
+ })(), c = [l.OWNER, l.ADMIN, l.MOD].includes(t);
974
1054
  return {
975
1055
  canPost: o,
976
1056
  canComment: r,
@@ -979,53 +1059,53 @@ function Fe({
979
1059
  }
980
1060
  export {
981
1061
  i as CONFIG,
982
- C as ConfigManager,
983
- Ce as EcencyAnalytics,
984
- b as EcencyQueriesManager,
985
- U as HiveSignerIntegration,
986
- R as Keychain,
987
- d as ROLES,
988
- be as ThreeSpeakIntegration,
989
- B as broadcastJson,
990
- ne as checkUsernameWalletsPendingQueryOptions,
1062
+ k as ConfigManager,
1063
+ Ee as EcencyAnalytics,
1064
+ K as EcencyQueriesManager,
1065
+ re as HiveSignerIntegration,
1066
+ de as Keychain,
1067
+ l as ROLES,
1068
+ Ie as ThreeSpeakIntegration,
1069
+ L as broadcastJson,
1070
+ ge as checkUsernameWalletsPendingQueryOptions,
991
1071
  y as getAccessToken,
992
- H as getAccountFullQueryOptions,
993
- qe as getAccountRcQueryOptions,
994
- oe as getAccountSubscriptionsQueryOptions,
995
- re as getActiveAccountBookmarksQueryOptions,
996
- ie as getActiveAccountFavouritesQueryOptions,
997
- he as getChainPropertiesQueryOptions,
998
- Ae as getCommunitiesQueryOptions,
999
- Qe as getCommunityContextQueryOptions,
1000
- Fe as getCommunityPermissions,
1001
- je as getCommunityType,
1002
- O as getFragmentsQueryOptions,
1003
- ke as getGameStatusCheckQueryOptions,
1004
- ge as getHiveEngineTokensListQueryOptions,
1005
- T as getLoginType,
1006
- k as getPostingKey,
1007
- ve as getPromotedPostsQuery,
1072
+ ee as getAccountFullQueryOptions,
1073
+ Be as getAccountRcQueryOptions,
1074
+ _e as getAccountSubscriptionsQueryOptions,
1075
+ ve as getActiveAccountBookmarksQueryOptions,
1076
+ we as getActiveAccountFavouritesQueryOptions,
1077
+ Ae as getChainPropertiesQueryOptions,
1078
+ Ne as getCommunitiesQueryOptions,
1079
+ xe as getCommunityContextQueryOptions,
1080
+ We as getCommunityPermissions,
1081
+ Ve as getCommunityType,
1082
+ he as getDynamicPropsQueryOptions,
1083
+ C as getFragmentsQueryOptions,
1084
+ He as getGameStatusCheckQueryOptions,
1085
+ F as getLoginType,
1086
+ j as getPostingKey,
1087
+ je as getPromotedPostsQuery,
1008
1088
  u as getQueryClient,
1009
- Ke as getRcStatsQueryOptions,
1010
- L as getRefreshToken,
1011
- x as getRelationshipBetweenAccountsQueryOptions,
1012
- te as getSearchAccountsByUsernameQueryOptions,
1013
- we as getTrendingTagsQueryOptions,
1014
- f as getUser,
1015
- ee as makeQueryClient,
1016
- _e as roleMap,
1017
- pe as useAccountFavouriteAdd,
1018
- ye as useAccountFavouriteDelete,
1019
- ae as useAccountRelationsUpdate,
1020
- se as useAccountUpdate,
1021
- me as useAddFragment,
1022
- ce as useBookmarkAdd,
1023
- ue as useBookmarkDelete,
1024
- I as useBroadcastMutation,
1025
- Oe as useEditFragment,
1026
- Te as useGameClaim,
1027
- Se as useRemoveFragment,
1028
- fe as useSignOperationByHivesigner,
1029
- le as useSignOperationByKey,
1030
- de as useSignOperationByKeychain
1089
+ Me as getRcStatsQueryOptions,
1090
+ ye as getRefreshToken,
1091
+ te as getRelationshipBetweenAccountsQueryOptions,
1092
+ fe as getSearchAccountsByUsernameQueryOptions,
1093
+ Qe as getTrendingTagsQueryOptions,
1094
+ _ as getUser,
1095
+ le as makeQueryClient,
1096
+ Ge as roleMap,
1097
+ Oe as useAccountFavouriteAdd,
1098
+ ke as useAccountFavouriteDelete,
1099
+ be as useAccountRelationsUpdate,
1100
+ me as useAccountUpdate,
1101
+ Fe as useAddFragment,
1102
+ Se as useBookmarkAdd,
1103
+ Ce as useBookmarkDelete,
1104
+ Z as useBroadcastMutation,
1105
+ De as useEditFragment,
1106
+ Je as useGameClaim,
1107
+ Pe as useRemoveFragment,
1108
+ Te as useSignOperationByHivesigner,
1109
+ Ke as useSignOperationByKey,
1110
+ qe as useSignOperationByKeychain
1031
1111
  };