mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-26 08:25:14 +00:00
29 lines
659 B
JavaScript
29 lines
659 B
JavaScript
|
// @flow
|
||
|
import { ensureOnce } from '~/utils/singleton'
|
||
|
import { TX_SERVICE_HOST } from '~/config/names'
|
||
|
import devConfig from './development'
|
||
|
import testConfig from './testing'
|
||
|
import prodConfig from './production'
|
||
|
|
||
|
const configuration = () => {
|
||
|
if (process.env.NODE_ENV === 'test') {
|
||
|
return testConfig
|
||
|
}
|
||
|
|
||
|
if (process.env.NODE_ENV === 'production') {
|
||
|
return prodConfig
|
||
|
}
|
||
|
|
||
|
return devConfig
|
||
|
}
|
||
|
|
||
|
const getConfig = ensureOnce(configuration)
|
||
|
|
||
|
export const getTxServiceHost = () => {
|
||
|
const config = getConfig()
|
||
|
|
||
|
return config[TX_SERVICE_HOST]
|
||
|
}
|
||
|
|
||
|
export const getTxServiceUriFrom = (safeAddress: string) => `safes/${safeAddress}/transactions/`
|