@compendiumfi/pendax
Version:
connector for centralized cryptocurrency exchanges
1 lines • 5.12 kB
JavaScript
const a8_0x54bbfb=a8_0x828a;(function(_0x43cf08,_0x5a38a2){const _0x2795e2=a8_0x828a,_0x2eec64=_0x43cf08();while(!![]){try{const _0x453058=parseInt(_0x2795e2(0x213))/0x1+-parseInt(_0x2795e2(0x1fa))/0x2+parseInt(_0x2795e2(0x1ee))/0x3*(-parseInt(_0x2795e2(0x201))/0x4)+parseInt(_0x2795e2(0x1f7))/0x5+-parseInt(_0x2795e2(0x1ed))/0x6*(parseInt(_0x2795e2(0x205))/0x7)+parseInt(_0x2795e2(0x1fc))/0x8+parseInt(_0x2795e2(0x21b))/0x9;if(_0x453058===_0x5a38a2)break;else _0x2eec64['push'](_0x2eec64['shift']());}catch(_0x5aa8e8){_0x2eec64['push'](_0x2eec64['shift']());}}}(a8_0x2a85,0xba2f5));import a8_0x4fe6f3 from'axios';import a8_0x5f192f from'crypto';function a8_0x828a(_0x943fe1,_0x6b1b11){const _0x2a859a=a8_0x2a85();return a8_0x828a=function(_0x828a66,_0x1ce012){_0x828a66=_0x828a66-0x1eb;let _0x1ede11=_0x2a859a[_0x828a66];return _0x1ede11;},a8_0x828a(_0x943fe1,_0x6b1b11);}function a8_0x2a85(){const _0x635ac8=['1201245tumTPB','digest','/api/v1/symbols','576388rKvXch','label','5238368JdRmCA','decrypt','getSignature','getSymbolsList','dec','4EueKeg','publicApis','KC-API-TIMESTAMP','apiKey','6673723pYrvTH','key','toString','main','api.kucoin.com','subaccount','exchangeid','base64','exchangename','name','url','createHmac','update','GET','363846RftDSp','baseUrl','exchange','kucoin','createGetHeader','KC-API-SIGN','https://api.hbdm.com','sha256','8861850uZSMaP','apiSecret','passphrase','6bTTDYG','718035siPtcZ','Utf8','Base64','https://api.kucoin.com','enc','secret','authenticate','MzLgN','parse'];a8_0x2a85=function(){return _0x635ac8;};return a8_0x2a85();}import a8_0xbcdc6b from'crypto-js';export class Kucoin{[a8_0x54bbfb(0x202)]=new Array();constructor(_0x13a29e){const _0x28c304=a8_0x54bbfb;this[_0x28c304(0x20f)]='https://api.kucoin.com',this[_0x28c304(0x1f4)]=_0x13a29e[_0x28c304(0x1f4)]==undefined?!![]:_0x13a29e[_0x28c304(0x1f4)],this[_0x28c304(0x214)]=_0x28c304(0x209),this[_0x28c304(0x20e)]=_0x13a29e[_0x28c304(0x215)][_0x28c304(0x20d)]==undefined?_0x28c304(0x216):_0x13a29e[_0x28c304(0x215)][_0x28c304(0x20d)],this[_0x28c304(0x20b)]=_0x13a29e['exchange']['id'],this[_0x28c304(0x204)]=_0x13a29e[_0x28c304(0x206)]==undefined?'':_0x13a29e[_0x28c304(0x206)],this['apiSecret']=_0x13a29e['secret']==undefined?'':_0x13a29e[_0x28c304(0x1f3)],this['subaccount']=_0x13a29e[_0x28c304(0x20a)]==undefined?_0x28c304(0x208):_0x13a29e['subaccount'],this[_0x28c304(0x1ec)]=_0x13a29e[_0x28c304(0x1ec)]==undefined?'':_0x13a29e[_0x28c304(0x1ec)],this['label']=_0x13a29e[_0x28c304(0x1fb)];}[a8_0x54bbfb(0x200)]=_0x25ce8e=>{const _0x3ab592=a8_0x54bbfb;if(_0x25ce8e==null){if(_0x3ab592(0x1f5)!=='MzLgN')this[_0x3ab592(0x20f)]=_0x3ab592(0x1f1),this[_0x3ab592(0x1f4)]=_0x990c61[_0x3ab592(0x1f4)]==_0x394c96?!![]:_0x5130df['authenticate'],this['baseUrl']=_0x3ab592(0x209),this['name']=_0x3819cd[_0x3ab592(0x215)][_0x3ab592(0x20d)]==_0x43e211?_0x3ab592(0x216):_0xa2e3ab[_0x3ab592(0x215)]['exchangename'],this[_0x3ab592(0x20b)]=_0x1bb23['exchange']['id'],this[_0x3ab592(0x204)]=_0x5de6ef['key']==_0x46da5d?'':_0x3c6564[_0x3ab592(0x206)],this[_0x3ab592(0x1eb)]=_0x28b0d6['secret']==_0x466cc9?'':_0x1070ef[_0x3ab592(0x1f3)],this[_0x3ab592(0x20a)]=_0x2b3af2[_0x3ab592(0x20a)]==_0x172142?'main':_0x1dac01['subaccount'],this[_0x3ab592(0x1ec)]=_0xffb4df['passphrase']==_0x3302f3?'':_0x1e65a6[_0x3ab592(0x1ec)],this[_0x3ab592(0x1fb)]=_0x53c16c['label'];else return undefined;}const _0x1458dd=a8_0xbcdc6b[_0x3ab592(0x1f2)][_0x3ab592(0x1f0)][_0x3ab592(0x1f6)](envkeys['ky']),_0x253f97=a8_0xbcdc6b[_0x3ab592(0x1f2)][_0x3ab592(0x1f0)][_0x3ab592(0x1f6)](envkeys['i']);return a8_0xbcdc6b['AES'][_0x3ab592(0x1fd)](_0x25ce8e,_0x1458dd,{'iv':_0x253f97})[_0x3ab592(0x207)](a8_0xbcdc6b[_0x3ab592(0x1f2)][_0x3ab592(0x1ef)]);};[a8_0x54bbfb(0x217)](){const _0x44fd92=a8_0x54bbfb;let _0x29951b=Date['now'](),_0x52c2f2={'KC-API-KEY':this['apiKey'],'KC-API-TIMESTAMP':_0x29951b,'KC-API_PASSPHRASE':a8_0x5f192f['createHmac'](_0x44fd92(0x21a),this[_0x44fd92(0x1eb)])['update'](this[_0x44fd92(0x1ec)])[_0x44fd92(0x1f8)](_0x44fd92(0x20c)),'KC-API-KEY-VERSION':'2'};return _0x52c2f2;}[a8_0x54bbfb(0x1fe)](_0x46726a,_0x449fd3,_0x23a810,_0xf8542b,_0x4cdcff){const _0x4743b3=a8_0x54bbfb;let _0x152f86=_0x449fd3+_0x46726a+_0x23a810+_0xf8542b;return a8_0x5f192f[_0x4743b3(0x210)](_0x4743b3(0x21a),_0x4cdcff)[_0x4743b3(0x211)](_0x152f86)[_0x4743b3(0x1f8)](_0x4743b3(0x20c));}async[a8_0x54bbfb(0x1ff)](_0xff4dfc){const _0x438ae2=a8_0x54bbfb;let _0x34ad0c=_0x438ae2(0x1f9);_0xff4dfc&&(_0x34ad0c=_0x34ad0c+'?market='+_0xff4dfc);let _0x2f707d=_0x438ae2(0x212),_0x4d9337='',_0x4d4171=this[_0x438ae2(0x217)](),_0x4f7b16=this['getSignature'](_0x2f707d,_0x4d4171[_0x438ae2(0x203)],_0x34ad0c,_0x4d9337,this[_0x438ae2(0x1eb)]);_0x4d4171[_0x438ae2(0x218)]=_0x4f7b16;let _0x29cf39={'baseURL':this[_0x438ae2(0x20f)],'url':_0x34ad0c,'method':_0x438ae2(0x212),'headers':_0x4d4171};const _0x58b494=await a8_0x4fe6f3(_0x29cf39);return _0x58b494;}async['getServerTime'](){const _0x166592=a8_0x54bbfb;let _0x316baa='/api/v1/timestamp',_0x3c4426={'baseURL':_0x166592(0x219),'url':_0x316baa,'method':_0x166592(0x212)};const _0x50cfbd=await a8_0x4fe6f3(_0x3c4426);return _0x50cfbd;}}