@orderly.network/hooks 0.0.69 → 0.0.71

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/index.js CHANGED
@@ -3182,21 +3182,21 @@ var useDeposit = (options) => {
3182
3182
  decimals
3183
3183
  });
3184
3184
  } else {
3185
- balance2 = await account5.assetsManager.getBalance(address);
3185
+ balance2 = await account5.assetsManager.getBalance(address, { decimals });
3186
3186
  }
3187
3187
  return balance2;
3188
3188
  },
3189
3189
  []
3190
3190
  );
3191
3191
  const fetchBalance = React2.useCallback(
3192
- async (address) => {
3192
+ async (address, decimals) => {
3193
3193
  if (!address)
3194
3194
  return;
3195
3195
  try {
3196
3196
  if (balanceRevalidating)
3197
3197
  return;
3198
3198
  setBalanceRevalidating(true);
3199
- const balance2 = await fetchBalanceHandler(address);
3199
+ const balance2 = await fetchBalanceHandler(address, decimals);
3200
3200
  console.log("----- refresh balance -----", balance2);
3201
3201
  setBalance(() => balance2);
3202
3202
  setBalanceRevalidating(false);
@@ -3228,15 +3228,11 @@ var useDeposit = (options) => {
3228
3228
  return;
3229
3229
  if (address && isNativeTokenChecker(address))
3230
3230
  return;
3231
- console.log("getAllowance", address, vaultAddress);
3232
3231
  prevAddress.current = key;
3233
3232
  const allowance2 = await account5.assetsManager.getAllowance(
3234
3233
  address,
3235
3234
  vaultAddress
3236
3235
  );
3237
- console.log("----- refresh allowance -----", {
3238
- allowance: allowance2
3239
- });
3240
3236
  setAllowance(() => allowance2);
3241
3237
  return allowance2;
3242
3238
  };
@@ -3265,7 +3261,7 @@ var useDeposit = (options) => {
3265
3261
  React2.useEffect(() => {
3266
3262
  if (state.status < types.AccountStatusEnum.Connected)
3267
3263
  return;
3268
- fetchBalance(options?.address);
3264
+ fetchBalance(options?.address, options?.decimals);
3269
3265
  if (dst.chainId !== options?.srcChainId) {
3270
3266
  getAllowance(options?.address, options?.crossChainRouteAddress);
3271
3267
  } else {