Skip to content
This repository was archived by the owner on Dec 26, 2024. It is now read-only.

Modified #12

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b741baa
Merge pull request #4 from sebs/snyk-fix-ece25e9d
sebs May 22, 2017
053e21d
Add package log
sebs Jun 2, 2017
b21b4d0
Update to node 8
sebs Jun 2, 2017
8d20bdf
changelog
sebs Jun 2, 2017
f271372
3.0.3
sebs Jun 2, 2017
6d72f1e
fix: missing data parameter.
sebs Jun 19, 2017
624bb1f
changelog
sebs Jun 19, 2017
907322a
3.0.4
sebs Jun 19, 2017
ced44ff
Updated dev deps
sebs Jun 20, 2017
c44b30f
changelog
sebs Jun 20, 2017
01efdeb
3.0.5
sebs Jun 20, 2017
6d24652
Added more tests for the tokenbalance
sebs Jun 21, 2017
4ee0163
changelog
sebs Jun 21, 2017
62ff55c
3.0.6
sebs Jun 21, 2017
d8cc926
chore(deps): Updated
sebs Jun 29, 2017
3da0a23
changelog
sebs Jun 29, 2017
346e68f
3.0.7
sebs Jun 29, 2017
42f8a55
chore(deps): outdated and moving from restify to only the clients.
sebs Jul 5, 2017
c47e720
changelog
sebs Jul 5, 2017
1e86840
3.0.8
sebs Jul 5, 2017
e21cf8b
fix error handling edge case
mvayngrib Sep 14, 2017
2fb5b9e
move browserify to devDependencies
mvayngrib Sep 15, 2017
a47e534
Removed snyk
sebs Sep 17, 2017
7b9163d
changelog
sebs Sep 17, 2017
a8771d7
3.0.9
sebs Sep 17, 2017
3f46dd7
Merge branch 'master' into movebrowserify
sebs Sep 17, 2017
bfcee05
Merge pull request #9 from mvayngrib/fixTxByHash
sebs Sep 17, 2017
11a7250
Merge pull request #10 from mvayngrib/movebrowserify
sebs Sep 17, 2017
df8f21a
changelog
sebs Sep 17, 2017
e7ce219
3.0.10
sebs Sep 17, 2017
f16b100
I need new example values for the blockchain
sebs Sep 17, 2017
cdce35f
changelog
sebs Sep 17, 2017
8f3f98a
3.0.11
sebs Sep 17, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: node_js
node_js:
- 6.5.0
- 7
- 8
env:
- CXX=g++-4.8
addons:
Expand Down
132 changes: 82 additions & 50 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,89 @@
2017-09-17
==========

