@orderly.network/hooks 0.0.45 → 0.0.47
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -1111,10 +1111,11 @@ var usePositionStream = (symbol, options) => {
|
|
|
1111
1111
|
const total = totalCollateral.toNumber();
|
|
1112
1112
|
return formatedPositions[0].filter((item) => item.position_qty !== 0).map((item) => {
|
|
1113
1113
|
const info = symbolInfo == null ? void 0 : symbolInfo[item.symbol];
|
|
1114
|
+
console.log("******", accountInfo, info("base"));
|
|
1114
1115
|
const MMR = positions.MMR({
|
|
1115
1116
|
baseMMR: info("base_mmr"),
|
|
1116
1117
|
baseIMR: info("base_imr"),
|
|
1117
|
-
IMRFactor: accountInfo.imr_factor[
|
|
1118
|
+
IMRFactor: accountInfo.imr_factor[item.symbol],
|
|
1118
1119
|
positionNotional: item.notional,
|
|
1119
1120
|
IMR_factor_power: 4 / 5
|
|
1120
1121
|
});
|
|
@@ -2035,7 +2036,9 @@ var useDeposit = () => {
|
|
|
2035
2036
|
const approve = useCallback(
|
|
2036
2037
|
(amount) => {
|
|
2037
2038
|
return account5.assetsManager.approve(amount).then((result) => {
|
|
2038
|
-
|
|
2039
|
+
if (typeof amount !== "undefined") {
|
|
2040
|
+
setAllowance((value) => new Decimal(value).add(amount).toString());
|
|
2041
|
+
}
|
|
2039
2042
|
return result;
|
|
2040
2043
|
});
|
|
2041
2044
|
},
|