@orderly.network/vaults 3.0.0-beta.5 → 3.0.0-beta.6
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +18 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
package/dist/index.mjs
CHANGED
|
@@ -1939,7 +1939,6 @@ var init_vaultCard_script = __esm({
|
|
|
1939
1939
|
init_depositAndWithdraw();
|
|
1940
1940
|
init_constants();
|
|
1941
1941
|
useVaultCardScript = (vault) => {
|
|
1942
|
-
const { t } = useTranslation();
|
|
1943
1942
|
const vaultLpInfo = useVaultLpInfoById(vault.vault_id);
|
|
1944
1943
|
const { fetchVaultLpInfo } = useVaultsStore();
|
|
1945
1944
|
const env = useGetEnv();
|
|
@@ -1984,9 +1983,12 @@ var init_vaultCard_script = __esm({
|
|
|
1984
1983
|
const isWrongNetwork = useMemo(() => {
|
|
1985
1984
|
return state.chainNamespace !== "EVM" && state.chainNamespace !== "SOL" && state.accountId !== state.mainAccountId;
|
|
1986
1985
|
}, [state.chainNamespace, state.accountId, state.mainAccountId]);
|
|
1987
|
-
const
|
|
1986
|
+
const isDepositDisabled = useMemo(() => {
|
|
1988
1987
|
return vault.status !== "live";
|
|
1989
1988
|
}, [vault.status]);
|
|
1989
|
+
const isWithdrawDisabled = useMemo(() => {
|
|
1990
|
+
return false;
|
|
1991
|
+
}, []);
|
|
1990
1992
|
const openDepositAndWithdraw = (activeTab) => {
|
|
1991
1993
|
modal.show(
|
|
1992
1994
|
isMobile ? VaultDepositAndWithdrawWithSheetId : VaultDepositAndWithdrawWithDialogId,
|
|
@@ -2012,7 +2014,8 @@ var init_vaultCard_script = __esm({
|
|
|
2012
2014
|
availableBalance: memoizedAvailableBalance,
|
|
2013
2015
|
openVaultWebsite,
|
|
2014
2016
|
isWrongNetwork,
|
|
2015
|
-
|
|
2017
|
+
isDepositDisabled,
|
|
2018
|
+
isWithdrawDisabled
|
|
2016
2019
|
};
|
|
2017
2020
|
};
|
|
2018
2021
|
}
|
|
@@ -2081,7 +2084,8 @@ var init_vaultCard_ui = __esm({
|
|
|
2081
2084
|
availableBalance,
|
|
2082
2085
|
openVaultWebsite,
|
|
2083
2086
|
icon,
|
|
2084
|
-
|
|
2087
|
+
isDepositDisabled,
|
|
2088
|
+
isWithdrawDisabled
|
|
2085
2089
|
} = props;
|
|
2086
2090
|
const { t } = useTranslation();
|
|
2087
2091
|
const { isMobile } = useScreen();
|
|
@@ -2251,7 +2255,8 @@ var init_vaultCard_ui = __esm({
|
|
|
2251
2255
|
isEVMConnected,
|
|
2252
2256
|
isSOLConnected,
|
|
2253
2257
|
openDepositAndWithdraw,
|
|
2254
|
-
|
|
2258
|
+
isDepositDisabled,
|
|
2259
|
+
isWithdrawDisabled
|
|
2255
2260
|
}
|
|
2256
2261
|
)
|
|
2257
2262
|
] })
|
|
@@ -2320,7 +2325,8 @@ var init_vaultCard_ui = __esm({
|
|
|
2320
2325
|
isEVMConnected,
|
|
2321
2326
|
isSOLConnected,
|
|
2322
2327
|
openDepositAndWithdraw,
|
|
2323
|
-
|
|
2328
|
+
isDepositDisabled,
|
|
2329
|
+
isWithdrawDisabled
|
|
2324
2330
|
} = props;
|
|
2325
2331
|
const { t } = useTranslation();
|
|
2326
2332
|
return /* @__PURE__ */ jsx(AuthGuard, { buttonProps: { size: "md", fullWidth: true }, children: isEVMConnected || isSOLConnected ? /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-gap-2", children: [
|
|
@@ -2329,7 +2335,7 @@ var init_vaultCard_ui = __esm({
|
|
|
2329
2335
|
{
|
|
2330
2336
|
className: "oui-flex-1",
|
|
2331
2337
|
size: "md",
|
|
2332
|
-
disabled:
|
|
2338
|
+
disabled: isDepositDisabled,
|
|
2333
2339
|
onClick: () => openDepositAndWithdraw("deposit"),
|
|
2334
2340
|
children: t("common.deposit")
|
|
2335
2341
|
}
|
|
@@ -2340,7 +2346,7 @@ var init_vaultCard_ui = __esm({
|
|
|
2340
2346
|
className: "oui-flex-1",
|
|
2341
2347
|
size: "md",
|
|
2342
2348
|
color: "secondary",
|
|
2343
|
-
disabled:
|
|
2349
|
+
disabled: isWithdrawDisabled,
|
|
2344
2350
|
onClick: () => openDepositAndWithdraw("withdraw"),
|
|
2345
2351
|
children: t("common.withdraw")
|
|
2346
2352
|
}
|
|
@@ -2531,7 +2537,8 @@ var init_vaults_list = __esm({
|
|
|
2531
2537
|
availableBalance,
|
|
2532
2538
|
openVaultWebsite,
|
|
2533
2539
|
icon,
|
|
2534
|
-
|
|
2540
|
+
isDepositDisabled,
|
|
2541
|
+
isWithdrawDisabled
|
|
2535
2542
|
} = script;
|
|
2536
2543
|
vaultInfo.status === "pre_launch";
|
|
2537
2544
|
const { isMobile } = useScreen();
|
|
@@ -2677,7 +2684,7 @@ var init_vaults_list = __esm({
|
|
|
2677
2684
|
{
|
|
2678
2685
|
size: "sm",
|
|
2679
2686
|
className: "oui-flex-1",
|
|
2680
|
-
disabled:
|
|
2687
|
+
disabled: isDepositDisabled,
|
|
2681
2688
|
onClick: () => openDepositAndWithdraw("deposit"),
|
|
2682
2689
|
children: t("common.deposit")
|
|
2683
2690
|
}
|
|
@@ -2688,7 +2695,7 @@ var init_vaults_list = __esm({
|
|
|
2688
2695
|
size: "sm",
|
|
2689
2696
|
color: "secondary",
|
|
2690
2697
|
className: "oui-flex-1",
|
|
2691
|
-
disabled:
|
|
2698
|
+
disabled: isWithdrawDisabled,
|
|
2692
2699
|
onClick: () => openDepositAndWithdraw("withdraw"),
|
|
2693
2700
|
children: t("common.withdraw")
|
|
2694
2701
|
}
|