@ecency/sdk 1.0.45 → 1.0.46

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 m = (e, t, n) => _(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { QueryClient as S, useMutation as y, useQuery as T, useInfiniteQuery as j, queryOptions as p, infiniteQueryOptions as k } from "@tanstack/react-query";
5
- import { Client as A, PrivateKey as h, cryptoUtils as F, RCAPI as D } from "@hiveio/dhive";
1
+ var _ = Object.defineProperty;
2
+ var T = (e, t, n) => t in e ? _(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
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";
5
+ import { Client as F, PrivateKey as h, cryptoUtils as D, RCAPI as P } from "@hiveio/dhive";
6
6
  import d from "hivesigner";
7
- class P {
7
+ class I {
8
8
  constructor() {
9
- m(this, "length", 0);
9
+ C(this, "length", 0);
10
10
  }
11
11
  clear() {
12
12
  throw new Error("Method not implemented.");
@@ -24,11 +24,11 @@ class P {
24
24
  this[t] = n;
25
25
  }
26
26
  }
27
- const s = {
27
+ const a = {
28
28
  privateApiHost: "https://ecency.com",
29
- storage: typeof window > "u" ? new P() : window.localStorage,
29
+ storage: typeof window > "u" ? new I() : window.localStorage,
30
30
  storagePrefix: "ecency",
31
- hiveClient: new A(
31
+ hiveClient: new F(
32
32
  [
33
33
  "https://api.hive.blog",
34
34
  "https://api.deathwing.me",
@@ -49,88 +49,118 @@ const s = {
49
49
  }
50
50
  ),
51
51
  heliusApiKey: void 0,
52
- queryClient: new S(),
52
+ queryClient: new q(),
53
53
  plausibleHost: "https://pl.ecency.com"
54
54
  };
55
- var C;
55
+ var O;
56
56
  ((e) => {
57
57
  function t(n) {
58
- s.queryClient = n;
58
+ a.queryClient = n;
59
59
  }
60
60
  e.setQueryClient = t;
61
- })(C || (C = {}));
62
- function I(e) {
61
+ })(O || (O = {}));
62
+ function N(e) {
63
63
  let t = atob(e);
64
64
  if (t[0] === "{")
65
65
  return JSON.parse(t);
66
66
  }
67
67
  const f = (e) => {
68
68
  try {
69
- const t = s.storage.getItem(
70
- s.storagePrefix + "_user_" + e
69
+ const t = a.storage.getItem(
70
+ a.storagePrefix + "_user_" + e
71
71
  );
72
- return I(JSON.parse(t));
72
+ return N(JSON.parse(t));
73
73
  } catch (t) {
74
74
  console.error(t);
75
75
  return;
76
76
  }
77
- }, l = (e) => f(e) && f(e).accessToken, q = (e) => f(e) && f(e).postingKey, V = (e) => f(e) && f(e).refreshToken;
78
- function N(e = [], t, n) {
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() {
79
+ return new Promise((e) => {
80
+ var t;
81
+ (t = window.hive_keychain) == null || t.requestHandshake(() => {
82
+ e();
83
+ });
84
+ });
85
+ }
86
+ const g = (e, t, n, o = null) => new Promise((s, u) => {
87
+ var i;
88
+ (i = window.hive_keychain) == null || i.requestBroadcast(
89
+ e,
90
+ t,
91
+ n,
92
+ (r) => {
93
+ r.success || u({ message: "Operation cancelled" }), s(r);
94
+ },
95
+ o
96
+ );
97
+ }), Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
98
+ __proto__: null,
99
+ broadcast: g,
100
+ handshake: J
101
+ }, Symbol.toStringTag, { value: "Module" }));
102
+ function H(e = [], t, n) {
79
103
  return y({
80
104
  mutationKey: [...e, t],
81
- mutationFn: async (r) => {
105
+ mutationFn: async (o) => {
82
106
  if (!t)
83
107
  throw new Error(
84
108
  "[Core][Broadcast] Attempted to call broadcast API with anon user"
85
109
  );
86
- const o = q(t);
87
- if (o) {
88
- const i = h.fromString(o);
89
- return s.hiveClient.broadcast.sendOperations(
90
- n(r),
91
- i
110
+ const s = K(t);
111
+ if (s) {
112
+ const r = h.fromString(s);
113
+ return a.hiveClient.broadcast.sendOperations(
114
+ n(o),
115
+ r
92
116
  );
93
117
  }
94
- let u = l(t);
95
- if (u)
118
+ const u = b(t);
119
+ if (u && u == "keychain")
120
+ return g(t, n(o), "Posting").then((r) => r.result);
121
+ let i = l(t);
122
+ if (i)
96
123
  return (await new d.Client({
97
- accessToken: u
98
- }).broadcast(n(r))).result;
124
+ accessToken: i
125
+ }).broadcast(n(o))).result;
99
126
  throw new Error(
100
127
  "[SDK][Broadcast] – cannot broadcast w/o posting key or token"
101
128
  );
102
129
  }
103
130
  });
104
131
  }
105
- async function J(e, t, n) {
132
+ async function E(e, t, n) {
106
133
  if (!e)
107
134
  throw new Error(
108
135
  "[Core][Broadcast] Attempted to call broadcast API with anon user"
109
136
  );
110
- const r = q(e);
111
- if (r) {
112
- const u = h.fromString(r);
113
- return s.hiveClient.broadcast.json(
114
- {
115
- id: t,
116
- required_auths: [],
117
- required_posting_auths: [e],
118
- json: JSON.stringify(n)
119
- },
120
- u
137
+ const o = {
138
+ id: t,
139
+ required_auths: [],
140
+ required_posting_auths: [e],
141
+ json: JSON.stringify(n)
142
+ }, s = K(e);
143
+ if (s) {
144
+ const r = h.fromString(s);
145
+ return a.hiveClient.broadcast.json(
146
+ o,
147
+ r
121
148
  );
122
149
  }
123
- let o = l(e);
124
- if (o)
150
+ const u = b(e);
151
+ if (u && u == "keychain")
152
+ return g(e, [["custom_json", o]], "Posting").then((r) => r.result);
153
+ let i = l(e);
154
+ if (i)
125
155
  return (await new d.Client({
126
- accessToken: o
156
+ accessToken: i
127
157
  }).customJson([], [e], t, JSON.stringify(n))).result;
128
158
  throw new Error(
129
159
  "[SDK][Broadcast] – cannot broadcast w/o posting key or token"
130
160
  );
131
161
  }
132
- function X() {
133
- return new S({
162
+ function Z() {
163
+ return new q({
134
164
  defaultOptions: {
135
165
  queries: {
136
166
  // With SSR, we usually want to set some default staleTime
@@ -142,46 +172,46 @@ function X() {
142
172
  }
143
173
  });
144
174
  }
145
- const c = () => s.queryClient;
146
- var O;
175
+ const c = () => a.queryClient;
176
+ var S;
147
177
  ((e) => {
148
- function t(a) {
149
- return c().getQueryData(a);
178
+ function t(r) {
179
+ return c().getQueryData(r);
150
180
  }
151
181
  e.getQueryData = t;
152
- function n(a) {
153
- return c().getQueryData(a);
182
+ function n(r) {
183
+ return c().getQueryData(r);
154
184
  }
155
185
  e.getInfiniteQueryData = n;
156
- async function r(a) {
157
- return await c().prefetchQuery(a), t(a.queryKey);
186
+ async function o(r) {
187
+ return await c().prefetchQuery(r), t(r.queryKey);
158
188
  }
159
- e.prefetchQuery = r;
160
- async function o(a) {
161
- return await c().prefetchInfiniteQuery(a), n(a.queryKey);
189
+ e.prefetchQuery = o;
190
+ async function s(r) {
191
+ return await c().prefetchInfiniteQuery(r), n(r.queryKey);
162
192
  }
163
- e.prefetchInfiniteQuery = o;
164
- function u(a) {
193
+ e.prefetchInfiniteQuery = s;
194
+ function u(r) {
165
195
  return {
166
- prefetch: () => r(a),
167
- getData: () => t(a.queryKey),
168
- useClientQuery: () => T(a),
169
- fetchAndGet: () => c().fetchQuery(a)
196
+ prefetch: () => o(r),
197
+ getData: () => t(r.queryKey),
198
+ useClientQuery: () => j(r),
199
+ fetchAndGet: () => c().fetchQuery(r)
170
200
  };
171
201
  }
172
202
  e.generateClientServerQuery = u;
173
- function i(a) {
203
+ function i(r) {
174
204
  return {
175
- prefetch: () => o(a),
176
- getData: () => n(a.queryKey),
177
- useClientQuery: () => j(a),
178
- fetchAndGet: () => c().fetchInfiniteQuery(a)
205
+ prefetch: () => s(r),
206
+ getData: () => n(r.queryKey),
207
+ useClientQuery: () => k(r),
208
+ fetchAndGet: () => c().fetchInfiniteQuery(r)
179
209
  };
180
210
  }
181
211
  e.generateClientServerInfiniteQuery = i;
182
- })(O || (O = {}));
183
- function Y(e) {
184
- return N(
212
+ })(S || (S = {}));
213
+ function R(e) {
214
+ return H(
185
215
  ["accounts", "update"],
186
216
  e,
187
217
  ({
@@ -203,36 +233,36 @@ function Y(e) {
203
233
  ]
204
234
  );
205
235
  }
206
- function Z(e) {
236
+ function ee(e) {
207
237
  return p({
208
238
  queryKey: ["get-account-full", e],
209
239
  queryFn: async () => {
210
240
  if (!e)
211
241
  throw new Error("[SDK] Username is empty");
212
- const t = await s.hiveClient.database.getAccounts([e]);
242
+ const t = await a.hiveClient.database.getAccounts([e]);
213
243
  if (!t[0])
214
244
  throw new Error("[SDK] No account with given username");
215
245
  const n = JSON.parse(t[0].posting_json_metadata).profile;
216
- let r;
246
+ let o;
217
247
  try {
218
- r = await s.hiveClient.database.call(
248
+ o = await a.hiveClient.database.call(
219
249
  "get_follow_count",
220
250
  [e]
221
251
  );
222
252
  } catch {
223
253
  }
224
- const o = await s.hiveClient.call(
254
+ const s = await a.hiveClient.call(
225
255
  "condenser_api",
226
256
  "get_account_reputations",
227
257
  [e, 1]
228
258
  );
229
259
  return {
230
260
  ...t,
231
- follow_stats: r,
232
- reputation: o[0].reputation,
261
+ follow_stats: o,
262
+ reputation: s[0].reputation,
233
263
  profile: {
234
264
  ...n,
235
- reputation: o[0].reputation
265
+ reputation: s[0].reputation
236
266
  }
237
267
  };
238
268
  },
@@ -240,23 +270,23 @@ function Z(e) {
240
270
  staleTime: 6e4
241
271
  });
242
272
  }
243
- function R(e, t = 5, n = []) {
273
+ function te(e, t = 5, n = []) {
244
274
  return p({
245
275
  queryKey: ["accounts", "search", e, n],
246
276
  enabled: !!e,
247
- queryFn: async () => (await s.hiveClient.database.call(
277
+ queryFn: async () => (await a.hiveClient.database.call(
248
278
  "lookup_accounts",
249
279
  [e, t]
250
280
  )).filter(
251
- (o) => n.length > 0 ? !n.includes(o) : !0
281
+ (s) => n.length > 0 ? !n.includes(s) : !0
252
282
  )
253
283
  });
254
284
  }
255
- function ee(e) {
285
+ function ne(e) {
256
286
  return p({
257
287
  queryKey: ["accounts", "check-wallet-pending", e],
258
288
  queryFn: async () => await (await fetch(
259
- s.privateApiHost + "/private-api/wallets-chkuser",
289
+ a.privateApiHost + "/private-api/wallets-chkuser",
260
290
  {
261
291
  method: "POST",
262
292
  headers: {
@@ -271,24 +301,24 @@ function ee(e) {
271
301
  refetchOnMount: !0
272
302
  });
273
303
  }
274
- function H(e, t) {
304
+ function B(e, t) {
275
305
  return p({
276
306
  queryKey: ["accounts", "relations", e, t],
277
307
  enabled: !!e && !!t,
278
308
  refetchOnMount: !1,
279
309
  refetchInterval: 36e5,
280
- queryFn: async () => await s.hiveClient.call(
310
+ queryFn: async () => await a.hiveClient.call(
281
311
  "bridge",
282
312
  "get_relationship_between_accounts",
283
313
  [e, t]
284
314
  )
285
315
  });
286
316
  }
287
- function te(e, t, n, r) {
317
+ function oe(e, t, n, o) {
288
318
  return y({
289
319
  mutationKey: [],
290
- mutationFn: async (o) => {
291
- const u = H(
320
+ mutationFn: async (s) => {
321
+ const u = B(
292
322
  e,
293
323
  t
294
324
  );
@@ -296,32 +326,32 @@ function te(e, t, n, r) {
296
326
  const i = c().getQueryData(
297
327
  u.queryKey
298
328
  );
299
- return await J(e, "follow", [
329
+ return await E(e, "follow", [
300
330
  "follow",
301
331
  {
302
332
  follower: e,
303
333
  following: t,
304
334
  what: [
305
- ...o === "toggle-ignore" && !(i != null && i.ignores) ? ["ignore"] : [],
306
- ...o === "toggle-follow" && !(i != null && i.follows) ? ["blog"] : []
335
+ ...s === "toggle-ignore" && !(i != null && i.ignores) ? ["ignore"] : [],
336
+ ...s === "toggle-follow" && !(i != null && i.follows) ? ["blog"] : []
307
337
  ]
308
338
  }
309
339
  ]), {
310
340
  ...i,
311
- ignores: o === "toggle-ignore" ? !(i != null && i.ignores) : i == null ? void 0 : i.ignores,
312
- follows: o === "toggle-follow" ? !(i != null && i.follows) : i == null ? void 0 : i.follows
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
313
343
  };
314
344
  },
315
- onError: r,
316
- onSuccess(o) {
317
- n(o), c().setQueryData(
345
+ onError: o,
346
+ onSuccess(s) {
347
+ n(s), c().setQueryData(
318
348
  ["accounts", "relations", e, t],
319
- o
349
+ s
320
350
  );
321
351
  }
322
352
  });
323
353
  }
324
- function ne(e) {
354
+ function re(e) {
325
355
  return y({
326
356
  mutationKey: ["operations", "sign", e],
327
357
  mutationFn: ({
@@ -330,39 +360,15 @@ function ne(e) {
330
360
  }) => {
331
361
  if (!e)
332
362
  throw new Error("[Operations][Sign] – cannot sign op with anon user");
333
- let r;
334
- return n.split(" ").length === 12 ? r = h.fromLogin(e, n, "active") : F.isWif(n) ? r = h.fromString(n) : r = h.from(n), s.hiveClient.broadcast.sendOperations(
363
+ let o;
364
+ return n.split(" ").length === 12 ? o = h.fromLogin(e, n, "active") : D.isWif(n) ? o = h.fromString(n) : o = h.from(n), a.hiveClient.broadcast.sendOperations(
335
365
  [t],
336
- r
366
+ o
337
367
  );
338
368
  }
339
369
  });
340
370
  }
341
- function E() {
342
- return new Promise((e) => {
343
- var t;
344
- (t = window.hive_keychain) == null || t.requestHandshake(() => {
345
- e();
346
- });
347
- });
348
- }
349
- const K = (e, t, n, r = null) => new Promise((o, u) => {
350
- var i;
351
- (i = window.hive_keychain) == null || i.requestBroadcast(
352
- e,
353
- t,
354
- n,
355
- (a) => {
356
- a.success || u({ message: "Operation cancelled" }), o(a);
357
- },
358
- r
359
- );
360
- }), re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
361
- __proto__: null,
362
- broadcast: K,
363
- handshake: E
364
- }, Symbol.toStringTag, { value: "Module" }));
365
- function oe(e, t = "Active") {
371
+ function ie(e, t = "Active") {
366
372
  return y({
367
373
  mutationKey: ["operations", "sign-keychain", e],
368
374
  mutationFn: ({ operation: n }) => {
@@ -370,28 +376,28 @@ function oe(e, t = "Active") {
370
376
  throw new Error(
371
377
  "[SDK][Keychain] – cannot sign operation with anon user"
372
378
  );
373
- return K(e, [n], t);
379
+ return g(e, [n], t);
374
380
  }
375
381
  });
376
382
  }
377
- function ie(e = "/") {
383
+ function se(e = "/") {
378
384
  return y({
379
385
  mutationKey: ["operations", "sign-hivesigner", e],
380
386
  mutationFn: async ({ operation: t }) => d.sendOperation(t, { callback: e }, () => {
381
387
  })
382
388
  });
383
389
  }
384
- function se() {
390
+ function ae() {
385
391
  return p({
386
392
  queryKey: ["operations", "chain-properties"],
387
- queryFn: async () => await s.hiveClient.database.getChainProperties()
393
+ queryFn: async () => await a.hiveClient.database.getChainProperties()
388
394
  });
389
395
  }
390
- function ae(e, t) {
396
+ function ce(e, t) {
391
397
  return p({
392
398
  queryKey: ["hive-engine", "tokens-list", e, t],
393
399
  queryFn: async () => (await (await fetch(
394
- `${s.privateApiHost}/private-api/engine-api`,
400
+ `${a.privateApiHost}/private-api/engine-api`,
395
401
  {
396
402
  method: "POST",
397
403
  body: JSON.stringify({
@@ -412,11 +418,11 @@ function ae(e, t) {
412
418
  )).json()).result
413
419
  });
414
420
  }
415
- function ce(e = 20) {
416
- return k({
421
+ function ue(e = 20) {
422
+ return A({
417
423
  queryKey: ["posts", "trending-tags"],
418
- queryFn: async ({ pageParam: { afterTag: t } }) => s.hiveClient.database.call("get_trending_tags", [t, e]).then(
419
- (n) => n.filter((r) => r.name !== "").filter((r) => !r.name.startsWith("hive-")).map((r) => r.name)
424
+ queryFn: async ({ pageParam: { afterTag: t } }) => a.hiveClient.database.call("get_trending_tags", [t, e]).then(
425
+ (n) => n.filter((o) => o.name !== "").filter((o) => !o.name.startsWith("hive-")).map((o) => o.name)
420
426
  ),
421
427
  initialPageParam: { afterTag: "" },
422
428
  getNextPageParam: (t) => ({
@@ -426,11 +432,11 @@ function ce(e = 20) {
426
432
  refetchOnMount: !0
427
433
  });
428
434
  }
429
- function v(e) {
435
+ function m(e) {
430
436
  return p({
431
437
  queryKey: ["posts", "fragments", e],
432
438
  queryFn: async () => (await fetch(
433
- s.privateApiHost + "/private-api/fragments",
439
+ a.privateApiHost + "/private-api/fragments",
434
440
  {
435
441
  method: "POST",
436
442
  body: JSON.stringify({
@@ -444,12 +450,12 @@ function v(e) {
444
450
  enabled: !!e
445
451
  });
446
452
  }
447
- function ue(e = "feed") {
453
+ function pe(e = "feed") {
448
454
  return p({
449
455
  queryKey: ["posts", "promoted", e],
450
456
  queryFn: async () => {
451
457
  const t = new URL(
452
- s.privateApiHost + "/private-api/promoted-entries"
458
+ a.privateApiHost + "/private-api/promoted-entries"
453
459
  );
454
460
  return e === "waves" && t.searchParams.append("short_content", "1"), await (await fetch(t.toString(), {
455
461
  method: "GET",
@@ -460,11 +466,11 @@ function ue(e = "feed") {
460
466
  }
461
467
  });
462
468
  }
463
- function pe(e) {
469
+ function ye(e) {
464
470
  return y({
465
471
  mutationKey: ["posts", "add-fragment", e],
466
472
  mutationFn: async ({ title: t, body: n }) => (await fetch(
467
- s.privateApiHost + "/private-api/fragments-add",
473
+ a.privateApiHost + "/private-api/fragments-add",
468
474
  {
469
475
  method: "POST",
470
476
  body: JSON.stringify({
@@ -479,24 +485,24 @@ function pe(e) {
479
485
  )).json(),
480
486
  onSuccess(t) {
481
487
  c().setQueryData(
482
- v(e).queryKey,
488
+ m(e).queryKey,
483
489
  (n) => [t, ...n ?? []]
484
490
  );
485
491
  }
486
492
  });
487
493
  }
488
- function ye(e, t) {
494
+ function le(e, t) {
489
495
  return y({
490
496
  mutationKey: ["posts", "edit-fragment", e, t],
491
- mutationFn: async ({ title: n, body: r }) => (await fetch(
492
- s.privateApiHost + "/private-api/fragments-update",
497
+ mutationFn: async ({ title: n, body: o }) => (await fetch(
498
+ a.privateApiHost + "/private-api/fragments-update",
493
499
  {
494
500
  method: "POST",
495
501
  body: JSON.stringify({
496
502
  code: l(e),
497
503
  id: t,
498
504
  title: n,
499
- body: r
505
+ body: o
500
506
  }),
501
507
  headers: {
502
508
  "Content-Type": "application/json"
@@ -505,21 +511,21 @@ function ye(e, t) {
505
511
  )).json(),
506
512
  onSuccess(n) {
507
513
  c().setQueryData(
508
- v(e).queryKey,
509
- (r) => {
510
- if (!r)
514
+ m(e).queryKey,
515
+ (o) => {
516
+ if (!o)
511
517
  return [];
512
- const o = r.findIndex(({ id: u }) => u === t);
513
- return o >= 0 && (r[o] = n), [...r];
518
+ const s = o.findIndex(({ id: u }) => u === t);
519
+ return s >= 0 && (o[s] = n), [...o];
514
520
  }
515
521
  );
516
522
  }
517
523
  });
518
524
  }
519
- function le(e, t) {
525
+ function fe(e, t) {
520
526
  return y({
521
527
  mutationKey: ["posts", "remove-fragment", e],
522
- mutationFn: async () => fetch(s.privateApiHost + "/private-api/fragments-delete", {
528
+ mutationFn: async () => fetch(a.privateApiHost + "/private-api/fragments-delete", {
523
529
  method: "POST",
524
530
  body: JSON.stringify({
525
531
  code: l(e),
@@ -531,19 +537,19 @@ function le(e, t) {
531
537
  }),
532
538
  onSuccess() {
533
539
  c().setQueryData(
534
- v(e).queryKey,
535
- (n) => [...n ?? []].filter(({ id: r }) => r !== t)
540
+ m(e).queryKey,
541
+ (n) => [...n ?? []].filter(({ id: o }) => o !== t)
536
542
  );
537
543
  }
538
544
  });
539
545
  }
540
- function b(e, t) {
546
+ function Q(e, t) {
541
547
  return y({
542
548
  mutationKey: ["analytics", t],
543
549
  mutationFn: async () => {
544
550
  if (!t)
545
551
  throw new Error("[SDK][Analytics] – no activity type provided");
546
- await fetch(s.plausibleHost + "/api/event", {
552
+ await fetch(a.plausibleHost + "/api/event", {
547
553
  method: "POST",
548
554
  headers: {
549
555
  "Content-Type": "application/json"
@@ -560,11 +566,11 @@ function b(e, t) {
560
566
  }
561
567
  });
562
568
  }
563
- const fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
569
+ const he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
564
570
  __proto__: null,
565
- useRecordActivity: b
571
+ useRecordActivity: Q
566
572
  }, Symbol.toStringTag, { value: "Module" }));
567
- function B(e, t) {
573
+ function M(e, t) {
568
574
  return p({
569
575
  queryKey: ["integrations", "hivesigner", "decode-memo", e],
570
576
  queryFn: async () => {
@@ -576,13 +582,13 @@ function B(e, t) {
576
582
  }
577
583
  });
578
584
  }
579
- const M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
585
+ const x = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
580
586
  __proto__: null,
581
- getDecodeMemoQueryOptions: B
582
- }, Symbol.toStringTag, { value: "Module" })), x = {
583
- queries: M
587
+ getDecodeMemoQueryOptions: M
588
+ }, Symbol.toStringTag, { value: "Module" })), G = {
589
+ queries: x
584
590
  };
585
- function w(e) {
591
+ function v(e) {
586
592
  return p({
587
593
  queryKey: ["integrations", "3speak", "authenticate", e],
588
594
  enabled: !!e,
@@ -596,28 +602,28 @@ function w(e) {
596
602
  "Content-Type": "application/json"
597
603
  }
598
604
  }
599
- ), n = x.queries.getDecodeMemoQueryOptions(
605
+ ), n = G.queries.getDecodeMemoQueryOptions(
600
606
  e,
601
607
  (await t.json()).memo
602
608
  );
603
609
  await c().prefetchQuery(n);
604
- const { memoDecoded: r } = c().getQueryData(
610
+ const { memoDecoded: o } = c().getQueryData(
605
611
  n.queryKey
606
612
  );
607
- return r.replace("#", "");
613
+ return o.replace("#", "");
608
614
  }
609
615
  });
610
616
  }
611
- function G(e) {
617
+ function U(e) {
612
618
  return p({
613
619
  queryKey: ["integrations", "3speak", "videos", e],
614
620
  enabled: !!e,
615
621
  queryFn: async () => {
616
622
  await c().prefetchQuery(
617
- w(e)
623
+ v(e)
618
624
  );
619
625
  const t = c().getQueryData(
620
- w(e).queryKey
626
+ v(e).queryKey
621
627
  );
622
628
  return await (await fetch(
623
629
  "https://studio.3speak.tv/mobile/api/my-videos",
@@ -631,31 +637,31 @@ function G(e) {
631
637
  }
632
638
  });
633
639
  }
634
- const U = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
640
+ const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
635
641
  __proto__: null,
636
- getAccountTokenQueryOptions: w,
637
- getAccountVideosQueryOptions: G
638
- }, Symbol.toStringTag, { value: "Module" })), he = {
639
- queries: U
642
+ getAccountTokenQueryOptions: v,
643
+ getAccountVideosQueryOptions: U
644
+ }, Symbol.toStringTag, { value: "Module" })), de = {
645
+ queries: z
640
646
  };
641
- function de() {
647
+ function ge() {
642
648
  return p({
643
649
  queryKey: ["resource-credits", "stats"],
644
- queryFn: async () => (await s.hiveClient.call(
650
+ queryFn: async () => (await a.hiveClient.call(
645
651
  "rc_api",
646
652
  "get_rc_stats",
647
653
  {}
648
654
  )).rc_stats
649
655
  });
650
656
  }
651
- function ge(e) {
657
+ function we(e) {
652
658
  return p({
653
659
  queryKey: ["resource-credits", "account", e],
654
- queryFn: async () => new D(s.hiveClient).findRCAccounts([e]),
660
+ queryFn: async () => new P(a.hiveClient).findRCAccounts([e]),
655
661
  enabled: !!e
656
662
  });
657
663
  }
658
- function we(e, t) {
664
+ function ve(e, t) {
659
665
  return p({
660
666
  queryKey: ["games", "status-check", t, e],
661
667
  enabled: !!e,
@@ -663,7 +669,7 @@ function we(e, t) {
663
669
  if (!e)
664
670
  throw new Error("[SDK][Games] – anon user in status check");
665
671
  return await (await fetch(
666
- s.privateApiHost + "/private-api/get-game",
672
+ a.privateApiHost + "/private-api/get-game",
667
673
  {
668
674
  method: "POST",
669
675
  body: JSON.stringify({
@@ -678,8 +684,8 @@ function we(e, t) {
678
684
  }
679
685
  });
680
686
  }
681
- function ve(e, t, n) {
682
- const { mutateAsync: r } = b(
687
+ function me(e, t, n) {
688
+ const { mutateAsync: o } = Q(
683
689
  e,
684
690
  "spin-rolled"
685
691
  );
@@ -689,7 +695,7 @@ function ve(e, t, n) {
689
695
  if (!e)
690
696
  throw new Error("[SDK][Games] – anon user in game post");
691
697
  return await (await fetch(
692
- s.privateApiHost + "/private-api/post-game",
698
+ a.privateApiHost + "/private-api/post-game",
693
699
  {
694
700
  method: "POST",
695
701
  body: JSON.stringify({
@@ -704,45 +710,46 @@ function ve(e, t, n) {
704
710
  )).json();
705
711
  },
706
712
  onSuccess() {
707
- r();
713
+ o();
708
714
  }
709
715
  });
710
716
  }
711
717
  export {
712
- s as CONFIG,
713
- C as ConfigManager,
714
- fe as EcencyAnalytics,
715
- O as EcencyQueriesManager,
716
- x as HiveSignerIntegration,
717
- re as Keychain,
718
- he as ThreeSpeakIntegration,
719
- J as broadcastJson,
720
- ee as checkUsernameWalletsPendingQueryOptions,
718
+ 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,
721
727
  l as getAccessToken,
722
- Z as getAccountFullQueryOptions,
723
- ge as getAccountRcQueryOptions,
724
- se as getChainPropertiesQueryOptions,
725
- v as getFragmentsQueryOptions,
726
- we as getGameStatusCheckQueryOptions,
727
- ae as getHiveEngineTokensListQueryOptions,
728
- q as getPostingKey,
729
- ue as getPromotedPostsQuery,
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,
735
+ K as getPostingKey,
736
+ pe as getPromotedPostsQuery,
730
737
  c as getQueryClient,
731
- de as getRcStatsQueryOptions,
732
- V as getRefreshToken,
733
- H as getRelationshipBetweenAccountsQueryOptions,
734
- R as getSearchAccountsByUsernameQueryOptions,
735
- ce as getTrendingTagsQueryOptions,
738
+ ge as getRcStatsQueryOptions,
739
+ X as getRefreshToken,
740
+ B as getRelationshipBetweenAccountsQueryOptions,
741
+ te as getSearchAccountsByUsernameQueryOptions,
742
+ ue as getTrendingTagsQueryOptions,
736
743
  f as getUser,
737
- X as makeQueryClient,
738
- te as useAccountRelationsUpdate,
739
- Y as useAccountUpdate,
740
- pe as useAddFragment,
741
- N as useBroadcastMutation,
742
- ye as useEditFragment,
743
- ve as useGameClaim,
744
- le as useRemoveFragment,
745
- ie as useSignOperationByHivesigner,
746
- ne as useSignOperationByKey,
747
- oe as useSignOperationByKeychain
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
748
755
  };
@@ -4,5 +4,6 @@ export interface StoringUser {
4
4
  refreshToken: string;
5
5
  expiresIn: number;
6
6
  postingKey: null | undefined | string;
7
+ loginType: null | undefined | string;
7
8
  index?: number;
8
9
  }
@@ -2,4 +2,5 @@ import { StoringUser } from './entities';
2
2
  export declare const getUser: (username: string) => StoringUser | undefined;
3
3
  export declare const getAccessToken: (username: string) => string | undefined;
4
4
  export declare const getPostingKey: (username: string) => null | undefined | string;
5
+ export declare const getLoginType: (username: string) => null | undefined | string;
5
6
  export declare const getRefreshToken: (username: string) => string | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ecency/sdk",
3
3
  "private": false,
4
- "version": "1.0.45",
4
+ "version": "1.0.46",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "./dist/ecency-sdk.umd.js",