Skip to content

Commit

Permalink
update AWS KMS transaction signing fields (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecananian authored Oct 16, 2024
1 parent 79e7179 commit b82e78b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/hip-bugs-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@treasure-dev/tdk-core": patch
---

Updated AWS KMS transaction signing fields
5 changes: 3 additions & 2 deletions packages/core/src/connect/kms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ export const getAwsKmsAccount = async ({

const r = `0x${signature.r.toString("hex")}` as Hex;
const s = `0x${signature.s.toString("hex")}` as Hex;
const v = signature.v;
const v = BigInt(signature.v);

const yParity = v % 2 === 0 ? 1 : (0 as 0 | 1);
const yParity: 0 | 1 = signature.v % 2 === 0 ? 1 : 0;

const signedTx = serializeTransaction({
transaction: tx,
signature: {
r,
s,
v,
yParity,
},
});
Expand Down

0 comments on commit b82e78b

Please sign in to comment.