type DriftConfig = { ENV : DriftEnv ; PYTH_ORACLE_MAPPING_ADDRESS : string ; CLEARING_HOUSE_PROGRAM_ID : string ; USDC_MINT_ADDRESS : string ; } ; export type DriftEnv = 'devnet' | 'mainnet-beta' ; export const configs = { devnet : { ENV : 'devnet' , PYTH_ORACLE_MAPPING_ADDRESS : 'BmA9Z6FjioHJPpjT39QazZyhDRUdZy2ezwx4GiDdE2u2' , CLEARING_HOUSE_PROGRAM_ID : 'AsW7LnXB9UA1uec9wi9MctYTgTz7YH9snhxd16GsFaGX' , USDC_MINT_ADDRESS : '8zGuJQqwhZafTah7Uc7Z4tXRnguqkn5KLFAP8oV6PHe2' , } , 'mainnet-beta' : { ENV : 'mainnet-beta' , PYTH_ORACLE_MAPPING_ADDRESS : 'AHtgzX45WTKfkPG53L6WYhGEXwQkN1BVknET3sVsLL8J' , CLEARING_HOUSE_PROGRAM_ID : 'dammHkt7jmytvbS3nHTxQNEcP59aE57nxwV21YdqEDN' , USDC_MINT_ADDRESS : 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' , } , } ; let currentConfig = configs . devnet ; export const getConfig = ( ) : DriftConfig => currentConfig ; param props returns export const initialize = ( props ) : DriftConfig => { if ( props . env === 'master' ) return { ... configs [ 'devnet' ] , ... ( props . overrideEnv ?? { } ) } ; currentConfig = { ... configs [ props . env ] , ... ( props . overrideEnv ?? { } ) } ; return currentConfig ; } ;