-
Notifications
You must be signed in to change notification settings - Fork 759
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into tx-new-release-v301
- Loading branch information
Showing
15 changed files
with
344 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,42 @@ | ||
import { chainsType } from './../types' | ||
import { Chain, chainsType } from './../types' | ||
import mainnet from './mainnet.json' | ||
import ropsten from './ropsten.json' | ||
import rinkeby from './rinkeby.json' | ||
import kovan from './kovan.json' | ||
import goerli from './goerli.json' | ||
|
||
export const chains: chainsType = { | ||
names: { | ||
/** | ||
* @hidden | ||
*/ | ||
export function _getInitializedChains(customChains?: Chain[]) { | ||
const names: any = { | ||
'1': 'mainnet', | ||
'3': 'ropsten', | ||
'4': 'rinkeby', | ||
'42': 'kovan', | ||
'5': 'goerli', | ||
}, | ||
mainnet: require('./mainnet.json'), | ||
ropsten: require('./ropsten.json'), | ||
rinkeby: require('./rinkeby.json'), | ||
kovan: require('./kovan.json'), | ||
goerli: require('./goerli.json'), | ||
} | ||
const chains: any = { | ||
mainnet, | ||
ropsten, | ||
rinkeby, | ||
kovan, | ||
goerli, | ||
} | ||
if (customChains) { | ||
for (const chain of customChains) { | ||
const name = chain.name | ||
names[chain.chainId.toString()] = name | ||
chains[name] = chain | ||
} | ||
} | ||
|
||
chains['names'] = names | ||
return chains | ||
} | ||
|
||
/** | ||
* @deprecated this constant will be internalized (removed) | ||
* on next major version update | ||
*/ | ||
export const chains: chainsType = _getInitializedChains() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.