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:
@@ -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,
|
||||
|
5
packages/website/ts/globals.d.ts
vendored
5
packages/website/ts/globals.d.ts
vendored
@@ -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 {
|
||||
|
Reference in New Issue
Block a user