Type the ethereumjs-util
This commit is contained in:
parent
568b9fe742
commit
6470cf54e3
@ -9,13 +9,11 @@ export interface ECSignature {
|
||||
s: string;
|
||||
}
|
||||
|
||||
export type ETHAddress = string;
|
||||
|
||||
export class ZeroEx {
|
||||
/**
|
||||
* Checks if the signature is valid
|
||||
*/
|
||||
public static isValidSignature(data: string, signature: ECSignature, signer: ETHAddress): boolean {
|
||||
public static isValidSignature(data: string, signature: ECSignature, signer: ETHAddressHex): boolean {
|
||||
const dataBuff = ethUtil.toBuffer(data);
|
||||
const msgHashBuff = ethUtil.hashPersonalMessage(dataBuff);
|
||||
try {
|
||||
|
12
src/ts/globals.d.ts
vendored
12
src/ts/globals.d.ts
vendored
@ -1 +1,11 @@
|
||||
declare module 'ethereumjs-util';
|
||||
declare type PubKey = string;
|
||||
declare type ETHAddressHex = string;
|
||||
declare type ETHAddressBuff = Buffer;
|
||||
|
||||
declare module 'ethereumjs-util' {
|
||||
const toBuffer: (data: string) => Buffer;
|
||||
const hashPersonalMessage: (msg: Buffer) => Buffer;
|
||||
const bufferToHex: (buff: Buffer) => string;
|
||||
const ecrecover: (msgHashBuff: Buffer, v: number, r: Buffer, s: Buffer) => PubKey;
|
||||
const pubToAddress: (pubKey: PubKey) => ETHAddressBuff;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user