From 99395b34c5a74db26e2ee753607a2d3ffc9b79f2 Mon Sep 17 00:00:00 2001 From: Aleka Cheung Date: Tue, 13 Feb 2024 13:22:12 -0500 Subject: [PATCH] bump abacus + use new env config format --- package.json | 2 +- pnpm-lock.yaml | 25 +- public/configs/env.json | 1079 +++-------------- src/constants/networks.ts | 5 + src/constants/wallets.ts | 8 +- src/hooks/useDydxClient.tsx | 7 +- src/hooks/useGovernanceVariables.ts | 6 +- src/hooks/useNotificationTypes.tsx | 4 +- src/hooks/useSelectedNetwork.ts | 9 +- src/hooks/useTokenConfigs.ts | 6 +- src/hooks/useURLConfigs.ts | 8 +- src/hooks/useWalletConnection.ts | 8 +- src/layout/Footer/FooterDesktop.tsx | 7 +- src/lib/abacus/dydxChainTransactions.ts | 15 +- src/state/appSelectors.ts | 4 + .../dialogs/OnboardingDialog/GenerateKeys.tsx | 5 +- .../AccountManagementForms/DepositForm.tsx | 8 +- .../AccountManagementForms/WithdrawForm.tsx | 8 +- src/views/forms/TransferForm.tsx | 7 +- .../TransferStatusSteps.tsx | 8 +- 20 files changed, 279 insertions(+), 950 deletions(-) diff --git a/package.json b/package.json index be01787..d0620db 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@cosmjs/proto-signing": "^0.32.1", "@cosmjs/stargate": "^0.32.1", "@cosmjs/tendermint-rpc": "^0.32.1", - "@dydxprotocol/v4-abacus": "^1.4.2", + "@dydxprotocol/v4-abacus": "^1.4.4", "@dydxprotocol/v4-client-js": "^1.0.20", "@dydxprotocol/v4-localization": "^1.1.30", "@ethersproject/providers": "^5.7.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 99ca395..ab7f8d1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,9 +1,5 @@ lockfileVersion: '6.0' -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - overrides: follow-redirects: 1.15.3 @@ -30,14 +26,14 @@ dependencies: specifier: ^0.32.1 version: 0.32.2 '@dydxprotocol/v4-abacus': - specifier: ^1.4.2 - version: 1.4.2 + specifier: ^1.4.4 + version: 1.4.4 '@dydxprotocol/v4-client-js': specifier: ^1.0.20 version: 1.0.20 '@dydxprotocol/v4-localization': - specifier: ^1.1.30 - version: 1.1.30 + specifier: ^1.1.28 + version: 1.1.29 '@ethersproject/providers': specifier: ^5.7.2 version: 5.7.2 @@ -1290,8 +1286,8 @@ packages: resolution: {integrity: sha512-Gg5t+eR7vPJMAmhkFt6CZrzPd0EKpAslWwk5rFVYZpJsM8JG5KT9XQ99hgNM3Ov6ScNoIWbXkpX27F6A9cXR4Q==} dev: false - /@dydxprotocol/v4-abacus@1.4.2: - resolution: {integrity: sha512-+hugk0RulMwMthR2xCMYXohcC3sEYqVW/lmiq0RUuHZ9yrjmgy48xl0aZUmXGUYXyoiHXPS4AULhRKHQ4OOLwg==} + /@dydxprotocol/v4-abacus@1.4.4: + resolution: {integrity: sha512-5Hwpxyk89M03L8IBTv8lpX9O03uJuQu81q1rE2uTA27uAp357Vb+AbURdX/OtXuSBCYsLIyzlzraQrfi989J2w==} dev: false /@dydxprotocol/v4-client-js@1.0.20: @@ -1323,8 +1319,13 @@ packages: - utf-8-validate dev: false +<<<<<<< HEAD /@dydxprotocol/v4-localization@1.1.30: resolution: {integrity: sha512-TZfWWRSOxcjLHs972wlJVVHkE7+DVqAUnGZSs24HYHsPtUkPhZiNXMOA2Vk9YddQxumhM79xIRH0cmJSe5DDUg==} +======= + /@dydxprotocol/v4-localization@1.1.29: + resolution: {integrity: sha512-o9lxsYl5ObqO9OUyxiKuUxoBmYZk0qGDeNxGScY8uMRq4Ahhz3BPxAC7jUYypCNAMpieiQjVGxMnnhIbwEkm2w==} +>>>>>>> d67495d (bump abacus + use new env config format) dev: false /@dydxprotocol/v4-proto@4.0.0-dev.0: @@ -16053,3 +16054,7 @@ packages: /zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} dev: true + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false diff --git a/public/configs/env.json b/public/configs/env.json index 9b6f2ff..666b304 100644 --- a/public/configs/env.json +++ b/public/configs/env.json @@ -43,6 +43,198 @@ "default": "dydxprotocol-testnet" } }, + "tokens": { + "dydxprotocol-testnet": { + "chain": { + "name": "Dv4TNT", + "denom": "adv4tnt", + "decimals": 18, + "image": "/currencies/dydx.png" + }, + "usdc": { + "name": "USDC", + "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", + "gasDenom": "uusdc", + "decimals": 6, + "image": "/currencies/usdc.png" + } + }, + "dydx-testnet-4": { + "chain": { + "name": "Dv4TNT", + "denom": "adv4tnt", + "decimals": 18, + "image": "/currencies/dydx.png" + }, + "usdc": { + "name": "USDC", + "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", + "gasDenom": "uusdc", + "decimals": 6, + "image": "/currencies/usdc.png" + } + }, + "[mainnet chain id]": { + "comment": "Change according to mainnet release", + "chain": { + "name": "TokenName", + "denom": "tokenDenom", + "decimals": 18, + "image": "/currencies/dydx.png" + }, + "usdc": { + "name": "USDC", + "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", + "gasDenom": "uusdc", + "decimals": 6, + "image": "/currencies/usdc.png" + } + } + }, + "links": { + "dydxprotocol-testnet": { + "tos": "https://dydx.exchange/v4-terms", + "privacy": "https://dydx.exchange/privacy", + "statusPage": "https://status.v4testnet.dydx.exchange/", + "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", + "documentation": "https://docs.dydx.exchange/", + "community": "https://discord.com/invite/dydx", + "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", + "blogs": "https://www.dydx.foundation/blog", + "foundation": "https://www.dydx.foundation", + "help": "https://help.dydx.exchange/", + "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", + "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", + "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", + "stakingLearnMore": "https://help.dydx.exchange", + "keplrDashboard": "https://testnet.keplr.app/", + "strideZoneApp": "https://testnet.stride.zone", + "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", + "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" + }, + "dydx-testnet-4": { + "tos": "https://dydx.exchange/v4-terms", + "privacy": "https://dydx.exchange/privacy", + "statusPage": "https://status.v4testnet.dydx.exchange/", + "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", + "documentation": "https://docs.dydx.exchange/", + "community": "https://discord.com/invite/dydx", + "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", + "blogs": "https://www.dydx.foundation/blog", + "foundation": "https://www.dydx.foundation", + "help": "https://help.dydx.exchange/", + "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", + "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", + "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", + "stakingLearnMore": "https://help.dydx.exchange", + "keplrDashboard": "https://testnet.keplr.app/", + "strideZoneApp": "https://testnet.stride.zone", + "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", + "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" + }, + "[mainnet chain id]": { + "tos": "[HTTP link to TOS]", + "privacy": "[HTTP link to Privacy Policy]", + "statusPage": "[HTTP link to status page]", + "mintscan": "[HTTP link to Mintscan, with {tx_hash} placeholder]", + "mintscanBase": "[HTTP link to TOS mintscan base url]", + "feedback": "[HTTP link to feedback form, can be null]", + "blogs": "[HTTP link to blogs, can be null]", + "foundation": "[HTTP link to foundation, can be null]", + "reduceOnlyLearnMore": "[HTTP link to reduce-only learn more, can be null]", + "documentation": "[HTTP link to documentation, can be null]", + "community": "[HTTP link to community, can be null]", + "help": "[HTTP link to help page, can be null]", + "governanceLearnMore": "[HTTP link to governance learn more, can be null]", + "newMarketProposalLearnMore": "[HTTP link to new market proposal learn more, can be null]", + "stakingLearnMore": "[HTTP link to staking learn more, can be null]", + "keplrDashboard": "[HTTP link to keplr dashboard, can be null]", + "strideZoneApp": "[HTTP link to stride zone app, can be null]", + "accountExportLearnMore": "[HTTP link to account export learn more, can be null]", + "walletLearnMore": "[HTTP link to wallet learn more, can be null]" + } + }, + "wallets": { + "dydxprotocol-testnet": { + "walletconnect": { + "client": { + "name": "dYdX v4", + "description": "dYdX v4 App", + "iconUrl": "/logos/dydx-x.png" + }, + "v2": { + "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" + } + }, + "walletSegue": { + "callbackUrl": "/walletsegue" + }, + "images": "/wallets/", + "signTypedDataAction": "dYdX Chain Onboarding", + "signTypedDataDomainName": "dYdX Chain" + }, + "dydx-testnet-4": { + "walletconnect": { + "client": { + "name": "dYdX v4", + "description": "dYdX v4 App", + "iconUrl": "/logos/dydx-x.png" + }, + "v2": { + "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" + } + }, + "walletSegue": { + "callbackUrl": "/walletsegue" + }, + "images": "/wallets/", + "signTypedDataAction": "dYdX Chain Onboarding", + "signTypedDataDomainName": "dYdX Chain" + }, + "[mainnet chain id]": { + "walletconnect": { + "client": { + "name": "[Name of the app]", + "description": "[Description of the app]", + "iconUrl": "[Relative URL of the icon URL]" + }, + "v2": { + "projectId": "[Project ID]" + } + }, + "walletSegue": { + "callbackUrl": "[Relative callback URL for WalletSegue, should match apple-app-site-association]" + }, + "images": "[Relative URL for wallet images]", + "signTypedDataAction": "dYdX Chain Onboarding", + "signTypedDataDomainName": "dYdX Chain" + } + }, + "governance": { + "dydxprotocol-testnet": { + "newMarketProposal": { + "initialDepositAmount": 10000000, + "delayBlocks": 900, + "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" + } + }, + "dydx-testnet-4": { + "newMarketProposal": { + "initialDepositAmount": 10000000, + "delayBlocks": 900, + "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" + } + }, + "[mainnet chain id]": { + "newMarketProposal": { + "initialDepositAmount": 0, + "delayBlocks": 0, + "newMarketsMethodology": "[URL to spreadsheet or document that explains methodology]" + } + } + }, "environments": { "dydxprotocol-dev": { "name": "v4 Dev", @@ -52,21 +244,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -81,50 +258,6 @@ "nobleValidator": "https://noble-testnet-rpc.polkachu.com/", "faucet": "https://faucet.v4dev.dydx.exchange" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "blogs": "https://www.dydx.foundation/blog", - "foundation": "https://www.dydx.foundation", - "help": "https://help.dydx.exchange/", - "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "governanceLearnMore": "https://help.dydx.exchange", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", - "stakingLearnMore": "https://help.dydx.exchange", - "keplrDashboard": "https://testnet.keplr.app/", - "strideZoneApp": "https://testnet.stride.zone", - "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", - "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX Chain" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": true } @@ -137,21 +270,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -165,50 +283,6 @@ "0xsquid": "https://testnet.api.0xsquid.com", "nobleValidator": "https://noble-testnet-rpc.polkachu.com/" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "blogs": "https://www.dydx.foundation/blog", - "foundation": "https://www.dydx.foundation", - "help": "https://help.dydx.exchange/", - "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "governanceLearnMore": "https://help.dydx.exchange", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", - "stakingLearnMore": "https://help.dydx.exchange", - "keplrDashboard": "https://testnet.keplr.app/", - "strideZoneApp": "https://testnet.stride.zone", - "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", - "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX Chain" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": true } @@ -221,21 +295,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -250,50 +309,6 @@ "nobleValidator": "https://noble-testnet-rpc.polkachu.com/", "faucet": "https://faucet.v4dev4.dydx.exchange" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "blogs": "https://www.dydx.foundation/blog", - "foundation": "https://www.dydx.foundation", - "help": "https://help.dydx.exchange/", - "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "governanceLearnMore": "https://help.dydx.exchange", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", - "stakingLearnMore": "https://help.dydx.exchange", - "keplrDashboard": "https://testnet.keplr.app/", - "strideZoneApp": "https://testnet.stride.zone", - "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", - "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX Chain" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": true } @@ -306,21 +321,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -334,50 +334,6 @@ "0xsquid": "https://testnet.api.0xsquid.com", "nobleValidator": "https://noble-testnet-rpc.polkachu.com/" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "blogs": "https://www.dydx.foundation/blog", - "foundation": "https://www.dydx.foundation", - "help": "https://help.dydx.exchange/", - "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "governanceLearnMore": "https://help.dydx.exchange", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", - "stakingLearnMore": "https://help.dydx.exchange", - "keplrDashboard": "https://testnet.keplr.app/", - "strideZoneApp": "https://testnet.stride.zone", - "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", - "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX Chain" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": true } @@ -390,21 +346,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -419,51 +360,6 @@ "0xsquid": "https://testnet.api.squidrouter.com", "nobleValidator": "https://noble-testnet-rpc.polkachu.com/" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", - "blogs": "https://www.dydx.foundation/blog", - "help": "https://help.dydx.exchange", - "foundation": "https://www.dydx.foundation", - "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "governanceLearnMore": "https://help.dydx.exchange", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", - "stakingLearnMore": "https://help.dydx.exchange", - "keplrDashboard": "https://testnet.keplr.app/", - "strideZoneApp": "https://testnet.stride.zone", - "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", - "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX Chain" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": true } @@ -476,21 +372,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -505,35 +386,6 @@ "0xsquid": "https://testnet.api.squidrouter.com", "nobleValidator": "https://noble-testnet-rpc.polkachu.com/" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "documentation": "https://v4-teacher.vercel.app/", - "community": "https://discord.com/invite/dydx", - "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", - "blogs": "https://www.dydx.foundation/blog", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX Chain" - }, "apps": { "ios": { "minimalVersion": "1.0", @@ -541,13 +393,6 @@ "url": "https://apps.apple.com/app/dydx/id1564787350" } }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": true } @@ -560,21 +405,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -589,51 +419,6 @@ "0xsquid": "https://testnet.api.squidrouter.com", "nobleValidator": "https://noble-testnet-rpc.polkachu.com/" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", - "blogs": "https://www.dydx.foundation/blog", - "help": "https://help.dydx.exchange", - "foundation": "https://www.dydx.foundation", - "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "governanceLearnMore": "https://help.dydx.exchange", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", - "stakingLearnMore": "https://help.dydx.exchange", - "keplrDashboard": "https://testnet.keplr.app/", - "strideZoneApp": "https://testnet.stride.zone", - "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", - "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX Chain" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": true } @@ -646,21 +431,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -679,51 +449,6 @@ "nobleValidator": "https://noble-testnet-rpc.polkachu.com/", "faucet": "https://faucet.v4testnet.dydx.exchange" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", - "blogs": "https://www.dydx.foundation/blog", - "foundation": "https://www.dydx.foundation", - "help": "https://help.dydx.exchange/", - "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "governanceLearnMore": "https://help.dydx.exchange", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", - "stakingLearnMore": "https://help.dydx.exchange", - "keplrDashboard": "https://testnet.keplr.app/", - "strideZoneApp": "https://testnet.stride.zone", - "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", - "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX V4" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": false } @@ -736,21 +461,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -765,52 +475,6 @@ "nobleValidator": "https://noble-testnet-rpc.polkachu.com/", "faucet": "https://faucet.v4testnet.dydx.exchange" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "statusPage": "https://status.v4testnet.dydx.exchange/", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", - "blogs": "https://www.dydx.foundation/blog", - "foundation": "https://www.dydx.foundation", - "help": "https://help.dydx.exchange/", - "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "governanceLearnMore": "https://help.dydx.exchange", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", - "stakingLearnMore": "https://help.dydx.exchange", - "keplrDashboard": "https://testnet.keplr.app/", - "strideZoneApp": "https://testnet.stride.zone", - "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", - "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX V4" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": false } @@ -823,21 +487,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -852,52 +501,6 @@ "nobleValidator": "https://noble-testnet-rpc.polkachu.com/", "faucet": "https://faucet.v4testnet.dydx.exchange" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "statusPage": "https://status.v4testnet.dydx.exchange/", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", - "blogs": "https://www.dydx.foundation/blog", - "foundation": "https://www.dydx.foundation", - "help": "https://help.dydx.exchange/", - "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "governanceLearnMore": "https://help.dydx.exchange", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", - "stakingLearnMore": "https://help.dydx.exchange", - "keplrDashboard": "https://testnet.keplr.app/", - "strideZoneApp": "https://testnet.stride.zone", - "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", - "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX V4" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": false } @@ -910,21 +513,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -939,52 +527,6 @@ "nobleValidator": "https://noble-testnet-rpc.polkachu.com/", "faucet": "https://faucet.v4testnet.dydx.exchange" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "statusPage": "https://status.v4testnet.dydx.exchange/", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", - "blogs": "https://www.dydx.foundation/blog", - "foundation": "https://www.dydx.foundation", - "help": "https://help.dydx.exchange/", - "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "governanceLearnMore": "https://help.dydx.exchange", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", - "stakingLearnMore": "https://help.dydx.exchange", - "keplrDashboard": "https://testnet.keplr.app/", - "strideZoneApp": "https://testnet.stride.zone", - "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", - "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX V4" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": false } @@ -997,21 +539,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -1026,52 +553,6 @@ "nobleValidator": "https://noble-testnet-rpc.polkachu.com/", "faucet": "https://faucet.v4testnet.dydx.exchange" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "statusPage": "https://status.v4testnet.dydx.exchange/", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", - "blogs": "https://www.dydx.foundation/blog", - "foundation": "https://www.dydx.foundation", - "help": "https://help.dydx.exchange/", - "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "governanceLearnMore": "https://help.dydx.exchange", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", - "stakingLearnMore": "https://help.dydx.exchange", - "keplrDashboard": "https://testnet.keplr.app/", - "strideZoneApp": "https://testnet.stride.zone", - "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", - "walletLearnMore": "https://www.dydx.academy/video/defi-wallet" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX V4" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": false } @@ -1084,21 +565,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -1113,43 +579,6 @@ "nobleValidator": "https://noble-testnet-rpc.polkachu.com/", "faucet": "https://faucet.v4testnet.dydx.exchange" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "statusPage": "https://status.v4testnet.dydx.exchange/", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", - "blogs": "https://www.dydx.foundation/blog", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX V4" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": false } @@ -1162,21 +591,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "dYdX-api", "isMainNet": false, - "tokens": { - "chain": { - "name": "Dv4TNT", - "denom": "adv4tnt", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -1191,52 +605,6 @@ "nobleValidator": "https://noble-testnet-rpc.polkachu.com/", "faucet": "https://faucet.v4testnet.dydx.exchange" }, - "links": { - "tos": "https://dydx.exchange/v4-terms", - "privacy": "https://dydx.exchange/privacy", - "statusPage": "https://status.v4testnet.dydx.exchange/", - "mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}", - "documentation": "https://docs.dydx.exchange/", - "community": "https://discord.com/invite/dydx", - "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", - "blogs": "https://www.dydx.foundation/blog", - "foundation": "https://www.dydx.foundation", - "help": "https://help.dydx.exchange/", - "reduceOnlyLearnmore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", - "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", - "governanceLearnmore": "https://help.dydx.exchange", - "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", - "stakingLearnmore": "https://help.dydx.exchange", - "keplrDashboard": "https://testnet.keplr.app/", - "strideZoneApp": "https://testnet.stride.zone", - "accountExportLearnmore": "https://help.dydx.exchange", - "walletLearnmore": "https://www.dydx.academy/video/defi-wallet" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "dYdX v4", - "description": "dYdX v4 App", - "iconUrl": "/logos/dydx-x.png" - }, - "v2": { - "projectId": "47559b2ec96c09aed9ff2cb54a31ab0e" - } - }, - "walletSegue": { - "callbackUrl": "/walletsegue" - }, - "images": "/wallets/", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX V4" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 10000000, - "delayBlocks": 900, - "newMarketsMethodology": "https://docs.google.com/spreadsheets/d/1zjkV9R7R_7KMItuzqzvKGwefSBRfE-ZNAx1LH55OcqY/edit?usp=sharing" - } - }, "featureFlags": { "reduceOnlySupported": false } @@ -1249,22 +617,6 @@ "chainLogo": "/dydx-chain.png", "squidIntegratorId": "[mainnet squid integrator id]", "isMainNet": true, - "tokens": { - "comment": "Change according to mainnet release", - "chain": { - "name": "TokenName", - "denom": "tokenDenom", - "decimals": 18, - "image": "/currencies/dydx.png" - }, - "usdc": { - "name": "USDC", - "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - "gasDenom": "uusdc", - "decimals": 6, - "image": "/currencies/usdc.png" - } - }, "endpoints": { "indexers": [ { @@ -1279,54 +631,9 @@ "0xsquid": "[0xSquid endpoint for mainnet]", "nobleValidator": "[noble validator endpoint for mainnet]" }, - "links": { - "tos": "[HTTP link to TOS]", - "privacy": "[HTTP link to Privacy Policy]", - "mintscan": "[HTTP link to Mintscan, with {tx_hash} placeholder]", - "mintscanBase": "[HTTP link to TOS mintscan base url]", - "feedback": "[HTTP link to feedback form, can be null]", - "blogs": "[HTTP link to blogs, can be null]", - "foundation": "[HTTP link to foundation, can be null]", - "reduceOnlyLearnMore": "[HTTP link to reduce-only learn more, can be null]", - "documentation": "[HTTP link to documentation, can be null]", - "community": "[HTTP link to community, can be null]", - "help": "[HTTP link to help page, can be null]", - "governanceLearnMore": "[HTTP link to governance learn more, can be null]", - "newMarketProposalLearnMore": "[HTTP link to new market proposal learn more, can be null]", - "stakingLearnMore": "[HTTP link to staking learn more, can be null]", - "keplrDashboard": "[HTTP link to keplr dashboard, can be null]", - "strideZoneApp": "[HTTP link to stride zone app, can be null]", - "accountExportLearnMore": "[HTTP link to account export learn more, can be null]", - "walletLearnMore": "[HTTP link to wallet learn more, can be null]" - }, - "wallets": { - "walletconnect": { - "client": { - "name": "[Name of the app]", - "description": "[Description of the app]", - "iconUrl": "[Relative URL of the icon URL]" - }, - "v2": { - "projectId": "[Project ID]" - } - }, - "walletSegue": { - "callbackUrl": "[Relative callback URL for WalletSegue, should match apple-app-site-association]" - }, - "images": "[Relative URL for wallet images]", - "signTypedDataAction": "dYdX Chain Onboarding", - "signTypedDataDomainName": "dYdX Chain" - }, - "governance": { - "newMarketProposal": { - "initialDepositAmount": 0, - "delayBlocks": 0, - "newMarketsMethodology": "[URL to spreadsheet or document that explains methodology]" - } - }, "featureFlags": { "reduceOnlySupported": false } } } -} +} \ No newline at end of file diff --git a/src/constants/networks.ts b/src/constants/networks.ts index 8bfe05e..9d624a4 100644 --- a/src/constants/networks.ts +++ b/src/constants/networks.ts @@ -14,5 +14,10 @@ export const isDev = CURRENT_MODE === 'DEV'; export const AVAILABLE_ENVIRONMENTS = environments.deployments[CURRENT_MODE]; export const CURRENT_ABACUS_DEPLOYMENT = CURRENT_MODE; export const ENVIRONMENT_CONFIG_MAP = environments.environments; +export const TOKEN_CONFIG_MAP = environments.tokens; +export const LINKS_CONFIG_MAP = environments.links; +export const WALLETS_CONFIG_MAP = environments.wallets; +export const GOVERNANCE_CONFIG_MAP = environments.governance; export type DydxNetwork = keyof typeof ENVIRONMENT_CONFIG_MAP; +export type DydxChainId = keyof typeof TOKEN_CONFIG_MAP; export const DEFAULT_APP_ENVIRONMENT = AVAILABLE_ENVIRONMENTS.default as DydxNetwork; diff --git a/src/constants/wallets.ts b/src/constants/wallets.ts index 4eced61..b4ab501 100644 --- a/src/constants/wallets.ts +++ b/src/constants/wallets.ts @@ -24,7 +24,7 @@ import { import { isMetaMask } from '@/lib/wallet/providers'; -import { DydxNetwork, ENVIRONMENT_CONFIG_MAP } from './networks'; +import { DydxChainId, WALLETS_CONFIG_MAP } from './networks'; // Wallet connection types @@ -291,17 +291,17 @@ export const COSMOS_DERIVATION_PATH = "m/44'/118'/0'/0/0"; /** * @description typed data to sign for dYdX Chain onboarding */ -export const getSignTypedData = (selectedNetwork: DydxNetwork) => +export const getSignTypedData = (selectedDydxChainId: DydxChainId) => ({ primaryType: 'dYdX', domain: { - name: ENVIRONMENT_CONFIG_MAP[selectedNetwork].wallets.signTypedDataDomainName, + name: WALLETS_CONFIG_MAP[selectedDydxChainId].signTypedDataDomainName, }, types: { dYdX: [{ name: 'action', type: 'string' }], }, message: { - action: ENVIRONMENT_CONFIG_MAP[selectedNetwork].wallets.signTypedDataAction, + action: WALLETS_CONFIG_MAP[selectedDydxChainId].signTypedDataAction, }, } as const); diff --git a/src/hooks/useDydxClient.tsx b/src/hooks/useDydxClient.tsx index b629c18..a42f564 100644 --- a/src/hooks/useDydxClient.tsx +++ b/src/hooks/useDydxClient.tsx @@ -18,10 +18,10 @@ import type { ResolutionString } from 'public/tradingview/charting_library'; import type { ConnectNetworkEvent, NetworkConfig } from '@/constants/abacus'; import { DEFAULT_TRANSACTION_MEMO } from '@/constants/analytics'; import { type Candle, RESOLUTION_MAP } from '@/constants/candles'; -import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks'; +import { ENVIRONMENT_CONFIG_MAP, TOKEN_CONFIG_MAP } from '@/constants/networks'; import { DydxChainAsset } from '@/constants/wallets'; -import { getSelectedNetwork } from '@/state/appSelectors'; +import { getSelectedDydxChainId, getSelectedNetwork } from '@/state/appSelectors'; import { log } from '@/lib/telemetry'; @@ -41,7 +41,8 @@ const useDydxClientContext = () => { // ------ Network ------ // const selectedNetwork = useSelector(getSelectedNetwork); - const tokensConfigs = ENVIRONMENT_CONFIG_MAP[selectedNetwork].tokens; + const selectedDydxChainId = useSelector(getSelectedDydxChainId); + const tokensConfigs = TOKEN_CONFIG_MAP[selectedDydxChainId]; const [networkConfig, setNetworkConfig] = useState(); diff --git a/src/hooks/useGovernanceVariables.ts b/src/hooks/useGovernanceVariables.ts index 0234ea0..40012fe 100644 --- a/src/hooks/useGovernanceVariables.ts +++ b/src/hooks/useGovernanceVariables.ts @@ -1,4 +1,4 @@ -import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks'; +import { GOVERNANCE_CONFIG_MAP } from '@/constants/networks'; import { useSelectedNetwork } from '@/hooks'; export interface GovernanceVariables { @@ -10,7 +10,7 @@ export interface GovernanceVariables { } export const useGovernanceVariables = (): GovernanceVariables => { - const { selectedNetwork } = useSelectedNetwork(); - const governanceVars = ENVIRONMENT_CONFIG_MAP[selectedNetwork].governance as GovernanceVariables; + const { selectedDydxChainId } = useSelectedNetwork(); + const governanceVars = GOVERNANCE_CONFIG_MAP[selectedDydxChainId] as GovernanceVariables; return governanceVars; }; diff --git a/src/hooks/useNotificationTypes.tsx b/src/hooks/useNotificationTypes.tsx index b7be4f3..06bd9f1 100644 --- a/src/hooks/useNotificationTypes.tsx +++ b/src/hooks/useNotificationTypes.tsx @@ -175,7 +175,7 @@ export const notificationTypes: NotificationTypeConfig[] = [ useTrigger: ({ trigger }) => { const stringGetter = useStringGetter(); const { transferNotifications } = useLocalNotifications(); - const { selectedNetwork } = useSelectedNetwork(); + const { selectedDydxChainId } = useSelectedNetwork(); useEffect(() => { for (const transfer of transferNotifications) { @@ -184,7 +184,7 @@ export const notificationTypes: NotificationTypeConfig[] = [ const icon = ; const transferType = - type ?? fromChainId === ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId + type ?? fromChainId === selectedDydxChainId ? TransferNotificationTypes.Withdrawal : TransferNotificationTypes.Deposit; diff --git a/src/hooks/useSelectedNetwork.ts b/src/hooks/useSelectedNetwork.ts index 9b7a898..d9077d5 100644 --- a/src/hooks/useSelectedNetwork.ts +++ b/src/hooks/useSelectedNetwork.ts @@ -2,7 +2,7 @@ import { useCallback } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { LocalStorageKey } from '@/constants/localStorage'; -import { DEFAULT_APP_ENVIRONMENT, DydxNetwork, ENVIRONMENT_CONFIG_MAP } from '@/constants/networks'; +import { DEFAULT_APP_ENVIRONMENT, DydxChainId, DydxNetwork, ENVIRONMENT_CONFIG_MAP } from '@/constants/networks'; import { useAccounts, useLocalStorage } from '@/hooks'; @@ -14,6 +14,7 @@ import { validateAgainstAvailableEnvironments } from '@/lib/network'; export const useSelectedNetwork = (): { switchNetwork: (network: DydxNetwork) => void; selectedNetwork: DydxNetwork; + selectedDydxChainId: DydxChainId; } => { const dispatch = useDispatch(); const { disconnect } = useAccounts(); @@ -35,5 +36,9 @@ export const useSelectedNetwork = (): { [dispatch, disconnect, setLocalStorageNetwork] ); - return { switchNetwork, selectedNetwork }; + return { + switchNetwork, + selectedNetwork, + selectedDydxChainId: ENVIRONMENT_CONFIG_MAP[selectedNetwork as DydxNetwork].dydxChainId as DydxChainId, + }; }; diff --git a/src/hooks/useTokenConfigs.ts b/src/hooks/useTokenConfigs.ts index 2bbe155..50aee49 100644 --- a/src/hooks/useTokenConfigs.ts +++ b/src/hooks/useTokenConfigs.ts @@ -1,4 +1,4 @@ -import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks'; +import { TOKEN_CONFIG_MAP } from '@/constants/networks'; import { DydxChainAsset } from '@/constants/wallets'; import { useSelectedNetwork } from '@/hooks'; @@ -25,8 +25,8 @@ export const useTokenConfigs = (): { chainTokenDecimals: number; chainTokenLabel: string; } => { - const { selectedNetwork } = useSelectedNetwork(); - const tokensConfigs = ENVIRONMENT_CONFIG_MAP[selectedNetwork].tokens; + const { selectedDydxChainId } = useSelectedNetwork(); + const tokensConfigs = TOKEN_CONFIG_MAP[selectedDydxChainId]; return { tokensConfigs, diff --git a/src/hooks/useURLConfigs.ts b/src/hooks/useURLConfigs.ts index 67cfc1d..d4d6376 100644 --- a/src/hooks/useURLConfigs.ts +++ b/src/hooks/useURLConfigs.ts @@ -1,4 +1,4 @@ -import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks'; +import { LINKS_CONFIG_MAP } from '@/constants/networks'; import { useSelectedNetwork } from '@/hooks'; @@ -7,6 +7,7 @@ const FALLBACK_URL = 'https://help.dydx.exchange/'; export interface LinksConfigs { tos: string; privacy: string; + statusPage: string; mintscan: string; mintscanBase: string; feedback?: string; @@ -27,12 +28,13 @@ export interface LinksConfigs { } export const useURLConfigs = (): LinksConfigs => { - const { selectedNetwork } = useSelectedNetwork(); - const linksConfigs = ENVIRONMENT_CONFIG_MAP[selectedNetwork].links as LinksConfigs; + const { selectedDydxChainId } = useSelectedNetwork(); + const linksConfigs = LINKS_CONFIG_MAP[selectedDydxChainId] as LinksConfigs; return { tos: linksConfigs.tos, privacy: linksConfigs.privacy, + statusPage: linksConfigs.statusPage, mintscan: linksConfigs.mintscan, mintscanBase: linksConfigs.mintscanBase, feedback: linksConfigs.feedback || FALLBACK_URL, diff --git a/src/hooks/useWalletConnection.ts b/src/hooks/useWalletConnection.ts index 3fc63a8..39b8887 100644 --- a/src/hooks/useWalletConnection.ts +++ b/src/hooks/useWalletConnection.ts @@ -4,7 +4,7 @@ import { useSelector } from 'react-redux'; import { EvmDerivedAddresses } from '@/constants/account'; import { STRING_KEYS } from '@/constants/localization'; import { LocalStorageKey } from '@/constants/localStorage'; -import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks'; +import { ENVIRONMENT_CONFIG_MAP, WALLETS_CONFIG_MAP } from '@/constants/networks'; import { type DydxAddress, @@ -32,7 +32,7 @@ import { WalletType as CosmosWalletType, } from 'graz'; -import { getSelectedNetwork } from '@/state/appSelectors'; +import { getSelectedDydxChainId } from '@/state/appSelectors'; import { resolveWagmiConnector } from '@/lib/wagmi'; import { getWalletConnection, parseWalletError } from '@/lib/wallet'; @@ -91,8 +91,8 @@ export const useWalletConnection = () => { // Wallet connection - const selectedNetwork = useSelector(getSelectedNetwork); - const walletConnectConfig = ENVIRONMENT_CONFIG_MAP[selectedNetwork].wallets.walletconnect; + const selectedDydxChainId = useSelector(getSelectedDydxChainId); + const walletConnectConfig = WALLETS_CONFIG_MAP[selectedDydxChainId].walletconnect; const wagmiConnector = useMemo( () => walletType && walletConnectionType diff --git a/src/layout/Footer/FooterDesktop.tsx b/src/layout/Footer/FooterDesktop.tsx index 7426cd2..9a6c524 100644 --- a/src/layout/Footer/FooterDesktop.tsx +++ b/src/layout/Footer/FooterDesktop.tsx @@ -3,9 +3,9 @@ import styled, { type AnyStyledComponent, css } from 'styled-components'; import { AbacusApiStatus } from '@/constants/abacus'; import { ButtonSize, ButtonType } from '@/constants/buttons'; import { STRING_KEYS } from '@/constants/localization'; -import { ENVIRONMENT_CONFIG_MAP, isDev } from '@/constants/networks'; +import { isDev } from '@/constants/networks'; -import { useApiState, useSelectedNetwork, useStringGetter } from '@/hooks'; +import { useApiState, useStringGetter, useURLConfigs } from '@/hooks'; import { ChatIcon, LinkOutIcon } from '@/icons'; import { layoutMixins } from '@/styles/layoutMixins'; @@ -28,8 +28,7 @@ enum ExchangeStatus { export const FooterDesktop = () => { const stringGetter = useStringGetter(); const { height, indexerHeight, status, statusErrorMessage } = useApiState(); - const { selectedNetwork } = useSelectedNetwork(); - const { statusPage } = ENVIRONMENT_CONFIG_MAP[selectedNetwork].links; + const { statusPage } = useURLConfigs(); const { exchangeStatus, label } = !status || status === AbacusApiStatus.NORMAL diff --git a/src/lib/abacus/dydxChainTransactions.ts b/src/lib/abacus/dydxChainTransactions.ts index 3185c3b..f5f85c1 100644 --- a/src/lib/abacus/dydxChainTransactions.ts +++ b/src/lib/abacus/dydxChainTransactions.ts @@ -34,7 +34,13 @@ import { import { DEFAULT_TRANSACTION_MEMO } from '@/constants/analytics'; import { DialogTypes } from '@/constants/dialogs'; import { UNCOMMITTED_ORDER_TIMEOUT_MS } from '@/constants/trade'; -import { ENVIRONMENT_CONFIG_MAP, DydxNetwork, isTestnet } from '@/constants/networks'; +import { + ENVIRONMENT_CONFIG_MAP, + DydxNetwork, + isTestnet, + LINKS_CONFIG_MAP, + DydxChainId, +} from '@/constants/networks'; import { RootStore } from '@/state/_store'; import { addUncommittedOrderClientId, removeUncommittedOrderClientId } from '@/state/account'; @@ -238,9 +244,10 @@ class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol { if (isTestnet) { console.log( - `${ENVIRONMENT_CONFIG_MAP[ - this.compositeClient.network.getString() as DydxNetwork - ]?.links?.mintscan?.replace('{tx_hash}', hash.toString())}` + `${LINKS_CONFIG_MAP[ + ENVIRONMENT_CONFIG_MAP[this.compositeClient.network.getString() as DydxNetwork] + .dydxChainId as DydxChainId + ]?.mintscan?.replace('{tx_hash}', hash.toString())}` ); } else console.log(`txHash: ${hash}`); diff --git a/src/state/appSelectors.ts b/src/state/appSelectors.ts index 2917494..2351386 100644 --- a/src/state/appSelectors.ts +++ b/src/state/appSelectors.ts @@ -1,4 +1,8 @@ +import { DydxChainId, ENVIRONMENT_CONFIG_MAP } from '@/constants/networks'; import type { RootState } from './_store'; export const getApiState = (state: RootState) => state.app.apiState; export const getSelectedNetwork = (state: RootState) => state.app.selectedNetwork; + +export const getSelectedDydxChainId = (state: RootState) => + ENVIRONMENT_CONFIG_MAP[state.app.selectedNetwork].dydxChainId as DydxChainId; diff --git a/src/views/dialogs/OnboardingDialog/GenerateKeys.tsx b/src/views/dialogs/OnboardingDialog/GenerateKeys.tsx index 5e03705..23c560e 100644 --- a/src/views/dialogs/OnboardingDialog/GenerateKeys.tsx +++ b/src/views/dialogs/OnboardingDialog/GenerateKeys.tsx @@ -25,7 +25,7 @@ import { Switch } from '@/components/Switch'; import { WithReceipt } from '@/components/WithReceipt'; import { WithTooltip } from '@/components/WithTooltip'; -import { getSelectedNetwork } from '@/state/appSelectors'; +import { getSelectedNetwork, getSelectedDydxChainId } from '@/state/appSelectors'; import { track } from '@/lib/analytics'; import { isTruthy } from '@/lib/isTruthy'; @@ -98,7 +98,8 @@ export const GenerateKeys = ({ EvmDerivedAccountStatus.Derived, ].includes(status); - const signTypedData = getSignTypedData(selectedNetwork); + const selectedDydxChainId = useSelector(getSelectedDydxChainId); + const signTypedData = getSignTypedData(selectedDydxChainId); const { signTypedDataAsync } = useSignTypedData({ ...signTypedData, domain: { diff --git a/src/views/forms/AccountManagementForms/DepositForm.tsx b/src/views/forms/AccountManagementForms/DepositForm.tsx index 4b2ceb8..9b3b483 100644 --- a/src/views/forms/AccountManagementForms/DepositForm.tsx +++ b/src/views/forms/AccountManagementForms/DepositForm.tsx @@ -10,7 +10,7 @@ import { TransferInputField, TransferInputTokenResource, TransferType } from '@/ import { AlertType } from '@/constants/alerts'; import { ButtonSize } from '@/constants/buttons'; import { STRING_KEYS } from '@/constants/localization'; -import { ENVIRONMENT_CONFIG_MAP, isMainnet } from '@/constants/networks'; +import { isMainnet } from '@/constants/networks'; import { MAX_CCTP_TRANSFER_AMOUNT, MAX_PRICE_IMPACT, NumberSign } from '@/constants/numbers'; import type { EvmAddress } from '@/constants/wallets'; @@ -56,7 +56,7 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => { const [error, setError] = useState(null); const [isLoading, setIsLoading] = useState(false); const [requireUserActionInWallet, setRequireUserActionInWallet] = useState(false); - const { selectedNetwork } = useSelectedNetwork(); + const { selectedDydxChainId } = useSelectedNetwork(); const { evmAddress, signerWagmi, publicClientWagmi, nobleAddress } = useAccounts(); @@ -262,9 +262,7 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => { if (txHash) { addTransferNotification({ txHash: txHash, - toChainId: !isCctp - ? ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId - : getNobleChainId(), + toChainId: !isCctp ? selectedDydxChainId : getNobleChainId(), fromChainId: chainIdStr || undefined, toAmount: summary?.usdcSize || undefined, triggeredAt: Date.now(), diff --git a/src/views/forms/AccountManagementForms/WithdrawForm.tsx b/src/views/forms/AccountManagementForms/WithdrawForm.tsx index 33f26ef..f4474c4 100644 --- a/src/views/forms/AccountManagementForms/WithdrawForm.tsx +++ b/src/views/forms/AccountManagementForms/WithdrawForm.tsx @@ -9,7 +9,7 @@ import { TransferInputField, TransferInputTokenResource, TransferType } from '@/ import { AlertType } from '@/constants/alerts'; import { ButtonSize } from '@/constants/buttons'; import { STRING_KEYS } from '@/constants/localization'; -import { ENVIRONMENT_CONFIG_MAP, isMainnet } from '@/constants/networks'; +import { isMainnet } from '@/constants/networks'; import { TransferNotificationTypes } from '@/constants/notifications'; import { MAX_CCTP_TRANSFER_AMOUNT, MAX_PRICE_IMPACT, NumberSign } from '@/constants/numbers'; @@ -54,7 +54,7 @@ export const WithdrawForm = () => { const stringGetter = useStringGetter(); const [error, setError] = useState(); const [isLoading, setIsLoading] = useState(false); - const { selectedNetwork } = useSelectedNetwork(); + const { selectedDydxChainId } = useSelectedNetwork(); const { sendSquidWithdraw } = useSubaccount(); const { freeCollateral } = useSelector(getSubaccount, shallowEqual) || {}; @@ -177,9 +177,7 @@ export const WithdrawForm = () => { addTransferNotification({ txHash: txHash, type: TransferNotificationTypes.Withdrawal, - fromChainId: !isCctp - ? ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId - : getNobleChainId(), + fromChainId: !isCctp ? selectedDydxChainId : getNobleChainId(), toChainId: chainIdStr || undefined, toAmount: debouncedAmountBN.toNumber(), triggeredAt: Date.now(), diff --git a/src/views/forms/TransferForm.tsx b/src/views/forms/TransferForm.tsx index 678e72e..82297e3 100644 --- a/src/views/forms/TransferForm.tsx +++ b/src/views/forms/TransferForm.tsx @@ -9,7 +9,6 @@ import { TransferInputField, TransferType } from '@/constants/abacus'; import { AlertType } from '@/constants/alerts'; import { ButtonShape, ButtonSize } from '@/constants/buttons'; import { STRING_KEYS } from '@/constants/localization'; -import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks'; import { NumberSign } from '@/constants/numbers'; import { DydxChainAsset } from '@/constants/wallets'; @@ -63,7 +62,7 @@ export const TransferForm = ({ const { dydxAddress } = useAccounts(); const { transfer } = useSubaccount(); const { nativeTokenBalance, usdcBalance } = useAccountBalance(); - const { selectedNetwork } = useSelectedNetwork(); + const { selectedDydxChainId } = useSelectedNetwork(); const { tokensConfigs, usdcLabel, chainTokenLabel } = useTokenConfigs(); const { @@ -239,7 +238,7 @@ export const TransferForm = ({ const networkOptions = [ { - chainId: ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId, + chainId: selectedDydxChainId, label: ( {stringGetter({ key: STRING_KEYS.DYDX_CHAIN })} @@ -322,7 +321,7 @@ export const TransferForm = ({ /> {networkOptions.map(({ chainId, label }) => ( diff --git a/src/views/notifications/TransferStatusNotification/TransferStatusSteps.tsx b/src/views/notifications/TransferStatusNotification/TransferStatusSteps.tsx index 96c1adf..0c81ee6 100644 --- a/src/views/notifications/TransferStatusNotification/TransferStatusSteps.tsx +++ b/src/views/notifications/TransferStatusNotification/TransferStatusSteps.tsx @@ -11,7 +11,6 @@ import { LoadingSpinner } from '@/components/Loading/LoadingSpinner'; import { layoutMixins } from '@/styles/layoutMixins'; import { STRING_KEYS } from '@/constants/localization'; -import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks'; import { TransferNotificationTypes } from '@/constants/notifications'; type ElementProps = { @@ -32,9 +31,8 @@ enum TransferStatusStep { export const TransferStatusSteps = ({ className, status, type }: ElementProps & StyleProps) => { const stringGetter = useStringGetter(); - const { selectedNetwork } = useSelectedNetwork(); + const { selectedDydxChainId } = useSelectedNetwork(); const { mintscan: mintscanTxUrl } = useURLConfigs(); - const dydxChainId = ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId; const { currentStep, steps } = useMemo(() => { const routeStatus = status?.routeStatus; @@ -55,7 +53,7 @@ export const TransferStatusSteps = ({ className, status, type }: ElementProps & link: type === TransferNotificationTypes.Deposit ? status?.fromChain?.transactionUrl - : routeStatus?.[0]?.chainId === dydxChainId && routeStatus[0].txHash + : routeStatus?.[0]?.chainId === selectedDydxChainId && routeStatus[0].txHash ? `${mintscanTxUrl?.replace('{tx_hash}', routeStatus[0].txHash.replace('0x', ''))}` : undefined, }, @@ -81,7 +79,7 @@ export const TransferStatusSteps = ({ className, status, type }: ElementProps & link: type === TransferNotificationTypes.Withdrawal ? status?.toChain?.transactionUrl - : currentStatus?.chainId === dydxChainId && currentStatus?.txHash + : currentStatus?.chainId === selectedDydxChainId && currentStatus?.txHash ? `${mintscanTxUrl?.replace('{tx_hash}', currentStatus.txHash.replace('0x', ''))}` : undefined, },