From fb234fffd400a5726ee76012deabbb9c19eae5d1 Mon Sep 17 00:00:00 2001 From: David Kevork Date: Mon, 5 Nov 2018 13:26:16 +1100 Subject: [PATCH 1/2] fix amount multiplication --- src/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 8dd816632..9570d8b85 100644 --- a/src/index.js +++ b/src/index.js @@ -5,14 +5,14 @@ for (var key in templates) { script[key] = templates[key] } -function amount (amount, fee) { - fee = parseInt(parseFloat(fee) * 100000000, 10) - amount = parseInt(parseFloat(amount) * 100000000, 10) +function amount (amount, fee = '0') { + fee = parseInt((parseFloat(fee) * 1000000000) / 10, 10) + amount = parseInt((parseFloat(amount) * 1000000000) / 10, 10) return amount - fee } module.exports = { - bufferutils: require('./bufferutils'), // TODO: remove in 4.0.0 + bufferutils: require('./bufferutils'), Block: require('./block'), ECPair: require('./ecpair'), From d7d1c7eb21853b81b098fdafef21331783242956 Mon Sep 17 00:00:00 2001 From: David Kevork Date: Mon, 5 Nov 2018 13:26:44 +1100 Subject: [PATCH 2/2] bump version to 3.3.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ba118ad4f..16b22cd08 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "smartcashjs-lib", - "version": "3.3.5", + "version": "3.3.6", "description": "Client-side SmartCash JavaScript library", "main": "./src/index.js", "engines": {