@ecency/sdk 1.1.6 → 1.1.8
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/README.md +30 -0
- package/dist/ecency-sdk.es.js +10 -9
- package/dist/modules/core/config.d.ts +1 -0
- package/package.json +1 -1
package/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# @ecency/sdk
|
2
|
+
|
3
|
+
Utilities for building Hive applications with React and TypeScript.
|
4
|
+
|
5
|
+
## Features
|
6
|
+
|
7
|
+
- Query and mutation option builders powered by [@tanstack/react-query](https://tanstack.com/query)
|
8
|
+
- Modules for accounts, posts, operations, communities, games, analytics, keychain integrations, and more
|
9
|
+
- Configurable Hive RPC client and storage via the `CONFIG` object
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
```sh
|
14
|
+
yarn add @ecency/sdk
|
15
|
+
# or
|
16
|
+
npm install @ecency/sdk
|
17
|
+
```
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
```ts
|
22
|
+
import { getAccountFullQueryOptions, ConfigManager } from '@ecency/sdk';
|
23
|
+
import { useQuery } from '@tanstack/react-query';
|
24
|
+
|
25
|
+
// optionally provide a custom QueryClient
|
26
|
+
// ConfigManager.setQueryClient(myQueryClient);
|
27
|
+
|
28
|
+
const { data } = useQuery(getAccountFullQueryOptions('ecency'));
|
29
|
+
```
|
30
|
+
|
package/dist/ecency-sdk.es.js
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
var V = Object.defineProperty;
|
2
2
|
var W = (e, t, n) => t in e ? V(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
3
|
-
var
|
3
|
+
var K = (e, t, n) => W(e, typeof t != "symbol" ? t + "" : t, n);
|
4
4
|
import { QueryClient as A, useMutation as d, useQuery as j, useInfiniteQuery as z, queryOptions as p, useQueryClient as U, infiniteQueryOptions as $ } from "@tanstack/react-query";
|
5
5
|
import { Client as R, PrivateKey as v, cryptoUtils as X, RCAPI as Y } from "@hiveio/dhive";
|
6
6
|
import m from "hivesigner";
|
7
7
|
import * as C from "remeda";
|
8
8
|
class Z {
|
9
9
|
constructor() {
|
10
|
-
|
10
|
+
K(this, "length", 0);
|
11
11
|
}
|
12
12
|
clear() {
|
13
13
|
throw new Error("Method not implemented.");
|
@@ -50,17 +50,18 @@ const i = {
|
|
50
50
|
}
|
51
51
|
),
|
52
52
|
heliusApiKey: void 0,
|
53
|
+
bitqueryApiKey: void 0,
|
53
54
|
queryClient: new A(),
|
54
55
|
plausibleHost: "https://pl.ecency.com",
|
55
56
|
spkNode: "https://spk.good-karma.xyz"
|
56
57
|
};
|
57
|
-
var
|
58
|
+
var k;
|
58
59
|
((e) => {
|
59
60
|
function t(n) {
|
60
61
|
i.queryClient = n;
|
61
62
|
}
|
62
63
|
e.setQueryClient = t;
|
63
|
-
})(
|
64
|
+
})(k || (k = {}));
|
64
65
|
function L(e) {
|
65
66
|
let t = atob(e);
|
66
67
|
if (t[0] === "{")
|
@@ -544,7 +545,7 @@ function Oe(e, t, n, o) {
|
|
544
545
|
}
|
545
546
|
});
|
546
547
|
}
|
547
|
-
function
|
548
|
+
function Ke(e, t, n) {
|
548
549
|
return d({
|
549
550
|
mutationKey: ["accounts", "bookmarks", "add", e],
|
550
551
|
mutationFn: async ({ author: o, permlink: r }) => {
|
@@ -573,7 +574,7 @@ function ke(e, t, n) {
|
|
573
574
|
onError: n
|
574
575
|
});
|
575
576
|
}
|
576
|
-
function
|
577
|
+
function ke(e, t, n) {
|
577
578
|
return d({
|
578
579
|
mutationKey: ["accounts", "bookmarks", "delete", e],
|
579
580
|
mutationFn: async (o) => {
|
@@ -1113,7 +1114,7 @@ function Re({
|
|
1113
1114
|
}
|
1114
1115
|
export {
|
1115
1116
|
i as CONFIG,
|
1116
|
-
|
1117
|
+
k as ConfigManager,
|
1117
1118
|
Ie as EcencyAnalytics,
|
1118
1119
|
q as EcencyQueriesManager,
|
1119
1120
|
ae as HiveSignerIntegration,
|
@@ -1154,8 +1155,8 @@ export {
|
|
1154
1155
|
Oe as useAccountRelationsUpdate,
|
1155
1156
|
Se as useAccountUpdate,
|
1156
1157
|
Ee as useAddFragment,
|
1157
|
-
|
1158
|
-
|
1158
|
+
Ke as useBookmarkAdd,
|
1159
|
+
ke as useBookmarkDelete,
|
1159
1160
|
ne as useBroadcastMutation,
|
1160
1161
|
Be as useEditFragment,
|
1161
1162
|
Ve as useGameClaim,
|