Skip to content

Commit

Permalink
Merge pull request #3 from SmartCash/refactor(index)
Browse files Browse the repository at this point in the history
Refactor(index)
  • Loading branch information
davidkevork authored Nov 5, 2018
2 parents 683ceed + d7d1c7e commit 1cecbc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 1cecbc7

Please sign in to comment.