Expose eth_signTypedData functionality for order signing
This commit is contained in:
@@ -314,6 +314,21 @@ export class Web3Wrapper {
|
||||
});
|
||||
return signData;
|
||||
}
|
||||
/**
|
||||
* Sign an EIP712 typed data message with a specific address's private key (`eth_signTypedData`)
|
||||
* @param address Address of signer
|
||||
* @param typedData Typed data message to sign
|
||||
* @returns Signature string (might be VRS or RSV depending on the Signer)
|
||||
*/
|
||||
public async signTypedDataAsync(address: string, typedData: object): Promise<string> {
|
||||
assert.isETHAddressHex('address', address);
|
||||
assert.doesConformToSchema('typedData', typedData, schemas.eip712TypedData);
|
||||
const signData = await this.sendRawPayloadAsync<string>({
|
||||
method: 'eth_signTypedData',
|
||||
params: [address, typedData],
|
||||
});
|
||||
return signData;
|
||||
}
|
||||
/**
|
||||
* Fetches the latest block number
|
||||
* @returns Block number
|
||||
|
Reference in New Issue
Block a user