-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from 409H/en-account_nonce
Added logic to show the account nonce on lookup
- Loading branch information
Showing
2 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ function callMainnetNetwork(txHash, addr, contractAddr, nodeName, type) { | |
return getCommonAddress(url, addr); | ||
else if (type == 3) | ||
return getCommonToken(url, addr, contractAddr) | ||
else if (type == 4) | ||
return getCommonAddressNonce(url, addr); | ||
|
||
} | ||
|
||
|
@@ -39,6 +41,8 @@ function callTestnetNetwork(txHash, addr, contractAddr, nodeName, type) { | |
return getCommonAddress(url, addr); | ||
else if (type == 3) | ||
return getCommonToken(url, addr, contractAddr) | ||
else if (type == 4) | ||
return getCommonAddressNonce(url, addr); | ||
|
||
} | ||
|
||
|
@@ -134,6 +138,22 @@ function getCommonAddress(url, addr) { | |
}) | ||
} | ||
|
||
function getCommonAddressNonce(url, addr) { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
return new Promise(function (resolve, reject) { | ||
|
||
commonAPI(url, 'eth_getTransactionCount', [addr, 'latest']) | ||
.then(function (data) { | ||
if (data.error) | ||
reject(data.error); | ||
|
||
resolve(data); | ||
}, function (err, val){ | ||
reject(err); | ||
}) | ||
|
||
}) | ||
} | ||
|
||
function getCommonToken(url, addr, contractAddr) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ScottRodriguez
via email
|
||
return new Promise(function (resolve, reject) { | ||
|
||
|
0x1befC4c650d664cD4f56AcA30DD42272F22D935D