diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-09-05 00:48:13 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-09-05 02:07:56 +0800 |
commit | 66ed6b9b887b97fa117d91f1034ad1aa3c095249 (patch) | |
tree | aee5c758ad212c4a6596dd0a80adc3c125bae331 /packages/migrations/src/utils | |
parent | 9304d09da6c3a78e25caf67a024b0cfef4a3b922 (diff) | |
download | dexon-sol-tools-66ed6b9b887b97fa117d91f1034ad1aa3c095249.tar.gz dexon-sol-tools-66ed6b9b887b97fa117d91f1034ad1aa3c095249.tar.zst dexon-sol-tools-66ed6b9b887b97fa117d91f1034ad1aa3c095249.zip |
Update mainnet configs
Diffstat (limited to 'packages/migrations/src/utils')
-rw-r--r-- | packages/migrations/src/utils/constants.ts | 2 | ||||
-rw-r--r-- | packages/migrations/src/utils/provider_factory.ts | 14 |
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; + }, }; |