Skip to content

Commit

Permalink
use explicit varuint-bitcoin functions from official npm package
Browse files Browse the repository at this point in the history
  • Loading branch information
landabaso committed Dec 9, 2023
1 parent 44a279d commit 48dd02e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/psbt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down

0 comments on commit 48dd02e

Please sign in to comment.