* I need new example values for the blockchain
* 3.0.10
* changelog
* Merge pull request [#10](https://github.com/sebs/etherscan-api/issues/10) from mvayngrib/movebrowserify
move dev deps to devDependencies
* Merge pull request [#9](https://github.com/sebs/etherscan-api/issues/9) from mvayngrib/fixTxByHash
fix error handling edge case
* Merge branch 'master' into movebrowserify
* 3.0.9
* Removed snyk

2017-09-15
==========

* move browserify to devDependencies

2017-09-14
==========

* fix error handling edge case

2017-07-05
==========

* 3.0.8
* changelog
* chore(deps): outdated and moving from restify to only the clients.
* This should reduce package sizes

2017-06-29
==========

* 3.0.7
* changelog
* chore(deps): Updated

2017-06-21
==========

* 3.0.6
* changelog
* Added more tests for the tokenbalance

2017-06-20
==========

* 3.0.5
* changelog
* Updated dev deps

2017-06-19
==========

* 3.0.4
* changelog
* fix: missing data parameter.
* Thanks for the report

2017-06-02
==========

* 3.0.3
* changelog
* Update to node 8
* Add package log

2017-05-22
==========

* Merge pull request [#4](https://github.com/sebs/etherscan-api/issues/4) from sebs/snyk-fix-ece25e9d
[Snyk Update] New fixes for 1 vulnerable dependency path
* fix: package.json & .snyk to reduce vulnerabilities
The following vulnerabilities are fixed with a Snyk patch:
- https://snyk.io/vuln/npm:ms:20170412
Latest report for sebs/etherscan-api:
https://snyk.io/test/github/sebs/etherscan-api

2017-04-24
==========

* Updated Readme for dev
* 3.0.2
* changelog
* Updated Readme for dev
* Autochangelog
* 3.0.1

Expand Down Expand Up @@ -105,52 +186,3 @@
* 2.0.0
* (feature): eth api tests and proxy
* 1.3.2
* 1.3.1
* (docs): cdn
* 1.3.0
* (feature): Bundled version
* 1.2.0
* (feature): added the complete eth proxy api
* 1.1.4
* Pages
* 1.1.3
* Add pages script

2016-10-06
==========

* 1.1.2
* (docs): api docs

2016-10-04
==========

* 1.1.1
* fix
* 1.1.0
* (churn): fix
* (feature): token methods
* 1.0.0
* (feature): resorted apis and a first 1.0 release candidate
* (refactor): rename apis and complete astuff
* .accounts for accounts related stuff
* .accounts.balance for multiple entries
* .accounts.txlist internal
* .accounts.getminedblocks
* 0.3.1
* 0.3.0
* (docs): naming and a little example for the docs
* (docs): Badges and a usable readme
* (feature): completeted the first set of tests for all existing implementations
* 0.2.1
* (churn): featurelist

2016-10-03
==========

* 0.2.0
* (feature): 30% of apis
* 0.1.1
* i(feature): transaction list
* 0.1.0
* (feature): balance and tests
23 changes: 15 additions & 8 deletions lib/init.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict";
var restify = require('restify');
var restify = require('restify-clients');
const querystring = require('querystring');

const url = 'https://api.etherscan.io/api';
Expand Down Expand Up @@ -51,6 +51,10 @@ module.exports = function (apiKey, chain) {
return reject(data.message);
}

if (data.error) {
return reject(data.error.message);
}

resolve(data);
});
});
Expand Down Expand Up @@ -198,11 +202,11 @@ module.exports = function (apiKey, chain) {
* var res = api.proxy.eth_getTransactionByHash('0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1');
* @returns {Promise.<object>}
*/
eth_getTransactionByHash(hash) {
eth_getTransactionByHash(txhash) {
const module = 'proxy';
const action = 'eth_getTransactionByHash';
var query = querystring.stringify({
module, action, apiKey, hash
module, action, apiKey, txhash
});
return getRequest(query);
},
Expand Down Expand Up @@ -270,16 +274,17 @@ module.exports = function (apiKey, chain) {
/**
* Executes a new message call immediately without creating a transaction on the block chain
* @param {string} to - Address to execute from
* @param {string} tag - Content
* @param {string} data - Data to transfer
* @param {string} tag - A tag
* @example
* var res = api.proxy.eth_call('0xAEEF46DB4855E25702F8237E8f403FddcaF931C0', '0x70a08231000000000000000000000000e16359506c028e51f16be38986ec5746251e9724', 'latest');
* @returns {Promise.<object>}
*/
eth_call(to, tag) {
eth_call(to, data, tag) {
const module = 'proxy';
const action = 'eth_call';
var query = querystring.stringify({
module, action, apiKey, to, tag
module, action, apiKey, to, data, tag
});
return getRequest(query);
},
Expand Down Expand Up @@ -491,8 +496,10 @@ module.exports = function (apiKey, chain) {
* @param {string} contractaddress - Contract address
* @example
* var supply = api.account.tokenbalance(
* '0x0a869d79a7052c7f1b55a8ebabbea3420f0d1e13',
* 'TheDAO');
* '0x4366ddc115d8cf213c564da36e64c8ebaa30cdbd',
* 'DGD',
* ''
* );
* @returns {Promise.<object>}
*/
tokenbalance(address, tokenname, contractaddress){
Expand Down
Loading