Skip to content

Commit b82e78b

Browse files
authored
update AWS KMS transaction signing fields (#143)
1 parent 79e7179 commit b82e78b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/hip-bugs-complain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@treasure-dev/tdk-core": patch
3+
---
4+
5+
Updated AWS KMS transaction signing fields

packages/core/src/connect/kms.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ export const getAwsKmsAccount = async ({
3737

3838
const r = `0x${signature.r.toString("hex")}` as Hex;
3939
const s = `0x${signature.s.toString("hex")}` as Hex;
40-
const v = signature.v;
40+
const v = BigInt(signature.v);
4141

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

4444
const signedTx = serializeTransaction({
4545
transaction: tx,
4646
signature: {
4747
r,
4848
s,
49+
v,
4950
yParity,
5051
},
5152
});

0 commit comments

Comments
 (0)