Skip to content

Commit

Permalink
Merge pull request #18 from torus-economy/route-address-balance
Browse files Browse the repository at this point in the history
Fix #17 Return int in balance api
  • Loading branch information
sskender authored Aug 3, 2023
2 parents 1ce6a52 + 15c738f commit f9e9db2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ app.use('/ext/getmoneysupply', function(req,res){
app.use('/ext/getaddressbalance/:address', function(req,res){
db.get_address(req.params.address, function(address){
if (address) {
const balance = (address.balance).toString().replace(/(^-+)/mg, '');
const balance = parseInt((address.balance).toString().replace(/(^-+)/mg, ''));
res.status(200).send({ data: balance });
} else {
res.status(404).send({ data: null })
Expand Down

0 comments on commit f9e9db2

Please sign in to comment.