From 51aebbfbb60b787f512bc7a5b5df3fa764f964b5 Mon Sep 17 00:00:00 2001 From: brucedonovan Date: Tue, 24 Jan 2023 10:13:01 +0000 Subject: [PATCH] nonDefaultExports --- packages/core/src/config/new/assets.ts | 4 +- packages/core/src/config/new/oracles.ts | 6 +- packages/core/src/config/new/series.ts | 62 +++++++++---------- packages/core/src/config/new/strategies.ts | 4 +- .../core/src/config/new/validateSeries.ts | 2 +- .../core/src/config/new/validateStrategies.ts | 2 +- packages/core/src/index.ts | 8 +-- 7 files changed, 38 insertions(+), 50 deletions(-) diff --git a/packages/core/src/config/new/assets.ts b/packages/core/src/config/new/assets.ts index 5d94091..4baa3a7 100644 --- a/packages/core/src/config/new/assets.ts +++ b/packages/core/src/config/new/assets.ts @@ -525,9 +525,7 @@ ASSETS_42161.set(WETH, { }); -const ASSETS = new Map( [ +export const ASSETS = new Map( [ [1, ASSETS_1], [42161, ASSETS_42161], ]) - -export default ASSETS; diff --git a/packages/core/src/config/new/oracles.ts b/packages/core/src/config/new/oracles.ts index c5eaca0..f6a225d 100644 --- a/packages/core/src/config/new/oracles.ts +++ b/packages/core/src/config/new/oracles.ts @@ -39,7 +39,7 @@ const NOTIONAL_MULTI_ORACLE = 'NotionalMultiOracle'; const ACCUMULATOR_ORACLE = 'AccumulatorOracle'; // map chain id to oracle info -const ORACLES = new Map>>(); +export const ORACLES = new Map>>(); // map asset (quote) and other asset (base) to a specific oracle based on where there is relevant price info for the pair const CHAIN_ID_1_ASSET_ORACLE_INFO = new Map>(); @@ -212,6 +212,4 @@ ORACLES.set(4, CHAIN_ID_1_ASSET_ORACLE_INFO); ORACLES.set(5, CHAIN_ID_1_ASSET_ORACLE_INFO); ORACLES.set(42, CHAIN_ID_1_ASSET_ORACLE_INFO); ORACLES.set(42161, CHAIN_ID_421611_ASSET_ORACLE_INFO); -ORACLES.set(421611, CHAIN_ID_421611_ASSET_ORACLE_INFO); - -export default ORACLES; \ No newline at end of file +ORACLES.set(421611, CHAIN_ID_421611_ASSET_ORACLE_INFO); \ No newline at end of file diff --git a/packages/core/src/config/new/series.ts b/packages/core/src/config/new/series.ts index e9716f3..0efa3a6 100644 --- a/packages/core/src/config/new/series.ts +++ b/packages/core/src/config/new/series.ts @@ -1,5 +1,3 @@ - - const commonProperties = { version: '1', poolVersion: '1', decimals: 18 } export interface ISeriesStatic { @@ -23,39 +21,37 @@ export interface ISeriesStatic { g2: string; } -const USDC_2112 = '0x303230340000'; -const USDC_2203 = '0x303230350000'; -const USDC_2206 = '0x303230360000'; -const USDC_2209 = '0x303230370000'; -const USDC_2212 = '0x303230380000'; -const USDC_2303 = '0x303230390000'; - -const DAI_2112 = '0x303130340000'; -const DAI_2203 = '0x303130350000'; -const DAI_2206 = '0x303130360000'; -const DAI_2209 = '0x303130370000'; -const DAI_2212 = '0x303130380000'; -const DAI_2303 = '0x303130390000'; - -const WETH_2206 = '0x303030360000'; -const WETH_2209 = '0x303030370000'; -const WETH_2212 = '0x303030380000'; -const WETH_2303 = '0x303030390000'; - -const FRAX_2206 = '0x303330360000'; -const FRAX_2209 = '0x303330370000'; -const FRAX_2212 = '0x313830380000'; -const FRAX_2303 = '0x313830390000'; +export const USDC_2112 = '0x303230340000'; +export const USDC_2203 = '0x303230350000'; +export const USDC_2206 = '0x303230360000'; +export const USDC_2209 = '0x303230370000'; +export const USDC_2212 = '0x303230380000'; +export const USDC_2303 = '0x303230390000'; + +export const DAI_2112 = '0x303130340000'; +export const DAI_2203 = '0x303130350000'; +export const DAI_2206 = '0x303130360000'; +export const DAI_2209 = '0x303130370000'; +export const DAI_2212 = '0x303130380000'; +export const DAI_2303 = '0x303130390000'; + +export const WETH_2206 = '0x303030360000'; +export const WETH_2209 = '0x303030370000'; +export const WETH_2212 = '0x303030380000'; +export const WETH_2303 = '0x303030390000'; + +export const FRAX_2206 = '0x303330360000'; +export const FRAX_2209 = '0x303330370000'; +export const FRAX_2212 = '0x313830380000'; +export const FRAX_2303 = '0x313830390000'; // 2306 - New Naming Structure -const USDC_2306 = '0x0032ff00028b'; -const DAI_2306 = '0x0031ff00028b'; -const WETH_2306 = '0x0030ff00028b'; -const FRAX_2306 = '0x0138ff00028b'; - +export const USDC_2306 = '0x0032ff00028b'; +export const DAI_2306 = '0x0031ff00028b'; +export const WETH_2306 = '0x0030ff00028b'; +export const FRAX_2306 = '0x0138ff00028b'; - -const SERIES = new Map>(); +export const SERIES = new Map>(); SERIES.set( 1, @@ -928,5 +924,3 @@ SERIES.set( ], ]) ); - -export default SERIES; \ No newline at end of file diff --git a/packages/core/src/config/new/strategies.ts b/packages/core/src/config/new/strategies.ts index c2f5d0a..3c63311 100644 --- a/packages/core/src/config/new/strategies.ts +++ b/packages/core/src/config/new/strategies.ts @@ -19,7 +19,7 @@ export interface StrategyInfo { } // map each chain id to its corresponding strategies' data -const STRATEGIES = new Map(); +export const STRATEGIES = new Map(); STRATEGIES.set(1, [ /* V1 strategies */ @@ -236,5 +236,3 @@ STRATEGIES.set(42161, [ version: '1', }, ]); - -export default STRATEGIES; diff --git a/packages/core/src/config/new/validateSeries.ts b/packages/core/src/config/new/validateSeries.ts index 82136bb..43e43ba 100644 --- a/packages/core/src/config/new/validateSeries.ts +++ b/packages/core/src/config/new/validateSeries.ts @@ -2,7 +2,7 @@ import { BaseProvider } from '@ethersproject/providers'; import { Pool__factory, FYToken__factory, Cauldron__factory } from '@yield-protocol/ui-contracts'; // import { Cauldron__factory, FYToken__factory, Pool__factory } from '../contracts'; -import SERIES, { ISeriesStatic } from './series'; +import { SERIES, ISeriesStatic } from './series'; // TODO validate series export const validateSeries = async (provider: BaseProvider, cauldronAddress: string) => { diff --git a/packages/core/src/config/new/validateStrategies.ts b/packages/core/src/config/new/validateStrategies.ts index 53cb8e5..381c460 100644 --- a/packages/core/src/config/new/validateStrategies.ts +++ b/packages/core/src/config/new/validateStrategies.ts @@ -1,6 +1,6 @@ import {BaseProvider} from "@ethersproject/providers"; import { Strategy__factory } from "@yield-protocol/ui-contracts"; -import STRATEGIES, { StrategyInfo } from "./strategies"; +import { STRATEGIES, StrategyInfo } from "./strategies"; export const validateStrategies = async (provider: BaseProvider) => { const preText = '### STRATEGY VALIDATION ERROR ### '; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 5d65e70..d217072 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -35,10 +35,10 @@ import * as yieldObservables from './observables'; import * as viewObservables from './viewObservables'; -import ASSETS from './config/new/assets'; -import SERIES from './config/new/series'; -import ORACLES from './config/new/oracles'; -import STRATEGIES from './config/new/strategies'; +import { ASSETS } from './config/new/assets'; +import { SERIES } from './config/new/series'; +import { ORACLES } from './config/new/oracles'; +import { STRATEGIES } from './config/new/strategies'; /**