@compendiumfi/pendax
Version:
connector for centralized cryptocurrency exchanges
1 lines • 6.27 kB
JavaScript
const a7_0x18ffb0=a7_0x7f14;function a7_0x7f14(_0x192b62,_0x472954){const _0x31740b=a7_0x3174();return a7_0x7f14=function(_0x7f14a1,_0x56ec14){_0x7f14a1=_0x7f14a1-0x64;let _0x44715a=_0x31740b[_0x7f14a1];return _0x44715a;},a7_0x7f14(_0x192b62,_0x472954);}(function(_0x3b7069,_0x2a1c21){const _0x40821f=a7_0x7f14,_0x170b9f=_0x3b7069();while(!![]){try{const _0x453034=parseInt(_0x40821f(0x9d))/0x1*(parseInt(_0x40821f(0x9c))/0x2)+parseInt(_0x40821f(0x7e))/0x3+-parseInt(_0x40821f(0x8c))/0x4*(parseInt(_0x40821f(0x99))/0x5)+parseInt(_0x40821f(0x90))/0x6+parseInt(_0x40821f(0x79))/0x7+-parseInt(_0x40821f(0x89))/0x8*(-parseInt(_0x40821f(0x91))/0x9)+parseInt(_0x40821f(0x84))/0xa*(-parseInt(_0x40821f(0x9a))/0xb);if(_0x453034===_0x2a1c21)break;else _0x170b9f['push'](_0x170b9f['shift']());}catch(_0x5ac2d0){_0x170b9f['push'](_0x170b9f['shift']());}}}(a7_0x3174,0x754ee));import a7_0xd62954 from'axios';import a7_0x3ba272 from'dateformat';function a7_0x3174(){const _0x48e1ed=['90CCqACc','/api/v1/timestamp','getSignature','/v1/order/orders','assembleRequest','main','AES','executeGetRequest','3535wijvpz','14817aApEbJ','sort','193576igOEmN','8bwnAIH','object','forEach','enc','toString','data','key','huobi','authenticate','secret','CVZpn','hex','publicApis','Signature=','executeOrder','post','exchange','Base64','apiKey','getAccountInfo','getServerTime','api.huobi.pro','exchangename','decrypt','4945794YOYehm','stringify','https://api.hbdm.com','subaccount','parse','2571156pohwnn','HmacSHA256','update','substring','apiSecret','keys','20590VamKaV','UTC:yyyy-mm-dd\x27T\x27HH:MM:ss','url','label','baseUrl','458552OJNzyX','createHmac','GET','1076aRgsQp','length','/v1/account/accounts','riLxp','3198372VVWTZh'];a7_0x3174=function(){return _0x48e1ed;};return a7_0x3174();}import a7_0x22c741 from'crypto-js';export class Huobi{[a7_0x18ffb0(0x6d)]=new Array();constructor(_0x41c2c2){const _0x47fd11=a7_0x18ffb0;this['url']='https://api.huobi.pro',this[_0x47fd11(0x69)]=_0x41c2c2[_0x47fd11(0x69)]==undefined?!![]:_0x41c2c2['authenticate'],this[_0x47fd11(0x88)]=_0x47fd11(0x76),this['name']=_0x41c2c2['exchange']['exchangename']==undefined?_0x47fd11(0x68):_0x41c2c2[_0x47fd11(0x71)][_0x47fd11(0x77)],this['exchangeid']=_0x41c2c2[_0x47fd11(0x71)]['id'],this[_0x47fd11(0x73)]=_0x41c2c2[_0x47fd11(0x67)]==undefined?'':_0x41c2c2[_0x47fd11(0x67)],this[_0x47fd11(0x82)]=_0x41c2c2[_0x47fd11(0x6a)]==undefined?'':_0x41c2c2[_0x47fd11(0x6a)],this[_0x47fd11(0x7c)]=_0x41c2c2[_0x47fd11(0x7c)]==undefined?_0x47fd11(0x96):_0x41c2c2[_0x47fd11(0x7c)],this[_0x47fd11(0x87)]=_0x41c2c2[_0x47fd11(0x87)],this[_0x47fd11(0x6d)]['push'](_0x47fd11(0x75));}['dec']=_0x5884a1=>{const _0x29fa5f=a7_0x18ffb0;if(_0x5884a1==null)return undefined;const _0x5208c1=a7_0x22c741[_0x29fa5f(0x64)][_0x29fa5f(0x72)][_0x29fa5f(0x7d)](envkeys['ky']),_0x4bea90=a7_0x22c741[_0x29fa5f(0x64)][_0x29fa5f(0x72)][_0x29fa5f(0x7d)](envkeys['i']);return a7_0x22c741[_0x29fa5f(0x97)][_0x29fa5f(0x78)](_0x5884a1,_0x5208c1,{'iv':_0x4bea90})[_0x29fa5f(0x65)](a7_0x22c741[_0x29fa5f(0x64)]['Utf8']);};async[a7_0x18ffb0(0x6f)](_0x19ad8a,_0x32c668,_0x38baa3){const _0x529a01=a7_0x18ffb0;let _0x5b3cd2=this[_0x529a01(0x86)]+_0x38baa3;const _0x5a71db=await a7_0xd62954[_0x529a01(0x70)](_0x5b3cd2,_0x32c668,{'headers':_0x19ad8a});return _0x5a71db;}async[a7_0x18ffb0(0x98)](_0x45c020){const _0x52f067=a7_0x18ffb0;let _0x481a19={'baseURL':this[_0x52f067(0x86)],'url':_0x45c020,'method':_0x52f067(0x8b)};const _0x3dcb3a=await a7_0xd62954(_0x481a19);return _0x3dcb3a;}async[a7_0x18ffb0(0x95)](_0x3cb0ef,_0x191b02,_0x27307a){const _0xbc36bd=a7_0x18ffb0;let _0x49a375=await this[_0xbc36bd(0x75)](),_0x270a77=encodeURIComponent(a7_0x3ba272(new Date(_0x49a375[_0xbc36bd(0x66)]['ts']),_0xbc36bd(0x85))),_0x496539={'AccessKeyId':this[_0xbc36bd(0x73)],'SignatureMethod':_0xbc36bd(0x7f),'SignatureVersion':'2','Timestamp':_0x270a77};if(_0x27307a&&typeof _0x27307a===_0xbc36bd(0x9e)){if(_0xbc36bd(0x6b)!==_0xbc36bd(0x8f))Object['keys'](_0x27307a)['forEach'](function(_0x5b45e4){_0x496539[_0x5b45e4]=_0x27307a[_0x5b45e4];});else{var _0x25ff7f='';return _0x51e42a[_0xbc36bd(0x83)](_0x6c9b0e)[_0xbc36bd(0x9b)]()[_0xbc36bd(0x9f)](function(_0x195a11){_0x25ff7f+=_0x195a11+'='+_0x2010e3[_0x195a11]+'&';}),_0x25ff7f=_0x25ff7f[_0xbc36bd(0x81)](0x0,_0x25ff7f[_0xbc36bd(0x8d)]-0x1),_0x4ae178[_0xbc36bd(0x8a)]('sha256',_0x231d34)[_0xbc36bd(0x80)](_0x25ff7f)['digest'](_0xbc36bd(0x6c));}}let _0x59a848=Object[_0xbc36bd(0x83)](_0x496539)['sort'](),_0xb92014='\x0a',_0x4718d1=_0x191b02+_0xb92014+this[_0xbc36bd(0x88)]+_0xb92014+_0x3cb0ef+_0xb92014;_0x59a848[_0xbc36bd(0x9f)](_0x11ef88=>{const _0x53441a=_0xbc36bd;_0x4718d1=_0x4718d1+(_0x4718d1[_0x4718d1[_0x53441a(0x8d)]-0x1]==_0xb92014?'':'&')+_0x11ef88+'='+_0x496539[_0x11ef88];});const _0x5a2807=a7_0x22c741[_0xbc36bd(0x7f)](_0x4718d1,this[_0xbc36bd(0x82)]),_0x4b59b3=a7_0x22c741[_0xbc36bd(0x64)][_0xbc36bd(0x72)][_0xbc36bd(0x7a)](_0x5a2807);let _0x31663d=_0x3cb0ef,_0x1b8b94='?';return _0x59a848[_0xbc36bd(0x9f)](_0xd0d1ce=>{_0x1b8b94=_0x1b8b94+(_0x1b8b94[_0x1b8b94['length']-0x1]=='?'?'':'&')+_0xd0d1ce+'='+_0x496539[_0xd0d1ce];}),_0x1b8b94=_0x1b8b94+'&'+_0xbc36bd(0x6e)+encodeURIComponent(_0x4b59b3),_0x31663d=_0x31663d+_0x1b8b94,_0x31663d;}async[a7_0x18ffb0(0x74)](){const _0x41dad6=a7_0x18ffb0;let _0x46b12c=_0x41dad6(0x8e),_0x421cb8='GET',_0x57f2a4=await this[_0x41dad6(0x95)](_0x46b12c,_0x421cb8,undefined),_0x56d409=await this[_0x41dad6(0x98)](_0x57f2a4);return _0x56d409;}async['getWalletBalance'](_0xeeafba){const _0x125df6=a7_0x18ffb0;let _0x2320da=_0x125df6(0x94),_0x415fa9=_0x125df6(0x8b),_0xfcfff4=this[_0x125df6(0x95)](_0x2320da,_0x415fa9,_0xeeafba);return _0xfcfff4;}[a7_0x18ffb0(0x93)](_0x4cab77,_0x6eb4c8){const _0x428b91=a7_0x18ffb0;var _0x385f18='';return Object[_0x428b91(0x83)](_0x4cab77)[_0x428b91(0x9b)]()[_0x428b91(0x9f)](function(_0x3cf4de){_0x385f18+=_0x3cf4de+'='+_0x4cab77[_0x3cf4de]+'&';}),_0x385f18=_0x385f18[_0x428b91(0x81)](0x0,_0x385f18[_0x428b91(0x8d)]-0x1),crypto[_0x428b91(0x8a)]('sha256',_0x6eb4c8)['update'](_0x385f18)['digest'](_0x428b91(0x6c));}async[a7_0x18ffb0(0x75)](){const _0x4269c9=a7_0x18ffb0;let _0x29c2e9=_0x4269c9(0x92),_0xbd9cd3={'baseURL':_0x4269c9(0x7b),'url':_0x29c2e9,'method':_0x4269c9(0x8b)};const _0x4b3078=await a7_0xd62954(_0xbd9cd3);return _0x4b3078;}}