From 84062df29a97d8286e13d26be8c20b4924363b97 Mon Sep 17 00:00:00 2001 From: Nayan Das Date: Mon, 9 Mar 2026 15:02:27 +0530 Subject: [PATCH] feat(sdk-coin-tempo): add getSenderAddress to Tip20Transaction Ticket: CECHO-333 --- modules/sdk-coin-tempo/src/lib/transaction.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/sdk-coin-tempo/src/lib/transaction.ts b/modules/sdk-coin-tempo/src/lib/transaction.ts index 41c1b07c33..34060c992a 100644 --- a/modules/sdk-coin-tempo/src/lib/transaction.ts +++ b/modules/sdk-coin-tempo/src/lib/transaction.ts @@ -211,6 +211,24 @@ export class Tip20Transaction extends BaseTransaction { return this._signature; } + /** + * Recover the signer address from the transaction signature. + * @returns Checksummed sender address, or undefined if unsigned + */ + getSenderAddress(): string | undefined { + if (!this._signature) { + return undefined; + } + + const unsignedHex = this.serializeTransaction(); + const msgHash = ethers.utils.keccak256(ethers.utils.arrayify(unsignedHex)); + return ethers.utils.recoverAddress(msgHash, { + r: this._signature.r, + s: this._signature.s, + recoveryParam: this._signature.yParity, + }); + } + toJson(): TxData { return { type: this.txRequest.type,