Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coinselect

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coinselect - npm Package Compare versions

Comparing version 3.1.10 to 3.1.11

2

package.json
{
"name": "coinselect",
"version": "3.1.10",
"version": "3.1.11",
"description": "A transaction input selection module for bitcoin.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -8,11 +8,5 @@ # coinselect

A transaction input selection module for bitcoin.
An unspent transaction output (UTXO) selection module for bitcoin.
The code is stable.
The module's interface is not.
Please let me know if you are using this package.
## Example

@@ -24,16 +18,16 @@

let utxos = [
...,
{
txId: '...',
vout: 0,
...,
value: 10000
}
...,
{
txId: '...',
vout: 0,
...,
value: 10000
}
]
let targets = [
...,
{
address: '1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm',
value: 5000
}
...,
{
address: '1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm',
value: 5000
}
]

@@ -54,15 +48,13 @@

outputs.forEach(output => {
// watch out, outputs may have been added that you need to provide
// an output address/script for
if (!output.address) {
output.address = wallet.getChangeAddress()
}
// watch out, outputs may have been added that you need to provide
// an output address/script for
if (!output.address) {
output.address = wallet.getChangeAddress()
}
txb.addOutput(output.address, output.value)
txb.addOutput(output.address, output.value)
})
```
Feedback welcome on the API, I'm not sure if I like it.
## License [MIT](LICENSE)

@@ -30,3 +30,4 @@ // baseline estimates, used to improve performance

if (!isFinite(v)) return NaN
if (v >>> 0 !== v) return NaN
if (Math.floor(v) !== v) return NaN
if (v < 0) return NaN
return v

@@ -36,3 +37,3 @@ }

function sumForgiving (range) {
return range.reduce(function (a, x) { return a + (x.value >>> 0) }, 0)
return range.reduce(function (a, x) { return a + (isFinite(x.value) ? x.value : 0) }, 0)
}

@@ -39,0 +40,0 @@

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