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

cashscript

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cashscript - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

8

dist/main/Transaction.js

@@ -216,3 +216,3 @@ "use strict";

? this.hardcodedFee
: Math.ceil(utils_2.getTxSizeWithoutInputs(this.outputs) * this.feePerByte);
: utils_2.getTxSizeWithoutInputs(this.outputs) * this.feePerByte;
// Select and gather UTXOs and calculate fees and available funds

@@ -224,3 +224,3 @@ let satsAvailable = 0;

if (!this.hardcodedFee)
fee += this.inputs.length * inputSize;
fee += this.inputs.length * inputSize * this.feePerByte;
satsAvailable = this.inputs.reduce((acc, input) => acc + input.satoshis, 0);

@@ -238,3 +238,3 @@ }

if (!this.hardcodedFee)
fee += inputSize;
fee += inputSize * this.feePerByte;
if (satsAvailable > amount + fee)

@@ -244,2 +244,4 @@ break;

}
// Fee per byte can be a decimal number, but we need the total fee to be an integer
fee = Math.ceil(fee);
// Calculate change and check available funds

@@ -246,0 +248,0 @@ let change = satsAvailable - amount - fee;

@@ -210,3 +210,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

? this.hardcodedFee
: Math.ceil(getTxSizeWithoutInputs(this.outputs) * this.feePerByte);
: getTxSizeWithoutInputs(this.outputs) * this.feePerByte;
// Select and gather UTXOs and calculate fees and available funds

@@ -218,3 +218,3 @@ let satsAvailable = 0;

if (!this.hardcodedFee)
fee += this.inputs.length * inputSize;
fee += this.inputs.length * inputSize * this.feePerByte;
satsAvailable = this.inputs.reduce((acc, input) => acc + input.satoshis, 0);

@@ -232,3 +232,3 @@ }

if (!this.hardcodedFee)
fee += inputSize;
fee += inputSize * this.feePerByte;
if (satsAvailable > amount + fee)

@@ -238,2 +238,4 @@ break;

}
// Fee per byte can be a decimal number, but we need the total fee to be an integer
fee = Math.ceil(fee);
// Calculate change and check available funds

@@ -240,0 +242,0 @@ let change = satsAvailable - amount - fee;

{
"name": "cashscript",
"version": "0.6.0",
"version": "0.6.1",
"description": "Easily write and interact with Bitcoin Cash contracts",

@@ -45,3 +45,3 @@ "keywords": [

"@bitauth/libauth": "^1.18.1",
"@cashscript/utils": "^0.6.0",
"@cashscript/utils": "^0.6.1",
"bip68": "^1.0.4",

@@ -48,0 +48,0 @@ "bitcoin-rpc-promise-retry": "^1.3.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