@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.mjs CHANGED
@@ -3173,21 +3173,21 @@ var useDeposit = (options) => {
3173
3173
  decimals
3174
3174
  });
3175
3175
  } else {
3176
- balance2 = await account5.assetsManager.getBalance(address);
3176
+ balance2 = await account5.assetsManager.getBalance(address, { decimals });
3177
3177
  }
3178
3178
  return balance2;
3179
3179
  },
3180
3180
  []
3181
3181
  );
3182
3182
  const fetchBalance = useCallback(
3183
- async (address) => {
3183
+ async (address, decimals) => {
3184
3184
  if (!address)
3185
3185
  return;
3186
3186
  try {
3187
3187
  if (balanceRevalidating)
3188
3188
  return;
3189
3189
  setBalanceRevalidating(true);
3190
- const balance2 = await fetchBalanceHandler(address);
3190
+ const balance2 = await fetchBalanceHandler(address, decimals);
3191
3191
  console.log("----- refresh balance -----", balance2);
3192
3192
  setBalance(() => balance2);
3193
3193
  setBalanceRevalidating(false);
@@ -3219,15 +3219,11 @@ var useDeposit = (options) => {
3219
3219
  return;
3220
3220
  if (address && isNativeTokenChecker(address))
3221
3221
  return;
3222
- console.log("getAllowance", address, vaultAddress);
3223
3222
  prevAddress.current = key;
3224
3223
  const allowance2 = await account5.assetsManager.getAllowance(
3225
3224
  address,
3226
3225
  vaultAddress
3227
3226
  );
3228
- console.log("----- refresh allowance -----", {
3229
- allowance: allowance2
3230
- });
3231
3227
  setAllowance(() => allowance2);
3232
3228
  return allowance2;
3233
3229
  };
@@ -3256,7 +3252,7 @@ var useDeposit = (options) => {
3256
3252
  useEffect(() => {
3257
3253
  if (state.status < AccountStatusEnum.Connected)
3258
3254
  return;
3259
- fetchBalance(options?.address);
3255
+ fetchBalance(options?.address, options?.decimals);
3260
3256
  if (dst.chainId !== options?.srcChainId) {
3261
3257
  getAllowance(options?.address, options?.crossChainRouteAddress);
3262
3258
  } else {