From 48dd02e1de697eba4f6644a854048afa5b2c7187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Landabaso=20D=C3=ADaz?= Date: Sat, 9 Dec 2023 06:52:18 +0100 Subject: [PATCH] use explicit varuint-bitcoin functions from official npm package --- src/psbt.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/psbt.ts b/src/psbt.ts index 30141c4..5ddca45 100644 --- a/src/psbt.ts +++ b/src/psbt.ts @@ -10,7 +10,7 @@ import { Transaction, PsbtTxInput } from 'bitcoinjs-lib'; -import * as varuint from 'bip174/src/lib/converter/varint'; +import { encode, encodingLength } from 'varuint-bitcoin'; interface PsbtInputExtended extends PsbtInput, PsbtTxInput {} function reverseBuffer(buffer: Buffer): Buffer { if (buffer.length < 1) return buffer; @@ -33,10 +33,10 @@ function witnessStackToScriptWitness(witness: Buffer[]): Buffer { function writeVarInt(i: number): void { const currentLen = buffer.length; - const varintLen = varuint.encodingLength(i); + const varintLen = encodingLength(i); buffer = Buffer.concat([buffer, Buffer.allocUnsafe(varintLen)]); - varuint.encode(i, buffer, currentLen); + encode(i, buffer, currentLen); } function writeVarSlice(slice: Buffer): void {