@ecency/sdk 1.0.56 → 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.
@@ -1,10 +1,10 @@
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 O = (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
9
  O(this, "length", 0);
10
10
  }
@@ -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 S;
56
+ var k;
56
57
  ((e) => {
57
58
  function t(n) {
58
59
  i.queryClient = n;
59
60
  }
60
61
  e.setQueryClient = t;
61
- })(S || (S = {}));
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 d = (e) => {
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
+ 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: Q[t[1]]
76
+ };
77
+ } else
78
+ return {
79
+ amount: parseFloat(e.amount.toString()) / Math.pow(10, e.precision),
80
+ // @ts-ignore
81
+ symbol: A[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) => d(e) && d(e).accessToken, k = (e) => d(e) && d(e).postingKey, T = (e) => d(e) && d(e).loginType, L = (e) => d(e) && d(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 C;
207
+ var K;
177
208
  ((e) => {
178
209
  function t(s) {
179
210
  return u().getQueryData(s);
@@ -195,7 +226,7 @@ var C;
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 C;
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
- })(C || (C = {}));
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, H = g(
265
+ e.total_vesting_fund_hive
266
+ ).amount, I = g(
267
+ e.total_vesting_shares
268
+ ).amount, M = g(e.virtual_supply).amount, B = 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: H,
279
+ totalVestingShares: I,
280
+ virtualSupply: M,
281
+ vestingRewardPercent: B,
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,9 +456,9 @@ 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
464
  ({ profile: n, tokens: o }) => {
@@ -366,11 +478,11 @@ function se(e) {
366
478
  }
367
479
  );
368
480
  }
369
- function ae(e, t, n, o) {
370
- return l({
481
+ function be(e, t, n, o) {
482
+ return d({
371
483
  mutationKey: [],
372
484
  mutationFn: async (r) => {
373
- const c = x(
485
+ const c = te(
374
486
  e,
375
487
  t
376
488
  );
@@ -378,7 +490,7 @@ function ae(e, t, n, o) {
378
490
  const a = u().getQueryData(
379
491
  c.queryKey
380
492
  );
381
- return await B(e, "follow", [
493
+ return await L(e, "follow", [
382
494
  "follow",
383
495
  {
384
496
  follower: e,
@@ -403,8 +515,8 @@ function ae(e, t, n, o) {
403
515
  }
404
516
  });
405
517
  }
406
- function ce(e, t, n) {
407
- return l({
518
+ function Ce(e, t, n) {
519
+ return d({
408
520
  mutationKey: ["accounts", "bookmarks", "add", e],
409
521
  mutationFn: async ({ author: o, permlink: r }) => {
410
522
  if (!e)
@@ -432,8 +544,8 @@ function ce(e, t, n) {
432
544
  onError: n
433
545
  });
434
546
  }
435
- function ue(e, t, n) {
436
- return l({
547
+ function Se(e, t, n) {
548
+ return d({
437
549
  mutationKey: ["accounts", "bookmarks", "delete", e],
438
550
  mutationFn: async (o) => {
439
551
  if (!e)
@@ -460,8 +572,8 @@ function ue(e, t, n) {
460
572
  onError: n
461
573
  });
462
574
  }
463
- function pe(e, t, n) {
464
- return l({
575
+ function Oe(e, t, n) {
576
+ return d({
465
577
  mutationKey: ["accounts", "favourites", "add", e],
466
578
  mutationFn: async (o) => {
467
579
  if (!e)
@@ -488,8 +600,8 @@ function pe(e, t, n) {
488
600
  onError: n
489
601
  });
490
602
  }
491
- function ye(e, t, n) {
492
- return l({
603
+ function ke(e, t, n) {
604
+ return d({
493
605
  mutationKey: ["accounts", "favourites", "add", e],
494
606
  mutationFn: async (o) => {
495
607
  if (!e)
@@ -516,8 +628,8 @@ function ye(e, t, n) {
516
628
  onError: n
517
629
  });
518
630
  }
519
- function le(e) {
520
- return l({
631
+ function Ke(e) {
632
+ return d({
521
633
  mutationKey: ["operations", "sign", e],
522
634
  mutationFn: ({
523
635
  operation: t,
@@ -526,65 +638,40 @@ function le(e) {
526
638
  if (!e)
527
639
  throw new Error("[Operations][Sign] – cannot sign op with anon user");
528
640
  let o;
529
- 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(
530
642
  [t],
531
643
  o
532
644
  );
533
645
  }
534
646
  });
535
647
  }
536
- function fe(e, t = "Active") {
537
- return l({
648
+ function qe(e, t = "Active") {
649
+ return d({
538
650
  mutationKey: ["operations", "sign-keychain", e],
539
651
  mutationFn: ({ operation: n }) => {
540
652
  if (!e)
541
653
  throw new Error(
542
654
  "[SDK][Keychain] – cannot sign operation with anon user"
543
655
  );
544
- return w(e, [n], t);
656
+ return b(e, [n], t);
545
657
  }
546
658
  });
547
659
  }
548
- function de(e = "/") {
549
- return l({
660
+ function Te(e = "/") {
661
+ return d({
550
662
  mutationKey: ["operations", "sign-hivesigner", e],
551
- mutationFn: async ({ operation: t }) => g.sendOperation(t, { callback: e }, () => {
663
+ mutationFn: async ({ operation: t }) => m.sendOperation(t, { callback: e }, () => {
552
664
  })
553
665
  });
554
666
  }
555
- function he() {
667
+ function Qe() {
556
668
  return p({
557
669
  queryKey: ["operations", "chain-properties"],
558
670
  queryFn: async () => await i.hiveClient.database.getChainProperties()
559
671
  });
560
672
  }
561
- function ge(e, t) {
562
- return p({
563
- queryKey: ["hive-engine", "tokens-list", e, t],
564
- queryFn: async () => (await (await fetch(
565
- `${i.privateApiHost}/private-api/engine-api`,
566
- {
567
- method: "POST",
568
- body: JSON.stringify({
569
- jsonrpc: "2.0",
570
- method: "find",
571
- params: {
572
- contract: "market",
573
- table: "metrics",
574
- query: {
575
- symbol: t,
576
- account: e
577
- }
578
- },
579
- id: 1
580
- }),
581
- headers: { "Content-type": "application/json" }
582
- }
583
- )).json()).result
584
- });
585
- }
586
- function we(e = 20) {
587
- return F({
673
+ function Ae(e = 20) {
674
+ return V({
588
675
  queryKey: ["posts", "trending-tags"],
589
676
  queryFn: async ({ pageParam: { afterTag: t } }) => i.hiveClient.database.call("get_trending_tags", [t, e]).then(
590
677
  (n) => n.filter((o) => o.name !== "").filter((o) => !o.name.startsWith("hive-")).map((o) => o.name)
@@ -597,7 +684,7 @@ function we(e = 20) {
597
684
  refetchOnMount: !0
598
685
  });
599
686
  }
600
- function b(e) {
687
+ function S(e) {
601
688
  return p({
602
689
  queryKey: ["posts", "fragments", e],
603
690
  queryFn: async () => (await fetch(
@@ -615,7 +702,7 @@ function b(e) {
615
702
  enabled: !!e
616
703
  });
617
704
  }
618
- function ve(e = "feed") {
705
+ function je(e = "feed") {
619
706
  return p({
620
707
  queryKey: ["posts", "promoted", e],
621
708
  queryFn: async () => {
@@ -631,8 +718,8 @@ function ve(e = "feed") {
631
718
  }
632
719
  });
633
720
  }
634
- function me(e) {
635
- return l({
721
+ function Fe(e) {
722
+ return d({
636
723
  mutationKey: ["posts", "add-fragment", e],
637
724
  mutationFn: async ({ title: t, body: n }) => (await fetch(
638
725
  i.privateApiHost + "/private-api/fragments-add",
@@ -650,14 +737,14 @@ function me(e) {
650
737
  )).json(),
651
738
  onSuccess(t) {
652
739
  u().setQueryData(
653
- b(e).queryKey,
740
+ S(e).queryKey,
654
741
  (n) => [t, ...n ?? []]
655
742
  );
656
743
  }
657
744
  });
658
745
  }
659
- function be(e, t) {
660
- return l({
746
+ function De(e, t) {
747
+ return d({
661
748
  mutationKey: ["posts", "edit-fragment", e, t],
662
749
  mutationFn: async ({ title: n, body: o }) => (await fetch(
663
750
  i.privateApiHost + "/private-api/fragments-update",
@@ -676,7 +763,7 @@ function be(e, t) {
676
763
  )).json(),
677
764
  onSuccess(n) {
678
765
  u().setQueryData(
679
- b(e).queryKey,
766
+ S(e).queryKey,
680
767
  (o) => {
681
768
  if (!o)
682
769
  return [];
@@ -687,8 +774,8 @@ function be(e, t) {
687
774
  }
688
775
  });
689
776
  }
690
- function Oe(e, t) {
691
- return l({
777
+ function Pe(e, t) {
778
+ return d({
692
779
  mutationKey: ["posts", "remove-fragment", e],
693
780
  mutationFn: async () => fetch(i.privateApiHost + "/private-api/fragments-delete", {
694
781
  method: "POST",
@@ -702,14 +789,14 @@ function Oe(e, t) {
702
789
  }),
703
790
  onSuccess() {
704
791
  u().setQueryData(
705
- b(e).queryKey,
792
+ S(e).queryKey,
706
793
  (n) => [...n ?? []].filter(({ id: o }) => o !== t)
707
794
  );
708
795
  }
709
796
  });
710
797
  }
711
- function A(e, t) {
712
- return l({
798
+ function D(e, t) {
799
+ return d({
713
800
  mutationKey: ["analytics", t],
714
801
  mutationFn: async () => {
715
802
  if (!t)
@@ -731,29 +818,29 @@ function A(e, t) {
731
818
  }
732
819
  });
733
820
  }
734
- const Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
821
+ const Ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
735
822
  __proto__: null,
736
- useRecordActivity: A
823
+ useRecordActivity: D
737
824
  }, Symbol.toStringTag, { value: "Module" }));
738
- function G(e, t) {
825
+ function ne(e, t) {
739
826
  return p({
740
827
  queryKey: ["integrations", "hivesigner", "decode-memo", e],
741
828
  queryFn: async () => {
742
829
  const n = y(e);
743
830
  if (n)
744
- return new g.Client({
831
+ return new m.Client({
745
832
  accessToken: n
746
833
  }).decode(t);
747
834
  }
748
835
  });
749
836
  }
750
- const W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
837
+ const oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
751
838
  __proto__: null,
752
- getDecodeMemoQueryOptions: G
753
- }, Symbol.toStringTag, { value: "Module" })), U = {
754
- queries: W
839
+ getDecodeMemoQueryOptions: ne
840
+ }, Symbol.toStringTag, { value: "Module" })), re = {
841
+ queries: oe
755
842
  };
756
- function m(e) {
843
+ function C(e) {
757
844
  return p({
758
845
  queryKey: ["integrations", "3speak", "authenticate", e],
759
846
  enabled: !!e,
@@ -767,7 +854,7 @@ function m(e) {
767
854
  "Content-Type": "application/json"
768
855
  }
769
856
  }
770
- ), n = U.queries.getDecodeMemoQueryOptions(
857
+ ), n = re.queries.getDecodeMemoQueryOptions(
771
858
  e,
772
859
  (await t.json()).memo
773
860
  );
@@ -779,16 +866,16 @@ function m(e) {
779
866
  }
780
867
  });
781
868
  }
782
- function z(e) {
869
+ function ie(e) {
783
870
  return p({
784
871
  queryKey: ["integrations", "3speak", "videos", e],
785
872
  enabled: !!e,
786
873
  queryFn: async () => {
787
874
  await u().prefetchQuery(
788
- m(e)
875
+ C(e)
789
876
  );
790
877
  const t = u().getQueryData(
791
- m(e).queryKey
878
+ C(e).queryKey
792
879
  );
793
880
  return await (await fetch(
794
881
  "https://studio.3speak.tv/mobile/api/my-videos",
@@ -802,14 +889,39 @@ function z(e) {
802
889
  }
803
890
  });
804
891
  }
805
- const $ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
892
+ const se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
806
893
  __proto__: null,
807
- getAccountTokenQueryOptions: m,
808
- getAccountVideosQueryOptions: z
809
- }, Symbol.toStringTag, { value: "Module" })), Ce = {
810
- queries: $
894
+ getAccountTokenQueryOptions: C,
895
+ getAccountVideosQueryOptions: ie
896
+ }, Symbol.toStringTag, { value: "Module" })), He = {
897
+ queries: se
811
898
  };
812
- function Ke() {
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
+ }
924
+ function Me() {
813
925
  return p({
814
926
  queryKey: ["resource-credits", "stats"],
815
927
  queryFn: async () => (await i.hiveClient.call(
@@ -819,14 +931,14 @@ function Ke() {
819
931
  )).rc_stats
820
932
  });
821
933
  }
822
- function qe(e) {
934
+ function Be(e) {
823
935
  return p({
824
936
  queryKey: ["resource-credits", "account", e],
825
- queryFn: async () => new N(i.hiveClient).findRCAccounts([e]),
937
+ queryFn: async () => new U(i.hiveClient).findRCAccounts([e]),
826
938
  enabled: !!e
827
939
  });
828
940
  }
829
- function ke(e, t) {
941
+ function Je(e, t) {
830
942
  return p({
831
943
  queryKey: ["games", "status-check", t, e],
832
944
  enabled: !!e,
@@ -849,12 +961,12 @@ function ke(e, t) {
849
961
  }
850
962
  });
851
963
  }
852
- function Te(e, t, n) {
853
- const { mutateAsync: o } = A(
964
+ function Ne(e, t, n) {
965
+ const { mutateAsync: o } = D(
854
966
  e,
855
967
  "spin-rolled"
856
968
  );
857
- return l({
969
+ return d({
858
970
  mutationKey: ["games", "post", t, e],
859
971
  mutationFn: async () => {
860
972
  if (!e)
@@ -879,7 +991,7 @@ function Te(e, t, n) {
879
991
  }
880
992
  });
881
993
  }
882
- function Ae(e, t, n = 100, o = void 0, r = !0) {
994
+ function xe(e, t, n = 100, o = void 0, r = !0) {
883
995
  return p({
884
996
  queryKey: ["communities", "list", e, t, n],
885
997
  enabled: r,
@@ -899,7 +1011,7 @@ function Ae(e, t, n = 100, o = void 0, r = !0) {
899
1011
  }
900
1012
  });
901
1013
  }
902
- function Qe(e, t) {
1014
+ function Ge(e, t) {
903
1015
  return p({
904
1016
  queryKey: ["community", "context", e, t],
905
1017
  enabled: !!e && !!t,
@@ -919,8 +1031,8 @@ function Qe(e, t) {
919
1031
  }
920
1032
  });
921
1033
  }
922
- var f = /* @__PURE__ */ ((e) => (e.OWNER = "owner", e.ADMIN = "admin", e.MOD = "mod", e.MEMBER = "member", e.GUEST = "guest", e.MUTED = "muted", e))(f || {});
923
- const _e = {
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 || {});
1035
+ const Ve = {
924
1036
  owner: [
925
1037
  "admin",
926
1038
  "mod",
@@ -943,27 +1055,27 @@ const _e = {
943
1055
  /* MUTED */
944
1056
  ]
945
1057
  };
946
- function je(e, t) {
1058
+ function We(e, t) {
947
1059
  return e.startsWith("hive-3") || t === 3 ? "Council" : e.startsWith("hive-2") || t === 2 ? "Journal" : "Topic";
948
1060
  }
949
- function Fe({
1061
+ function ze({
950
1062
  communityType: e,
951
1063
  userRole: t,
952
1064
  subscribed: n
953
1065
  }) {
954
- const o = t === f.MUTED ? !1 : e === "Topic" ? !0 : [f.OWNER, f.ADMIN, f.MOD, f.MEMBER].includes(
1066
+ const o = t === l.MUTED ? !1 : e === "Topic" ? !0 : [l.OWNER, l.ADMIN, l.MOD, l.MEMBER].includes(
955
1067
  t
956
1068
  ), r = (() => {
957
- if (t === f.MUTED) return !1;
1069
+ if (t === l.MUTED) return !1;
958
1070
  switch (e) {
959
1071
  case "Topic":
960
1072
  return !0;
961
1073
  case "Journal":
962
- return t !== f.GUEST || n;
1074
+ return t !== l.GUEST || n;
963
1075
  case "Council":
964
1076
  return o;
965
1077
  }
966
- })(), c = [f.OWNER, f.ADMIN, f.MOD].includes(t);
1078
+ })(), c = [l.OWNER, l.ADMIN, l.MOD].includes(t);
967
1079
  return {
968
1080
  canPost: o,
969
1081
  canComment: r,
@@ -972,53 +1084,54 @@ function Fe({
972
1084
  }
973
1085
  export {
974
1086
  i as CONFIG,
975
- S as ConfigManager,
976
- Se as EcencyAnalytics,
977
- C as EcencyQueriesManager,
978
- U as HiveSignerIntegration,
979
- R as Keychain,
980
- f as ROLES,
981
- Ce as ThreeSpeakIntegration,
982
- B as broadcastJson,
983
- ne as checkUsernameWalletsPendingQueryOptions,
1087
+ k as ConfigManager,
1088
+ Ee as EcencyAnalytics,
1089
+ K as EcencyQueriesManager,
1090
+ re as HiveSignerIntegration,
1091
+ de as Keychain,
1092
+ l as ROLES,
1093
+ He as ThreeSpeakIntegration,
1094
+ L as broadcastJson,
1095
+ ge as checkUsernameWalletsPendingQueryOptions,
984
1096
  y as getAccessToken,
985
- H as getAccountFullQueryOptions,
986
- qe as getAccountRcQueryOptions,
987
- oe as getAccountSubscriptionsQueryOptions,
988
- re as getActiveAccountBookmarksQueryOptions,
989
- ie as getActiveAccountFavouritesQueryOptions,
990
- he as getChainPropertiesQueryOptions,
991
- Ae as getCommunitiesQueryOptions,
992
- Qe as getCommunityContextQueryOptions,
993
- Fe as getCommunityPermissions,
994
- je as getCommunityType,
995
- b as getFragmentsQueryOptions,
996
- ke as getGameStatusCheckQueryOptions,
997
- ge as getHiveEngineTokensListQueryOptions,
998
- T as getLoginType,
999
- k as getPostingKey,
1000
- ve as getPromotedPostsQuery,
1097
+ ee as getAccountFullQueryOptions,
1098
+ Be as getAccountRcQueryOptions,
1099
+ _e as getAccountSubscriptionsQueryOptions,
1100
+ ve as getActiveAccountBookmarksQueryOptions,
1101
+ we as getActiveAccountFavouritesQueryOptions,
1102
+ Qe as getChainPropertiesQueryOptions,
1103
+ xe as getCommunitiesQueryOptions,
1104
+ Ge as getCommunityContextQueryOptions,
1105
+ ze as getCommunityPermissions,
1106
+ We as getCommunityType,
1107
+ he as getDynamicPropsQueryOptions,
1108
+ S as getFragmentsQueryOptions,
1109
+ Je as getGameStatusCheckQueryOptions,
1110
+ Ie as getHivePoshLinksQueryOptions,
1111
+ F as getLoginType,
1112
+ j as getPostingKey,
1113
+ je as getPromotedPostsQuery,
1001
1114
  u as getQueryClient,
1002
- Ke as getRcStatsQueryOptions,
1003
- L as getRefreshToken,
1004
- x as getRelationshipBetweenAccountsQueryOptions,
1005
- te as getSearchAccountsByUsernameQueryOptions,
1006
- we as getTrendingTagsQueryOptions,
1007
- d as getUser,
1008
- ee as makeQueryClient,
1009
- _e as roleMap,
1010
- pe as useAccountFavouriteAdd,
1011
- ye as useAccountFavouriteDelete,
1012
- ae as useAccountRelationsUpdate,
1013
- se as useAccountUpdate,
1014
- me as useAddFragment,
1015
- ce as useBookmarkAdd,
1016
- ue as useBookmarkDelete,
1017
- I as useBroadcastMutation,
1018
- be as useEditFragment,
1019
- Te as useGameClaim,
1020
- Oe as useRemoveFragment,
1021
- de as useSignOperationByHivesigner,
1022
- le as useSignOperationByKey,
1023
- fe as useSignOperationByKeychain
1115
+ Me as getRcStatsQueryOptions,
1116
+ ye as getRefreshToken,
1117
+ te as getRelationshipBetweenAccountsQueryOptions,
1118
+ fe as getSearchAccountsByUsernameQueryOptions,
1119
+ Ae as getTrendingTagsQueryOptions,
1120
+ _ as getUser,
1121
+ le as makeQueryClient,
1122
+ Ve as roleMap,
1123
+ Oe as useAccountFavouriteAdd,
1124
+ ke as useAccountFavouriteDelete,
1125
+ be as useAccountRelationsUpdate,
1126
+ me as useAccountUpdate,
1127
+ Fe as useAddFragment,
1128
+ Ce as useBookmarkAdd,
1129
+ Se as useBookmarkDelete,
1130
+ Z as useBroadcastMutation,
1131
+ De as useEditFragment,
1132
+ Ne as useGameClaim,
1133
+ Pe as useRemoveFragment,
1134
+ Te as useSignOperationByHivesigner,
1135
+ Ke as useSignOperationByKey,
1136
+ qe as useSignOperationByKeychain
1024
1137
  };