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

@fivebinaries/coin-selection

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fivebinaries/coin-selection - npm Package Compare versions

Comparing version 2.0.0-beta.2 to 2.0.0-beta.3

4

lib/constants/index.d.ts

@@ -14,2 +14,6 @@ import * as CardanoWasm from '@emurgo/cardano-serialization-lib-browser';

};
readonly UTXO_VALUE_TOO_SMALL: {
readonly code: "UTXO_VALUE_TOO_SMALL";
readonly message: "UTxO value too small";
};
readonly UNSUPPORTED_CERTIFICATE_TYPE: {

@@ -16,0 +20,0 @@ readonly code: "UNSUPPORTED_CERTIFICATE_TYPE";

@@ -15,2 +15,6 @@ import * as CardanoWasm from '@emurgo/cardano-serialization-lib-browser';

},
UTXO_VALUE_TOO_SMALL: {
code: 'UTXO_VALUE_TOO_SMALL',
message: 'UTxO value too small',
},
UNSUPPORTED_CERTIFICATE_TYPE: {

@@ -17,0 +21,0 @@ code: 'UNSUPPORTED_CERTIFICATE_TYPE',

@@ -169,2 +169,3 @@ import * as CardanoWasm from '@emurgo/cardano-serialization-lib-browser';

if (output.assets.length > 0 && outputAmount.compare(minOutputAmount) < 0) {
// output with an asset(s) adjust minimum ADA to met network requirements
amount = minOutputAmount.to_str();

@@ -175,2 +176,12 @@ }

}
if (!output.setMax &&
output.assets.length === 0 &&
output.amount &&
outputAmount.compare(minOutputAmount) < 0) {
// Case of an output without any asset, and without setMax = true
// If the user entered less than min utxo val then throw an error (won't throw if there is no amount yet)
// (On outputs with setMax flag we set '0' on purpose)
// (On outputs with an asset we automatically adjust ADA amount if it is below required minimum)
throw new CoinSelectionError(ERROR.UTXO_VALUE_TOO_SMALL);
}
if (output.setMax) {

@@ -186,3 +197,3 @@ // if setMax is active set initial value to 0

return Object.assign(Object.assign({}, output), {
// if output contains assets make sure that minUtxoValue is at least minOutputAmount (even for output where we want to setMax)
// if output contains assets make sure that minUtxoValue is at least minOutputAmount (even for output where we want to setMax)
amount });

@@ -189,0 +200,0 @@ });

2

package.json
{
"name": "@fivebinaries/coin-selection",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"description": "",

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

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