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