Skip to content

Commit 2a5ab1a

Browse files
OttoAllmendingerllm-git
andcommitted
feat(abstract-utxo): add decodePsbt helper function
Add convenience function that uses wasm-utxo decoder by default Issue: BTC-2768 Co-authored-by: llm-git <llm-git@ttll.de>
1 parent 59cfc0a commit 2a5ab1a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • modules/abstract-utxo/src/transaction

modules/abstract-utxo/src/transaction/decode.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { fixedScriptWallet, utxolibCompat } from '@bitgo/wasm-utxo';
33

44
import { getNetworkFromCoinName, UtxoCoinName } from '../names';
55

6-
import { SdkBackend } from './types';
6+
import { SdkBackend, BitGoPsbt } from './types';
77

88
type BufferEncoding = 'hex' | 'base64';
99

@@ -62,6 +62,10 @@ export function decodePsbtWith(
6262
}
6363
}
6464

65+
export function decodePsbt(psbt: string | Buffer, coinName: UtxoCoinName): BitGoPsbt {
66+
return decodePsbtWith(psbt, coinName, 'wasm-utxo');
67+
}
68+
6569
export function encodeTransaction(
6670
transaction: utxolib.bitgo.UtxoTransaction<bigint | number> | utxolib.bitgo.UtxoPsbt | fixedScriptWallet.BitGoPsbt
6771
): Buffer {

0 commit comments

Comments
 (0)