aboutsummaryrefslogtreecommitdiffstats
path: root/packages/migrations/src/utils/provider_factory.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/migrations/src/utils/provider_factory.ts')
-rw-r--r--packages/migrations/src/utils/provider_factory.ts16
1 files changed, 14 insertions, 2 deletions
diff --git a/packages/migrations/src/utils/provider_factory.ts b/packages/migrations/src/utils/provider_factory.ts
index a0d4e436e..8017b672a 100644
--- a/packages/migrations/src/utils/provider_factory.ts
+++ b/packages/migrations/src/utils/provider_factory.ts
@@ -1,4 +1,4 @@
-import { LedgerEthereumClient, LedgerSubprovider, RPCSubprovider, Web3ProviderEngine } from '@0xproject/subproviders';
+import { LedgerEthereumClient, LedgerSubprovider, RPCSubprovider, Web3ProviderEngine } from '@0x/subproviders';
import Eth from '@ledgerhq/hw-app-eth';
// tslint:disable:no-implicit-dependencies
import TransportNodeHid from '@ledgerhq/hw-transport-node-hid';
@@ -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;
+ },
};