From 32c0a4c77d801bc4ec453abfcf6b7e4a5a90aeea Mon Sep 17 00:00:00 2001 From: Paul Puey Date: Wed, 7 Aug 2024 18:00:33 -0700 Subject: [PATCH] Make several chains configurable via env.json Now various whitelabels can disable chains via config. --- CHANGELOG.md | 6 +++++- src/envConfig.ts | 8 +++++++- src/util/corePlugins.ts | 14 +++++++------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dd8456ac55..4d3c1444889 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +- added: Add disableSurveyModal option +- changed: Disable Home scene swap and FIO cards if configured +- changed: Allow some chains to be disabled in env.json + ## 4.11.0 - added: Kado buy via wire transfer @@ -37,7 +41,7 @@ - fixed: Buying non-BTC assets with Bity - fixed: Misc styling fixes on SepaFormScene and AddressFormScene - fixed: Pressing back during native fiat buy/sell flows results in stuck button spinners -- fixed: Broken Android paste into `TextInputModal` in "ScanQR" -> "Enter" +- fixed: Broken Android paste into `TextInputModal` in "ScanQR" -> "Enter" - fixed: Promo cards not visible until scroll for new accounts ## 4.9.2 (2024-07-22) diff --git a/src/envConfig.ts b/src/envConfig.ts index 7a5d5aed3b1..aaaa400a559 100644 --- a/src/envConfig.ts +++ b/src/envConfig.ts @@ -118,7 +118,9 @@ export const asEnvConfig = asObject({ // Core plugin options: ARBITRUM_INIT: asCorePluginInit(asEvmApiKeys), AMOY_INIT: asCorePluginInit(asEvmApiKeys), + ALGORAND_INIT: asOptional(asBoolean, true), AVALANCHE_INIT: asCorePluginInit(asEvmApiKeys), + AXELAR_INIT: asOptional(asBoolean, true), BASE_INIT: asCorePluginInit(asEvmApiKeys), BINANCE_SMART_CHAIN_INIT: asCorePluginInit(asEvmApiKeys), BITCOIN_INIT: asCorePluginInit( @@ -156,6 +158,7 @@ export const asEnvConfig = asObject({ }).withRest ), COREUM_INIT: asCorePluginInit(asBoolean), + COSMOSHUB_INIT: asCorePluginInit(asBoolean), DASH_INIT: asCorePluginInit( asObject({ nowNodeApiKey: asOptional(asString, '') @@ -188,6 +191,7 @@ export const asEnvConfig = asObject({ freeRegRefCode: asOptional(asString, '') }).withRest ), + FILECOINFEVM_INIT: asOptional(asBoolean, true), FILECOIN_INIT: asCorePluginInit( asObject({ glifApiKey: asOptional(asString, '') @@ -204,6 +208,8 @@ export const asEnvConfig = asObject({ }).withRest ), HOLESKY_INIT: asCorePluginInit(asEvmApiKeys), + HEDERA_INIT: asOptional(asBoolean, true), + LIBERLAND_INIT: asOptional(asBoolean, true), LIFI_INIT: asCorePluginInit( asObject({ affiliateFeeBasis: asOptional(asString, '50'), @@ -229,7 +235,7 @@ export const asEnvConfig = asObject({ OPTIMISM_INIT: asCorePluginInit(asEvmApiKeys), OSMOSIS_INIT: asCorePluginInit(asBoolean), PULSECHAIN_INIT: asCorePluginInit(asEvmApiKeys), - + POLKADOT_INIT: asOptional(asBoolean, true), POLYGON_INIT: asCorePluginInit(asEvmApiKeys), RANGO_INIT: asCorePluginInit( asObject({ diff --git a/src/util/corePlugins.ts b/src/util/corePlugins.ts index d03e11d44fe..397702d315b 100644 --- a/src/util/corePlugins.ts +++ b/src/util/corePlugins.ts @@ -6,9 +6,9 @@ export const currencyPlugins: EdgeCorePluginsInit = { // edge-currency-accountbased: amoy: ENV.AMOY_INIT, arbitrum: ENV.ARBITRUM_INIT, - algorand: true, + algorand: ENV.ALGORAND_INIT, avalanche: ENV.AVALANCHE_INIT, - axelar: true, + axelar: ENV.AXELAR_INIT, base: ENV.BASE_INIT, binance: true, binancesmartchain: ENV.BINANCE_SMART_CHAIN_INIT, @@ -17,24 +17,24 @@ export const currencyPlugins: EdgeCorePluginsInit = { cardanotestnet: false, // ENV.CARDANO_INIT, celo: true, coreum: ENV.COREUM_INIT, - cosmoshub: true, + cosmoshub: ENV.COSMOSHUB_INIT, eos: true, ethereum: ENV.ETHEREUM_INIT, ethereumclassic: true, ethereumpow: ENV.ETHEREUM_POW_INIT, fantom: ENV.FANTOM_INIT, filecoin: ENV.FILECOIN_INIT, - filecoinfevm: true, + filecoinfevm: ENV.FILECOINFEVM_INIT, filecoinfevmcalibration: true, fio: ENV.FIO_INIT, - hedera: true, + hedera: ENV.HEDERA_INIT, holesky: ENV.HOLESKY_INIT, - liberland: true, + liberland: ENV.LIBERLAND_INIT, liberlandtestnet: false, optimism: ENV.OPTIMISM_INIT, osmosis: ENV.OSMOSIS_INIT, piratechain: true, - polkadot: true, + polkadot: ENV.POLKADOT_INIT, polygon: ENV.POLYGON_INIT, pulsechain: ENV.PULSECHAIN_INIT, ripple: true,