@orderly.network/hooks 0.0.46 → 0.0.48

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.d.mts CHANGED
@@ -287,7 +287,7 @@ declare const useWithdraw: () => {
287
287
  declare const useDeposit: () => {
288
288
  balance: string;
289
289
  allowance: string;
290
- approve: (amount: string) => Promise<any>;
290
+ approve: (amount: string | undefined) => Promise<any>;
291
291
  deposit: (amount: string) => Promise<any>;
292
292
  };
293
293
 
package/dist/index.d.ts CHANGED
@@ -287,7 +287,7 @@ declare const useWithdraw: () => {
287
287
  declare const useDeposit: () => {
288
288
  balance: string;
289
289
  allowance: string;
290
- approve: (amount: string) => Promise<any>;
290
+ approve: (amount: string | undefined) => Promise<any>;
291
291
  deposit: (amount: string) => Promise<any>;
292
292
  };
293
293
 
package/dist/index.js CHANGED
@@ -1123,7 +1123,7 @@ var usePositionStream = (symbol, options) => {
1123
1123
  const MMR = futures.positions.MMR({
1124
1124
  baseMMR: info("base_mmr"),
1125
1125
  baseIMR: info("base_imr"),
1126
- IMRFactor: accountInfo.imr_factor[info("base")],
1126
+ IMRFactor: accountInfo.imr_factor[item.symbol],
1127
1127
  positionNotional: item.notional,
1128
1128
  IMR_factor_power: 4 / 5
1129
1129
  });
@@ -2044,7 +2044,9 @@ var useDeposit = () => {
2044
2044
  const approve = React2.useCallback(
2045
2045
  (amount) => {
2046
2046
  return account5.assetsManager.approve(amount).then((result) => {
2047
- setAllowance((value) => new utils.Decimal(value).add(amount).toString());
2047
+ if (typeof amount !== "undefined") {
2048
+ setAllowance((value) => new utils.Decimal(value).add(amount).toString());
2049
+ }
2048
2050
  return result;
2049
2051
  });
2050
2052
  },