aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-12-12 22:30:04 +0800
committerGitHub <noreply@github.com>2017-12-12 22:30:04 +0800
commitcb7188d47390719b74d7e09c938068a9f201c1b0 (patch)
tree1b67b0b849550bea8b5ad20fe4d7a383ec49163d /packages/subproviders
parent02f22d91555ea05fc52d342e9c91cd9477321da1 (diff)
parentd778378b37b0cbd77ecdf8d1cafc7720682064ec (diff)
downloaddexon-0x-contracts-cb7188d47390719b74d7e09c938068a9f201c1b0.tar
dexon-0x-contracts-cb7188d47390719b74d7e09c938068a9f201c1b0.tar.gz
dexon-0x-contracts-cb7188d47390719b74d7e09c938068a9f201c1b0.tar.bz2
dexon-0x-contracts-cb7188d47390719b74d7e09c938068a9f201c1b0.tar.lz
dexon-0x-contracts-cb7188d47390719b74d7e09c938068a9f201c1b0.tar.xz
dexon-0x-contracts-cb7188d47390719b74d7e09c938068a9f201c1b0.tar.zst
dexon-0x-contracts-cb7188d47390719b74d7e09c938068a9f201c1b0.zip
Merge pull request #257 from 0xProject/fix/ethereum-address
Remove ethereum-address dependency and add this logic to the repo
Diffstat (limited to 'packages/subproviders')
-rw-r--r--packages/subproviders/package.json1
-rw-r--r--packages/subproviders/src/globals.d.ts5
-rw-r--r--packages/subproviders/src/subproviders/ledger.ts4
3 files changed, 2 insertions, 8 deletions
diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json
index 7ff0c5b09..b0c5686a6 100644
--- a/packages/subproviders/package.json
+++ b/packages/subproviders/package.json
@@ -21,7 +21,6 @@
"@0xproject/utils": "^0.1.0",
"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);
}
}