aboutsummaryrefslogtreecommitdiffstats
path: root/packages/migrations/src/utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-09-05 03:23:48 +0800
committerGitHub <noreply@github.com>2018-09-05 03:23:48 +0800
commita5859c6cee0729cf493afa4ff192469cd781fa2b (patch)
treef9f90173c30b6af0eaf903444d1766713a8349e6 /packages/migrations/src/utils
parent6a619a4084188d1c48d8030d0fe2a1ba777c55e3 (diff)
parent6f7a5d00e6af9e94043daef858ed407a95f386b2 (diff)
downloaddexon-0x-contracts-a5859c6cee0729cf493afa4ff192469cd781fa2b.tar.gz
dexon-0x-contracts-a5859c6cee0729cf493afa4ff192469cd781fa2b.tar.zst
dexon-0x-contracts-a5859c6cee0729cf493afa4ff192469cd781fa2b.zip
Merge pull request #1038 from 0xProject/feature/contracts/mainnetMigrations
Mainnet migrations
Diffstat (limited to 'packages/migrations/src/utils')
-rw-r--r--packages/migrations/src/utils/constants.ts2
-rw-r--r--packages/migrations/src/utils/provider_factory.ts14
2 files changed, 15 insertions, 1 deletions
diff --git a/packages/migrations/src/utils/constants.ts b/packages/migrations/src/utils/constants.ts
index 4ae2ff833..63898ac02 100644
--- a/packages/migrations/src/utils/constants.ts
+++ b/packages/migrations/src/utils/constants.ts
@@ -13,4 +13,6 @@ export const constants = {
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
KOVAN_RPC_URL: 'https://kovan.infura.io/',
KOVAN_NETWORK_ID: 42,
+ MAINNET_RPC_URL: 'https://mainnet.infura.io/',
+ MAINNET_NETWORK_ID: 1,
};
diff --git a/packages/migrations/src/utils/provider_factory.ts b/packages/migrations/src/utils/provider_factory.ts
index a0d4e436e..e7e00a039 100644
--- a/packages/migrations/src/utils/provider_factory.ts
+++ b/packages/migrations/src/utils/provider_factory.ts
@@ -12,7 +12,7 @@ async function ledgerEthereumNodeJsClientFactoryAsync(): Promise<LedgerEthereumC
return ledgerEthClient;
}
export const providerFactory = {
- async getLedgerProviderAsync(): Promise<Provider> {
+ async getKovanLedgerProviderAsync(): Promise<Provider> {
const provider = new Web3ProviderEngine();
const ledgerWalletConfigs = {
networkId: constants.KOVAN_NETWORK_ID,
@@ -24,4 +24,16 @@ export const providerFactory = {
provider.start();
return provider;
},
+ async getMainnetLedgerProviderAsync(): Promise<Provider> {
+ const provider = new Web3ProviderEngine();
+ const ledgerWalletConfigs = {
+ networkId: constants.MAINNET_NETWORK_ID,
+ ledgerEthereumClientFactoryAsync: ledgerEthereumNodeJsClientFactoryAsync,
+ };
+ const ledgerSubprovider = new LedgerSubprovider(ledgerWalletConfigs);
+ provider.addProvider(ledgerSubprovider);
+ provider.addProvider(new RPCSubprovider(constants.MAINNET_RPC_URL));
+ provider.start();
+ return provider;
+ },
};