Skip to content

Commit

Permalink
fix(sdk-api): use createPsbtDecode instead of createPsbtFromBuffer
Browse files Browse the repository at this point in the history
The endpoint will now accept both hex and base64 encoded PSBTs.

Issue: BTC-1351
  • Loading branch information
OttoAllmendinger committed Sep 27, 2024
1 parent 09b4423 commit 06d0b30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/sdk-api/src/v1/signPsbt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function signPsbtRequest(params: { psbt: string; keychain: { xprv: string
throw new Error(`invalid params.keychain.xprv`);
}

const psbt = utxolib.bitgo.createPsbtFromBuffer(Buffer.from(params.psbt, 'hex'), utxolib.networks.bitcoin);
const psbt = utxolib.bitgo.createPsbtDecode(params.psbt, utxolib.networks.bitcoin);
const keypair = utxolib.bip32.fromBase58(params.keychain.xprv, utxolib.networks.bitcoin);
debug('signing PSBT with keychain %s', keypair.neutered().toBase58());
utxolib.bitgo.withUnsafeNonSegwit(psbt, () => psbt.signAllInputsHD(keypair));
Expand Down

0 comments on commit 06d0b30

Please sign in to comment.