@orderly.network/vaults 3.0.0-beta.5 → 3.0.0-beta.7
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.d.mts
CHANGED
|
@@ -301,7 +301,8 @@ declare const useVaultCardScript: (vault: VaultInfo) => {
|
|
|
301
301
|
availableBalance: number;
|
|
302
302
|
openVaultWebsite: () => void;
|
|
303
303
|
isWrongNetwork: boolean;
|
|
304
|
-
|
|
304
|
+
isDepositDisabled: boolean;
|
|
305
|
+
isWithdrawDisabled: boolean;
|
|
305
306
|
};
|
|
306
307
|
type VaultCardScript = ReturnType<typeof useVaultCardScript>;
|
|
307
308
|
|
package/dist/index.d.ts
CHANGED
|
@@ -301,7 +301,8 @@ declare const useVaultCardScript: (vault: VaultInfo) => {
|
|
|
301
301
|
availableBalance: number;
|
|
302
302
|
openVaultWebsite: () => void;
|
|
303
303
|
isWrongNetwork: boolean;
|
|
304
|
-
|
|
304
|
+
isDepositDisabled: boolean;
|
|
305
|
+
isWithdrawDisabled: boolean;
|
|
305
306
|
};
|
|
306
307
|
type VaultCardScript = ReturnType<typeof useVaultCardScript>;
|
|
307
308
|
|
package/dist/index.js
CHANGED
|
@@ -1945,7 +1945,6 @@ var init_vaultCard_script = __esm({
|
|
|
1945
1945
|
init_depositAndWithdraw();
|
|
1946
1946
|
init_constants();
|
|
1947
1947
|
exports.useVaultCardScript = (vault) => {
|
|
1948
|
-
const { t } = i18n.useTranslation();
|
|
1949
1948
|
const vaultLpInfo = exports.useVaultLpInfoById(vault.vault_id);
|
|
1950
1949
|
const { fetchVaultLpInfo } = exports.useVaultsStore();
|
|
1951
1950
|
const env = hooks.useGetEnv();
|
|
@@ -1990,9 +1989,12 @@ var init_vaultCard_script = __esm({
|
|
|
1990
1989
|
const isWrongNetwork = React.useMemo(() => {
|
|
1991
1990
|
return state.chainNamespace !== "EVM" && state.chainNamespace !== "SOL" && state.accountId !== state.mainAccountId;
|
|
1992
1991
|
}, [state.chainNamespace, state.accountId, state.mainAccountId]);
|
|
1993
|
-
const
|
|
1992
|
+
const isDepositDisabled = React.useMemo(() => {
|
|
1994
1993
|
return vault.status !== "live";
|
|
1995
1994
|
}, [vault.status]);
|
|
1995
|
+
const isWithdrawDisabled = React.useMemo(() => {
|
|
1996
|
+
return false;
|
|
1997
|
+
}, []);
|
|
1996
1998
|
const openDepositAndWithdraw = (activeTab) => {
|
|
1997
1999
|
ui.modal.show(
|
|
1998
2000
|
isMobile ? exports.VaultDepositAndWithdrawWithSheetId : exports.VaultDepositAndWithdrawWithDialogId,
|
|
@@ -2018,7 +2020,8 @@ var init_vaultCard_script = __esm({
|
|
|
2018
2020
|
availableBalance: memoizedAvailableBalance,
|
|
2019
2021
|
openVaultWebsite,
|
|
2020
2022
|
isWrongNetwork,
|
|
2021
|
-
|
|
2023
|
+
isDepositDisabled,
|
|
2024
|
+
isWithdrawDisabled
|
|
2022
2025
|
};
|
|
2023
2026
|
};
|
|
2024
2027
|
}
|
|
@@ -2087,7 +2090,8 @@ var init_vaultCard_ui = __esm({
|
|
|
2087
2090
|
availableBalance,
|
|
2088
2091
|
openVaultWebsite,
|
|
2089
2092
|
icon,
|
|
2090
|
-
|
|
2093
|
+
isDepositDisabled,
|
|
2094
|
+
isWithdrawDisabled
|
|
2091
2095
|
} = props;
|
|
2092
2096
|
const { t } = i18n.useTranslation();
|
|
2093
2097
|
const { isMobile } = ui.useScreen();
|
|
@@ -2257,7 +2261,8 @@ var init_vaultCard_ui = __esm({
|
|
|
2257
2261
|
isEVMConnected,
|
|
2258
2262
|
isSOLConnected,
|
|
2259
2263
|
openDepositAndWithdraw,
|
|
2260
|
-
|
|
2264
|
+
isDepositDisabled,
|
|
2265
|
+
isWithdrawDisabled
|
|
2261
2266
|
}
|
|
2262
2267
|
)
|
|
2263
2268
|
] })
|
|
@@ -2326,7 +2331,8 @@ var init_vaultCard_ui = __esm({
|
|
|
2326
2331
|
isEVMConnected,
|
|
2327
2332
|
isSOLConnected,
|
|
2328
2333
|
openDepositAndWithdraw,
|
|
2329
|
-
|
|
2334
|
+
isDepositDisabled,
|
|
2335
|
+
isWithdrawDisabled
|
|
2330
2336
|
} = props;
|
|
2331
2337
|
const { t } = i18n.useTranslation();
|
|
2332
2338
|
return /* @__PURE__ */ jsxRuntime.jsx(uiConnector.AuthGuard, { buttonProps: { size: "md", fullWidth: true }, children: isEVMConnected || isSOLConnected ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "oui-flex oui-items-center oui-gap-2", children: [
|
|
@@ -2335,7 +2341,7 @@ var init_vaultCard_ui = __esm({
|
|
|
2335
2341
|
{
|
|
2336
2342
|
className: "oui-flex-1",
|
|
2337
2343
|
size: "md",
|
|
2338
|
-
disabled:
|
|
2344
|
+
disabled: isDepositDisabled,
|
|
2339
2345
|
onClick: () => openDepositAndWithdraw("deposit"),
|
|
2340
2346
|
children: t("common.deposit")
|
|
2341
2347
|
}
|
|
@@ -2346,7 +2352,7 @@ var init_vaultCard_ui = __esm({
|
|
|
2346
2352
|
className: "oui-flex-1",
|
|
2347
2353
|
size: "md",
|
|
2348
2354
|
color: "secondary",
|
|
2349
|
-
disabled:
|
|
2355
|
+
disabled: isWithdrawDisabled,
|
|
2350
2356
|
onClick: () => openDepositAndWithdraw("withdraw"),
|
|
2351
2357
|
children: t("common.withdraw")
|
|
2352
2358
|
}
|
|
@@ -2537,7 +2543,8 @@ var init_vaults_list = __esm({
|
|
|
2537
2543
|
availableBalance,
|
|
2538
2544
|
openVaultWebsite,
|
|
2539
2545
|
icon,
|
|
2540
|
-
|
|
2546
|
+
isDepositDisabled,
|
|
2547
|
+
isWithdrawDisabled
|
|
2541
2548
|
} = script;
|
|
2542
2549
|
vaultInfo.status === "pre_launch";
|
|
2543
2550
|
const { isMobile } = ui.useScreen();
|
|
@@ -2683,7 +2690,7 @@ var init_vaults_list = __esm({
|
|
|
2683
2690
|
{
|
|
2684
2691
|
size: "sm",
|
|
2685
2692
|
className: "oui-flex-1",
|
|
2686
|
-
disabled:
|
|
2693
|
+
disabled: isDepositDisabled,
|
|
2687
2694
|
onClick: () => openDepositAndWithdraw("deposit"),
|
|
2688
2695
|
children: t("common.deposit")
|
|
2689
2696
|
}
|
|
@@ -2694,7 +2701,7 @@ var init_vaults_list = __esm({
|
|
|
2694
2701
|
size: "sm",
|
|
2695
2702
|
color: "secondary",
|
|
2696
2703
|
className: "oui-flex-1",
|
|
2697
|
-
disabled:
|
|
2704
|
+
disabled: isWithdrawDisabled,
|
|
2698
2705
|
onClick: () => openDepositAndWithdraw("withdraw"),
|
|
2699
2706
|
children: t("common.withdraw")
|
|
2700
2707
|
}
|