From 139071176779c615da8a17ad7da336d83de481b2 Mon Sep 17 00:00:00 2001 From: Peter Kieltyka Date: Wed, 11 Dec 2024 21:00:06 -0500 Subject: [PATCH] waas-ethers: sign typed data --- packages/waas-ethers/src/signer.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/waas-ethers/src/signer.ts b/packages/waas-ethers/src/signer.ts index f51a9401e..cab5e280e 100644 --- a/packages/waas-ethers/src/signer.ts +++ b/packages/waas-ethers/src/signer.ts @@ -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, value: Record ): Promise { - 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 {