Skip to content

Commit

Permalink
fix: hex signature
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiubreban committed Oct 31, 2024
1 parent 7341af7 commit 5cd0ca8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-planets-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/live-common": patch
---

fix: hex signature
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ const completeExchange = (
* @return {Buffer} The correct format Buffer for AppExchange call.
*/
function convertSignature(signature: string, exchangeType: ExchangeTypes): Buffer {
return isExchangeTypeNg(exchangeType)
? Buffer.from(signature, "base64url")
: <Buffer>secp256k1.signatureExport(Buffer.from(signature, "hex"));
if (isExchangeTypeNg(exchangeType)) {
return Buffer.from(signature, "base64url");
}
if (exchangeType === ExchangeTypes.Sell) return Buffer.from(signature, "hex");
return <Buffer>secp256k1.signatureExport(Buffer.from(signature, "hex"));
}

export default completeExchange;

0 comments on commit 5cd0ca8

Please sign in to comment.