diff --git a/package.json b/package.json index 8d6fe33ee..d72191f1b 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "@cosmjs/tendermint-rpc": "^0.32.1", "@dydxprotocol/v4-abacus": "^1.7.72", "@dydxprotocol/v4-client-js": "^1.1.15", - "@dydxprotocol/v4-localization": "^1.1.118", + "@dydxprotocol/v4-localization": "^1.1.121", "@ethersproject/providers": "^5.7.2", "@js-joda/core": "^5.5.3", "@privy-io/react-auth": "^1.66.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0f93eca18..060e44e7d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,8 +36,8 @@ dependencies: specifier: ^1.1.15 version: 1.1.15 '@dydxprotocol/v4-localization': - specifier: ^1.1.118 - version: 1.1.118 + specifier: ^1.1.121 + version: 1.1.121 '@ethersproject/providers': specifier: ^5.7.2 version: 5.7.2 @@ -1412,8 +1412,8 @@ packages: - utf-8-validate dev: false - /@dydxprotocol/v4-localization@1.1.118: - resolution: {integrity: sha512-s4NshsTo24aMlDNNNwZ+C3H19HqrfqMf6Be9crWm95+SkPGysDyE+6tZyOMWkZiprcwlTwrw1wJS+jAsBDN9Dw==} + /@dydxprotocol/v4-localization@1.1.121: + resolution: {integrity: sha512-pG3e5+lIuskM0HD45k18q8ZxnFNNkTpv4z/td0AzVIVUq7nzJ4O6ft4vcuNrm4k0Zd9nySEtSjODPC9qicxUKw==} dev: false /@dydxprotocol/v4-proto@5.0.0-dev.0: diff --git a/public/configs/v1/env.json b/public/configs/v1/env.json index 33f8f0081..26b83e9e6 100644 --- a/public/configs/v1/env.json +++ b/public/configs/v1/env.json @@ -81,7 +81,8 @@ "complianceSupportEmail": "support@dydx.exchange", "equityTiersLearnMore": "https://help.dydx.trade/en/articles/171918-equity-tiers-and-rate-limits", "fetAgixMarketWindDownProposal": "https://www.mintscan.io/dydx/proposals/61", - "contractLossMechanismLearnMore": "https://help.dydx.trade/en/articles/166973-contract-loss-mechanisms-on-dydx-chain" + "contractLossMechanismLearnMore": "https://help.dydx.trade/en/articles/166973-contract-loss-mechanisms-on-dydx-chain", + "isolatedMarginLearnMore": "https://help.dydx.trade/en/articles/172975-isolated-margin" }, "dydx-testnet-4": { "tos": "https://dydx.exchange/v4-terms", @@ -112,7 +113,8 @@ "complianceSupportEmail": "support@dydx.exchange", "equityTiersLearnMore": "https://help.dydx.trade/en/articles/171918-equity-tiers-and-rate-limits", "fetAgixMarketWindDownProposal": "https://www.mintscan.io/dydx/proposals/61", - "contractLossMechanismLearnMore": "https://help.dydx.trade/en/articles/166973-contract-loss-mechanisms-on-dydx-chain" + "contractLossMechanismLearnMore": "https://help.dydx.trade/en/articles/166973-contract-loss-mechanisms-on-dydx-chain", + "isolatedMarginLearnMore": "https://help.dydx.trade/en/articles/172975-isolated-margin" }, "[mainnet chain id]": { "tos": "[HTTP link to TOS]", @@ -143,7 +145,8 @@ "complianceSupportEmail": "[Email address for compliance support, can be null]", "equityTiersLearnMore": "[HTTP link to equity tiers learn more, can be null]", "fetAgixMarketWindDownProposal": "[HTTP link to mintscan proposal]", - "contractLossMechanismLearnMore": "[HTTP link to documentation on contract loss mechanisms]" + "contractLossMechanismLearnMore": "[HTTP link to documentation on contract loss mechanisms]", + "isolatedMarginLearnMore": "[HTTP link to documentation on isolated margin]" } }, "wallets": { diff --git a/src/constants/notifications.ts b/src/constants/notifications.ts index cd965a4f4..e6316f85c 100644 --- a/src/constants/notifications.ts +++ b/src/constants/notifications.ts @@ -188,6 +188,7 @@ export enum ReleaseUpdateNotificationIds { IncentivesS5 = 'incentives-s5', IncentivesDistributedS4 = 'incentives-distributed-s4', FOKDeprecation = 'fok-deprecation', + IsolatedMarginLive = 'isolated-margin-live', // Added 06/12/2024 } // Incentives Season diff --git a/src/hooks/useNotificationTypes.tsx b/src/hooks/useNotificationTypes.tsx index ffc08e53e..71ec694b8 100644 --- a/src/hooks/useNotificationTypes.tsx +++ b/src/hooks/useNotificationTypes.tsx @@ -285,6 +285,8 @@ export const notificationTypes: NotificationTypeConfig[] = [ const incentivesExpirationDate = new Date('2024-07-17T23:59:59'); const conditionalOrdersExpirationDate = new Date('2024-06-01T23:59:59'); const fokDeprecationExpirationDate = new Date('2024-07-01T23:59:59'); + const isolatedMarginLiveExpirationDate = new Date('2024-07-12T23:59:59'); + const { isolatedMarginLearnMore } = useURLConfigs(); const currentDate = new Date(); @@ -355,6 +357,31 @@ export const notificationTypes: NotificationTypeConfig[] = [ [] ); } + + if (currentDate <= isolatedMarginLiveExpirationDate) { + trigger( + ReleaseUpdateNotificationIds.IsolatedMarginLive, + { + icon: , + title: stringGetter({ + key: 'NOTIFICATIONS.ISOLATED_MARGIN_LIVE.TITLE', + }), + body: stringGetter({ + key: 'NOTIFICATIONS.ISOLATED_MARGIN_LIVE.BODY', + params: { + LEARN_MORE: ( + <$Link href={isolatedMarginLearnMore}> + {stringGetter({ key: STRING_KEYS.HERE })} + + ), + }, + }), + toastSensitivity: 'foreground', + groupKey: ReleaseUpdateNotificationIds.IsolatedMarginLive, + }, + [] + ); + } }, [stringGetter]); const { dydxAddress } = useAccounts(); diff --git a/src/hooks/useURLConfigs.ts b/src/hooks/useURLConfigs.ts index aab92fc57..d5c79cc3e 100644 --- a/src/hooks/useURLConfigs.ts +++ b/src/hooks/useURLConfigs.ts @@ -16,6 +16,7 @@ export interface LinksConfigs { governanceLearnMore?: string; help?: string; initialMarginFractionLearnMore?: string; + isolatedMarginLearnMore?: string; keplrDashboard?: string; launchIncentive?: string; mintscan: string; @@ -52,6 +53,7 @@ export const useURLConfigs = (): LinksConfigs => { governanceLearnMore: linksConfigs.governanceLearnMore ?? FALLBACK_URL, help: linksConfigs.help ?? FALLBACK_URL, initialMarginFractionLearnMore: linksConfigs.initialMarginFractionLearnMore ?? FALLBACK_URL, + isolatedMarginLearnMore: linksConfigs.isolatedMarginLearnMore ?? FALLBACK_URL, keplrDashboard: linksConfigs.keplrDashboard ?? FALLBACK_URL, launchIncentive: linksConfigs.launchIncentive ?? FALLBACK_URL, mintscan: linksConfigs.mintscan, diff --git a/src/views/AccountInfo/AccountInfoConnectedState.tsx b/src/views/AccountInfo/AccountInfoConnectedState.tsx index f181d2d5b..52f4c80bf 100644 --- a/src/views/AccountInfo/AccountInfoConnectedState.tsx +++ b/src/views/AccountInfo/AccountInfoConnectedState.tsx @@ -66,6 +66,9 @@ export const AccountInfoConnectedState = () => { const { freeCollateral, marginUsage } = subAccount ?? {}; + /** + * TODO: isClosingIsolatedPosition controls whether diff state is shown. Remove when diff state is fixed in Abacus. + */ const hasDiff = !isClosingIsolatedPosition && ((!!marginUsage?.postOrder && getTradeStateWithDoubleValuesHasDiff(marginUsage)) ||