New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bitcore-lib-doge

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcore-lib-doge - npm Package Compare versions

Comparing version 8.25.1 to 8.25.2

60

lib/transaction/transaction.js

@@ -564,2 +564,62 @@ 'use strict';

/**
* associateInputs - Update inputs with utxos, allowing you to specify value, and pubkey.
* Populating these inputs allows for them to be signed with .sign(privKeys)
*
* @param {Array<Object>} utxos
* @param {Array<string | PublicKey>} pubkeys
* @param {number} threshold
* @param {Object} opts
* @returns {Array<number>}
*/
Transaction.prototype.associateInputs = function(utxos, pubkeys, threshold, opts) {
let indexes = [];
for(let utxo of utxos) {
const index = this.inputs.findIndex(i => i.prevTxId.toString('hex') === utxo.txId && i.outputIndex === utxo.outputIndex);
indexes.push(index);
if(index >= 0) {
this.inputs[index] = this._getInputFrom(utxo, pubkeys, threshold, opts);
}
}
return indexes;
}
Transaction.prototype._selectInputType = function(utxo, pubkeys, threshold) {
var clazz;
utxo = new UnspentOutput(utxo);
if(pubkeys && threshold) {
if (utxo.script.isMultisigOut()) {
clazz = MultiSigInput;
} else if (utxo.script.isScriptHashOut() || utxo.script.isWitnessScriptHashOut()) {
clazz = MultiSigScriptHashInput;
}
} else if (utxo.script.isPublicKeyHashOut() || utxo.script.isWitnessPublicKeyHashOut() || utxo.script.isScriptHashOut()) {
clazz = PublicKeyHashInput;
} else if (utxo.script.isPublicKeyOut()) {
clazz = PublicKeyInput;
} else {
clazz = Input;
}
return clazz;
}
Transaction.prototype._getInputFrom = function(utxo, pubkeys, threshold, opts) {
utxo = new UnspentOutput(utxo);
const InputClass = this._selectInputType(utxo, pubkeys, threshold);
const input = {
output: new Output({
script: utxo.script,
satoshis: utxo.satoshis
}),
prevTxId: utxo.txId,
outputIndex: utxo.outputIndex,
sequenceNumber: utxo.sequenceNumber,
script: Script.empty()
};
let args = pubkeys && threshold ? [pubkeys, threshold, false, opts] : []
return new InputClass(input, ...args);
}
Transaction.prototype._fromNonP2SH = function(utxo) {

@@ -566,0 +626,0 @@ var clazz;

4

package.json
{
"name": "bitcore-lib-doge",
"version": "8.25.1",
"version": "8.25.2",
"description": "A pure and powerful JavaScript Dogecoin library.",

@@ -48,3 +48,3 @@ "author": "BitPay <dev@bitpay.com>",

"devDependencies": {
"bitcore-build": "^8.25.1",
"bitcore-build": "^8.25.2",
"brfs": "^2.0.1",

@@ -51,0 +51,0 @@ "chai": "^4.2.0",

Sorry, the diff of this file is too big to display

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