From 3148a99fb49fe5f490ad01b06ed07853db1f225e Mon Sep 17 00:00:00 2001 From: Catzilla <11861208+Catzilla@users.noreply.github.com> Date: Wed, 17 Feb 2021 00:08:31 +0200 Subject: [PATCH] Fixed #84 --- lib/account.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/account.js b/lib/account.js index 9fbc8c29..5b5ccf32 100644 --- a/lib/account.js +++ b/lib/account.js @@ -82,16 +82,6 @@ module.exports = function(getRequest, apiKey) { apiKey }; - if (!startblock) { - startblock = 0; - } - queryObject.startblock = startblock; - - if (!endblock) { - endblock = 'latest'; - } - queryObject.endblock = endblock; - if (!sort) { sort = 'asc'; } @@ -101,6 +91,16 @@ module.exports = function(getRequest, apiKey) { queryObject.txhash = txhash; } else { queryObject.address = address; + + if (!startblock) { + startblock = 0; + } + queryObject.startblock = startblock; + + if (!endblock) { + endblock = 'latest'; + } + queryObject.endblock = endblock; } queryObject.txhash = txhash;