Skip to content

Commit

Permalink
Merge pull request #48 from secretkeylabs/fix/ENG-5091
Browse files Browse the repository at this point in the history
fix: Unisat integration signPsbt functionality [ENG-5091]
  • Loading branch information
m-aboelenein authored Nov 12, 2024
2 parents 86c43fa + 26e1c66 commit b6fc100
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sats-connect/core",
"version": "0.4.0",
"version": "0.4.1",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
"types": "dist/index.d.mts",
Expand Down
13 changes: 7 additions & 6 deletions src/adapters/unisat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,16 @@ class UnisatAdapter extends SatsConnectAdapter {
autoFinalized: broadcast,
toSignInputs: convertSignInputsToInputType(signInputs),
});
const signedPsbtBase64 = Buffer.from(signedPsbt, 'hex').toString('base64');

let txid: string | undefined;
if (broadcast) {
const txid = await window.unisat.pushPsbt(psbtHex);
return {
psbt: signedPsbt,
txid,
};
txid = await window.unisat.pushPsbt(signedPsbt);
}

return {
psbt: psbtHex,
psbt: signedPsbtBase64,
txid,
};
}

Expand Down

0 comments on commit b6fc100

Please sign in to comment.