Skip to content

Commit

Permalink
fix: signature
Browse files Browse the repository at this point in the history
  • Loading branch information
ieow committed Oct 21, 2024
1 parent 55f6cfe commit d0a37f2
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
TypedMessageParams,
validateTypedSignMessageDataV4,
} from "@web3auth/ethereum-provider";
import { hashMessage, TypedDataEncoder } from "ethers";
import { hashMessage, Signature, TypedDataEncoder } from "ethers";

async function signTx(
txParams: TransactionParams & { gas?: string },
Expand All @@ -37,9 +37,7 @@ async function signTx(

// addSignature will handle the v value
const tx = ethTx;
tx.signature.v = BigInt(v);
tx.signature.r = r;
tx.signature.s = s;
tx.signature = Signature.from({ v, r: `0x${r.toString("hex")}`, s: `0x${s.toString("hex")}` });

return tx.serialized as PrefixedHexString;
}
Expand Down

0 comments on commit d0a37f2

Please sign in to comment.