@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.
@@ -2640,24 +2640,21 @@ async function claimHiveEngineRewards(payload, auth) {
2640
2640
  if (payload.type === "key" && "key" in payload) {
2641
2641
  return CONFIG.hiveClient.broadcast.sendOperations([operation], payload.key);
2642
2642
  }
2643
- if (payload.type === "keychain") {
2644
- if (auth?.broadcast) {
2645
- return auth.broadcast([operation], "posting");
2646
- }
2647
- throw new Error("[SDK][Wallets] \u2013 missing broadcaster");
2643
+ if (auth?.broadcast) {
2644
+ return auth.broadcast([operation], "posting");
2645
+ }
2646
+ if (auth?.postingKey) {
2647
+ const key = PrivateKey.fromString(auth.postingKey);
2648
+ return CONFIG.hiveClient.broadcast.sendOperations([operation], key);
2649
+ }
2650
+ if (auth?.accessToken) {
2651
+ const client = new hs.Client({ accessToken: auth.accessToken });
2652
+ return client.broadcast([operation]);
2648
2653
  }
2649
2654
  if (payload.type === "hiveauth") {
2650
- if (auth?.broadcast) {
2651
- return auth.broadcast([operation], "posting");
2652
- }
2653
2655
  return broadcastWithWalletHiveAuth(payload.account, [operation], "posting");
2654
2656
  }
2655
- return hs.sendOperation(
2656
- operation,
2657
- { callback: `https://ecency.com/@${payload.account}/wallet/engine` },
2658
- () => {
2659
- }
2660
- );
2657
+ throw new Error("[SDK][Wallets] \u2013 cannot broadcast without auth context");
2661
2658
  }
2662
2659
  function getPointsQueryOptions(username) {
2663
2660
  return queryOptions({