diff --git a/.env.base b/.env.base index a15243f1306..6edbff24bc8 100644 --- a/.env.base +++ b/.env.base @@ -42,6 +42,7 @@ REACT_APP_FEATURE_USDT_APPROVAL_RESET=true REACT_APP_FEATURE_PORTALS_SWAPPER=true REACT_APP_FEATURE_RUNEPOOL=true REACT_APP_FEATURE_MARKETS=false +REACT_APP_FEATURE_PHANTOM_WALLET=false # absolute URL prefix REACT_APP_ABSOLUTE_URL_PREFIX=https://app.shapeshift.com diff --git a/.env.dev b/.env.dev index 326bdaa71d6..f299a217699 100644 --- a/.env.dev +++ b/.env.dev @@ -55,3 +55,4 @@ REACT_APP_THORCHAIN_NODE_URL=https://dev-daemon.thorchain.shapeshift.com REACT_APP_MIDGARD_URL=https://dev-indexer.thorchain.shapeshift.com/v2 REACT_APP_FEATURE_MARKETS=true +REACT_APP_FEATURE_PHANTOM_WALLET=true diff --git a/.env.develop b/.env.develop index cdf541615e5..3d89e187356 100644 --- a/.env.develop +++ b/.env.develop @@ -52,3 +52,4 @@ REACT_APP_THORCHAIN_NODE_URL=https://dev-daemon.thorchain.shapeshift.com REACT_APP_MIDGARD_URL=https://dev-indexer.thorchain.shapeshift.com/v2 REACT_APP_FEATURE_MARKETS=true +REACT_APP_FEATURE_PHANTOM_WALLET=true diff --git a/src/config.ts b/src/config.ts index e369aaa9e03..61c0cafc351 100644 --- a/src/config.ts +++ b/src/config.ts @@ -172,6 +172,7 @@ const validators = { REACT_APP_FEATURE_MARKETS: bool({ default: false }), REACT_APP_PORTALS_BASE_URL: url(), REACT_APP_ZERION_BASE_URL: url(), + REACT_APP_FEATURE_PHANTOM_WALLET: bool({ default: false }), } function reporter({ errors }: envalid.ReporterOptions) { diff --git a/src/context/WalletProvider/SelectModal.tsx b/src/context/WalletProvider/SelectModal.tsx index 9e6dbbf8e62..c5e18a4371b 100644 --- a/src/context/WalletProvider/SelectModal.tsx +++ b/src/context/WalletProvider/SelectModal.tsx @@ -64,6 +64,9 @@ const WalletSelectItem = ({ const isCoinbaseEnabled = getConfig().REACT_APP_FEATURE_COINBASE_WALLET if (walletType === KeyManager.Coinbase && !isCoinbaseEnabled) return null + const isPhantomEnabled = getConfig().REACT_APP_FEATURE_PHANTOM_WALLET + if (walletType === KeyManager.Phantom && !isPhantomEnabled) return null + const isWalletConnectV2Enabled = getConfig().REACT_APP_FEATURE_WALLET_CONNECT_V2 if (walletType === KeyManager.WalletConnectV2 && !isWalletConnectV2Enabled) return null diff --git a/src/state/slices/preferencesSlice/preferencesSlice.ts b/src/state/slices/preferencesSlice/preferencesSlice.ts index b276822c6b5..cc06a169feb 100644 --- a/src/state/slices/preferencesSlice/preferencesSlice.ts +++ b/src/state/slices/preferencesSlice/preferencesSlice.ts @@ -62,6 +62,7 @@ export type FeatureFlags = { UsdtApprovalReset: boolean RunePool: boolean Markets: boolean + PhantomWallet: boolean } export type Flag = keyof FeatureFlags @@ -149,6 +150,7 @@ const initialState: Preferences = { UsdtApprovalReset: getConfig().REACT_APP_FEATURE_USDT_APPROVAL_RESET, RunePool: getConfig().REACT_APP_FEATURE_RUNEPOOL, Markets: getConfig().REACT_APP_FEATURE_MARKETS, + PhantomWallet: getConfig().REACT_APP_FEATURE_PHANTOM_WALLET, }, selectedLocale: simpleLocale(), balanceThreshold: '0', diff --git a/src/test/mocks/store.ts b/src/test/mocks/store.ts index cb9f8af6d1a..cc5087d3b14 100644 --- a/src/test/mocks/store.ts +++ b/src/test/mocks/store.ts @@ -114,6 +114,7 @@ export const mockStore: ReduxState = { RunePool: false, Portals: false, Markets: false, + PhantomWallet: false, }, selectedLocale: 'en', balanceThreshold: '0',