@ecency/sdk 1.0.44 → 1.0.45
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
var Q = Object.defineProperty;
|
2
2
|
var _ = (e, t, n) => t in e ? Q(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
3
3
|
var m = (e, t, n) => _(e, typeof t != "symbol" ? t + "" : t, n);
|
4
|
-
import { QueryClient as S, useMutation as y, useQuery as
|
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
5
|
import { Client as A, PrivateKey as h, cryptoUtils as F, RCAPI as D } from "@hiveio/dhive";
|
6
6
|
import d from "hivesigner";
|
7
7
|
class P {
|
@@ -74,7 +74,7 @@ const f = (e) => {
|
|
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,
|
77
|
+
}, l = (e) => f(e) && f(e).accessToken, q = (e) => f(e) && f(e).postingKey, V = (e) => f(e) && f(e).refreshToken;
|
78
78
|
function N(e = [], t, n) {
|
79
79
|
return y({
|
80
80
|
mutationKey: [...e, t],
|
@@ -165,7 +165,7 @@ var O;
|
|
165
165
|
return {
|
166
166
|
prefetch: () => r(a),
|
167
167
|
getData: () => t(a.queryKey),
|
168
|
-
useClientQuery: () =>
|
168
|
+
useClientQuery: () => T(a),
|
169
169
|
fetchAndGet: () => c().fetchQuery(a)
|
170
170
|
};
|
171
171
|
}
|
@@ -174,7 +174,7 @@ var O;
|
|
174
174
|
return {
|
175
175
|
prefetch: () => o(a),
|
176
176
|
getData: () => n(a.queryKey),
|
177
|
-
useClientQuery: () =>
|
177
|
+
useClientQuery: () => j(a),
|
178
178
|
fetchAndGet: () => c().fetchInfiniteQuery(a)
|
179
179
|
};
|
180
180
|
}
|
@@ -338,7 +338,7 @@ function ne(e) {
|
|
338
338
|
}
|
339
339
|
});
|
340
340
|
}
|
341
|
-
function
|
341
|
+
function E() {
|
342
342
|
return new Promise((e) => {
|
343
343
|
var t;
|
344
344
|
(t = window.hive_keychain) == null || t.requestHandshake(() => {
|
@@ -346,7 +346,7 @@ function B() {
|
|
346
346
|
});
|
347
347
|
});
|
348
348
|
}
|
349
|
-
const
|
349
|
+
const K = (e, t, n, r = null) => new Promise((o, u) => {
|
350
350
|
var i;
|
351
351
|
(i = window.hive_keychain) == null || i.requestBroadcast(
|
352
352
|
e,
|
@@ -359,8 +359,8 @@ const b = (e, t, n, r = null) => new Promise((o, u) => {
|
|
359
359
|
);
|
360
360
|
}), re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
361
361
|
__proto__: null,
|
362
|
-
broadcast:
|
363
|
-
handshake:
|
362
|
+
broadcast: K,
|
363
|
+
handshake: E
|
364
364
|
}, Symbol.toStringTag, { value: "Module" }));
|
365
365
|
function oe(e, t = "Active") {
|
366
366
|
return y({
|
@@ -370,7 +370,7 @@ function oe(e, t = "Active") {
|
|
370
370
|
throw new Error(
|
371
371
|
"[SDK][Keychain] – cannot sign operation with anon user"
|
372
372
|
);
|
373
|
-
return
|
373
|
+
return K(e, [n], t);
|
374
374
|
}
|
375
375
|
});
|
376
376
|
}
|
@@ -413,7 +413,7 @@ function ae(e, t) {
|
|
413
413
|
});
|
414
414
|
}
|
415
415
|
function ce(e = 20) {
|
416
|
-
return
|
416
|
+
return k({
|
417
417
|
queryKey: ["posts", "trending-tags"],
|
418
418
|
queryFn: async ({ pageParam: { afterTag: t } }) => s.hiveClient.database.call("get_trending_tags", [t, e]).then(
|
419
419
|
(n) => n.filter((r) => r.name !== "").filter((r) => !r.name.startsWith("hive-")).map((r) => r.name)
|
@@ -444,7 +444,23 @@ function v(e) {
|
|
444
444
|
enabled: !!e
|
445
445
|
});
|
446
446
|
}
|
447
|
-
function ue(e) {
|
447
|
+
function ue(e = "feed") {
|
448
|
+
return p({
|
449
|
+
queryKey: ["posts", "promoted", e],
|
450
|
+
queryFn: async () => {
|
451
|
+
const t = new URL(
|
452
|
+
s.privateApiHost + "/private-api/promoted-entries"
|
453
|
+
);
|
454
|
+
return e === "waves" && t.searchParams.append("short_content", "1"), await (await fetch(t.toString(), {
|
455
|
+
method: "GET",
|
456
|
+
headers: {
|
457
|
+
"Content-Type": "application/json"
|
458
|
+
}
|
459
|
+
})).json();
|
460
|
+
}
|
461
|
+
});
|
462
|
+
}
|
463
|
+
function pe(e) {
|
448
464
|
return y({
|
449
465
|
mutationKey: ["posts", "add-fragment", e],
|
450
466
|
mutationFn: async ({ title: t, body: n }) => (await fetch(
|
@@ -469,7 +485,7 @@ function ue(e) {
|
|
469
485
|
}
|
470
486
|
});
|
471
487
|
}
|
472
|
-
function
|
488
|
+
function ye(e, t) {
|
473
489
|
return y({
|
474
490
|
mutationKey: ["posts", "edit-fragment", e, t],
|
475
491
|
mutationFn: async ({ title: n, body: r }) => (await fetch(
|
@@ -500,7 +516,7 @@ function pe(e, t) {
|
|
500
516
|
}
|
501
517
|
});
|
502
518
|
}
|
503
|
-
function
|
519
|
+
function le(e, t) {
|
504
520
|
return y({
|
505
521
|
mutationKey: ["posts", "remove-fragment", e],
|
506
522
|
mutationFn: async () => fetch(s.privateApiHost + "/private-api/fragments-delete", {
|
@@ -521,7 +537,7 @@ function ye(e, t) {
|
|
521
537
|
}
|
522
538
|
});
|
523
539
|
}
|
524
|
-
function
|
540
|
+
function b(e, t) {
|
525
541
|
return y({
|
526
542
|
mutationKey: ["analytics", t],
|
527
543
|
mutationFn: async () => {
|
@@ -544,11 +560,11 @@ function K(e, t) {
|
|
544
560
|
}
|
545
561
|
});
|
546
562
|
}
|
547
|
-
const
|
563
|
+
const fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
548
564
|
__proto__: null,
|
549
|
-
useRecordActivity:
|
565
|
+
useRecordActivity: b
|
550
566
|
}, Symbol.toStringTag, { value: "Module" }));
|
551
|
-
function
|
567
|
+
function B(e, t) {
|
552
568
|
return p({
|
553
569
|
queryKey: ["integrations", "hivesigner", "decode-memo", e],
|
554
570
|
queryFn: async () => {
|
@@ -562,7 +578,7 @@ function E(e, t) {
|
|
562
578
|
}
|
563
579
|
const M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
564
580
|
__proto__: null,
|
565
|
-
getDecodeMemoQueryOptions:
|
581
|
+
getDecodeMemoQueryOptions: B
|
566
582
|
}, Symbol.toStringTag, { value: "Module" })), x = {
|
567
583
|
queries: M
|
568
584
|
};
|
@@ -619,10 +635,10 @@ const U = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
619
635
|
__proto__: null,
|
620
636
|
getAccountTokenQueryOptions: w,
|
621
637
|
getAccountVideosQueryOptions: G
|
622
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
638
|
+
}, Symbol.toStringTag, { value: "Module" })), he = {
|
623
639
|
queries: U
|
624
640
|
};
|
625
|
-
function
|
641
|
+
function de() {
|
626
642
|
return p({
|
627
643
|
queryKey: ["resource-credits", "stats"],
|
628
644
|
queryFn: async () => (await s.hiveClient.call(
|
@@ -632,14 +648,14 @@ function he() {
|
|
632
648
|
)).rc_stats
|
633
649
|
});
|
634
650
|
}
|
635
|
-
function
|
651
|
+
function ge(e) {
|
636
652
|
return p({
|
637
653
|
queryKey: ["resource-credits", "account", e],
|
638
654
|
queryFn: async () => new D(s.hiveClient).findRCAccounts([e]),
|
639
655
|
enabled: !!e
|
640
656
|
});
|
641
657
|
}
|
642
|
-
function
|
658
|
+
function we(e, t) {
|
643
659
|
return p({
|
644
660
|
queryKey: ["games", "status-check", t, e],
|
645
661
|
enabled: !!e,
|
@@ -662,8 +678,8 @@ function ge(e, t) {
|
|
662
678
|
}
|
663
679
|
});
|
664
680
|
}
|
665
|
-
function
|
666
|
-
const { mutateAsync: r } =
|
681
|
+
function ve(e, t, n) {
|
682
|
+
const { mutateAsync: r } = b(
|
667
683
|
e,
|
668
684
|
"spin-rolled"
|
669
685
|
);
|
@@ -695,24 +711,25 @@ function we(e, t, n) {
|
|
695
711
|
export {
|
696
712
|
s as CONFIG,
|
697
713
|
C as ConfigManager,
|
698
|
-
|
714
|
+
fe as EcencyAnalytics,
|
699
715
|
O as EcencyQueriesManager,
|
700
716
|
x as HiveSignerIntegration,
|
701
717
|
re as Keychain,
|
702
|
-
|
718
|
+
he as ThreeSpeakIntegration,
|
703
719
|
J as broadcastJson,
|
704
720
|
ee as checkUsernameWalletsPendingQueryOptions,
|
705
721
|
l as getAccessToken,
|
706
722
|
Z as getAccountFullQueryOptions,
|
707
|
-
|
723
|
+
ge as getAccountRcQueryOptions,
|
708
724
|
se as getChainPropertiesQueryOptions,
|
709
725
|
v as getFragmentsQueryOptions,
|
710
|
-
|
726
|
+
we as getGameStatusCheckQueryOptions,
|
711
727
|
ae as getHiveEngineTokensListQueryOptions,
|
712
728
|
q as getPostingKey,
|
729
|
+
ue as getPromotedPostsQuery,
|
713
730
|
c as getQueryClient,
|
714
|
-
|
715
|
-
|
731
|
+
de as getRcStatsQueryOptions,
|
732
|
+
V as getRefreshToken,
|
716
733
|
H as getRelationshipBetweenAccountsQueryOptions,
|
717
734
|
R as getSearchAccountsByUsernameQueryOptions,
|
718
735
|
ce as getTrendingTagsQueryOptions,
|
@@ -720,11 +737,11 @@ export {
|
|
720
737
|
X as makeQueryClient,
|
721
738
|
te as useAccountRelationsUpdate,
|
722
739
|
Y as useAccountUpdate,
|
723
|
-
|
740
|
+
pe as useAddFragment,
|
724
741
|
N as useBroadcastMutation,
|
725
|
-
|
726
|
-
|
727
|
-
|
742
|
+
ye as useEditFragment,
|
743
|
+
ve as useGameClaim,
|
744
|
+
le as useRemoveFragment,
|
728
745
|
ie as useSignOperationByHivesigner,
|
729
746
|
ne as useSignOperationByKey,
|
730
747
|
oe as useSignOperationByKeychain
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export declare function getPromotedPostsQuery<T extends any>(type?: "feed" | "waves"): import('@tanstack/query-core').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<T[], Error, T[], string[]>, "queryFn"> & {
|
2
|
+
queryFn?: import('@tanstack/query-core').QueryFunction<T[], string[], never> | undefined;
|
3
|
+
} & {
|
4
|
+
queryKey: string[] & {
|
5
|
+
[dataTagSymbol]: T[];
|
6
|
+
[dataTagErrorSymbol]: Error;
|
7
|
+
};
|
8
|
+
};
|