Merge pull request #257 from 0xProject/fix/ethereum-address

Remove ethereum-address dependency and add this logic to the repo
This commit is contained in:
Leonid
2017-12-12 15:30:04 +01:00
committed by GitHub
13 changed files with 58 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
import {isAddress} from 'ethereum-address';
import {addressUtils} from '@0xproject/utils';
import * as _ from 'lodash';
import {colors} from 'material-ui/styles';
import TextField from 'material-ui/TextField';
@@ -62,7 +62,7 @@ export class AddressInput extends React.Component<AddressInputProps, AddressInpu
}
private onOrderTakerAddressUpdated(e: any) {
const address = e.target.value.toLowerCase();
const isValidAddress = isAddress(address) || address === '';
const isValidAddress = addressUtils.isAddress(address) || address === '';
const errMsg = isValidAddress ? '' : 'Invalid ethereum address';
this.setState({
address,

View File

@@ -55,11 +55,6 @@ interface System {
}
declare var System: System;
// ethereum-address declarations
declare module 'ethereum-address' {
export const isAddress: (address: string) => boolean;
}
// jsonschema declarations
// Source: https://github.com/tdegrunt/jsonschema/blob/master/lib/index.d.ts
declare interface Schema {