@ecency/wallets 1.4.23 → 1.4.25

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.
@@ -1193,13 +1193,16 @@ function getHivePowerDelegatingsQueryOptions(username) {
1193
1193
  async function transferHive(payload) {
1194
1194
  const parsedAsset = parseAsset(payload.amount);
1195
1195
  const token = parsedAsset.symbol;
1196
+ const precision = token === "VESTS" /* VESTS */ ? 6 : 3;
1197
+ const formattedAmount = parsedAsset.amount.toFixed(precision);
1198
+ const amountWithSymbol = `${formattedAmount} ${token}`;
1196
1199
  if (payload.type === "key" && "key" in payload) {
1197
1200
  const { key, type, ...params } = payload;
1198
1201
  return CONFIG.hiveClient.broadcast.transfer(
1199
1202
  {
1200
1203
  from: params.from,
1201
1204
  to: params.to,
1202
- amount: params.amount,
1205
+ amount: amountWithSymbol,
1203
1206
  memo: params.memo
1204
1207
  },
1205
1208
  key
@@ -1209,7 +1212,7 @@ async function transferHive(payload) {
1209
1212
  (resolve, reject) => window.hive_keychain?.requestTransfer(
1210
1213
  payload.from,
1211
1214
  payload.to,
1212
- payload.amount,
1215
+ formattedAmount,
1213
1216
  payload.memo,
1214
1217
  token,
1215
1218
  (resp) => {
@@ -1229,7 +1232,7 @@ async function transferHive(payload) {
1229
1232
  {
1230
1233
  from: payload.from,
1231
1234
  to: payload.to,
1232
- amount: payload.amount,
1235
+ amount: amountWithSymbol,
1233
1236
  memo: payload.memo
1234
1237
  }
1235
1238
  ],
@@ -3677,15 +3680,29 @@ function useWalletOperation(username, asset, operation) {
3677
3680
  },
3678
3681
  onSuccess: () => {
3679
3682
  recordActivity();
3680
- const query = getAccountWalletAssetInfoQueryOptions(username, asset, {
3681
- refetch: true
3683
+ const assetsToRefresh = /* @__PURE__ */ new Set([asset]);
3684
+ if (asset === "HIVE") {
3685
+ assetsToRefresh.add("HP");
3686
+ assetsToRefresh.add("HIVE");
3687
+ }
3688
+ if (asset === "HBD") {
3689
+ assetsToRefresh.add("HBD");
3690
+ }
3691
+ if (asset === "LARYNX" && operation === "power-up" /* PowerUp */) {
3692
+ assetsToRefresh.add("LP");
3693
+ assetsToRefresh.add("LARYNX");
3694
+ }
3695
+ assetsToRefresh.forEach((symbol) => {
3696
+ const query = getAccountWalletAssetInfoQueryOptions(username, symbol, {
3697
+ refetch: true
3698
+ });
3699
+ setTimeout(
3700
+ () => getQueryClient().invalidateQueries({
3701
+ queryKey: query.queryKey
3702
+ }),
3703
+ 5e3
3704
+ );
3682
3705
  });
3683
- setTimeout(
3684
- () => getQueryClient().invalidateQueries({
3685
- queryKey: query.queryKey
3686
- }),
3687
- 5e3
3688
- );
3689
3706
  }
3690
3707
  });
3691
3708
  }