diff options
Diffstat (limited to 'packages/testnet-faucets')
-rw-r--r-- | packages/testnet-faucets/Dockerfile | 5 | ||||
-rw-r--r-- | packages/testnet-faucets/package.json | 1 | ||||
-rw-r--r-- | packages/testnet-faucets/src/ts/global.d.ts | 15 | ||||
-rw-r--r-- | packages/testnet-faucets/src/ts/handler.ts | 4 |
4 files changed, 22 insertions, 3 deletions
diff --git a/packages/testnet-faucets/Dockerfile b/packages/testnet-faucets/Dockerfile index 6d6ddc192..bd1dcc4a4 100644 --- a/packages/testnet-faucets/Dockerfile +++ b/packages/testnet-faucets/Dockerfile @@ -2,6 +2,11 @@ FROM node WORKDIR /src +# Ledger Provider (in the Subproviders package) requires node-hid at dependency install time +# which compiles and expects certain USB developer library packages to be present +RUN apt-get -qq update && apt-get install -y libhidapi-dev libusb-1.0-0-dev +# Our fork of ledgerco disables requiring node-hid at run time if CIRCLECI is set to true +ENV CIRCLECI=true COPY package.json . RUN npm i RUN npm install forever -g diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json index 9efacae0a..53c2f75e9 100644 --- a/packages/testnet-faucets/package.json +++ b/packages/testnet-faucets/package.json @@ -17,6 +17,7 @@ "dependencies": { "0x.js": "^0.32.0", "@0xproject/utils": "^0.3.0", + "@0xproject/subproviders": "^0.3.5", "body-parser": "^1.17.1", "ethereumjs-tx": "^1.3.3", "ethereumjs-util": "^5.1.1", 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 e9ced3437..d96b90802 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -1,4 +1,5 @@ import { Order, SignedOrder, ZeroEx } from '0x.js'; +import { NonceTrackerSubprovider } from '@0xproject/subproviders'; import { BigNumber } from '@0xproject/utils'; import * as express from 'express'; import * as _ from 'lodash'; @@ -11,7 +12,6 @@ import * as Web3 from 'web3'; (global as any).XMLHttpRequest = undefined; 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 { configs } from './configs'; @@ -61,7 +61,7 @@ export class Handler { } private static _createProviderEngine(rpcUrl: string) { const engine = new ProviderEngine(); - engine.addProvider(new NonceSubprovider()); + engine.addProvider(new NonceTrackerSubprovider()); engine.addProvider(new HookedWalletSubprovider(idManagement)); engine.addProvider( new RpcSubprovider({ |