@ecency/wallets 1.5.16 → 1.5.18
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/browser/index.d.ts +1 -1
- package/dist/browser/index.js +11 -14
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +11 -14
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +11 -14
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.d.ts
CHANGED
|
@@ -1574,7 +1574,7 @@ interface ClaimRewardsPayload<T extends HiveBasedAssetSignType> {
|
|
|
1574
1574
|
}
|
|
1575
1575
|
declare function claimHiveEngineRewards<T extends HiveBasedAssetSignType>(payload: T extends "key" ? ClaimRewardsPayload<T> & {
|
|
1576
1576
|
key: PrivateKey;
|
|
1577
|
-
} : ClaimRewardsPayload<T>, auth?: AuthContext): Promise<
|
|
1577
|
+
} : ClaimRewardsPayload<T>, auth?: AuthContext): Promise<any>;
|
|
1578
1578
|
|
|
1579
1579
|
declare function useClaimPoints(username: string | undefined, accessToken: string | undefined, onSuccess?: () => void, onError?: Parameters<typeof useMutation>["0"]["onError"]): _tanstack_react_query.UseMutationResult<any, unknown, unknown, unknown>;
|
|
1580
1580
|
|
package/dist/browser/index.js
CHANGED
|
@@ -2642,24 +2642,21 @@ async function claimHiveEngineRewards(payload, auth) {
|
|
|
2642
2642
|
if (payload.type === "key" && "key" in payload) {
|
|
2643
2643
|
return CONFIG.hiveClient.broadcast.sendOperations([operation], payload.key);
|
|
2644
2644
|
}
|
|
2645
|
-
if (
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2645
|
+
if (auth?.broadcast) {
|
|
2646
|
+
return auth.broadcast([operation], "posting");
|
|
2647
|
+
}
|
|
2648
|
+
if (auth?.postingKey) {
|
|
2649
|
+
const key = PrivateKey.fromString(auth.postingKey);
|
|
2650
|
+
return CONFIG.hiveClient.broadcast.sendOperations([operation], key);
|
|
2651
|
+
}
|
|
2652
|
+
if (auth?.accessToken) {
|
|
2653
|
+
const client = new hs.Client({ accessToken: auth.accessToken });
|
|
2654
|
+
return client.broadcast([operation]);
|
|
2650
2655
|
}
|
|
2651
2656
|
if (payload.type === "hiveauth") {
|
|
2652
|
-
if (auth?.broadcast) {
|
|
2653
|
-
return auth.broadcast([operation], "posting");
|
|
2654
|
-
}
|
|
2655
2657
|
return broadcastWithWalletHiveAuth(payload.account, [operation], "posting");
|
|
2656
2658
|
}
|
|
2657
|
-
|
|
2658
|
-
operation,
|
|
2659
|
-
{ callback: `https://ecency.com/@${payload.account}/wallet/engine` },
|
|
2660
|
-
() => {
|
|
2661
|
-
}
|
|
2662
|
-
);
|
|
2659
|
+
throw new Error("[SDK][Wallets] \u2013 cannot broadcast without auth context");
|
|
2663
2660
|
}
|
|
2664
2661
|
function getPointsQueryOptions(username) {
|
|
2665
2662
|
return queryOptions({
|