Skip to content

Commit

Permalink
waas-ethers: sign typed data
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka committed Dec 12, 2024
1 parent 6780bc4 commit 1390711
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/waas-ethers/src/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ export class SequenceSigner extends ethers.AbstractSigner {
return this.sequence.signMessage(args).then(response => response.data.signature)
}

signTypedData(
async signTypedData(
domain: ethers.TypedDataDomain,
types: Record<string, ethers.TypedDataField[]>,
value: Record<string, any>
): Promise<string> {
throw new Error('SequenceSigner does not support signTypedData')
const typedDataDigest = ethers.TypedDataEncoder.encode(domain, types, value)
return this.sequence.signMessage({
message: typedDataDigest,
network: await this.getSimpleNetwork()
}).then(response => response.data.signature)
}

async signTransaction(_transaction: ethers.TransactionRequest): Promise<string> {
Expand Down

0 comments on commit 1390711

Please sign in to comment.