From a14424ae5f45784db5e75c2d6a9098dc96914c9e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 11 Dec 2017 12:43:19 +0100 Subject: Move isAddress to shared utils and remove all dependencies on ethereum-address --- packages/subproviders/package.json | 1 - packages/subproviders/src/globals.d.ts | 5 ----- packages/subproviders/src/subproviders/ledger.ts | 4 ++-- 3 files changed, 2 insertions(+), 8 deletions(-) (limited to 'packages/subproviders') diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index b724e5dae..5256f336e 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -20,7 +20,6 @@ "@0xproject/assert": "^0.0.7", "bn.js": "^4.11.8", "es6-promisify": "^5.0.0", - "ethereum-address": "^0.0.4", "ethereumjs-tx": "^1.3.3", "ethereumjs-util": "^5.1.1", "ledgerco": "0xProject/ledger-node-js-api", diff --git a/packages/subproviders/src/globals.d.ts b/packages/subproviders/src/globals.d.ts index 520ca9232..400bbef5b 100644 --- a/packages/subproviders/src/globals.d.ts +++ b/packages/subproviders/src/globals.d.ts @@ -54,11 +54,6 @@ declare module 'ledgerco' { } } -// ethereum-address declarations -declare module 'ethereum-address' { - export const isAddress: (address: string) => boolean; -} - // Semaphore-async-await declarations declare module 'semaphore-async-await' { class Semaphore { diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts index e0a08f792..578f6ff6f 100644 --- a/packages/subproviders/src/subproviders/ledger.ts +++ b/packages/subproviders/src/subproviders/ledger.ts @@ -1,6 +1,6 @@ import {assert} from '@0xproject/assert'; +import {addressUtils} from '@0xproject/utils'; import promisify = require('es6-promisify'); -import {isAddress} from 'ethereum-address'; import EthereumTx = require('ethereumjs-tx'); import ethUtil = require('ethereumjs-util'); import * as ledger from 'ledgerco'; @@ -47,7 +47,7 @@ export class LedgerSubprovider extends Subprovider { return isValid; } private static validateSender(sender: string) { - if (_.isUndefined(sender) || !isAddress(sender)) { + if (_.isUndefined(sender) || !addressUtils.isAddress(sender)) { throw new Error(LedgerSubproviderErrors.SenderInvalidOrNotSupplied); } } -- cgit v1.2.3 From f3f596b231d3456850ebfd222471b7bbbfc74819 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 12 Dec 2017 15:06:38 +0100 Subject: Add missing dependency --- packages/subproviders/package.json | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/subproviders') diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index b724e5dae..7ff0c5b09 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -18,6 +18,7 @@ }, "dependencies": { "@0xproject/assert": "^0.0.7", + "@0xproject/utils": "^0.1.0", "bn.js": "^4.11.8", "es6-promisify": "^5.0.0", "ethereum-address": "^0.0.4", -- cgit v1.2.3 From d778378b37b0cbd77ecdf8d1cafc7720682064ec Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 12 Dec 2017 15:14:54 +0100 Subject: Add missing dependency --- packages/subproviders/package.json | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/subproviders') diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index 5256f336e..b0c5686a6 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -18,6 +18,7 @@ }, "dependencies": { "@0xproject/assert": "^0.0.7", + "@0xproject/utils": "^0.1.0", "bn.js": "^4.11.8", "es6-promisify": "^5.0.0", "ethereumjs-tx": "^1.3.3", -- cgit v1.2.3