Socket
Socket
Sign inDemoInstall

bip174

Package Overview
Dependencies
Maintainers
4
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bip174 - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

5

package.json
{
"name": "bip174",
"version": "0.0.8",
"version": "0.0.9",
"description": "",

@@ -16,3 +16,4 @@ "main": "src/lib/psbt.js",

"clean": "rimraf src types",
"coverage": "nyc --check-coverage --reporter=lcov --reporter=text --branches 75 --functions 90 --lines 90 npm run unit",
"coverage": "nyc --check-coverage --exclude='src/tests/**/*.js' --reporter=lcov --reporter=text --branches 90 --functions 90 --lines 90 npm run unit",
"flb": "npm run format && npm run lint && npm run build",
"format": "npm run prettier -- --write",

@@ -19,0 +20,0 @@ "formatjs": "npm run prettierjs -- --write > /dev/null 2>&1",

19

src/lib/parser/fromBuffer.js

@@ -166,3 +166,3 @@ 'use strict';

for (const keyVal of inputKeyVals[index]) {
const pubkey = convert.inputs.checkPubkey(keyVal);
convert.inputs.checkPubkey(keyVal);
switch (keyVal.key[0]) {

@@ -202,7 +202,2 @@ case typeFields_1.InputTypes.NON_WITNESS_UTXO:

case typeFields_1.InputTypes.PARTIAL_SIG:
if (pubkey === undefined) {
throw new Error(
'Format Error: PARTIAL_SIG requires pubkey in the key of KeyValue',
);
}
if (input.partialSig === undefined) {

@@ -247,7 +242,2 @@ input.partialSig = [];

case typeFields_1.InputTypes.BIP32_DERIVATION:
if (pubkey === undefined) {
throw new Error(
'Format Error: Input BIP32_DERIVATION requires pubkey in the key of KeyValue',
);
}
if (input.bip32Derivation === undefined) {

@@ -298,3 +288,3 @@ input.bip32Derivation = [];

for (const keyVal of outputKeyVals[index]) {
const pubkey = convert.outputs.checkPubkey(keyVal);
convert.outputs.checkPubkey(keyVal);
switch (keyVal.key[0]) {

@@ -324,7 +314,2 @@ case typeFields_1.OutputTypes.REDEEM_SCRIPT:

case typeFields_1.OutputTypes.BIP32_DERIVATION:
if (pubkey === undefined) {
throw new Error(
'Format Error: Output BIP32_DERIVATION requires pubkey in the key of KeyValue',
);
}
if (output.bip32Derivation === undefined) {

@@ -331,0 +316,0 @@ output.bip32Derivation = [];

@@ -15,24 +15,24 @@ /// <reference types="node" />

toBuffer(): Buffer;
addNonWitnessUtxoToInput<T extends InstanceType<typeof Psbt>>(this: T, inputIndex: number, nonWitnessUtxo: NonWitnessUtxo): T;
addWitnessUtxoToInput<T extends InstanceType<typeof Psbt>>(this: T, inputIndex: number, witnessUtxo: WitnessUtxo): T;
addPartialSigToInput<T extends InstanceType<typeof Psbt>>(this: T, inputIndex: number, partialSig: PartialSig): T;
addSighashTypeToInput<T extends InstanceType<typeof Psbt>>(this: T, inputIndex: number, sighashType: SighashType): T;
addRedeemScriptToInput<T extends InstanceType<typeof Psbt>>(this: T, inputIndex: number, redeemScript: RedeemScript): T;
addWitnessScriptToInput<T extends InstanceType<typeof Psbt>>(this: T, inputIndex: number, witnessScript: WitnessScript): T;
addBip32DerivationToInput<T extends InstanceType<typeof Psbt>>(this: T, inputIndex: number, bip32Derivation: Bip32Derivation): T;
addFinalScriptSigToInput<T extends InstanceType<typeof Psbt>>(this: T, inputIndex: number, finalScriptSig: FinalScriptSig): T;
addFinalScriptWitnessToInput<T extends InstanceType<typeof Psbt>>(this: T, inputIndex: number, finalScriptWitness: FinalScriptWitness): T;
addPorCommitmentToInput<T extends InstanceType<typeof Psbt>>(this: T, inputIndex: number, porCommitment: PorCommitment): T;
addRedeemScriptToOutput<T extends InstanceType<typeof Psbt>>(this: T, outputIndex: number, redeemScript: RedeemScript): T;
addWitnessScriptToOutput<T extends InstanceType<typeof Psbt>>(this: T, outputIndex: number, witnessScript: WitnessScript): T;
addBip32DerivationToOutput<T extends InstanceType<typeof Psbt>>(this: T, outputIndex: number, bip32Derivation: Bip32Derivation): T;
addKeyValToGlobal<T extends InstanceType<typeof Psbt>>(this: T, keyVal: KeyValue): T;
addKeyValToInput<T extends InstanceType<typeof Psbt>>(this: T, inputIndex: number, keyVal: KeyValue): T;
addKeyValToOutput<T extends InstanceType<typeof Psbt>>(this: T, outputIndex: number, keyVal: KeyValue): T;
addInput<V extends InstanceType<typeof Psbt>>(this: V, inputData: TransactionInput): V;
addInput<T, V extends InstanceType<typeof Psbt>>(this: V, inputData: T, transactionInputAdder?: (input: T, txBuffer: Buffer) => Buffer): V;
addOutput<V extends InstanceType<typeof Psbt>>(this: V, outputData: TransactionOutput, allowNoInput?: boolean): V;
addOutput<T, V extends InstanceType<typeof Psbt>>(this: V, outputData: T, allowNoInput?: boolean, transactionOutputAdder?: (output: T, txBuffer: Buffer) => Buffer): V;
combine<T extends InstanceType<typeof Psbt>>(this: T, ...those: Psbt[]): T;
addNonWitnessUtxoToInput(inputIndex: number, nonWitnessUtxo: NonWitnessUtxo): this;
addWitnessUtxoToInput(inputIndex: number, witnessUtxo: WitnessUtxo): this;
addPartialSigToInput(inputIndex: number, partialSig: PartialSig): this;
addSighashTypeToInput(inputIndex: number, sighashType: SighashType): this;
addRedeemScriptToInput(inputIndex: number, redeemScript: RedeemScript): this;
addWitnessScriptToInput(inputIndex: number, witnessScript: WitnessScript): this;
addBip32DerivationToInput(inputIndex: number, bip32Derivation: Bip32Derivation): this;
addFinalScriptSigToInput(inputIndex: number, finalScriptSig: FinalScriptSig): this;
addFinalScriptWitnessToInput(inputIndex: number, finalScriptWitness: FinalScriptWitness): this;
addPorCommitmentToInput(inputIndex: number, porCommitment: PorCommitment): this;
addRedeemScriptToOutput(outputIndex: number, redeemScript: RedeemScript): this;
addWitnessScriptToOutput(outputIndex: number, witnessScript: WitnessScript): this;
addBip32DerivationToOutput(outputIndex: number, bip32Derivation: Bip32Derivation): this;
addKeyValToGlobal(keyVal: KeyValue): this;
addKeyValToInput(inputIndex: number, keyVal: KeyValue): this;
addKeyValToOutput(outputIndex: number, keyVal: KeyValue): this;
addInput(inputData: TransactionInput): this;
addInput<T>(inputData: T, transactionInputAdder?: (input: T, txBuffer: Buffer) => Buffer): this;
addOutput(outputData: TransactionOutput, allowNoInput?: boolean): this;
addOutput<T>(outputData: T, allowNoInput?: boolean, transactionOutputAdder?: (output: T, txBuffer: Buffer) => Buffer): this;
combine(...those: this[]): this;
getTransaction(): Buffer;
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc