Refactor: Use varint from BIP174
This commit is contained in:
parent
479c56bbb4
commit
0f76aa935a
2 changed files with 3 additions and 3 deletions
ts_src
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue