@compendiumfi/pendax
Version:
connector for centralized cryptocurrency exchanges
1 lines • 4.71 kB
JavaScript
function a0_0x5b1e(_0x153275,_0x29e651){const _0x5f138b=a0_0x5f13();return a0_0x5b1e=function(_0x5b1ea8,_0x1dc381){_0x5b1ea8=_0x5b1ea8-0x17c;let _0x11e946=_0x5f138b[_0x5b1ea8];return _0x11e946;},a0_0x5b1e(_0x153275,_0x29e651);}const a0_0x386a63=a0_0x5b1e;(function(_0x4a2cd2,_0x2fe782){const _0x3256af=a0_0x5b1e,_0x52fa5f=_0x4a2cd2();while(!![]){try{const _0x2ef481=parseInt(_0x3256af(0x19c))/0x1+-parseInt(_0x3256af(0x196))/0x2+-parseInt(_0x3256af(0x1a6))/0x3+-parseInt(_0x3256af(0x18e))/0x4*(-parseInt(_0x3256af(0x1ad))/0x5)+parseInt(_0x3256af(0x188))/0x6+-parseInt(_0x3256af(0x18c))/0x7*(-parseInt(_0x3256af(0x17c))/0x8)+parseInt(_0x3256af(0x17d))/0x9*(-parseInt(_0x3256af(0x1ac))/0xa);if(_0x2ef481===_0x2fe782)break;else _0x52fa5f['push'](_0x52fa5f['shift']());}catch(_0xb0467){_0x52fa5f['push'](_0x52fa5f['shift']());}}}(a0_0x5f13,0xee96b));import a0_0x50ef59 from'axios';import a0_0x1bada1 from'crypto';import{BinanceSocket}from'../sockets/binancesocket.js';import a0_0x4ace75 from'short-unique-id';export class Binance{[a0_0x386a63(0x1a5)]=new Array();['sockets']={};constructor(_0x9a1670){const _0x18630d=a0_0x386a63;this[_0x18630d(0x18f)]='https://api.binance.com',this['authenticate']=_0x9a1670[_0x18630d(0x19b)]==undefined?!![]:_0x9a1670['authenticate'],this[_0x18630d(0x194)]=_0x9a1670['exchange'][_0x18630d(0x1a2)]==undefined?_0x18630d(0x195):_0x9a1670[_0x18630d(0x1ae)]['exchangename'],this[_0x18630d(0x18b)]=_0x9a1670[_0x18630d(0x1ae)]['id'],this[_0x18630d(0x19a)]=_0x9a1670[_0x18630d(0x185)]==undefined?'':_0x9a1670[_0x18630d(0x185)],this[_0x18630d(0x182)]=_0x9a1670[_0x18630d(0x197)]==undefined?'':_0x9a1670['secret'],this[_0x18630d(0x192)]=_0x9a1670[_0x18630d(0x192)],this[_0x18630d(0x187)]=_0x9a1670['margintype']?_0x9a1670['margintype']:_0x18630d(0x18d),this[_0x18630d(0x1a5)][_0x18630d(0x17e)]([_0x18630d(0x1a1),_0x18630d(0x198)]);}async['createHeader'](){const _0x46af6b=a0_0x386a63;let _0x2a303f={'X-MBX-APIKEY':this[_0x46af6b(0x19a)]};return _0x2a303f;}['createSignature'](_0x54b385,_0xac2f70){const _0x70138b=a0_0x386a63;return a0_0x1bada1['Hmac'](_0x70138b(0x193),_0xac2f70)[_0x70138b(0x1a0)](_0x54b385)[_0x70138b(0x1a9)](_0x70138b(0x183));}async[a0_0x386a63(0x1a8)](_0x501388,_0x241b98,_0x48281f,_0x22713e){const _0x435860=a0_0x386a63;let _0x2f542f=Date[_0x435860(0x1af)](),_0x4dc4f8=await this[_0x435860(0x17f)]();const _0x5dcd33=0x1388;let _0x132fa3=_0x22713e!=null?_0x48281f['filter'](_0x116c8f=>!Object[_0x435860(0x1a3)](_0x22713e)[_0x435860(0x180)](_0x116c8f)):_0x48281f;if(_0x132fa3[_0x435860(0x190)]==0x0){let _0x1323f4=new Array();for(const _0x4afae6 in _0x22713e){_0x1323f4['push'](_0x4afae6+'='+_0x22713e[_0x4afae6]);}let _0x242c07=this['formatQuery']({'timestamp':_0x2f542f,'recvWindow':_0x5dcd33,'queryString':_0x1323f4},_0x435860(0x181)),_0x2bc2b7={'baseURL':this[_0x435860(0x18f)],'url':_0x501388+_0x242c07,'method':_0x241b98,'headers':_0x4dc4f8};console[_0x435860(0x189)](_0x2bc2b7);const _0x105a42=await a0_0x50ef59(_0x2bc2b7);return _0x105a42;}else throw{'message':_0x435860(0x1aa)+_0x132fa3[_0x435860(0x184)](',')};}async[a0_0x386a63(0x1a1)](){const _0x2a0ac2=a0_0x386a63,_0xb03d95=await this[_0x2a0ac2(0x1a8)](_0x2a0ac2(0x19e),_0x2a0ac2(0x1a7),[]);return _0xb03d95;}['formatQuery'](_0x3c1cd0){const _0x5db9d4=a0_0x386a63;let _0x4f632f=_0x3c1cd0['queryString']['join']('&');if(_0x4f632f!=''){if(_0x5db9d4(0x199)!=='OMohE')_0x4f632f=_0x4f632f+'&';else{let _0xf48deb=_0x32f2aa[_0x5db9d4(0x19f)][_0x5db9d4(0x184)]('&');_0xf48deb!=''&&(_0xf48deb=_0xf48deb+'&');_0xf48deb=_0xf48deb+_0x5db9d4(0x19d)+_0x1854c5[_0x5db9d4(0x191)]+_0x5db9d4(0x1ab)+_0x183f30[_0x5db9d4(0x186)];let _0x4d5118=this[_0x5db9d4(0x18a)](_0xf48deb,this[_0x5db9d4(0x182)]);return _0xf48deb=_0xf48deb+_0x5db9d4(0x1a4)+_0x4d5118,_0xf48deb;}}_0x4f632f=_0x4f632f+_0x5db9d4(0x19d)+_0x3c1cd0['recvWindow']+_0x5db9d4(0x1ab)+_0x3c1cd0[_0x5db9d4(0x186)];let _0x52c32c=this[_0x5db9d4(0x18a)](_0x4f632f,this[_0x5db9d4(0x182)]);return _0x4f632f=_0x4f632f+_0x5db9d4(0x1a4)+_0x52c32c,_0x4f632f;}}function a0_0x5f13(){const _0x314ca9=['TRADE','apiSecret','hex','join','key','timestamp','futuresMarginType','9633588TwUXDw','log','createSignature','exchangeid','21JPReCy','usdt','10624UHaBNf','url','length','recvWindow','label','sha256','name','binance','1581772pLPnDy','secret','getServerTime','iyVHW','apiKey','authenticate','1158762NcSzgD','recvWindow=','/api/v3/ping?','queryString','update','testConnectivity','exchangename','keys','&signature=','publicApis','5733960tyKHep','GET','executeRequest','digest','Missing\x20params:\x20','×tamp=','2221840hjTlHa','2720ByEAQb','exchange','now','957272ZHzTyD','36zyHogf','push','createHeader','includes'];a0_0x5f13=function(){return _0x314ca9;};return a0_0x5f13();}