diff options
Diffstat (limited to 'packages/testnet-faucets/src/ts/handler.ts')
-rw-r--r-- | packages/testnet-faucets/src/ts/handler.ts | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index 6d26691d6..3749bc70b 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -5,9 +5,12 @@ import { Provider } from 'ethereum-types'; import * as express from 'express'; import * as _ from 'lodash'; -import { NonceTrackerSubprovider, PrivateKeyWalletSubprovider } from '@0xproject/subproviders'; -import ProviderEngine = require('web3-provider-engine'); -import RpcSubprovider = require('web3-provider-engine/subproviders/rpc'); +import { + NonceTrackerSubprovider, + PrivateKeyWalletSubprovider, + RPCSubprovider, + Web3ProviderEngine, +} from '@0xproject/subproviders'; import { configs } from './configs'; import { constants } from './constants'; @@ -34,19 +37,15 @@ enum RequestedAssetType { const FIVE_DAYS_IN_MS = 4.32e8; // TODO: make this configurable export class Handler { - private _networkConfigByNetworkId: ItemByNetworkId<NetworkConfig> = {}; + private readonly _networkConfigByNetworkId: ItemByNetworkId<NetworkConfig> = {}; private static _createProviderEngine(rpcUrl: string): Provider { if (_.isUndefined(configs.DISPENSER_PRIVATE_KEY)) { throw new Error('Dispenser Private key not found'); } - const engine = new ProviderEngine(); + const engine = new Web3ProviderEngine(); engine.addProvider(new NonceTrackerSubprovider()); engine.addProvider(new PrivateKeyWalletSubprovider(configs.DISPENSER_PRIVATE_KEY)); - engine.addProvider( - new RpcSubprovider({ - rpcUrl, - }), - ); + engine.addProvider(new RPCSubprovider(rpcUrl)); engine.start(); return engine; } |