Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async signTypedDataAsync(address: string, typedData: any): Promise {
assert.isETHAddressHex('address', address);
assert.doesConformToSchema('typedData', typedData, schemas.eip712TypedDataSchema);
const signData = await this.sendRawPayloadAsync({
method: 'eth_signTypedData',
params: [address, typedData],
});
return signData;
}
/**
assert.isString('primaryType', primaryType);
const typedData = {
types: {
EIP712Domain: constants.DEFAULT_DOMAIN_SCHEMA.parameters,
...types,
},
domain: {
name: domain.name === undefined ? constants.EXCHANGE_DOMAIN_NAME : domain.name,
version: domain.version === undefined ? constants.EXCHANGE_DOMAIN_VERSION : domain.version,
chainId: domain.chainId,
verifyingContract: domain.verifyingContract,
},
message,
primaryType,
};
assert.doesConformToSchema('typedData', typedData, schemas.eip712TypedDataSchema);
return typedData;
},
/**