import _ from 'lodash' ; import { ChainServiceConfiguration , DeepPartial , LoggingConfiguration , NetworkConfiguration , OptionalDatabaseConfiguration , OptionalWalletConfig , SyncConfiguration , WalletConfig , } from './types' ; export const defaultDatabaseConfiguration = { pool : undefined , debug : false , connection : { host : 'localhost' , port : 5432 , user : 'postgres' } , } ; /**
 * Network config
 */ /**
 * Logging and Metrics config
 */ export const defaultLoggingConfiguration = { logLevel : 'info' , logDestination : 'console' , } ; export const defaultMetricsConfiguration = { timingMetrics : false } ; export const defaultChainServiceConfiguration = { attachChainService : false , } ; export const defaultSyncConfiguration = { pollInterval : 100 , timeOutThreshold : 60000 , staleThreshold : 1000 , } ; /**
 * Server Wallet config
 */ /**
 * These are the default values that will be used by the server wallet
 * if not overidden in the provided config
 */ export const defaultConfig = { databaseConfiguration : defaultDatabaseConfiguration , loggingConfiguration : defaultLoggingConfiguration , metricsConfiguration : defaultMetricsConfiguration , chainServiceConfiguration : defaultChainServiceConfiguration , skipEvmValidation : false , workerThreadAmount : 0 , syncConfiguration : defaultSyncConfiguration , } ; export const DEFAULT_DB_NAME = 'server_wallet_test' ; export const DEFAULT_DB_USER = 'postgres' ; type HasDatabaseConnectionConfigObject = { databaseConfiguration : { connection : { host : string ; port : number ; database : string ; } ; } ; } ; export const defaultTestNetworkConfiguration = { chainNetworkID : parseInt ( process . env . CHAIN_NETWORK_ID ?? '0' ) , } ; export function defaultTestWalletConfig ( partialConfig = { } ) { const fullDefaultConfig = { ... defaultConfig , networkConfiguration : defaultTestNetworkConfiguration , skipEvmValidation : true , workerThreadAmount : 0 , databaseConfiguration : { connection : { host : defaultDatabaseConfiguration . connection . host , port : defaultDatabaseConfiguration . connection . port , database : DEFAULT_DB_NAME , user : DEFAULT_DB_USER , } , pool : { min : 0 , max : 1 } , } , } ; return _ . merge ( { } , fullDefaultConfig , partialConfig ) ; }