diff --git a/src/psbt.js b/src/psbt.js index 8e6f1f2..aa73949 100644 --- a/src/psbt.js +++ b/src/psbt.js @@ -1,6 +1,7 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const bip174_1 = require('bip174'); +const varuint = require('bip174/src/lib/converter/varint'); const utils_1 = require('bip174/src/lib/utils'); const address_1 = require('./address'); const bufferutils_1 = require('./bufferutils'); @@ -10,7 +11,6 @@ const networks_1 = require('./networks'); const payments = require('./payments'); const bscript = require('./script'); const transaction_1 = require('./transaction'); -const varuint = require('varuint-bitcoin'); const DEFAULT_OPTS = { network: networks_1.bitcoin, maximumFeeRate: 5000, diff --git a/ts_src/psbt.ts b/ts_src/psbt.ts index 617cde9..a78b37b 100644 --- a/ts_src/psbt.ts +++ b/ts_src/psbt.ts @@ -1,4 +1,5 @@ import { Psbt as PsbtBase } from 'bip174'; +import * as varuint from 'bip174/src/lib/converter/varint'; import { NonWitnessUtxo, PartialSig, @@ -19,7 +20,6 @@ import { bitcoin as btcNetwork, Network } from './networks'; import * as payments from './payments'; import * as bscript from './script'; import { Output, Transaction } from './transaction'; -const varuint = require('varuint-bitcoin'); const DEFAULT_OPTS: PsbtOpts = { network: btcNetwork, @@ -946,7 +946,7 @@ function scriptWitnessToWitnessStack(buffer: Buffer): Buffer[] { function readVarInt(): number { const vi = varuint.decode(buffer, offset); - offset += varuint.decode.bytes; + offset += (varuint.decode as any).bytes; return vi; }