From a69b30245d6fbfe9a717a0c71b5cedf7ccb2b6e7 Mon Sep 17 00:00:00 2001 From: piekczyk Date: Fri, 22 Sep 2023 12:12:13 +0200 Subject: [PATCH] Extend config with navigation specific data (#38) * Extend config with navigation specific data * split config into smaller pieces * convert getNavigation to function * undo changes in gitignore * undo changes in gitignore --- configs/oasis-borrow/getFeatures.ts | 36 ++++++++ configs/oasis-borrow/getNavigation.ts | 124 ++++++++++++++++++++++++++ configs/oasis-borrow/getParameters.ts | 14 +++ configs/oasis-borrow/index.ts | 54 ++--------- 4 files changed, 181 insertions(+), 47 deletions(-) create mode 100644 configs/oasis-borrow/getFeatures.ts create mode 100644 configs/oasis-borrow/getNavigation.ts create mode 100644 configs/oasis-borrow/getParameters.ts diff --git a/configs/oasis-borrow/getFeatures.ts b/configs/oasis-borrow/getFeatures.ts new file mode 100644 index 0000000..ee5f352 --- /dev/null +++ b/configs/oasis-borrow/getFeatures.ts @@ -0,0 +1,36 @@ +import { ConfigHelperType } from "⌨️"; + +export const getFeatures = ({ isStaging }: Pick) => ({ + AaveV3ArbitrumBorrow: true, + AaveV3ArbitrumEarn: false, + AaveV3EarncbETHeth: false, + AaveV3EarnrETHeth: false, + AaveV3History: false, + AaveV3OptimismBorrow: true, + AaveV3OptimismEarn: false, + AaveV3Protection: true, + AaveV3ProtectionWrite: true, + AjnaPoolFinder: true, + AjnaReusableDPM: false, + AjnaSafetySwitch: true, + AjnaSuppressValidation: false, + AnotherTestFeature: true, // used in unit tests + ConstantMultipleReadOnly: false, + DaiSavingsRate: true, + DisableSidebarScroll: false, + FollowAAVEVaults: false, + NewNavigation: false, + ProxyCreationDisabled: false, + ProxyReveal: false, + ReadOnlyAutoTakeProfit: false, + ReadOnlyBasicBS: false, + Referrals: true, + Sillyness: false, + StopLossOpenFlow: false, + StopLossRead: true, + StopLossWrite: true, + TestFeature: false, // used in unit tests + UseNetworkSwitcherForks: false, + UseNetworkSwitcherTestnets: false, + SparkProtocolStopLoss: isStaging, +}) \ No newline at end of file diff --git a/configs/oasis-borrow/getNavigation.ts b/configs/oasis-borrow/getNavigation.ts new file mode 100644 index 0000000..058e996 --- /dev/null +++ b/configs/oasis-borrow/getNavigation.ts @@ -0,0 +1,124 @@ +export const getNavigation= () => ({ + protocols: { + ajna: { + borrow: { + tokens: ['ETH', 'WBTC', 'DAI'], + extra: { + title: 'Amplify sDAI up to 35x.', + description: + 'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.', + url: '/', + }, + }, + multiply: { + tokens: ['ETH', 'WBTC', 'DAI'], + extra: { + title: 'Amplify sDAI up to 35x.', + description: + 'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.', + url: '/', + }, + }, + earn: { + tokens: ['ETH', 'WBTC', 'DAI'], + extra: { + title: 'Amplify sDAI up to 35x.', + description: + 'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.', + url: '/', + }, + }, + }, + aave: { + borrow: { + tokens: ['ETH', 'WBTC', 'DAI'], + extra: { + title: 'Amplify sDAI up to 35x.', + description: + 'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.', + url: '/', + }, + }, + multiply: { + tokens: ['ETH', 'WBTC', 'DAI'], + extra: { + title: 'Amplify sDAI up to 35x.', + description: + 'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.', + url: '', + }, + }, + earn: { + tokens: ['ETH', 'WBTC', 'DAI'], + extra: { + title: 'Amplify sDAI up to 35x.', + description: + 'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.', + url: '/', + }, + }, + }, + maker: { + borrow: { + tokens: ['ETH', 'WBTC', 'DAI'], + extra: { + title: 'Amplify sDAI up to 35x.', + description: + 'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.', + url: '', + }, + }, + multiply: { + tokens: ['ETH', 'WBTC', 'DAI'], + extra: { + title: 'Amplify sDAI up to 35x.', + description: + 'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.', + url: '', + }, + }, + earn: { + tokens: ['ETH', 'WBTC', 'DAI'], + extra: { + title: 'Amplify sDAI up to 35x.', + description: + 'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.', + url: '', + }, + }, + }, + spark: { + borrow: { + tokens: ['ETH', 'WBTC', 'DAI'], + extra: { + title: 'Amplify sDAI up to 35x.', + description: + 'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.', + url: '', + }, + }, + multiply: { + tokens: ['ETH', 'WBTC', 'DAI'], + extra: { + title: 'Amplify sDAI up to 35x.', + description: + 'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.', + url: '', + }, + }, + earn: { + tokens: ['ETH', 'WBTC', 'DAI'], + extra: { + title: 'Amplify sDAI up to 35x.', + description: + 'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.', + url: '', + }, + }, + }, + }, + tokens: { + popular: ['ETH, STETH', 'RETH', 'CBETH', 'DAI'], + new: ['SDAI', 'GHO', 'TBTC'], + }, +}) \ No newline at end of file diff --git a/configs/oasis-borrow/getParameters.ts b/configs/oasis-borrow/getParameters.ts new file mode 100644 index 0000000..a269b3b --- /dev/null +++ b/configs/oasis-borrow/getParameters.ts @@ -0,0 +1,14 @@ +import {ConfigHelperType} from "⌨️"; + +export const getParameters = ({notProduction}: Pick) => ({ + topBanner: { + name: 'rebranding', + url: 'https://blog.summer.fi/oasis-app-rebrands-to-summer-fi/', + message: 'Oasis.app is now Summer.fi! Read the announcement', + }, + aaveLike: { + orderInformation: { + showFlashloanInformation: notProduction, + }, + }, +}) \ No newline at end of file diff --git a/configs/oasis-borrow/index.ts b/configs/oasis-borrow/index.ts index 99c5a35..fed7f53 100644 --- a/configs/oasis-borrow/index.ts +++ b/configs/oasis-borrow/index.ts @@ -1,4 +1,7 @@ import { ConfigHelperType } from "⌨️"; +import { getFeatures } from "./getFeatures"; +import { getNavigation } from "./getNavigation"; +import { getParameters } from "./getParameters"; export default function ({ isDevelopment: _isDevelopment, @@ -6,51 +9,8 @@ export default function ({ isStaging, }: ConfigHelperType) { return { - features: { - AaveV3ArbitrumBorrow: true, - AaveV3ArbitrumEarn: false, - AaveV3EarncbETHeth: false, - AaveV3EarnrETHeth: false, - AaveV3History: false, - AaveV3OptimismBorrow: true, - AaveV3OptimismEarn: false, - AaveV3Protection: true, - AaveV3ProtectionWrite: true, - AjnaPoolFinder: true, - AjnaReusableDPM: false, - AjnaSafetySwitch: true, - AjnaSuppressValidation: false, - AnotherTestFeature: true, // used in unit tests - ConstantMultipleReadOnly: false, - DaiSavingsRate: true, - DisableSidebarScroll: false, - FollowAAVEVaults: false, - NewNavigation: false, - ProxyCreationDisabled: false, - ProxyReveal: false, - ReadOnlyAutoTakeProfit: false, - ReadOnlyBasicBS: false, - Referrals: true, - Sillyness: false, - StopLossOpenFlow: false, - StopLossRead: true, - StopLossWrite: true, - TestFeature: false, // used in unit tests - UseNetworkSwitcherForks: false, - UseNetworkSwitcherTestnets: false, - SparkProtocolStopLoss: isStaging, - }, - parameters: { - topBanner: { - name: "rebranding", - url: "https://blog.summer.fi/oasis-app-rebrands-to-summer-fi/", - message: "Oasis.app is now Summer.fi! Read the announcement", - }, - aaveLike: { - orderInformation: { - showFlashloanInformation: notProduction, - }, - }, - }, - }; + features: getFeatures({ isStaging }), + parameters: getParameters({ notProduction }), + navigation: getNavigation(), + } }