2017-03-14 05:14:19 +01:00
|
|
|
// test and development environment variables
|
|
|
|
const env = process.env.METAMASK_ENV
|
2018-04-03 18:51:33 +02:00
|
|
|
const METAMASK_DEBUG = process.env.METAMASK_DEBUG
|
2018-04-12 23:17:36 +02:00
|
|
|
const { DEFAULT_NETWORK, MAINNET } = require('./controllers/network/enums')
|
2017-03-14 05:14:19 +01:00
|
|
|
|
2018-04-18 23:02:08 +02:00
|
|
|
/**
|
|
|
|
* @typedef {Object} FirstTimeState
|
|
|
|
* @property {Object} config Initial configuration parameters
|
|
|
|
* @property {Object} NetworkController Network controller state
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2018-04-18 23:24:36 +02:00
|
|
|
* @type {FirstTimeState}
|
2018-04-18 23:02:08 +02:00
|
|
|
*/
|
|
|
|
const initialState = {
|
2017-05-23 08:12:28 +02:00
|
|
|
config: {},
|
|
|
|
NetworkController: {
|
2017-01-12 07:47:56 +01:00
|
|
|
provider: {
|
2018-04-12 23:17:36 +02:00
|
|
|
type: (METAMASK_DEBUG || env === 'test') ? DEFAULT_NETWORK : MAINNET,
|
2017-01-12 07:47:56 +01:00
|
|
|
},
|
|
|
|
},
|
2017-03-14 05:14:19 +01:00
|
|
|
}
|
2018-04-18 23:02:08 +02:00
|
|
|
|
|
|
|
module.exports = initialState
|