@ecency/sdk 1.0.50 → 1.0.52
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.
- package/dist/ecency-sdk.es.js +413 -254
- package/dist/modules/accounts/mutations/bookmarks/index.d.ts +2 -0
- package/dist/modules/accounts/mutations/bookmarks/use-account-bookmark-add.d.ts +6 -0
- package/dist/modules/accounts/mutations/bookmarks/use-account-bookmark-delete.d.ts +1 -0
- package/dist/modules/accounts/mutations/favourites/index.d.ts +2 -0
- package/dist/modules/accounts/mutations/favourites/use-account-favourite-add.d.ts +1 -0
- package/dist/modules/accounts/mutations/favourites/use-account-favourite-delete.d.ts +1 -0
- package/dist/modules/accounts/mutations/index.d.ts +2 -0
- package/dist/modules/accounts/queries/get-active-account-bookmarks-query-options.d.ts +9 -0
- package/dist/modules/accounts/queries/get-active-account-favourites-query-options.d.ts +9 -0
- package/dist/modules/accounts/queries/index.d.ts +2 -0
- package/dist/modules/accounts/types/account-bookmark.d.ts +7 -0
- package/dist/modules/accounts/types/account-favourite.d.ts +5 -0
- package/dist/modules/accounts/types/index.d.ts +2 -0
- package/dist/modules/communities/utils/index.d.ts +0 -6
- package/package.json +1 -1
package/dist/ecency-sdk.es.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var
|
4
|
-
import { QueryClient as K, useMutation as l, useQuery as
|
5
|
-
import { Client as
|
1
|
+
var A = Object.defineProperty;
|
2
|
+
var Q = (e, t, n) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
3
|
+
var C = (e, t, n) => Q(e, typeof t != "symbol" ? t + "" : t, n);
|
4
|
+
import { QueryClient as K, useMutation as l, useQuery as j, useInfiniteQuery as _, 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
6
|
import g from "hivesigner";
|
7
|
-
class
|
7
|
+
class M {
|
8
8
|
constructor() {
|
9
|
-
|
9
|
+
C(this, "length", 0);
|
10
10
|
}
|
11
11
|
clear() {
|
12
12
|
throw new Error("Method not implemented.");
|
@@ -24,11 +24,11 @@ class I {
|
|
24
24
|
this[t] = n;
|
25
25
|
}
|
26
26
|
}
|
27
|
-
const
|
27
|
+
const i = {
|
28
28
|
privateApiHost: "https://ecency.com",
|
29
|
-
storage: typeof window > "u" ? new
|
29
|
+
storage: typeof window > "u" ? new M() : window.localStorage,
|
30
30
|
storagePrefix: "ecency",
|
31
|
-
hiveClient: new
|
31
|
+
hiveClient: new D(
|
32
32
|
[
|
33
33
|
"https://api.hive.blog",
|
34
34
|
"https://api.deathwing.me",
|
@@ -55,27 +55,27 @@ const a = {
|
|
55
55
|
var O;
|
56
56
|
((e) => {
|
57
57
|
function t(n) {
|
58
|
-
|
58
|
+
i.queryClient = n;
|
59
59
|
}
|
60
60
|
e.setQueryClient = t;
|
61
61
|
})(O || (O = {}));
|
62
|
-
function
|
62
|
+
function E(e) {
|
63
63
|
let t = atob(e);
|
64
64
|
if (t[0] === "{")
|
65
65
|
return JSON.parse(t);
|
66
66
|
}
|
67
|
-
const
|
67
|
+
const f = (e) => {
|
68
68
|
try {
|
69
|
-
const t =
|
70
|
-
|
69
|
+
const t = i.storage.getItem(
|
70
|
+
i.storagePrefix + "_user_" + e
|
71
71
|
);
|
72
|
-
return
|
72
|
+
return E(JSON.parse(t));
|
73
73
|
} catch (t) {
|
74
74
|
console.error(t);
|
75
75
|
return;
|
76
76
|
}
|
77
|
-
},
|
78
|
-
function
|
77
|
+
}, y = (e) => f(e) && f(e).accessToken, q = (e) => f(e) && f(e).postingKey, k = (e) => f(e) && f(e).loginType, Z = (e) => f(e) && f(e).refreshToken;
|
78
|
+
function J() {
|
79
79
|
return new Promise((e) => {
|
80
80
|
var t;
|
81
81
|
(t = window.hive_keychain) == null || t.requestHandshake(() => {
|
@@ -83,77 +83,77 @@ function E() {
|
|
83
83
|
});
|
84
84
|
});
|
85
85
|
}
|
86
|
-
const w = (e, t, n,
|
87
|
-
var
|
88
|
-
(
|
86
|
+
const w = (e, t, n, o = null) => new Promise((r, c) => {
|
87
|
+
var a;
|
88
|
+
(a = window.hive_keychain) == null || a.requestBroadcast(
|
89
89
|
e,
|
90
90
|
t,
|
91
91
|
n,
|
92
|
-
(
|
93
|
-
|
92
|
+
(s) => {
|
93
|
+
s.success || c({ message: "Operation cancelled" }), r(s);
|
94
94
|
},
|
95
|
-
|
95
|
+
o
|
96
96
|
);
|
97
97
|
}), L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
98
98
|
__proto__: null,
|
99
99
|
broadcast: w,
|
100
|
-
handshake:
|
100
|
+
handshake: J
|
101
101
|
}, Symbol.toStringTag, { value: "Module" }));
|
102
|
-
function
|
102
|
+
function I(e = [], t, n) {
|
103
103
|
return l({
|
104
104
|
mutationKey: [...e, t],
|
105
|
-
mutationFn: async (
|
105
|
+
mutationFn: async (o) => {
|
106
106
|
if (!t)
|
107
107
|
throw new Error(
|
108
108
|
"[Core][Broadcast] Attempted to call broadcast API with anon user"
|
109
109
|
);
|
110
|
-
const
|
111
|
-
if (
|
112
|
-
const
|
113
|
-
return
|
114
|
-
n(
|
115
|
-
|
110
|
+
const r = q(t);
|
111
|
+
if (r) {
|
112
|
+
const s = h.fromString(r);
|
113
|
+
return i.hiveClient.broadcast.sendOperations(
|
114
|
+
n(o),
|
115
|
+
s
|
116
116
|
);
|
117
117
|
}
|
118
|
-
const c =
|
118
|
+
const c = k(t);
|
119
119
|
if (c && c == "keychain")
|
120
|
-
return w(t, n(
|
121
|
-
let
|
122
|
-
if (
|
120
|
+
return w(t, n(o), "Posting").then((s) => s.result);
|
121
|
+
let a = y(t);
|
122
|
+
if (a)
|
123
123
|
return (await new g.Client({
|
124
|
-
accessToken:
|
125
|
-
}).broadcast(n(
|
124
|
+
accessToken: a
|
125
|
+
}).broadcast(n(o))).result;
|
126
126
|
throw new Error(
|
127
127
|
"[SDK][Broadcast] – cannot broadcast w/o posting key or token"
|
128
128
|
);
|
129
129
|
}
|
130
130
|
});
|
131
131
|
}
|
132
|
-
async function
|
132
|
+
async function B(e, t, n) {
|
133
133
|
if (!e)
|
134
134
|
throw new Error(
|
135
135
|
"[Core][Broadcast] Attempted to call broadcast API with anon user"
|
136
136
|
);
|
137
|
-
const
|
137
|
+
const o = {
|
138
138
|
id: t,
|
139
139
|
required_auths: [],
|
140
140
|
required_posting_auths: [e],
|
141
141
|
json: JSON.stringify(n)
|
142
|
-
},
|
143
|
-
if (
|
144
|
-
const
|
145
|
-
return
|
146
|
-
|
147
|
-
|
142
|
+
}, r = q(e);
|
143
|
+
if (r) {
|
144
|
+
const s = h.fromString(r);
|
145
|
+
return i.hiveClient.broadcast.json(
|
146
|
+
o,
|
147
|
+
s
|
148
148
|
);
|
149
149
|
}
|
150
|
-
const c =
|
150
|
+
const c = k(e);
|
151
151
|
if (c && c == "keychain")
|
152
|
-
return w(e, [["custom_json",
|
153
|
-
let
|
154
|
-
if (
|
152
|
+
return w(e, [["custom_json", o]], "Posting").then((s) => s.result);
|
153
|
+
let a = y(e);
|
154
|
+
if (a)
|
155
155
|
return (await new g.Client({
|
156
|
-
accessToken:
|
156
|
+
accessToken: a
|
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"
|
@@ -172,46 +172,46 @@ function R() {
|
|
172
172
|
}
|
173
173
|
});
|
174
174
|
}
|
175
|
-
const
|
176
|
-
var
|
175
|
+
const u = () => i.queryClient;
|
176
|
+
var S;
|
177
177
|
((e) => {
|
178
|
-
function t(
|
179
|
-
return
|
178
|
+
function t(s) {
|
179
|
+
return u().getQueryData(s);
|
180
180
|
}
|
181
181
|
e.getQueryData = t;
|
182
|
-
function n(
|
183
|
-
return
|
182
|
+
function n(s) {
|
183
|
+
return u().getQueryData(s);
|
184
184
|
}
|
185
185
|
e.getInfiniteQueryData = n;
|
186
|
-
async function
|
187
|
-
return await
|
186
|
+
async function o(s) {
|
187
|
+
return await u().prefetchQuery(s), t(s.queryKey);
|
188
188
|
}
|
189
|
-
e.prefetchQuery =
|
190
|
-
async function
|
191
|
-
return await
|
189
|
+
e.prefetchQuery = o;
|
190
|
+
async function r(s) {
|
191
|
+
return await u().prefetchInfiniteQuery(s), n(s.queryKey);
|
192
192
|
}
|
193
|
-
e.prefetchInfiniteQuery =
|
194
|
-
function c(
|
193
|
+
e.prefetchInfiniteQuery = r;
|
194
|
+
function c(s) {
|
195
195
|
return {
|
196
|
-
prefetch: () =>
|
197
|
-
getData: () => t(
|
198
|
-
useClientQuery: () =>
|
199
|
-
fetchAndGet: () =>
|
196
|
+
prefetch: () => o(s),
|
197
|
+
getData: () => t(s.queryKey),
|
198
|
+
useClientQuery: () => j(s),
|
199
|
+
fetchAndGet: () => u().fetchQuery(s)
|
200
200
|
};
|
201
201
|
}
|
202
202
|
e.generateClientServerQuery = c;
|
203
|
-
function s
|
203
|
+
function a(s) {
|
204
204
|
return {
|
205
|
-
prefetch: () =>
|
206
|
-
getData: () => n(
|
207
|
-
useClientQuery: () =>
|
208
|
-
fetchAndGet: () =>
|
205
|
+
prefetch: () => r(s),
|
206
|
+
getData: () => n(s.queryKey),
|
207
|
+
useClientQuery: () => _(s),
|
208
|
+
fetchAndGet: () => u().fetchInfiniteQuery(s)
|
209
209
|
};
|
210
210
|
}
|
211
|
-
e.generateClientServerInfiniteQuery =
|
212
|
-
})(
|
211
|
+
e.generateClientServerInfiniteQuery = a;
|
212
|
+
})(S || (S = {}));
|
213
213
|
function ee(e) {
|
214
|
-
return
|
214
|
+
return I(
|
215
215
|
["accounts", "update"],
|
216
216
|
e,
|
217
217
|
({
|
@@ -234,35 +234,35 @@ function ee(e) {
|
|
234
234
|
);
|
235
235
|
}
|
236
236
|
function te(e) {
|
237
|
-
return
|
237
|
+
return p({
|
238
238
|
queryKey: ["get-account-full", e],
|
239
239
|
queryFn: async () => {
|
240
240
|
if (!e)
|
241
241
|
throw new Error("[SDK] Username is empty");
|
242
|
-
const t = await
|
242
|
+
const t = await i.hiveClient.database.getAccounts([e]);
|
243
243
|
if (!t[0])
|
244
244
|
throw new Error("[SDK] No account with given username");
|
245
245
|
const n = JSON.parse(t[0].posting_json_metadata).profile;
|
246
|
-
let
|
246
|
+
let o;
|
247
247
|
try {
|
248
|
-
|
248
|
+
o = await i.hiveClient.database.call(
|
249
249
|
"get_follow_count",
|
250
250
|
[e]
|
251
251
|
);
|
252
252
|
} catch {
|
253
253
|
}
|
254
|
-
const
|
254
|
+
const r = await i.hiveClient.call(
|
255
255
|
"condenser_api",
|
256
256
|
"get_account_reputations",
|
257
257
|
[e, 1]
|
258
258
|
);
|
259
259
|
return {
|
260
260
|
...t,
|
261
|
-
follow_stats:
|
262
|
-
reputation:
|
261
|
+
follow_stats: o,
|
262
|
+
reputation: r[0].reputation,
|
263
263
|
profile: {
|
264
264
|
...n,
|
265
|
-
reputation:
|
265
|
+
reputation: r[0].reputation
|
266
266
|
}
|
267
267
|
};
|
268
268
|
},
|
@@ -271,22 +271,22 @@ function te(e) {
|
|
271
271
|
});
|
272
272
|
}
|
273
273
|
function ne(e, t = 5, n = []) {
|
274
|
-
return
|
274
|
+
return p({
|
275
275
|
queryKey: ["accounts", "search", e, n],
|
276
276
|
enabled: !!e,
|
277
|
-
queryFn: async () => (await
|
277
|
+
queryFn: async () => (await i.hiveClient.database.call(
|
278
278
|
"lookup_accounts",
|
279
279
|
[e, t]
|
280
280
|
)).filter(
|
281
|
-
(
|
281
|
+
(r) => n.length > 0 ? !n.includes(r) : !0
|
282
282
|
)
|
283
283
|
});
|
284
284
|
}
|
285
|
-
function
|
286
|
-
return
|
285
|
+
function oe(e) {
|
286
|
+
return p({
|
287
287
|
queryKey: ["accounts", "check-wallet-pending", e],
|
288
288
|
queryFn: async () => await (await fetch(
|
289
|
-
|
289
|
+
i.privateApiHost + "/private-api/wallets-chkuser",
|
290
290
|
{
|
291
291
|
method: "POST",
|
292
292
|
headers: {
|
@@ -301,24 +301,24 @@ function re(e) {
|
|
301
301
|
refetchOnMount: !0
|
302
302
|
});
|
303
303
|
}
|
304
|
-
function
|
305
|
-
return
|
304
|
+
function H(e, t) {
|
305
|
+
return p({
|
306
306
|
queryKey: ["accounts", "relations", e, t],
|
307
307
|
enabled: !!e && !!t,
|
308
308
|
refetchOnMount: !1,
|
309
309
|
refetchInterval: 36e5,
|
310
|
-
queryFn: async () => await
|
310
|
+
queryFn: async () => await i.hiveClient.call(
|
311
311
|
"bridge",
|
312
312
|
"get_relationship_between_accounts",
|
313
313
|
[e, t]
|
314
314
|
)
|
315
315
|
});
|
316
316
|
}
|
317
|
-
function
|
318
|
-
return
|
317
|
+
function re(e) {
|
318
|
+
return p({
|
319
319
|
queryKey: ["accounts", "subscriptions", e],
|
320
320
|
enabled: !!e,
|
321
|
-
queryFn: async () => await
|
321
|
+
queryFn: async () => await i.hiveClient.call(
|
322
322
|
"bridge",
|
323
323
|
"list_all_subscriptions",
|
324
324
|
{
|
@@ -327,44 +327,197 @@ function oe(e) {
|
|
327
327
|
) ?? []
|
328
328
|
});
|
329
329
|
}
|
330
|
-
function ie(e
|
330
|
+
function ie(e) {
|
331
|
+
return p({
|
332
|
+
queryKey: ["accounts", "bookmarks", e],
|
333
|
+
enabled: !!e,
|
334
|
+
queryFn: async () => {
|
335
|
+
if (!e)
|
336
|
+
throw new Error("[SDK][Accounts][Bookmarks] – no active user");
|
337
|
+
return await (await fetch(
|
338
|
+
i.privateApiHost + "/private-api/bookmarks",
|
339
|
+
{
|
340
|
+
method: "POST",
|
341
|
+
headers: {
|
342
|
+
"Content-Type": "application/json"
|
343
|
+
},
|
344
|
+
body: JSON.stringify({ code: y(e) })
|
345
|
+
}
|
346
|
+
)).json();
|
347
|
+
}
|
348
|
+
});
|
349
|
+
}
|
350
|
+
function se(e) {
|
351
|
+
return p({
|
352
|
+
queryKey: ["accounts", "favourites", e],
|
353
|
+
enabled: !!e,
|
354
|
+
queryFn: async () => {
|
355
|
+
if (!e)
|
356
|
+
throw new Error("[SDK][Accounts][Favourites] – no active user");
|
357
|
+
return await (await fetch(
|
358
|
+
i.privateApiHost + "/private-api/favorites",
|
359
|
+
{
|
360
|
+
method: "POST",
|
361
|
+
headers: {
|
362
|
+
"Content-Type": "application/json"
|
363
|
+
},
|
364
|
+
body: JSON.stringify({ code: y(e) })
|
365
|
+
}
|
366
|
+
)).json();
|
367
|
+
}
|
368
|
+
});
|
369
|
+
}
|
370
|
+
function ae(e, t, n, o) {
|
331
371
|
return l({
|
332
372
|
mutationKey: [],
|
333
|
-
mutationFn: async (
|
334
|
-
const c =
|
373
|
+
mutationFn: async (r) => {
|
374
|
+
const c = H(
|
335
375
|
e,
|
336
376
|
t
|
337
377
|
);
|
338
|
-
await
|
339
|
-
const
|
378
|
+
await u().prefetchQuery(c);
|
379
|
+
const a = u().getQueryData(
|
340
380
|
c.queryKey
|
341
381
|
);
|
342
|
-
return await
|
382
|
+
return await B(e, "follow", [
|
343
383
|
"follow",
|
344
384
|
{
|
345
385
|
follower: e,
|
346
386
|
following: t,
|
347
387
|
what: [
|
348
|
-
...
|
349
|
-
...
|
388
|
+
...r === "toggle-ignore" && !(a != null && a.ignores) ? ["ignore"] : [],
|
389
|
+
...r === "toggle-follow" && !(a != null && a.follows) ? ["blog"] : []
|
350
390
|
]
|
351
391
|
}
|
352
392
|
]), {
|
353
|
-
...
|
354
|
-
ignores:
|
355
|
-
follows:
|
393
|
+
...a,
|
394
|
+
ignores: r === "toggle-ignore" ? !(a != null && a.ignores) : a == null ? void 0 : a.ignores,
|
395
|
+
follows: r === "toggle-follow" ? !(a != null && a.follows) : a == null ? void 0 : a.follows
|
356
396
|
};
|
357
397
|
},
|
358
|
-
onError:
|
359
|
-
onSuccess(
|
360
|
-
n(
|
398
|
+
onError: o,
|
399
|
+
onSuccess(r) {
|
400
|
+
n(r), u().setQueryData(
|
361
401
|
["accounts", "relations", e, t],
|
362
|
-
|
402
|
+
r
|
363
403
|
);
|
364
404
|
}
|
365
405
|
});
|
366
406
|
}
|
367
|
-
function
|
407
|
+
function ce(e, t, n) {
|
408
|
+
return l({
|
409
|
+
mutationKey: ["accounts", "bookmarks", "add", e],
|
410
|
+
mutationFn: async ({ author: o, permlink: r }) => {
|
411
|
+
if (!e)
|
412
|
+
throw new Error("[SDK][Account][Bookmarks] – no active user");
|
413
|
+
return (await fetch(
|
414
|
+
i.privateApiHost + "/private-api/bookmarks-add",
|
415
|
+
{
|
416
|
+
method: "POST",
|
417
|
+
headers: {
|
418
|
+
"Content-Type": "application/json"
|
419
|
+
},
|
420
|
+
body: JSON.stringify({
|
421
|
+
author: o,
|
422
|
+
permlink: r,
|
423
|
+
code: y(e)
|
424
|
+
})
|
425
|
+
}
|
426
|
+
)).json();
|
427
|
+
},
|
428
|
+
onSuccess: () => {
|
429
|
+
t(), u().invalidateQueries({
|
430
|
+
queryKey: ["accounts", "bookmarks", e]
|
431
|
+
});
|
432
|
+
},
|
433
|
+
onError: n
|
434
|
+
});
|
435
|
+
}
|
436
|
+
function ue(e, t, n) {
|
437
|
+
return l({
|
438
|
+
mutationKey: ["accounts", "bookmarks", "delete", e],
|
439
|
+
mutationFn: async (o) => {
|
440
|
+
if (!e)
|
441
|
+
throw new Error("[SDK][Account][Bookmarks] – no active user");
|
442
|
+
return (await fetch(
|
443
|
+
i.privateApiHost + "/private-api/bookmarks-delete",
|
444
|
+
{
|
445
|
+
method: "POST",
|
446
|
+
headers: {
|
447
|
+
"Content-Type": "application/json"
|
448
|
+
},
|
449
|
+
body: JSON.stringify({
|
450
|
+
id: o,
|
451
|
+
code: y(e)
|
452
|
+
})
|
453
|
+
}
|
454
|
+
)).json();
|
455
|
+
},
|
456
|
+
onSuccess: () => {
|
457
|
+
t(), u().invalidateQueries({
|
458
|
+
queryKey: ["accounts", "bookmarks", e]
|
459
|
+
});
|
460
|
+
},
|
461
|
+
onError: n
|
462
|
+
});
|
463
|
+
}
|
464
|
+
function pe(e, t, n) {
|
465
|
+
return l({
|
466
|
+
mutationKey: ["accounts", "favourites", "add", e],
|
467
|
+
mutationFn: async (o) => {
|
468
|
+
if (!e)
|
469
|
+
throw new Error("[SDK][Account][Bookmarks] – no active user");
|
470
|
+
return (await fetch(
|
471
|
+
i.privateApiHost + "/private-api/favorites-add",
|
472
|
+
{
|
473
|
+
method: "POST",
|
474
|
+
headers: {
|
475
|
+
"Content-Type": "application/json"
|
476
|
+
},
|
477
|
+
body: JSON.stringify({
|
478
|
+
account: o,
|
479
|
+
code: y(e)
|
480
|
+
})
|
481
|
+
}
|
482
|
+
)).json();
|
483
|
+
},
|
484
|
+
onSuccess: () => {
|
485
|
+
t(), u().invalidateQueries({
|
486
|
+
queryKey: ["accounts", "favourites", e]
|
487
|
+
});
|
488
|
+
},
|
489
|
+
onError: n
|
490
|
+
});
|
491
|
+
}
|
492
|
+
function ye(e, t, n) {
|
493
|
+
return l({
|
494
|
+
mutationKey: ["accounts", "favourites", "add", e],
|
495
|
+
mutationFn: async (o) => {
|
496
|
+
if (!e)
|
497
|
+
throw new Error("[SDK][Account][Bookmarks] – no active user");
|
498
|
+
return (await fetch(
|
499
|
+
i.privateApiHost + "/private-api/favorites-delete",
|
500
|
+
{
|
501
|
+
method: "POST",
|
502
|
+
headers: {
|
503
|
+
"Content-Type": "application/json"
|
504
|
+
},
|
505
|
+
body: JSON.stringify({
|
506
|
+
account: o,
|
507
|
+
code: y(e)
|
508
|
+
})
|
509
|
+
}
|
510
|
+
)).json();
|
511
|
+
},
|
512
|
+
onSuccess: () => {
|
513
|
+
t(), u().invalidateQueries({
|
514
|
+
queryKey: ["accounts", "favourites", e]
|
515
|
+
});
|
516
|
+
},
|
517
|
+
onError: n
|
518
|
+
});
|
519
|
+
}
|
520
|
+
function le(e) {
|
368
521
|
return l({
|
369
522
|
mutationKey: ["operations", "sign", e],
|
370
523
|
mutationFn: ({
|
@@ -373,15 +526,15 @@ function se(e) {
|
|
373
526
|
}) => {
|
374
527
|
if (!e)
|
375
528
|
throw new Error("[Operations][Sign] – cannot sign op with anon user");
|
376
|
-
let
|
377
|
-
return n.split(" ").length === 12 ?
|
529
|
+
let o;
|
530
|
+
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(
|
378
531
|
[t],
|
379
|
-
|
532
|
+
o
|
380
533
|
);
|
381
534
|
}
|
382
535
|
});
|
383
536
|
}
|
384
|
-
function
|
537
|
+
function de(e, t = "Active") {
|
385
538
|
return l({
|
386
539
|
mutationKey: ["operations", "sign-keychain", e],
|
387
540
|
mutationFn: ({ operation: n }) => {
|
@@ -393,24 +546,24 @@ function ae(e, t = "Active") {
|
|
393
546
|
}
|
394
547
|
});
|
395
548
|
}
|
396
|
-
function
|
549
|
+
function fe(e = "/") {
|
397
550
|
return l({
|
398
551
|
mutationKey: ["operations", "sign-hivesigner", e],
|
399
552
|
mutationFn: async ({ operation: t }) => g.sendOperation(t, { callback: e }, () => {
|
400
553
|
})
|
401
554
|
});
|
402
555
|
}
|
403
|
-
function
|
404
|
-
return
|
556
|
+
function he() {
|
557
|
+
return p({
|
405
558
|
queryKey: ["operations", "chain-properties"],
|
406
|
-
queryFn: async () => await
|
559
|
+
queryFn: async () => await i.hiveClient.database.getChainProperties()
|
407
560
|
});
|
408
561
|
}
|
409
|
-
function
|
410
|
-
return
|
562
|
+
function ge(e, t) {
|
563
|
+
return p({
|
411
564
|
queryKey: ["hive-engine", "tokens-list", e, t],
|
412
565
|
queryFn: async () => (await (await fetch(
|
413
|
-
`${
|
566
|
+
`${i.privateApiHost}/private-api/engine-api`,
|
414
567
|
{
|
415
568
|
method: "POST",
|
416
569
|
body: JSON.stringify({
|
@@ -431,11 +584,11 @@ function pe(e, t) {
|
|
431
584
|
)).json()).result
|
432
585
|
});
|
433
586
|
}
|
434
|
-
function
|
435
|
-
return
|
587
|
+
function we(e = 20) {
|
588
|
+
return F({
|
436
589
|
queryKey: ["posts", "trending-tags"],
|
437
|
-
queryFn: async ({ pageParam: { afterTag: t } }) =>
|
438
|
-
(n) => n.filter((
|
590
|
+
queryFn: async ({ pageParam: { afterTag: t } }) => i.hiveClient.database.call("get_trending_tags", [t, e]).then(
|
591
|
+
(n) => n.filter((o) => o.name !== "").filter((o) => !o.name.startsWith("hive-")).map((o) => o.name)
|
439
592
|
),
|
440
593
|
initialPageParam: { afterTag: "" },
|
441
594
|
getNextPageParam: (t) => ({
|
@@ -445,15 +598,15 @@ function ye(e = 20) {
|
|
445
598
|
refetchOnMount: !0
|
446
599
|
});
|
447
600
|
}
|
448
|
-
function
|
449
|
-
return
|
601
|
+
function b(e) {
|
602
|
+
return p({
|
450
603
|
queryKey: ["posts", "fragments", e],
|
451
604
|
queryFn: async () => (await fetch(
|
452
|
-
|
605
|
+
i.privateApiHost + "/private-api/fragments",
|
453
606
|
{
|
454
607
|
method: "POST",
|
455
608
|
body: JSON.stringify({
|
456
|
-
code:
|
609
|
+
code: y(e)
|
457
610
|
}),
|
458
611
|
headers: {
|
459
612
|
"Content-Type": "application/json"
|
@@ -463,12 +616,12 @@ function C(e) {
|
|
463
616
|
enabled: !!e
|
464
617
|
});
|
465
618
|
}
|
466
|
-
function
|
467
|
-
return
|
619
|
+
function ve(e = "feed") {
|
620
|
+
return p({
|
468
621
|
queryKey: ["posts", "promoted", e],
|
469
622
|
queryFn: async () => {
|
470
623
|
const t = new URL(
|
471
|
-
|
624
|
+
i.privateApiHost + "/private-api/promoted-entries"
|
472
625
|
);
|
473
626
|
return e === "waves" && t.searchParams.append("short_content", "1"), await (await fetch(t.toString(), {
|
474
627
|
method: "GET",
|
@@ -479,15 +632,15 @@ function le(e = "feed") {
|
|
479
632
|
}
|
480
633
|
});
|
481
634
|
}
|
482
|
-
function
|
635
|
+
function me(e) {
|
483
636
|
return l({
|
484
637
|
mutationKey: ["posts", "add-fragment", e],
|
485
638
|
mutationFn: async ({ title: t, body: n }) => (await fetch(
|
486
|
-
|
639
|
+
i.privateApiHost + "/private-api/fragments-add",
|
487
640
|
{
|
488
641
|
method: "POST",
|
489
642
|
body: JSON.stringify({
|
490
|
-
code:
|
643
|
+
code: y(e),
|
491
644
|
title: t,
|
492
645
|
body: n
|
493
646
|
}),
|
@@ -497,25 +650,25 @@ function fe(e) {
|
|
497
650
|
}
|
498
651
|
)).json(),
|
499
652
|
onSuccess(t) {
|
500
|
-
|
501
|
-
|
653
|
+
u().setQueryData(
|
654
|
+
b(e).queryKey,
|
502
655
|
(n) => [t, ...n ?? []]
|
503
656
|
);
|
504
657
|
}
|
505
658
|
});
|
506
659
|
}
|
507
|
-
function
|
660
|
+
function be(e, t) {
|
508
661
|
return l({
|
509
662
|
mutationKey: ["posts", "edit-fragment", e, t],
|
510
|
-
mutationFn: async ({ title: n, body:
|
511
|
-
|
663
|
+
mutationFn: async ({ title: n, body: o }) => (await fetch(
|
664
|
+
i.privateApiHost + "/private-api/fragments-update",
|
512
665
|
{
|
513
666
|
method: "POST",
|
514
667
|
body: JSON.stringify({
|
515
|
-
code:
|
668
|
+
code: y(e),
|
516
669
|
id: t,
|
517
670
|
title: n,
|
518
|
-
body:
|
671
|
+
body: o
|
519
672
|
}),
|
520
673
|
headers: {
|
521
674
|
"Content-Type": "application/json"
|
@@ -523,25 +676,25 @@ function he(e, t) {
|
|
523
676
|
}
|
524
677
|
)).json(),
|
525
678
|
onSuccess(n) {
|
526
|
-
|
527
|
-
|
528
|
-
(
|
529
|
-
if (!
|
679
|
+
u().setQueryData(
|
680
|
+
b(e).queryKey,
|
681
|
+
(o) => {
|
682
|
+
if (!o)
|
530
683
|
return [];
|
531
|
-
const
|
532
|
-
return
|
684
|
+
const r = o.findIndex(({ id: c }) => c === t);
|
685
|
+
return r >= 0 && (o[r] = n), [...o];
|
533
686
|
}
|
534
687
|
);
|
535
688
|
}
|
536
689
|
});
|
537
690
|
}
|
538
|
-
function
|
691
|
+
function Ce(e, t) {
|
539
692
|
return l({
|
540
693
|
mutationKey: ["posts", "remove-fragment", e],
|
541
|
-
mutationFn: async () => fetch(
|
694
|
+
mutationFn: async () => fetch(i.privateApiHost + "/private-api/fragments-delete", {
|
542
695
|
method: "POST",
|
543
696
|
body: JSON.stringify({
|
544
|
-
code:
|
697
|
+
code: y(e),
|
545
698
|
id: t
|
546
699
|
}),
|
547
700
|
headers: {
|
@@ -549,20 +702,20 @@ function de(e, t) {
|
|
549
702
|
}
|
550
703
|
}),
|
551
704
|
onSuccess() {
|
552
|
-
|
553
|
-
|
554
|
-
(n) => [...n ?? []].filter(({ id:
|
705
|
+
u().setQueryData(
|
706
|
+
b(e).queryKey,
|
707
|
+
(n) => [...n ?? []].filter(({ id: o }) => o !== t)
|
555
708
|
);
|
556
709
|
}
|
557
710
|
});
|
558
711
|
}
|
559
|
-
function
|
712
|
+
function T(e, t) {
|
560
713
|
return l({
|
561
714
|
mutationKey: ["analytics", t],
|
562
715
|
mutationFn: async () => {
|
563
716
|
if (!t)
|
564
717
|
throw new Error("[SDK][Analytics] – no activity type provided");
|
565
|
-
await fetch(
|
718
|
+
await fetch(i.plausibleHost + "/api/event", {
|
566
719
|
method: "POST",
|
567
720
|
headers: {
|
568
721
|
"Content-Type": "application/json"
|
@@ -579,15 +732,15 @@ function _(e, t) {
|
|
579
732
|
}
|
580
733
|
});
|
581
734
|
}
|
582
|
-
const
|
735
|
+
const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
583
736
|
__proto__: null,
|
584
|
-
useRecordActivity:
|
737
|
+
useRecordActivity: T
|
585
738
|
}, Symbol.toStringTag, { value: "Module" }));
|
586
|
-
function
|
587
|
-
return
|
739
|
+
function x(e, t) {
|
740
|
+
return p({
|
588
741
|
queryKey: ["integrations", "hivesigner", "decode-memo", e],
|
589
742
|
queryFn: async () => {
|
590
|
-
const n =
|
743
|
+
const n = y(e);
|
591
744
|
if (n)
|
592
745
|
return new g.Client({
|
593
746
|
accessToken: n
|
@@ -595,14 +748,14 @@ function U(e, t) {
|
|
595
748
|
}
|
596
749
|
});
|
597
750
|
}
|
598
|
-
const
|
751
|
+
const G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
599
752
|
__proto__: null,
|
600
|
-
getDecodeMemoQueryOptions:
|
601
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
602
|
-
queries:
|
753
|
+
getDecodeMemoQueryOptions: x
|
754
|
+
}, Symbol.toStringTag, { value: "Module" })), W = {
|
755
|
+
queries: G
|
603
756
|
};
|
604
|
-
function
|
605
|
-
return
|
757
|
+
function m(e) {
|
758
|
+
return p({
|
606
759
|
queryKey: ["integrations", "3speak", "authenticate", e],
|
607
760
|
enabled: !!e,
|
608
761
|
queryFn: async () => {
|
@@ -615,28 +768,28 @@ function v(e) {
|
|
615
768
|
"Content-Type": "application/json"
|
616
769
|
}
|
617
770
|
}
|
618
|
-
), n =
|
771
|
+
), n = W.queries.getDecodeMemoQueryOptions(
|
619
772
|
e,
|
620
773
|
(await t.json()).memo
|
621
774
|
);
|
622
|
-
await
|
623
|
-
const { memoDecoded:
|
775
|
+
await u().prefetchQuery(n);
|
776
|
+
const { memoDecoded: o } = u().getQueryData(
|
624
777
|
n.queryKey
|
625
778
|
);
|
626
|
-
return
|
779
|
+
return o.replace("#", "");
|
627
780
|
}
|
628
781
|
});
|
629
782
|
}
|
630
|
-
function
|
631
|
-
return
|
783
|
+
function U(e) {
|
784
|
+
return p({
|
632
785
|
queryKey: ["integrations", "3speak", "videos", e],
|
633
786
|
enabled: !!e,
|
634
787
|
queryFn: async () => {
|
635
|
-
await
|
636
|
-
|
788
|
+
await u().prefetchQuery(
|
789
|
+
m(e)
|
637
790
|
);
|
638
|
-
const t =
|
639
|
-
|
791
|
+
const t = u().getQueryData(
|
792
|
+
m(e).queryKey
|
640
793
|
);
|
641
794
|
return await (await fetch(
|
642
795
|
"https://studio.3speak.tv/mobile/api/my-videos",
|
@@ -652,42 +805,42 @@ function W(e) {
|
|
652
805
|
}
|
653
806
|
const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
654
807
|
__proto__: null,
|
655
|
-
getAccountTokenQueryOptions:
|
656
|
-
getAccountVideosQueryOptions:
|
657
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
808
|
+
getAccountTokenQueryOptions: m,
|
809
|
+
getAccountVideosQueryOptions: U
|
810
|
+
}, Symbol.toStringTag, { value: "Module" })), Se = {
|
658
811
|
queries: z
|
659
812
|
};
|
660
|
-
function
|
661
|
-
return
|
813
|
+
function Ke() {
|
814
|
+
return p({
|
662
815
|
queryKey: ["resource-credits", "stats"],
|
663
|
-
queryFn: async () => (await
|
816
|
+
queryFn: async () => (await i.hiveClient.call(
|
664
817
|
"rc_api",
|
665
818
|
"get_rc_stats",
|
666
819
|
{}
|
667
820
|
)).rc_stats
|
668
821
|
});
|
669
822
|
}
|
670
|
-
function
|
671
|
-
return
|
823
|
+
function qe(e) {
|
824
|
+
return p({
|
672
825
|
queryKey: ["resource-credits", "account", e],
|
673
|
-
queryFn: async () => new
|
826
|
+
queryFn: async () => new N(i.hiveClient).findRCAccounts([e]),
|
674
827
|
enabled: !!e
|
675
828
|
});
|
676
829
|
}
|
677
|
-
function
|
678
|
-
return
|
830
|
+
function ke(e, t) {
|
831
|
+
return p({
|
679
832
|
queryKey: ["games", "status-check", t, e],
|
680
833
|
enabled: !!e,
|
681
834
|
queryFn: async () => {
|
682
835
|
if (!e)
|
683
836
|
throw new Error("[SDK][Games] – anon user in status check");
|
684
837
|
return await (await fetch(
|
685
|
-
|
838
|
+
i.privateApiHost + "/private-api/get-game",
|
686
839
|
{
|
687
840
|
method: "POST",
|
688
841
|
body: JSON.stringify({
|
689
842
|
game_type: t,
|
690
|
-
code:
|
843
|
+
code: y(e)
|
691
844
|
}),
|
692
845
|
headers: {
|
693
846
|
"Content-Type": "application/json"
|
@@ -697,8 +850,8 @@ function Ce(e, t) {
|
|
697
850
|
}
|
698
851
|
});
|
699
852
|
}
|
700
|
-
function
|
701
|
-
const { mutateAsync:
|
853
|
+
function Te(e, t, n) {
|
854
|
+
const { mutateAsync: o } = T(
|
702
855
|
e,
|
703
856
|
"spin-rolled"
|
704
857
|
);
|
@@ -708,12 +861,12 @@ function be(e, t, n) {
|
|
708
861
|
if (!e)
|
709
862
|
throw new Error("[SDK][Games] – anon user in game post");
|
710
863
|
return await (await fetch(
|
711
|
-
|
864
|
+
i.privateApiHost + "/private-api/post-game",
|
712
865
|
{
|
713
866
|
method: "POST",
|
714
867
|
body: JSON.stringify({
|
715
868
|
game_type: t,
|
716
|
-
code:
|
869
|
+
code: y(e),
|
717
870
|
key: n
|
718
871
|
}),
|
719
872
|
headers: {
|
@@ -723,16 +876,16 @@ function be(e, t, n) {
|
|
723
876
|
)).json();
|
724
877
|
},
|
725
878
|
onSuccess() {
|
726
|
-
|
879
|
+
o();
|
727
880
|
}
|
728
881
|
});
|
729
882
|
}
|
730
|
-
function
|
731
|
-
return
|
883
|
+
function Ae(e, t, n = 100, o = void 0, r = !0) {
|
884
|
+
return p({
|
732
885
|
queryKey: ["communities", "list", e, t, n],
|
733
|
-
enabled:
|
886
|
+
enabled: r,
|
734
887
|
queryFn: async () => {
|
735
|
-
const c = await
|
888
|
+
const c = await i.hiveClient.call(
|
736
889
|
"bridge",
|
737
890
|
"list_communities",
|
738
891
|
{
|
@@ -740,19 +893,19 @@ function Oe(e, t, n = 100, r = void 0, o = !0) {
|
|
740
893
|
limit: n,
|
741
894
|
sort: e === "hot" ? "rank" : e,
|
742
895
|
query: t || null,
|
743
|
-
observer:
|
896
|
+
observer: o
|
744
897
|
}
|
745
898
|
);
|
746
899
|
return c ? e === "hot" ? c.sort(() => Math.random() - 0.5) : c : [];
|
747
900
|
}
|
748
901
|
});
|
749
902
|
}
|
750
|
-
function
|
751
|
-
return
|
903
|
+
function Qe(e, t) {
|
904
|
+
return p({
|
752
905
|
queryKey: ["community", "context", e, t],
|
753
906
|
enabled: !!e && !!t,
|
754
907
|
queryFn: async () => {
|
755
|
-
const n = await
|
908
|
+
const n = await i.hiveClient.call("bridge", "get_community_context", {
|
756
909
|
account: e,
|
757
910
|
name: t
|
758
911
|
});
|
@@ -763,8 +916,8 @@ function qe(e, t) {
|
|
763
916
|
}
|
764
917
|
});
|
765
918
|
}
|
766
|
-
var
|
767
|
-
const
|
919
|
+
var d = /* @__PURE__ */ ((e) => (e.OWNER = "owner", e.ADMIN = "admin", e.MOD = "mod", e.MEMBER = "member", e.GUEST = "guest", e.MUTED = "muted", e))(d || {});
|
920
|
+
const je = {
|
768
921
|
owner: [
|
769
922
|
"admin",
|
770
923
|
"mod",
|
@@ -787,74 +940,80 @@ const Ke = {
|
|
787
940
|
/* MUTED */
|
788
941
|
]
|
789
942
|
};
|
790
|
-
function
|
943
|
+
function _e(e, t) {
|
791
944
|
return e.startsWith("hive-3") || t === 3 ? "Council" : e.startsWith("hive-2") || t === 2 ? "Journal" : "Topic";
|
792
945
|
}
|
793
|
-
function
|
946
|
+
function Fe({
|
794
947
|
communityType: e,
|
795
948
|
userRole: t,
|
796
949
|
subscribed: n
|
797
950
|
}) {
|
798
|
-
const
|
799
|
-
if (t ===
|
951
|
+
const o = t === d.MUTED ? !1 : e === "Topic" ? !0 : [d.OWNER, d.ADMIN, d.MOD, d.MEMBER].includes(t), r = (() => {
|
952
|
+
if (t === d.MUTED) return !1;
|
800
953
|
switch (e) {
|
801
954
|
case "Topic":
|
802
955
|
return !0;
|
803
956
|
case "Journal":
|
804
|
-
return t !==
|
957
|
+
return t !== d.GUEST || n;
|
805
958
|
case "Council":
|
806
|
-
return
|
959
|
+
return o;
|
807
960
|
}
|
808
|
-
})(), c = [
|
961
|
+
})(), c = [d.OWNER, d.ADMIN, d.MOD].includes(t);
|
809
962
|
return {
|
810
|
-
canPost:
|
811
|
-
canComment:
|
963
|
+
canPost: o,
|
964
|
+
canComment: r,
|
812
965
|
isModerator: c
|
813
966
|
};
|
814
967
|
}
|
815
968
|
export {
|
816
|
-
|
969
|
+
i as CONFIG,
|
817
970
|
O as ConfigManager,
|
818
|
-
|
819
|
-
|
820
|
-
|
971
|
+
Oe as EcencyAnalytics,
|
972
|
+
S as EcencyQueriesManager,
|
973
|
+
W as HiveSignerIntegration,
|
821
974
|
L as Keychain,
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
975
|
+
d as ROLES,
|
976
|
+
Se as ThreeSpeakIntegration,
|
977
|
+
B as broadcastJson,
|
978
|
+
oe as checkUsernameWalletsPendingQueryOptions,
|
979
|
+
y as getAccessToken,
|
827
980
|
te as getAccountFullQueryOptions,
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
981
|
+
qe as getAccountRcQueryOptions,
|
982
|
+
re as getAccountSubscriptionsQueryOptions,
|
983
|
+
ie as getActiveAccountBookmarksQueryOptions,
|
984
|
+
se as getActiveAccountFavouritesQueryOptions,
|
985
|
+
he as getChainPropertiesQueryOptions,
|
986
|
+
Ae as getCommunitiesQueryOptions,
|
987
|
+
Qe as getCommunityContextQueryOptions,
|
988
|
+
Fe as getCommunityPermissions,
|
989
|
+
_e as getCommunityType,
|
990
|
+
b as getFragmentsQueryOptions,
|
991
|
+
ke as getGameStatusCheckQueryOptions,
|
992
|
+
ge as getHiveEngineTokensListQueryOptions,
|
993
|
+
k as getLoginType,
|
994
|
+
q as getPostingKey,
|
995
|
+
ve as getPromotedPostsQuery,
|
996
|
+
u as getQueryClient,
|
997
|
+
Ke as getRcStatsQueryOptions,
|
843
998
|
Z as getRefreshToken,
|
844
|
-
|
999
|
+
H as getRelationshipBetweenAccountsQueryOptions,
|
845
1000
|
ne as getSearchAccountsByUsernameQueryOptions,
|
846
|
-
|
847
|
-
|
1001
|
+
we as getTrendingTagsQueryOptions,
|
1002
|
+
f as getUser,
|
848
1003
|
R as makeQueryClient,
|
849
|
-
|
850
|
-
|
1004
|
+
je as roleMap,
|
1005
|
+
pe as useAccountFavouriteAdd,
|
1006
|
+
ye as useAccountFavouriteDelete,
|
1007
|
+
ae as useAccountRelationsUpdate,
|
851
1008
|
ee as useAccountUpdate,
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
1009
|
+
me as useAddFragment,
|
1010
|
+
ce as useBookmarkAdd,
|
1011
|
+
ue as useBookmarkDelete,
|
1012
|
+
I as useBroadcastMutation,
|
1013
|
+
be as useEditFragment,
|
1014
|
+
Te as useGameClaim,
|
1015
|
+
Ce as useRemoveFragment,
|
1016
|
+
fe as useSignOperationByHivesigner,
|
1017
|
+
le as useSignOperationByKey,
|
1018
|
+
de as useSignOperationByKeychain
|
860
1019
|
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
interface Payload {
|
2
|
+
author: string;
|
3
|
+
permlink: string;
|
4
|
+
}
|
5
|
+
export declare function useBookmarkAdd(username: string | undefined, onSuccess: () => void, onError: (e: Error) => void): import('@tanstack/react-query').UseMutationResult<any, Error, Payload, unknown>;
|
6
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function useBookmarkDelete(username: string | undefined, onSuccess: () => void, onError: (e: Error) => void): import('@tanstack/react-query').UseMutationResult<any, Error, string, unknown>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function useAccountFavouriteAdd(username: string | undefined, onSuccess: () => void, onError: (e: Error) => void): import('@tanstack/react-query').UseMutationResult<any, Error, string, unknown>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function useAccountFavouriteDelete(username: string | undefined, onSuccess: () => void, onError: (e: Error) => void): import('@tanstack/react-query').UseMutationResult<any, Error, string, unknown>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { AccountBookmark } from '../types';
|
2
|
+
export declare function getActiveAccountBookmarksQueryOptions(activeUsername: string | undefined): import('@tanstack/query-core').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<AccountBookmark[], Error, AccountBookmark[], (string | undefined)[]>, "queryFn"> & {
|
3
|
+
queryFn?: import('@tanstack/query-core').QueryFunction<AccountBookmark[], (string | undefined)[], never> | undefined;
|
4
|
+
} & {
|
5
|
+
queryKey: (string | undefined)[] & {
|
6
|
+
[dataTagSymbol]: AccountBookmark[];
|
7
|
+
[dataTagErrorSymbol]: Error;
|
8
|
+
};
|
9
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { AccountFavorite } from '../types';
|
2
|
+
export declare function getActiveAccountFavouritesQueryOptions(activeUsername: string | undefined): import('@tanstack/query-core').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<AccountFavorite[], Error, AccountFavorite[], (string | undefined)[]>, "queryFn"> & {
|
3
|
+
queryFn?: import('@tanstack/query-core').QueryFunction<AccountFavorite[], (string | undefined)[], never> | undefined;
|
4
|
+
} & {
|
5
|
+
queryKey: (string | undefined)[] & {
|
6
|
+
[dataTagSymbol]: AccountFavorite[];
|
7
|
+
[dataTagErrorSymbol]: Error;
|
8
|
+
};
|
9
|
+
};
|
@@ -3,3 +3,5 @@ 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
5
|
export * from './get-account-subscriptions-query-options';
|
6
|
+
export * from './get-active-account-bookmarks-query-options';
|
7
|
+
export * from './get-active-account-favourites-query-options';
|
@@ -1,13 +1,7 @@
|
|
1
1
|
import { ROLES } from '../types';
|
2
2
|
export type CommunityRole = (typeof ROLES)[keyof typeof ROLES];
|
3
3
|
export type CommunityType = "Topic" | "Journal" | "Council";
|
4
|
-
/**
|
5
|
-
* Determine community type based on its `name` or `type_id`
|
6
|
-
*/
|
7
4
|
export declare function getCommunityType(name: string, type_id: number): CommunityType;
|
8
|
-
/**
|
9
|
-
* Compute permissions for a given user role in a community
|
10
|
-
*/
|
11
5
|
export declare function getCommunityPermissions({ communityType, userRole, subscribed, }: {
|
12
6
|
communityType: CommunityType;
|
13
7
|
userRole: CommunityRole;
|