UNPKG

@compendiumfi/pendax

Version:

connector for centralized cryptocurrency exchanges

1 lines 4.7 kB
function a8_0x5132(_0x5af13e,_0x2675a5){const _0x36603=a8_0x3660();return a8_0x5132=function(_0x51322a,_0x3b4b85){_0x51322a=_0x51322a-0x1ef;let _0x4e8424=_0x36603[_0x51322a];return _0x4e8424;},a8_0x5132(_0x5af13e,_0x2675a5);}const a8_0x2d81d8=a8_0x5132;(function(_0x1f231f,_0x3ae9b2){const _0x554e8d=a8_0x5132,_0x802335=_0x1f231f();while(!![]){try{const _0x579509=parseInt(_0x554e8d(0x217))/0x1*(-parseInt(_0x554e8d(0x220))/0x2)+parseInt(_0x554e8d(0x200))/0x3+-parseInt(_0x554e8d(0x209))/0x4+parseInt(_0x554e8d(0x20e))/0x5*(-parseInt(_0x554e8d(0x1f1))/0x6)+-parseInt(_0x554e8d(0x20a))/0x7+-parseInt(_0x554e8d(0x1ef))/0x8*(-parseInt(_0x554e8d(0x1ff))/0x9)+parseInt(_0x554e8d(0x224))/0xa*(parseInt(_0x554e8d(0x1f0))/0xb);if(_0x579509===_0x3ae9b2)break;else _0x802335['push'](_0x802335['shift']());}catch(_0x14c5f9){_0x802335['push'](_0x802335['shift']());}}}(a8_0x3660,0x91f5c));import a8_0x4dda3a from'axios';function a8_0x3660(){const _0x535a89=['api.kucoin.com','update','exchangename','RbpJc','36463NGAmOn','now','exchange','kucoin','AES','secret','KC-API-TIMESTAMP','key','name','2sbkaOV','apiSecret','apiKey','toString','5570clyCZW','3112XQgiWa','15653pDTdih','618FhZDeT','main','custom-value','passphrase','Utf8','cfqHF','subaccount','authenticate','parse','exchangeid','decrypt','https://api.kucoin.com','Base64','NJnZp','17001zGjIJn','2290830SkyyqF','getSymbolsList','getSignature','createHmac','label','publicApis','getServerTime','baseUrl','base64','214948hQzcOJ','3181059OyMMwV','sha256','digest','?market=','55755Ljqifz','createGetHeader','/api/v1/timestamp','GET','dec'];a8_0x3660=function(){return _0x535a89;};return a8_0x3660();}import a8_0x126e10 from'crypto';import a8_0x29743a from'crypto-js';export class Kucoin{[a8_0x2d81d8(0x205)]=new Array();constructor(_0x22d9b4){const _0x517e3e=a8_0x2d81d8;this['url']=_0x517e3e(0x1fc),this[_0x517e3e(0x1f8)]=_0x22d9b4['authenticate']==undefined?!![]:_0x22d9b4[_0x517e3e(0x1f8)],this[_0x517e3e(0x207)]=_0x517e3e(0x213),this[_0x517e3e(0x21f)]=_0x22d9b4['exchange'][_0x517e3e(0x215)]==undefined?_0x517e3e(0x21a):_0x22d9b4[_0x517e3e(0x219)][_0x517e3e(0x215)],this[_0x517e3e(0x1fa)]=_0x22d9b4[_0x517e3e(0x219)]['id'],this[_0x517e3e(0x222)]=_0x22d9b4['key']==undefined?'':_0x22d9b4[_0x517e3e(0x21e)],this[_0x517e3e(0x221)]=_0x22d9b4[_0x517e3e(0x21c)]==undefined?'':_0x22d9b4[_0x517e3e(0x21c)],this[_0x517e3e(0x1f7)]=_0x22d9b4[_0x517e3e(0x1f7)]==undefined?_0x517e3e(0x1f2):_0x22d9b4[_0x517e3e(0x1f7)],this[_0x517e3e(0x1f4)]=_0x22d9b4['passphrase']==undefined?'':_0x22d9b4[_0x517e3e(0x1f4)],this[_0x517e3e(0x204)]=_0x22d9b4[_0x517e3e(0x204)];}[a8_0x2d81d8(0x212)]=_0x3ee5a3=>{const _0x5d863f=a8_0x2d81d8;if(_0x3ee5a3==null)return _0x5d863f(0x1f6)===_0x5d863f(0x1fe)?_0x34fb9e:undefined;const _0x4cc63c=a8_0x29743a['enc'][_0x5d863f(0x1fd)][_0x5d863f(0x1f9)](envkeys['ky']),_0x117163=a8_0x29743a['enc'][_0x5d863f(0x1fd)][_0x5d863f(0x1f9)](envkeys['i']);return a8_0x29743a[_0x5d863f(0x21b)][_0x5d863f(0x1fb)](_0x3ee5a3,_0x4cc63c,{'iv':_0x117163})[_0x5d863f(0x223)](a8_0x29743a['enc'][_0x5d863f(0x1f5)]);};[a8_0x2d81d8(0x20f)](){const _0x2da05d=a8_0x2d81d8;let _0x1a3701=Date[_0x2da05d(0x218)](),_0x4485da={'KC-API-KEY':this['apiKey'],'KC-API-TIMESTAMP':_0x1a3701,'KC-API_PASSPHRASE':a8_0x126e10[_0x2da05d(0x203)](_0x2da05d(0x20b),this[_0x2da05d(0x221)])[_0x2da05d(0x214)](this[_0x2da05d(0x1f4)])[_0x2da05d(0x20c)]('base64'),'KC-API-KEY-VERSION':'2'};return _0x4485da;}[a8_0x2d81d8(0x202)](_0xe4f43d,_0x202ced,_0x3982d4,_0x502f42,_0x4666da){const _0x21c11e=a8_0x2d81d8;let _0xf80a57=_0x202ced+_0xe4f43d+_0x3982d4+_0x502f42;return a8_0x126e10[_0x21c11e(0x203)]('sha256',_0x4666da)['update'](_0xf80a57)[_0x21c11e(0x20c)](_0x21c11e(0x208));}async[a8_0x2d81d8(0x201)](_0x1177e1){const _0x16f980=a8_0x2d81d8;let _0x522cfc='/api/v1/symbols';if(_0x1177e1){if('JofwJ'===_0x16f980(0x216)){let _0x4e0a80=_0x5863a8+_0x394970+_0x3dc4d9+_0x4c5bd8;return _0x4eceef[_0x16f980(0x203)]('sha256',_0x3a3880)[_0x16f980(0x214)](_0x4e0a80)['digest'](_0x16f980(0x208));}else _0x522cfc=_0x522cfc+_0x16f980(0x20d)+_0x1177e1;}let _0x21dd5a='GET',_0x702c17='',_0x15228f=this['createGetHeader'](),_0x5c4261=this[_0x16f980(0x202)](_0x21dd5a,_0x15228f[_0x16f980(0x21d)],_0x522cfc,_0x702c17,this[_0x16f980(0x221)]);_0x15228f['KC-API-SIGN']=_0x5c4261;let _0x91ff10={'baseURL':this['url'],'url':_0x522cfc,'method':'GET','headers':_0x15228f};const _0x53639b=await a8_0x4dda3a(_0x91ff10);return _0x53639b;}async[a8_0x2d81d8(0x206)](){const _0x40abd3=a8_0x2d81d8;let _0x3f6753=_0x40abd3(0x210),_0x173413={'baseURL':'https://api.hbdm.com','url':_0x3f6753,'method':_0x40abd3(0x211),'headers':{'X-Custom-Header':_0x40abd3(0x1f3)}};const _0x452fb5=await a8_0x4dda3a(_0x173413);return _0x452fb5;}}