aboutsummaryrefslogtreecommitdiffstats
path: root/packages/testnet-faucets/src
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-02-07 07:29:19 +0800
committerGitHub <noreply@github.com>2018-02-07 07:29:19 +0800
commit548246c05f128d23d701d9b738ce53deaf783f63 (patch)
tree2dd525ed3624352160c1de2747b7eb7932e28820 /packages/testnet-faucets/src
parent629653425da973df0ac5d21d11da5a61c3a31e09 (diff)
parent4be8eca3fe6a81b468776f5413f25ec726e4e752 (diff)
downloaddexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.tar
dexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.tar.gz
dexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.tar.bz2
dexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.tar.lz
dexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.tar.xz
dexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.tar.zst
dexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.zip
Merge pull request #355 from 0xProject/feature/subproviders/nonce-tracker
Nonce tracker subprovider
Diffstat (limited to 'packages/testnet-faucets/src')
-rw-r--r--packages/testnet-faucets/src/ts/global.d.ts15
-rw-r--r--packages/testnet-faucets/src/ts/handler.ts4
2 files changed, 16 insertions, 3 deletions
diff --git a/packages/testnet-faucets/src/ts/global.d.ts b/packages/testnet-faucets/src/ts/global.d.ts
index 97cd35680..41a2f3a8a 100644
--- a/packages/testnet-faucets/src/ts/global.d.ts
+++ b/packages/testnet-faucets/src/ts/global.d.ts
@@ -1,5 +1,4 @@
declare module 'rollbar';
-declare module 'web3-provider-engine';
declare module 'web3-provider-engine/subproviders/rpc';
declare module 'web3-provider-engine/subproviders/nonce-tracker';
declare module 'web3-provider-engine/subproviders/hooked-wallet';
@@ -24,3 +23,17 @@ declare module 'ethereumjs-tx' {
}
export = EthereumTx;
}
+
+/* tslint:disable */
+declare module 'web3-provider-engine' {
+ class Web3ProviderEngine {
+ public on(event: string, handler: () => void): void;
+ public send(payload: any): void;
+ public sendAsync(payload: any, callback: (error: any, response: any) => void): void;
+ public addProvider(provider: any): void;
+ public start(): void;
+ public stop(): void;
+ }
+ export = Web3ProviderEngine;
+}
+/* tslint:enable */
diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts
index bf5b3e81e..121112fd3 100644
--- a/packages/testnet-faucets/src/ts/handler.ts
+++ b/packages/testnet-faucets/src/ts/handler.ts
@@ -1,9 +1,9 @@
+import { NonceTrackerSubprovider } from '@0xproject/subproviders';
import { addressUtils } from '@0xproject/utils';
import * as express from 'express';
import * as _ from 'lodash';
import ProviderEngine = require('web3-provider-engine');
import HookedWalletSubprovider = require('web3-provider-engine/subproviders/hooked-wallet');
-import NonceSubprovider = require('web3-provider-engine/subproviders/nonce-tracker');
import RpcSubprovider = require('web3-provider-engine/subproviders/rpc');
import { EtherRequestQueue } from './ether_request_queue';
@@ -96,7 +96,7 @@ export class Handler {
// tslint:disable-next-line:prefer-function-over-method
private _createProviderEngine(rpcUrl: string) {
const engine = new ProviderEngine();
- engine.addProvider(new NonceSubprovider());
+ engine.addProvider(new NonceTrackerSubprovider());
engine.addProvider(new HookedWalletSubprovider(idManagement));
engine.addProvider(
new RpcSubprovider({