@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.
@@ -2667,24 +2667,21 @@ async function claimHiveEngineRewards(payload, auth) {
2667
2667
  if (payload.type === "key" && "key" in payload) {
2668
2668
  return sdk.CONFIG.hiveClient.broadcast.sendOperations([operation], payload.key);
2669
2669
  }
2670
- if (payload.type === "keychain") {
2671
- if (auth?.broadcast) {
2672
- return auth.broadcast([operation], "posting");
2673
- }
2674
- throw new Error("[SDK][Wallets] \u2013 missing broadcaster");
2670
+ if (auth?.broadcast) {
2671
+ return auth.broadcast([operation], "posting");
2672
+ }
2673
+ if (auth?.postingKey) {
2674
+ const key = dhive.PrivateKey.fromString(auth.postingKey);
2675
+ return sdk.CONFIG.hiveClient.broadcast.sendOperations([operation], key);
2676
+ }
2677
+ if (auth?.accessToken) {
2678
+ const client = new hs__default.default.Client({ accessToken: auth.accessToken });
2679
+ return client.broadcast([operation]);
2675
2680
  }
2676
2681
  if (payload.type === "hiveauth") {
2677
- if (auth?.broadcast) {
2678
- return auth.broadcast([operation], "posting");
2679
- }
2680
2682
  return broadcastWithWalletHiveAuth(payload.account, [operation], "posting");
2681
2683
  }
2682
- return hs__default.default.sendOperation(
2683
- operation,
2684
- { callback: `https://ecency.com/@${payload.account}/wallet/engine` },
2685
- () => {
2686
- }
2687
- );
2684
+ throw new Error("[SDK][Wallets] \u2013 cannot broadcast without auth context");
2688
2685
  }
2689
2686
  function getPointsQueryOptions(username) {
2690
2687
  return reactQuery.queryOptions({