@compendiumfi/pendax
Version:
connector for centralized cryptocurrency exchanges
1 lines • 38.4 kB
JavaScript
const a6_0xcf80f5=a6_0x20a0;function a6_0x4f52(){const _0x174f05=['uri','JfZZJ','authenticate\x20option\x20requires\x20valid\x20api\x20key\x20and\x20api\x20secret','createSubaccount','2418642DKHNkg','orders/','bMbgz','zdMex','decrypt','target','createTriggerBody','GHaZc','orderId=','result','tokens','body','BGCJL','DDZzZ','/modify','wPkaN','wallet/balances','yjrcc','getSubaccountBalances','transferBetweenSubaccounts','getHistoricalPrices','NmEWg','placeOrder','orderType','StEJO','order_id','market=','isMain','595136nSPrkh','ZLrHm','?market=','FGtAY','triggerOrder','price','useProxy','label','ftxus','balancer','type','AQEfF','sKlPl','RVbwt','entries','dec','modifyOrder','update','ytnis','kexli','QhEwi','orderType=','wGmOH','cancelOrderByClientId','authenticate','subaccounts','/balances','GAlQk','orders/history','RkbsH','toString','order=','coin','3320630cFvxoP','conditional_orders','getMarket','CKAfV','start_time=','ljrDj','10Kenujm','YCZpR','market_name','executeGetRequest','digest','TJiXt','UXwui','deleteSubaccountData','http://','constructor','subaccounts/transfer','90qnHDiS','GcMql','getOpenOrders','ZvMwc','deleteRequest','clientId','7781568jskhdg','getTriggerOrderTriggers','MXxvW','cancelOpenTriggerOrder','yrwjn','nickname','baseURL','XanXV','createPostHeader','GET/api/','AES','getAllBalances','hNsZv','AIPJc','getMarkets','getOpenTriggerOrders','conditional_orders/','orderId','secret','uJtcp','exchange','auystrAAS2iW85#s2@jdDC','497763yhZWTk','exchangename','createGetHeader','/trades','indexOf','JTbvF','https://ftx.us/api/','getTrades','/api/','changeSubaccountNameBody','PJCrH','join','depth','zeCMA','uoLwM','orders/by_client_id/','apiSecret','markets/','conditional_orders/history','No\x20response\x20from\x20exchange\x20-\x20double\x20check\x20parameters','url','GET','requires\x20clientId','getFills','Nntug','requires\x20price\x20or\x20size\x20or\x20both','side','publicApis','oXOsx','orders','Bgwnr','getBalances','end_time','side=','Hmac','map','now','hex','requires\x20orderId','name','size','cYDDQ','dhsyTW5!ysh8IuysQKcG45','baseUrl','/proxy/get','qnyUL','39650031LVjtJJ','length','LLkzf','market','wNNRW','ayCRW','vZzSa','parameter\x20must\x20be\x20an\x20array\x20of\x20tokens','order','POST','markets','key','subaccount','type=','getOrderHistory','ABgaI','sha256','25279JXrymO','sockets','/proxy/post','Crnot','sOcGK','proxy','/orderbook?depth=','parse','stringify','obCZH','createSubaccountBody','push','BOKFu','HmixR','FTXUS-SIGN','IINCN','headers','/proxy/delete','apiKey','/orderbook','includes','/candles?resolution=','executeOrder','DELETE','end_time=','changeSubaccountName','data','start_time','SSMrc','Mmnhk','exchangeid','3CoMWup','IgTas','proxyPort','rvScI','subaccounts/','/triggers','FTXUS-TS','enc','KDcHL'];a6_0x4f52=function(){return _0x174f05;};return a6_0x4f52();}function a6_0x20a0(_0x4a280b,_0xce385a){const _0x4f52cc=a6_0x4f52();return a6_0x20a0=function(_0x20a017,_0x1916d8){_0x20a017=_0x20a017-0xbe;let _0xe691ef=_0x4f52cc[_0x20a017];return _0xe691ef;},a6_0x20a0(_0x4a280b,_0xce385a);}(function(_0x2c659e,_0x40c55f){const _0x2fa6d3=a6_0x20a0,_0x1ea7d8=_0x2c659e();while(!![]){try{const _0x1e6027=parseInt(_0x2fa6d3(0xdb))/0x1+parseInt(_0x2fa6d3(0x107))/0x2*(-parseInt(_0x2fa6d3(0xfa))/0x3)+parseInt(_0x2fa6d3(0x123))/0x4+-parseInt(_0x2fa6d3(0x144))/0x5+-parseInt(_0x2fa6d3(0x155))/0x6*(parseInt(_0x2fa6d3(0x171))/0x7)+-parseInt(_0x2fa6d3(0x15b))/0x8+parseInt(_0x2fa6d3(0xca))/0x9*(parseInt(_0x2fa6d3(0x14a))/0xa);if(_0x1e6027===_0x40c55f)break;else _0x1ea7d8['push'](_0x1ea7d8['shift']());}catch(_0x16c28c){_0x1ea7d8['push'](_0x1ea7d8['shift']());}}}(a6_0x4f52,0xa2cdc));import a6_0x2259da from'axios';import a6_0x1de107 from'crypto';import a6_0x113a4c from'crypto-js';export class FtxUs{[a6_0xcf80f5(0x18c)]=new Array();['ky']=a6_0xcf80f5(0x170);['i']=a6_0xcf80f5(0xc6);[a6_0xcf80f5(0xdc)]={};constructor(_0xa6f64b){const _0x40535a=a6_0xcf80f5;this[_0x40535a(0x185)]=_0x40535a(0x177),this[_0x40535a(0x13b)]=_0xa6f64b['authenticate']==undefined?!![]:_0xa6f64b[_0x40535a(0x13b)],this[_0x40535a(0xc3)]=_0xa6f64b[_0x40535a(0x16f)][_0x40535a(0x172)]==undefined?_0x40535a(0x12b):_0xa6f64b[_0x40535a(0x16f)][_0x40535a(0x172)],this[_0x40535a(0xf9)]=_0xa6f64b[_0x40535a(0x16f)]['id'],this[_0x40535a(0x12a)]=_0xa6f64b[_0x40535a(0x12a)];if(this[_0x40535a(0x13b)]){if(_0x40535a(0xf7)!==_0x40535a(0x17e)){if(!_0xa6f64b[_0x40535a(0xd5)]||!_0xa6f64b[_0x40535a(0x16d)]||_0xa6f64b[_0x40535a(0xd5)]==''||_0xa6f64b['secret']==''){if(_0x40535a(0x14b)!==_0x40535a(0x14b))_0x4a9a76=_0x5572eb+(_0x36d773=='?'?'':'&'),_0x41cb3e=_0x3d34b9+_0x40535a(0xd7)+_0x3503a2[_0x40535a(0x12d)];else throw _0x40535a(0x105);}this[_0x40535a(0xed)]=_0xa6f64b['key'],this[_0x40535a(0x181)]=_0xa6f64b[_0x40535a(0x16d)],this[_0x40535a(0x122)]=_0xa6f64b[_0x40535a(0xd6)]==undefined,this[_0x40535a(0xd6)]=this['isMain']?'':_0xa6f64b[_0x40535a(0xd6)];}else _0x244455=_0x21041b+(_0xb5dcf9=='?'?'':'&'),_0x3cf1a7=_0x3b952a+'order='+_0x394ec8[_0x40535a(0xd2)];}this[_0x40535a(0x129)]=![],this[_0x40535a(0x12c)]=_0xa6f64b[_0x40535a(0x12c)]||undefined;if(_0xa6f64b['useProxy']){if('iFOmi'===_0x40535a(0x12f))_0x23beac[_0x40535a(0x161)]='http://'+this[_0x40535a(0xe0)]+':'+this[_0x40535a(0xfc)];else{if(_0xa6f64b[_0x40535a(0xe0)]&&_0xa6f64b[_0x40535a(0xe0)]!=''||_0xa6f64b[_0x40535a(0x12c)]&&_0xa6f64b['balancer']!=''){if(_0x40535a(0x14f)!==_0x40535a(0x14f))return _0x34f914[_0x40535a(0xf5)][_0x40535a(0xf5)];else this[_0x40535a(0x129)]=!![],this[_0x40535a(0xe0)]=_0xa6f64b['proxy'],_0xa6f64b[_0x40535a(0xfc)]?'qYQel'==='FskDp'?this[_0x40535a(0xfc)]=0xbb8:this[_0x40535a(0xfc)]=_0xa6f64b['proxyPort']:this[_0x40535a(0xfc)]=0xbb8;}}}this['ri']='lyQBz2wseWT6vT7XDyp9DQ==',this[_0x40535a(0x18c)]['push'](_0x40535a(0x178),_0x40535a(0x11b),'getMarkets',_0x40535a(0x146));}[a6_0xcf80f5(0x132)]=_0x51efff=>{const _0x4b629e=a6_0xcf80f5;if(_0x51efff==null){if(_0x4b629e(0x124)===_0x4b629e(0x137))_0x44923e[_0x4b629e(0xeb)]={'target':this[_0x4b629e(0x185)],'uri':_0x4bca7e['url'],'body':_0xce7487};else return undefined;}const _0x40397d=a6_0x113a4c['enc']['Base64']['parse'](this['ky']),_0x581a1d=a6_0x113a4c['enc']['Base64'][_0x4b629e(0xe2)](this['i']);return a6_0x113a4c[_0x4b629e(0x165)][_0x4b629e(0x10b)](_0x51efff,_0x40397d,{'iv':_0x581a1d})[_0x4b629e(0x141)](a6_0x113a4c[_0x4b629e(0x101)]['Utf8']);};['createPostHeader'](_0x35acff){const _0x3b5047=a6_0xcf80f5;let _0x1211af=Date[_0x3b5047(0xc0)](),_0x4bb305;if(this[_0x3b5047(0x122)]&&_0x35acff&&_0x35acff[_0x3b5047(0xd6)]){if('StEJO'!==_0x3b5047(0x11f))throw _0x3b5047(0xc2);else _0x4bb305={'FTXUS-KEY':this['apiKey'],'FTXUS-TS':_0x1211af,'FTXUS-SUBACCOUNT':_0x35acff[_0x3b5047(0xd6)]};}else{if(!this[_0x3b5047(0x122)]&&_0x35acff&&_0x35acff[_0x3b5047(0xd6)]&&_0x35acff[_0x3b5047(0xd6)]==this[_0x3b5047(0xd6)])_0x3b5047(0x16e)!==_0x3b5047(0x147)?_0x4bb305={'FTXUS-KEY':this['apiKey'],'FTXUS-TS':_0x1211af,'FTXUS-SUBACCOUNT':_0x35acff[_0x3b5047(0xd6)]}:_0x28c2ce={'FTXUS-KEY':this[_0x3b5047(0xed)],'FTXUS-TS':_0x2fb2a1,'FTXUS-SUBACCOUNT':_0xb82b91[_0x3b5047(0xd6)]};else{if(!this[_0x3b5047(0x122)]&&(!_0x35acff||!_0x35acff[_0x3b5047(0xd6)]))_0x4bb305={'FTXUS-KEY':this[_0x3b5047(0xed)],'FTXUS-TS':_0x1211af,'FTXUS-SUBACCOUNT':this[_0x3b5047(0xd6)]};else this[_0x3b5047(0x122)]&&(_0x4bb305={'FTXUS-KEY':this[_0x3b5047(0xed)],'FTXUS-TS':_0x1211af});}}return _0x4bb305;}[a6_0xcf80f5(0x173)](_0x429966){const _0x401b37=a6_0xcf80f5;let _0x176ec8=Date[_0x401b37(0xc0)](),_0x2e3b32;if(this[_0x401b37(0x122)]&&_0x429966&&_0x429966[_0x401b37(0xd6)]){if('RjweA'==='wkbos')return{'result':_0x33dd49['data'][_0x401b37(0xf5)],'body':_0x5bfa1f};else _0x2e3b32={'FTXUS-KEY':this['apiKey'],'FTXUS-TS':_0x176ec8,'FTXUS-SUBACCOUNT':_0x429966['subaccount']};}else{if(!this['isMain']&&_0x429966&&_0x429966[_0x401b37(0xd6)]&&_0x429966[_0x401b37(0xd6)]==this[_0x401b37(0xd6)])'dHXyn'!==_0x401b37(0x113)?_0x2e3b32={'FTXUS-KEY':this['apiKey'],'FTXUS-TS':_0x176ec8,'FTXUS-SUBACCOUNT':_0x429966[_0x401b37(0xd6)]}:_0x3893cb[_0x401b37(0xeb)]={'target':this[_0x401b37(0x185)],'uri':_0x2198fd[_0x401b37(0x185)],'body':_0x5f224b};else{if(!this[_0x401b37(0x122)]&&(!_0x429966||!_0x429966[_0x401b37(0xd6)])){if(_0x401b37(0x118)!==_0x401b37(0x150))_0x2e3b32={'FTXUS-KEY':this[_0x401b37(0xed)],'FTXUS-TS':_0x176ec8,'FTXUS-SUBACCOUNT':this[_0x401b37(0xd6)]};else return _0x5b93c6[_0x401b37(0xf5)][_0x401b37(0xf5)][_0x401b37(0x110)]?_0x4790a7['data']['data'][_0x401b37(0x110)]:_0x3c855e[_0x401b37(0xf5)][_0x401b37(0xf5)];}else{if(this[_0x401b37(0x122)]){if('rQCVS'===_0x401b37(0x116))return{'result':_0x4b7625['data']['data'],'body':_0x265ab3};else _0x2e3b32={'FTXUS-KEY':this[_0x401b37(0xed)],'FTXUS-TS':_0x176ec8};}}}}return _0x2e3b32;}async['executeOrder'](_0x4ae8de,_0x50af31,_0x57af78,_0x518811){const _0x534f64=a6_0xcf80f5;let _0x441793={'baseURL':this[_0x534f64(0x185)],'url':_0x57af78,'method':'POST','headers':_0x4ae8de};const _0x7ae6cd=_0x50af31?JSON[_0x534f64(0xe3)](_0x50af31):'';if(this[_0x534f64(0x129)]){if(_0x534f64(0x109)==='UZnvD')throw _0x534f64(0x184);else _0x4ae8de==''?_0x534f64(0x149)===_0x534f64(0x149)?_0x441793['headers']={'target':this[_0x534f64(0x185)],'uri':_0x441793[_0x534f64(0x185)],'body':_0x7ae6cd}:_0x23f716=_0x3e6f2a+_0x534f64(0x121)+_0x2aad4c[_0x534f64(0xcd)]:'QLLTG'===_0x534f64(0x126)?(_0x1ad2e7['headers']['baseUrl']=this[_0x534f64(0x185)],_0x39747b[_0x534f64(0x161)]='http://'+this[_0x534f64(0x12c)]+':'+this[_0x534f64(0xfc)]):(_0x441793[_0x534f64(0xeb)]['target']=this['url'],_0x441793['headers'][_0x534f64(0x103)]=_0x441793[_0x534f64(0x185)],_0x441793[_0x534f64(0xeb)][_0x534f64(0x112)]=_0x7ae6cd),this[_0x534f64(0x12c)]?_0x534f64(0xfb)===_0x534f64(0xfb)?(_0x441793['headers'][_0x534f64(0xc7)]=this[_0x534f64(0x185)],_0x441793[_0x534f64(0x161)]=_0x534f64(0x152)+this[_0x534f64(0x12c)]+':'+this[_0x534f64(0xfc)]):(_0x51010d=_0x332b19+(_0x151169=='?'?'':'&'),_0x2815ba=_0x222c21+_0x534f64(0x148)+_0x30e36a['start_time']):_0x441793['baseURL']='http://'+this['proxy']+':'+this[_0x534f64(0xfc)],_0x441793['url']=_0x534f64(0xdd);}else{if(_0x534f64(0x139)!==_0x534f64(0x139))throw'requires\x20price\x20or\x20size\x20or\x20both';else _0x441793['data']=_0x50af31;}try{const _0xc9499f=await a6_0x2259da(_0x441793);if(!_0xc9499f){if(_0x534f64(0xcf)===_0x534f64(0x12e))throw _0x534f64(0xc2);else throw _0x534f64(0x184);}if(this[_0x534f64(0x129)]){let _0x4fd2e4=_0xc9499f[_0x534f64(0xf5)][_0x534f64(0xf5)]?_0xc9499f['data'][_0x534f64(0xf5)]:_0xc9499f[_0x534f64(0xf5)];delete _0xc9499f[_0x534f64(0xf5)],_0xc9499f['data']=_0x4fd2e4;}if(_0x518811&&['1','2','3','4','5','6']['includes'](_0x518811))switch(_0x518811){case'1':if(_0xc9499f['data']['data'])return _0xc9499f[_0x534f64(0xf5)][_0x534f64(0xf5)];else{if(_0x534f64(0x102)==='pxdYu')_0x432bb2[_0x534f64(0x161)]=_0x534f64(0x152)+this[_0x534f64(0xe0)]+':'+this[_0x534f64(0xfc)];else return _0xc9499f['data'];}break;case'2':return _0xc9499f[_0x534f64(0xf5)];break;case'3':return _0xc9499f;break;case'4':return _0xc9499f[_0x534f64(0xf5)]['data']?{'result':_0xc9499f['data']['data'],'body':_0x50af31}:{'result':_0xc9499f[_0x534f64(0xf5)],'body':_0x50af31};break;case'5':return{'result':_0xc9499f[_0x534f64(0xf5)],'body':_0x50af31};break;case'6':return{'result':_0xc9499f,'body':_0x50af31};break;}if(_0xc9499f[_0x534f64(0xf5)][_0x534f64(0xf5)]){if('Crnot'===_0x534f64(0xde))return{'result':_0xc9499f[_0x534f64(0xf5)][_0x534f64(0xf5)],'body':_0x50af31};else _0x2f6d97=_0x41d0e0+_0x534f64(0x121)+_0x27d77b[_0x534f64(0xcd)];}else return{'result':_0xc9499f[_0x534f64(0xf5)],'body':_0x50af31};}catch(_0x34373f){return _0x34373f;}}async[a6_0xcf80f5(0x14d)](_0x9fab0f,_0x20a66f,_0x3623b0){const _0x1cb75f=a6_0xcf80f5;let _0x26b1f0={'baseURL':this[_0x1cb75f(0x185)],'url':_0x20a66f,'method':_0x1cb75f(0x186),'headers':_0x9fab0f};this['useProxy']&&(_0x1cb75f(0x18d)===_0x1cb75f(0xfd)?_0x4e5fc5={'FTXUS-KEY':this['apiKey'],'FTXUS-TS':_0xcbe91f,'FTXUS-SUBACCOUNT':this[_0x1cb75f(0xd6)]}:(_0x9fab0f==''?_0x26b1f0[_0x1cb75f(0xeb)]={'target':this[_0x1cb75f(0x185)],'uri':_0x26b1f0['url']}:(_0x26b1f0[_0x1cb75f(0xeb)][_0x1cb75f(0x10c)]=this[_0x1cb75f(0x185)],_0x26b1f0['headers'][_0x1cb75f(0x103)]=_0x26b1f0[_0x1cb75f(0x185)]),this[_0x1cb75f(0x12c)]?_0x1cb75f(0xd9)!==_0x1cb75f(0x10e)?(_0x26b1f0[_0x1cb75f(0xeb)]['baseUrl']=this[_0x1cb75f(0x185)],_0x26b1f0[_0x1cb75f(0x161)]=_0x1cb75f(0x152)+this[_0x1cb75f(0x12c)]+':'+this[_0x1cb75f(0xfc)]):(this[_0x1cb75f(0x129)]=!![],this[_0x1cb75f(0xe0)]=_0x3780bb[_0x1cb75f(0xe0)],_0xe6d5d4[_0x1cb75f(0xfc)]?this[_0x1cb75f(0xfc)]=_0x3a727a['proxyPort']:this['proxyPort']=0xbb8):_0x26b1f0[_0x1cb75f(0x161)]=_0x1cb75f(0x152)+this[_0x1cb75f(0xe0)]+':'+this[_0x1cb75f(0xfc)],_0x26b1f0[_0x1cb75f(0x185)]=_0x1cb75f(0xc8)));try{const _0x2aaf36=await a6_0x2259da(_0x26b1f0);if(!_0x2aaf36)throw'No\x20response\x20from\x20exchange\x20-\x20double\x20check\x20parameters';if(_0x3623b0&&['1','2','3'][_0x1cb75f(0xef)](_0x3623b0))switch(_0x3623b0){case'1':if(_0x2aaf36[_0x1cb75f(0xf5)][_0x1cb75f(0xf5)]){if(_0x1cb75f(0x114)==='DDZzZ')return _0x2aaf36[_0x1cb75f(0xf5)]['data'];else _0xcbfa09[_0x1cb75f(0xf5)]['result'];}else _0x2aaf36['data'][_0x1cb75f(0x110)]&&_0x2aaf36[_0x1cb75f(0xf5)]['result'];break;case'2':return _0x2aaf36[_0x1cb75f(0xf5)];break;case'3':return _0x2aaf36;break;}if(_0x2aaf36[_0x1cb75f(0xf5)][_0x1cb75f(0xf5)])return _0x2aaf36[_0x1cb75f(0xf5)][_0x1cb75f(0xf5)][_0x1cb75f(0x110)]?_0x2aaf36[_0x1cb75f(0xf5)]['data'][_0x1cb75f(0x110)]:_0x2aaf36['data']['data'];else{if(_0x2aaf36['data'][_0x1cb75f(0x110)])return _0x2aaf36[_0x1cb75f(0xf5)]['result'];}}catch(_0x234f39){if('WVSxz'!=='iLCkl')return _0x234f39;else throw _0x1cb75f(0x187);}}async[a6_0xcf80f5(0x159)](_0x43e7a2,_0x5b72f8,_0x454931,_0x2c637b){const _0x27458f=a6_0xcf80f5;let _0x364eaa={'baseURL':this['url'],'url':_0x454931,'method':_0x27458f(0xf2),'headers':_0x43e7a2};const _0x50516c=_0x5b72f8?JSON['stringify'](_0x5b72f8):'';if(this[_0x27458f(0x129)]){if(_0x27458f(0x17b)===_0x27458f(0x17b)){if(_0x43e7a2==''){if('pJyaU'===_0x27458f(0x156))return _0x582945;else _0x364eaa['headers']={'target':this[_0x27458f(0x185)],'uri':_0x364eaa['url'],'body':_0x50516c};}else{if(_0x27458f(0x158)===_0x27458f(0x158))_0x364eaa[_0x27458f(0xeb)][_0x27458f(0x10c)]=this[_0x27458f(0x185)],_0x364eaa[_0x27458f(0xeb)]['uri']=_0x364eaa[_0x27458f(0x185)],_0x364eaa[_0x27458f(0xeb)][_0x27458f(0x112)]=_0x50516c;else{if(_0x5e33e9[_0x27458f(0xf5)]&&_0x21a199[_0x27458f(0xf5)]['result'])for(let _0x2a0fef=0x0;_0x2a0fef<_0x4ead96[_0x27458f(0xf5)]['result']['length'];_0x2a0fef++){let _0x4c8a56=_0x34cd1c[_0x27458f(0xf5)]['result'][_0x2a0fef][_0x27458f(0x143)];_0xaf93c7[_0x27458f(0xef)](_0x4c8a56)&&_0x387e50[_0x27458f(0xe6)](_0x427363[_0x27458f(0xf5)][_0x27458f(0x110)][_0x2a0fef]);}}}this[_0x27458f(0x12c)]?(_0x364eaa['headers'][_0x27458f(0xc7)]=this[_0x27458f(0x185)],_0x364eaa['baseURL']=_0x27458f(0x152)+this[_0x27458f(0x12c)]+':'+this[_0x27458f(0xfc)]):_0x27458f(0xe4)==='obCZH'?_0x364eaa['baseURL']='http://'+this['proxy']+':'+this['proxyPort']:(_0x40911e[_0x27458f(0xeb)][_0x27458f(0x10c)]=this[_0x27458f(0x185)],_0x59f959[_0x27458f(0xeb)][_0x27458f(0x103)]=_0x32ca66[_0x27458f(0x185)],_0x54b251['headers'][_0x27458f(0x112)]=_0x202050),_0x364eaa[_0x27458f(0x185)]=_0x27458f(0xec);}else throw'authenticate\x20option\x20requires\x20valid\x20api\x20key\x20and\x20api\x20secret';}else _0x5b72f8&&(_0x364eaa[_0x27458f(0xf5)]=_0x5b72f8);try{const _0x21e3b8=await a6_0x2259da(_0x364eaa);if(!_0x21e3b8){if(_0x27458f(0xce)===_0x27458f(0xce))throw _0x27458f(0x184);else{let _0x422acd=_0x539e34;return _0x422acd;}}if(this[_0x27458f(0x129)]){let _0x510a86=_0x21e3b8[_0x27458f(0xf5)][_0x27458f(0xf5)]?_0x21e3b8[_0x27458f(0xf5)][_0x27458f(0xf5)]:_0x21e3b8['data'];delete _0x21e3b8['data'],_0x21e3b8['data']=_0x510a86;}if(_0x2c637b&&['1','2'][_0x27458f(0xef)](_0x2c637b))switch(_0x2c637b){case'1':return _0x21e3b8[_0x27458f(0xf5)];break;case'2':return _0x21e3b8;break;}return _0x21e3b8[_0x27458f(0xf5)];}catch(_0x2f6b51){return _0x2f6b51;}}async['getAllSubaccounts'](_0x533c89){const _0x1cc7c8=a6_0xcf80f5;let _0xaceefb=this[_0x1cc7c8(0x173)](),_0x40a970='subaccounts',_0x4c6421=_0xaceefb['FTXUS-TS']+_0x1cc7c8(0x164)+_0x40a970;const _0x5b19ba=a6_0x1de107[_0x1cc7c8(0xbe)](_0x1cc7c8(0xda),this[_0x1cc7c8(0x181)])[_0x1cc7c8(0x134)](_0x4c6421)[_0x1cc7c8(0x14e)]('hex');return _0xaceefb[_0x1cc7c8(0xe9)]=_0x5b19ba,await(await this[_0x1cc7c8(0x14d)](_0xaceefb,_0x40a970,_0x533c89||undefined))['data'];}[a6_0xcf80f5(0xe5)](_0x4fee27){let _0x234bab=_0x4fee27;return _0x234bab;}async[a6_0xcf80f5(0x106)](_0x4112c5,_0x331736){const _0x252bb6=a6_0xcf80f5;let _0x280f45=this['createPostHeader'](),_0x17c5ba=this[_0x252bb6(0xe5)](_0x4112c5),_0x34d715=_0x252bb6(0x13c),_0x1e0114=_0x280f45[_0x252bb6(0x100)]+'POST'+_0x252bb6(0x179)+_0x34d715+JSON[_0x252bb6(0xe3)](_0x17c5ba);const _0x450d5a=a6_0x1de107['Hmac']('sha256',this[_0x252bb6(0x181)])[_0x252bb6(0x134)](_0x1e0114)[_0x252bb6(0x14e)](_0x252bb6(0xc1));return _0x280f45[_0x252bb6(0xe9)]=_0x450d5a,await(await this[_0x252bb6(0xf1)](_0x280f45,_0x17c5ba,_0x34d715,_0x331736||undefined))[_0x252bb6(0xf5)];}['changeSubaccountNameBody'](_0x1ebb02){let _0x26707d=_0x1ebb02;return _0x26707d;}async[a6_0xcf80f5(0xf4)](_0x4b433c,_0x4240db){const _0x295ea7=a6_0xcf80f5;let _0x5ded33=this[_0x295ea7(0x163)](),_0x23fc06=this[_0x295ea7(0x17a)](_0x4b433c),_0x4ce32b='subaccounts/update_name',_0x454e58=_0x5ded33[_0x295ea7(0x100)]+_0x295ea7(0xd3)+'/api/'+_0x4ce32b+JSON[_0x295ea7(0xe3)](_0x23fc06);const _0x4ba655=a6_0x1de107[_0x295ea7(0xbe)](_0x295ea7(0xda),this[_0x295ea7(0x181)])['update'](_0x454e58)[_0x295ea7(0x14e)](_0x295ea7(0xc1));return _0x5ded33['FTXUS-SIGN']=_0x4ba655,await(await this[_0x295ea7(0xf1)](_0x5ded33,_0x23fc06,_0x4ce32b,_0x4240db||undefined))['data'];}['deleteSubaccountData'](_0x264f34){let _0x133bdf=_0x264f34;return _0x133bdf;}async['deleteSubaccount'](_0x5b2f9e,_0x44f531){const _0x101c4f=a6_0xcf80f5;let _0x2cc908=this['createPostHeader'](_0x5b2f9e),_0x17408d=this[_0x101c4f(0x151)](_0x5b2f9e),_0x5781ec=_0x101c4f(0x13c),_0x2e6a65=_0x2cc908[_0x101c4f(0x100)]+_0x101c4f(0xf2)+_0x101c4f(0x179)+_0x5781ec+JSON['stringify'](_0x17408d);const _0x3eddde=a6_0x1de107[_0x101c4f(0xbe)](_0x101c4f(0xda),this[_0x101c4f(0x181)])['update'](_0x2e6a65)['digest'](_0x101c4f(0xc1));return _0x2cc908['FTXUS-SIGN']=_0x3eddde,await this[_0x101c4f(0x159)](_0x2cc908,_0x17408d,_0x5781ec,_0x44f531||undefined);}async[a6_0xcf80f5(0x119)](_0x485843,_0x475b87){const _0x1adb31=a6_0xcf80f5;let _0x1dff2e=this[_0x1adb31(0x173)](),_0x2b84f0=_0x485843[_0x1adb31(0x160)],_0x5bce9c=_0x1adb31(0xfe)+_0x2b84f0+_0x1adb31(0x13d),_0x31ff67=_0x1dff2e[_0x1adb31(0x100)]+_0x1adb31(0x164)+_0x5bce9c;const _0x563314=a6_0x1de107[_0x1adb31(0xbe)](_0x1adb31(0xda),this[_0x1adb31(0x181)])[_0x1adb31(0x134)](_0x31ff67)[_0x1adb31(0x14e)](_0x1adb31(0xc1));return _0x1dff2e[_0x1adb31(0xe9)]=_0x563314,await this[_0x1adb31(0x14d)](_0x1dff2e,_0x5bce9c,_0x475b87||undefined);}async[a6_0xcf80f5(0x11a)](_0x61c401,_0x1ec1b6){const _0x6e761c=a6_0xcf80f5;let _0x2e13e3=this[_0x6e761c(0x163)](),_0x99e1a6=_0x61c401,_0x4e43cd=_0x6e761c(0x154),_0x21543e=_0x2e13e3[_0x6e761c(0x100)]+_0x6e761c(0xd3)+_0x6e761c(0x179)+_0x4e43cd+JSON[_0x6e761c(0xe3)](_0x99e1a6);const _0x3c8e97=a6_0x1de107['Hmac'](_0x6e761c(0xda),this[_0x6e761c(0x181)])[_0x6e761c(0x134)](_0x21543e)[_0x6e761c(0x14e)](_0x6e761c(0xc1));return _0x2e13e3[_0x6e761c(0xe9)]=_0x3c8e97,await this[_0x6e761c(0xf1)](_0x2e13e3,_0x99e1a6,_0x4e43cd,_0x1ec1b6||undefined);}async[a6_0xcf80f5(0x169)](_0x2c9f94){const _0x355d78=a6_0xcf80f5;let _0x2b72c6=_0x355d78(0xd4),_0x4fb1d2=this[_0x355d78(0x185)]+_0x2b72c6;return await this[_0x355d78(0x14d)]('',_0x4fb1d2,_0x2c9f94||undefined);}async[a6_0xcf80f5(0x146)](_0x58b811,_0xff6dd4){const _0x69f242=a6_0xcf80f5;let _0xf83004=_0x69f242(0x182),_0x43182d=this[_0x69f242(0x185)]+_0xf83004+_0x58b811;return await this[_0x69f242(0x14d)]('',_0x43182d,_0xff6dd4||undefined);}async['getOrderbook'](_0x3775ae,_0x37df82){const _0x2bd14f=a6_0xcf80f5;let _0x2beb9a='?';return _0x3775ae[_0x2bd14f(0x17d)]==null?_0x2beb9a=this[_0x2bd14f(0x185)]+_0x2bd14f(0x182)+_0x3775ae['market_name']+_0x2bd14f(0xee):_0x2bd14f(0xdf)!==_0x2bd14f(0x168)?_0x2beb9a=this[_0x2bd14f(0x185)]+'markets/'+_0x3775ae[_0x2bd14f(0x14c)]+_0x2bd14f(0xe1)+_0x3775ae[_0x2bd14f(0x17d)]:_0x127ea7=_0x2ab458+_0x2bd14f(0x125)+_0x4b76a5,await this['executeGetRequest']('',_0x2beb9a,_0x37df82||undefined);}async[a6_0xcf80f5(0x178)](_0x318f95,_0x3b982f){const _0x33590e=a6_0xcf80f5;let _0x5ac822=this['url']+_0x33590e(0x182)+_0x318f95[_0x33590e(0x14c)]+_0x33590e(0x174);if(_0x318f95[_0x33590e(0xf6)]||_0x318f95[_0x33590e(0x191)]){_0x5ac822=_0x5ac822+'?';if(_0x318f95[_0x33590e(0xf6)])_0x5ac822=_0x5ac822+'start_time='+_0x318f95[_0x33590e(0xf6)],_0x318f95[_0x33590e(0x191)]&&(_0x5ac822=_0x5ac822+'&'+_0x33590e(0xf3)+_0x318f95[_0x33590e(0x191)]);else{if(_0x318f95[_0x33590e(0x191)]){if('eYHAJ'===_0x33590e(0x140)){let _0x19fa03=_0x56e198[_0x33590e(0xf5)][_0x33590e(0xf5)]?_0x2e76a5[_0x33590e(0xf5)][_0x33590e(0xf5)]:_0x4d9337[_0x33590e(0xf5)];delete _0xd17000[_0x33590e(0xf5)],_0x323368[_0x33590e(0xf5)]=_0x19fa03;}else _0x5ac822=_0x5ac822+_0x33590e(0xf3)+_0x318f95['end_time'];}}}return await this[_0x33590e(0x14d)]('',_0x5ac822,_0x3b982f||undefined);}async[a6_0xcf80f5(0x11b)](_0x41ffa4,_0x48a9c0){const _0x3cb4d7=a6_0xcf80f5;let _0x3d1dce=this[_0x3cb4d7(0x185)]+_0x3cb4d7(0x182)+_0x41ffa4[_0x3cb4d7(0x14c)]+_0x3cb4d7(0xf0)+_0x41ffa4['resolution'];if(_0x41ffa4[_0x3cb4d7(0xf6)]||_0x41ffa4['end_time']){_0x3d1dce=_0x3d1dce+'&';if(_0x41ffa4['start_time']){if(_0x3cb4d7(0x167)==='oCfnk')return _0x557033;else _0x3d1dce=_0x3d1dce+_0x3cb4d7(0x148)+_0x41ffa4[_0x3cb4d7(0xf6)],_0x41ffa4[_0x3cb4d7(0x191)]&&(_0x3cb4d7(0xc9)!==_0x3cb4d7(0xc9)?_0x53c1b9=_0x34482e+'&'+_0x3cb4d7(0xf3)+_0x4cd040[_0x3cb4d7(0x191)]:_0x3d1dce=_0x3d1dce+'&'+'end_time'+_0x41ffa4['end_time']);}else{if(_0x41ffa4[_0x3cb4d7(0x191)]){if(_0x3cb4d7(0x18f)!==_0x3cb4d7(0x162))_0x3d1dce=_0x3d1dce+_0x3cb4d7(0xf3)+_0x41ffa4[_0x3cb4d7(0x191)];else throw _0x3cb4d7(0xd1);}}}return await this[_0x3cb4d7(0x14d)]('',_0x3d1dce,_0x48a9c0||undefined);}async['getCoins'](_0x23556d,_0x5941ce){const _0x5009b6=a6_0xcf80f5;let _0x42f010=this[_0x5009b6(0x173)](_0x23556d),_0x47bc46='wallet/coins',_0x5cca19=_0x42f010[_0x5009b6(0x100)]+_0x5009b6(0x164)+_0x47bc46;const _0x4d20d9=a6_0x1de107[_0x5009b6(0xbe)](_0x5009b6(0xda),this[_0x5009b6(0x181)])[_0x5009b6(0x134)](_0x5cca19)[_0x5009b6(0x14e)](_0x5009b6(0xc1));return _0x42f010[_0x5009b6(0xe9)]=_0x4d20d9,await this['executeGetRequest'](_0x42f010,_0x47bc46,_0x5941ce||undefined);}async['getPositions'](_0x7a31b5,_0x441422){const _0x2749d9=a6_0xcf80f5;return await this[_0x2749d9(0x190)](_0x7a31b5,_0x441422||undefined);}async[a6_0xcf80f5(0x190)](_0x79bf33,_0x15e2b4){const _0x2fcdca=a6_0xcf80f5;let _0x58d068=this[_0x2fcdca(0x173)](_0x79bf33),_0xa6a6eb;if(_0x79bf33&&_0x79bf33[_0x2fcdca(0x111)]){if(_0x2fcdca(0x11c)===_0x2fcdca(0x11c)){_0xa6a6eb=_0x79bf33[_0x2fcdca(0x111)];if(!_0xa6a6eb[_0x2fcdca(0x153)][_0x2fcdca(0x141)]()[_0x2fcdca(0x175)]('Array')>0x1)throw'parameter\x20must\x20be\x20an\x20array\x20of\x20tokens';}else{let _0x46a677=_0x504ff7[_0x2fcdca(0xf5)][_0x2fcdca(0xf5)]?_0x5b5032[_0x2fcdca(0xf5)]['data']:_0x3f49e9[_0x2fcdca(0xf5)];delete _0x34cbcc[_0x2fcdca(0xf5)],_0x574274['data']=_0x46a677;}}let _0x541871=_0x2fcdca(0x117),_0x56775d=_0x58d068[_0x2fcdca(0x100)]+'GET/api/'+_0x541871;const _0x5e603c=a6_0x1de107[_0x2fcdca(0xbe)]('sha256',this[_0x2fcdca(0x181)])['update'](_0x56775d)[_0x2fcdca(0x14e)]('hex');_0x58d068[_0x2fcdca(0xe9)]=_0x5e603c;let _0x53f034=await this[_0x2fcdca(0x14d)](_0x58d068,_0x541871,_0x15e2b4||undefined),_0x4e00a5=new Array();if(_0xa6a6eb){if(_0x2fcdca(0x136)==='kexli'){if(_0x53f034[_0x2fcdca(0xf5)]&&_0x53f034[_0x2fcdca(0xf5)][_0x2fcdca(0x110)]){if(_0x2fcdca(0xea)!==_0x2fcdca(0xc5))for(let _0x487c4f=0x0;_0x487c4f<_0x53f034[_0x2fcdca(0xf5)][_0x2fcdca(0x110)][_0x2fcdca(0xcb)];_0x487c4f++){let _0x2375ed=_0x53f034['data'][_0x2fcdca(0x110)][_0x487c4f][_0x2fcdca(0x143)];_0xa6a6eb[_0x2fcdca(0xef)](_0x2375ed)&&_0x4e00a5[_0x2fcdca(0xe6)](_0x53f034['data'][_0x2fcdca(0x110)][_0x487c4f]);}else _0x73061d=_0x52f431+(_0x29eb20=='?'?'':'&'),_0x35c6cc=_0x4fc6e0+_0x2fcdca(0xf3)+_0x4c20fd[_0x2fcdca(0x191)];}}else{if(!_0x1ddee0['key']||!_0x4c2087[_0x2fcdca(0x16d)]||_0x4bb359[_0x2fcdca(0xd5)]==''||_0x4fa016[_0x2fcdca(0x16d)]=='')throw _0x2fcdca(0x105);this[_0x2fcdca(0xed)]=_0x3eb201[_0x2fcdca(0xd5)],this[_0x2fcdca(0x181)]=_0x311be0['secret'],this[_0x2fcdca(0x122)]=_0x2791ca[_0x2fcdca(0xd6)]==_0x1d4f52,this[_0x2fcdca(0xd6)]=this[_0x2fcdca(0x122)]?'':_0x2b1cf7[_0x2fcdca(0xd6)];}}else{if(_0x2fcdca(0x15f)!==_0x2fcdca(0x15f)){let _0x2f18b2=_0x28ecbd;return _0x2f18b2;}else _0x4e00a5=_0x53f034[_0x2fcdca(0xf5)];}return _0x4e00a5;}async[a6_0xcf80f5(0x166)](_0x99f5cf,_0x434936){const _0x5b4604=a6_0xcf80f5;let _0x290812=this['createGetHeader'](_0x99f5cf),_0x51ac16='wallet/all_balances',_0x20cbaa=_0x290812[_0x5b4604(0x100)]+'GET/api/'+_0x51ac16;const _0x362298=a6_0x1de107['Hmac'](_0x5b4604(0xda),this[_0x5b4604(0x181)])[_0x5b4604(0x134)](_0x20cbaa)['digest']('hex');return _0x290812[_0x5b4604(0xe9)]=_0x362298,await this[_0x5b4604(0x14d)](_0x290812,_0x51ac16,_0x434936||undefined);}async[a6_0xcf80f5(0x157)](_0x3a003d,_0x1e0a2c){const _0x2717d2=a6_0xcf80f5;let _0x14fa9e=this[_0x2717d2(0x173)](),_0x210eb2=_0x2717d2(0x18e);_0x3a003d&&(_0x2717d2(0x104)==='JfZZJ'?_0x210eb2=_0x210eb2+_0x2717d2(0x125)+_0x3a003d:_0x2a6cd6={'FTXUS-KEY':this[_0x2717d2(0xed)],'FTXUS-TS':_0x56a7ff});let _0x43cd82=_0x14fa9e[_0x2717d2(0x100)]+_0x2717d2(0x164)+_0x210eb2;const _0x5d60ce=a6_0x1de107[_0x2717d2(0xbe)](_0x2717d2(0xda),this[_0x2717d2(0x181)])[_0x2717d2(0x134)](_0x43cd82)[_0x2717d2(0x14e)](_0x2717d2(0xc1));return _0x14fa9e[_0x2717d2(0xe9)]=_0x5d60ce,await this['executeGetRequest'](_0x14fa9e,_0x210eb2,_0x1e0a2c||undefined);}async[a6_0xcf80f5(0xd8)](_0x19b937,_0x10dde5){const _0x57e3d6=a6_0xcf80f5;let _0x2c4976=this[_0x57e3d6(0x173)](),_0x4d6594=_0x57e3d6(0x13f),_0x4f5926=Object[_0x57e3d6(0x131)](_0x19b937)[_0x57e3d6(0xbf)](_0x806e1d=>_0x806e1d['join']('='));_0x4f5926[_0x57e3d6(0xcb)]>0x0&&(_0x4d6594=_0x4d6594+'?',_0x4d6594=_0x4d6594+_0x4f5926[_0x57e3d6(0x17c)]('&'));let _0x42ce1f=_0x4d6594,_0x2f775a=_0x2c4976[_0x57e3d6(0x100)]+'GET/api/'+_0x4d6594;const _0x3d2cd3=a6_0x1de107[_0x57e3d6(0xbe)](_0x57e3d6(0xda),this[_0x57e3d6(0x181)])[_0x57e3d6(0x134)](_0x2f775a)[_0x57e3d6(0x14e)]('hex');return _0x2c4976[_0x57e3d6(0xe9)]=_0x3d2cd3,await this[_0x57e3d6(0x14d)](_0x2c4976,_0x42ce1f,_0x10dde5||undefined);}async[a6_0xcf80f5(0x16a)](_0x36dbf0,_0x5ac3be){const _0x5eab25=a6_0xcf80f5;_0x36dbf0=_0x36dbf0||{};let _0x4cbe8b=this[_0x5eab25(0x173)](),_0x3820d4=_0x5eab25(0x145),_0x39c9db=Object[_0x5eab25(0x131)](_0x36dbf0)[_0x5eab25(0xbf)](_0x4226d2=>_0x4226d2[_0x5eab25(0x17c)]('='));if(_0x39c9db[_0x5eab25(0xcb)]>0x0){if(_0x5eab25(0x15d)===_0x5eab25(0x15d))_0x3820d4=_0x3820d4+'?',_0x3820d4=_0x3820d4+_0x39c9db[_0x5eab25(0x17c)]('&');else throw'requires\x20clientId';}let _0x1c7c97=_0x3820d4,_0xf01f95=_0x4cbe8b[_0x5eab25(0x100)]+_0x5eab25(0x164)+_0x1c7c97;const _0x78dcd4=a6_0x1de107[_0x5eab25(0xbe)](_0x5eab25(0xda),this[_0x5eab25(0x181)])[_0x5eab25(0x134)](_0xf01f95)[_0x5eab25(0x14e)](_0x5eab25(0xc1));return _0x4cbe8b['FTXUS-SIGN']=_0x78dcd4,await this[_0x5eab25(0x14d)](_0x4cbe8b,_0x1c7c97,_0x5ac3be||undefined);}async[a6_0xcf80f5(0x15c)](_0x56c593,_0x36dab0){const _0x14e7f8=a6_0xcf80f5;let _0x579e69=this[_0x14e7f8(0x173)]();if(!_0x56c593||!_0x56c593['orderId'])throw'requires\x20orderId';let _0x18642e=_0x14e7f8(0x16b)+_0x56c593[_0x14e7f8(0x16c)]+_0x14e7f8(0xff),_0x5ee558=_0x18642e,_0x5596c4=_0x579e69[_0x14e7f8(0x100)]+'GET/api/'+_0x5ee558;const _0x561b03=a6_0x1de107[_0x14e7f8(0xbe)](_0x14e7f8(0xda),this[_0x14e7f8(0x181)])[_0x14e7f8(0x134)](_0x5596c4)[_0x14e7f8(0x14e)]('hex');return _0x579e69[_0x14e7f8(0xe9)]=_0x561b03,await this[_0x14e7f8(0x14d)](_0x579e69,_0x5ee558,_0x36dab0||undefined);}async['getTriggerOrderHistory'](_0x51744f,_0x566f37){const _0x1129f0=a6_0xcf80f5;let _0x36a4e6=this[_0x1129f0(0x173)](),_0x3ce676='?';_0x51744f=_0x51744f||{};_0x51744f[_0x1129f0(0xcd)]&&(_0x1129f0(0xf8)==='Mmnhk'?_0x3ce676=_0x3ce676+_0x1129f0(0x121)+_0x51744f[_0x1129f0(0xcd)]:_0x10c903=this['url']+_0x1129f0(0x182)+_0x2e6983[_0x1129f0(0x14c)]+_0x1129f0(0xee));_0x51744f['start_time']&&(_0x3ce676=_0x3ce676+(_0x3ce676=='?'?'':'&'),_0x3ce676=_0x3ce676+_0x1129f0(0x148)+_0x51744f['start_time']);_0x51744f[_0x1129f0(0x191)]&&(_0x3ce676=_0x3ce676+(_0x3ce676=='?'?'':'&'),_0x3ce676=_0x3ce676+_0x1129f0(0xf3)+_0x51744f['end_time']);_0x51744f[_0x1129f0(0x18b)]&&(_0x3ce676=_0x3ce676+(_0x3ce676=='?'?'':'&'),_0x3ce676=_0x3ce676+_0x1129f0(0x192)+_0x51744f[_0x1129f0(0x18b)]);_0x51744f[_0x1129f0(0x12d)]&&(_0x1129f0(0xd0)===_0x1129f0(0x189)?_0x37e52e[_0x1129f0(0xf5)]=_0x25c635:(_0x3ce676=_0x3ce676+(_0x3ce676=='?'?'':'&'),_0x3ce676=_0x3ce676+_0x1129f0(0xd7)+_0x51744f[_0x1129f0(0x12d)]));_0x51744f[_0x1129f0(0x11e)]&&(_0x3ce676=_0x3ce676+(_0x3ce676=='?'?'':'&'),_0x3ce676=_0x3ce676+_0x1129f0(0x138)+_0x51744f[_0x1129f0(0x11e)]);let _0x34deeb=_0x1129f0(0x183)+(_0x3ce676=='?'?'':_0x3ce676),_0x2be9a4=_0x36a4e6['FTXUS-TS']+'GET/api/'+_0x34deeb;const _0x19c8b4=a6_0x1de107[_0x1129f0(0xbe)](_0x1129f0(0xda),this['apiSecret'])[_0x1129f0(0x134)](_0x2be9a4)[_0x1129f0(0x14e)](_0x1129f0(0xc1));return _0x36a4e6[_0x1129f0(0xe9)]=_0x19c8b4,await this[_0x1129f0(0x14d)](_0x36a4e6,_0x34deeb,_0x566f37||undefined);}['createPlaceBody'](_0x31e74f){const _0x4a5246=a6_0xcf80f5;let _0x129928=_0x31e74f;return _0x129928[_0x4a5246(0x12d)]==_0x4a5246(0xcd)&&(_0x129928['price']=null),_0x129928;}async[a6_0xcf80f5(0x11d)](_0x2d6c37,_0x26c3eb){const _0x4673df=a6_0xcf80f5;let _0xeba31b=this[_0x4673df(0x163)](_0x2d6c37),_0x59114c=this['createPlaceBody'](_0x2d6c37),_0x3d906c=_0x4673df(0x18e),_0x11d236=_0xeba31b[_0x4673df(0x100)]+_0x4673df(0xd3)+_0x4673df(0x179)+_0x3d906c+JSON[_0x4673df(0xe3)](_0x59114c);const _0xed2dd3=a6_0x1de107[_0x4673df(0xbe)](_0x4673df(0xda),this[_0x4673df(0x181)])[_0x4673df(0x134)](_0x11d236)[_0x4673df(0x14e)](_0x4673df(0xc1));_0xeba31b['FTXUS-SIGN']=_0xed2dd3,await this[_0x4673df(0xf1)](_0xeba31b,_0x59114c,_0x3d906c,_0x26c3eb||undefined);}[a6_0xcf80f5(0x10d)](_0x3e7c80){let _0x3c6fcb=_0x3e7c80;return _0x3c6fcb;}async[a6_0xcf80f5(0x127)](_0x235be2,_0x30e86b){const _0x5c8840=a6_0xcf80f5;let _0x432a61=this['createPostHeader'](_0x235be2),_0x39e2c5=this['createTriggerBody'](_0x235be2),_0x5102a3='conditional_orders',_0x381fef=_0x432a61[_0x5c8840(0x100)]+_0x5c8840(0xd3)+'/api/'+_0x5102a3+JSON[_0x5c8840(0xe3)](_0x39e2c5);const _0x436729=a6_0x1de107[_0x5c8840(0xbe)](_0x5c8840(0xda),this[_0x5c8840(0x181)])[_0x5c8840(0x134)](_0x381fef)[_0x5c8840(0x14e)](_0x5c8840(0xc1));_0x432a61['FTXUS-SIGN']=_0x436729,await this[_0x5c8840(0xf1)](_0x432a61,_0x39e2c5,_0x5102a3,_0x30e86b||undefined);}async[a6_0xcf80f5(0x15e)](_0x10a3ba,_0x54e422){const _0x116b46=a6_0xcf80f5;if(!_0x10a3ba||!_0x10a3ba[_0x116b46(0x16c)])throw _0x116b46(0xc2);let _0x50343e=this['createPostHeader'](_0x10a3ba),_0x2d0115=_0x116b46(0x16b)+_0x10a3ba['orderId'],_0x68106d=_0x50343e[_0x116b46(0x100)]+_0x116b46(0xf2)+_0x116b46(0x179)+_0x2d0115+(_0x10a3ba?JSON['stringify'](_0x10a3ba):'');const _0x305685=a6_0x1de107[_0x116b46(0xbe)](_0x116b46(0xda),this['apiSecret'])['update'](_0x68106d)[_0x116b46(0x14e)](_0x116b46(0xc1));return _0x50343e['FTXUS-SIGN']=_0x305685,await this['deleteRequest'](_0x50343e,_0x10a3ba,_0x2d0115,_0x54e422||undefined);}async['cancelAllOrders'](_0x55dd73,_0x10abb0){const _0x105d80=a6_0xcf80f5;let _0x16e28a=this['createPostHeader'](_0x55dd73),_0x126a30=_0x105d80(0x18e),_0x13e0d9=_0x16e28a['FTXUS-TS']+_0x105d80(0xf2)+_0x105d80(0x179)+_0x126a30+(_0x55dd73?JSON['stringify'](_0x55dd73):'');const _0x24bc17=a6_0x1de107[_0x105d80(0xbe)](_0x105d80(0xda),this[_0x105d80(0x181)])[_0x105d80(0x134)](_0x13e0d9)[_0x105d80(0x14e)](_0x105d80(0xc1));return _0x16e28a[_0x105d80(0xe9)]=_0x24bc17,await this[_0x105d80(0x159)](_0x16e28a,_0x55dd73,_0x126a30,_0x10abb0||undefined);}async[a6_0xcf80f5(0x133)](_0x13900e,_0x13922a){const _0x37c8f9=a6_0xcf80f5;if(!_0x13900e||!_0x13900e[_0x37c8f9(0x16c)])throw _0x37c8f9(0xc2);if(!_0x13900e[_0x37c8f9(0xc4)]&&!_0x13900e[_0x37c8f9(0x128)]){if(_0x37c8f9(0x17f)===_0x37c8f9(0x17f))throw'requires\x20price\x20or\x20size\x20or\x20both';else _0x2357a0={'FTXUS-KEY':this['apiKey'],'FTXUS-TS':_0x36911d};}let _0x963df0=_0x13900e,_0x223330=this[_0x37c8f9(0x163)](_0x13900e),_0x17f067=_0x37c8f9(0x108)+_0x13900e[_0x37c8f9(0x16c)]+'/modify';delete _0x13900e[_0x37c8f9(0x16c)];let _0x2ba578=_0x223330[_0x37c8f9(0x100)]+'POST'+_0x37c8f9(0x179)+_0x17f067+JSON['stringify'](_0x963df0);const _0x26bdbb=a6_0x1de107[_0x37c8f9(0xbe)](_0x37c8f9(0xda),this[_0x37c8f9(0x181)])[_0x37c8f9(0x134)](_0x2ba578)['digest']('hex');return _0x223330[_0x37c8f9(0xe9)]=_0x26bdbb,await this[_0x37c8f9(0xf1)](_0x223330,_0x963df0,_0x17f067,_0x13922a||undefined);}async['modifyOrderByClientId'](_0x3e73a3,_0x5b9733){const _0x33fbbf=a6_0xcf80f5;if(!_0x3e73a3||!_0x3e73a3[_0x33fbbf(0x15a)])throw _0x33fbbf(0x187);if(!_0x3e73a3[_0x33fbbf(0xc4)]&&!_0x3e73a3[_0x33fbbf(0x128)])throw _0x33fbbf(0x18a);let _0x38013d=_0x3e73a3,_0x3da7d5=this[_0x33fbbf(0x163)](_0x38013d),_0xa10c95=_0x33fbbf(0x180)+_0x38013d[_0x33fbbf(0x15a)]+'/modify';delete _0x38013d['clientId'];let _0x26e8fa=_0x3da7d5[_0x33fbbf(0x100)]+'POST'+'/api/'+_0xa10c95+JSON[_0x33fbbf(0xe3)](_0x38013d);const _0x1abc3e=a6_0x1de107['Hmac'](_0x33fbbf(0xda),this[_0x33fbbf(0x181)])[_0x33fbbf(0x134)](_0x26e8fa)[_0x33fbbf(0x14e)](_0x33fbbf(0xc1));return _0x3da7d5[_0x33fbbf(0xe9)]=_0x1abc3e,await this[_0x33fbbf(0xf1)](_0x3da7d5,_0x38013d,_0xa10c95,_0x5b9733||undefined);}['modifyTriggerOrderBody'](_0x38ed37){const _0x46ffe3=a6_0xcf80f5;let _0x1ad0cc=_0x38ed37;return delete _0x38ed37[_0x46ffe3(0x120)],_0x1ad0cc;}async['modifyTriggerOrder'](_0x518674,_0x1694bd){const _0x1809cd=a6_0xcf80f5;let _0x2247dc=_0x518674,_0x428b59=_0x2247dc[_0x1809cd(0x16c)];delete _0x2247dc[_0x1809cd(0x16c)];let _0xaa7a92=this['createPostHeader'](_0x2247dc),_0x451856=_0x1809cd(0x16b)+_0x428b59+_0x1809cd(0x115),_0x3267ab=_0xaa7a92[_0x1809cd(0x100)]+_0x1809cd(0xd3)+'/api/'+_0x451856+JSON[_0x1809cd(0xe3)](_0x2247dc);const _0x713564=a6_0x1de107[_0x1809cd(0xbe)]('sha256',this[_0x1809cd(0x181)])['update'](_0x3267ab)[_0x1809cd(0x14e)](_0x1809cd(0xc1));return _0xaa7a92[_0x1809cd(0xe9)]=_0x713564,await this['executeOrder'](_0xaa7a92,_0x2247dc,_0x451856,_0x1694bd||undefined);}async['getOrderStatus'](_0x11c8a4,_0x5d953d){const _0x2fe079=a6_0xcf80f5;let _0xa8ac05=this['createGetHeader']();if(!_0x11c8a4||!_0x11c8a4[_0x2fe079(0x16c)]){if(_0x2fe079(0x13e)==='XfvZH')_0x381628=this[_0x2fe079(0x185)]+'markets/'+_0x5309a6[_0x2fe079(0x14c)]+_0x2fe079(0xe1)+_0x271df8['depth'];else throw _0x2fe079(0xc2);}let _0x5044d6=_0x2fe079(0x108)+_0x11c8a4[_0x2fe079(0x16c)],_0x28dc06=_0xa8ac05['FTXUS-TS']+_0x2fe079(0x164)+_0x5044d6;const _0x1e581c=a6_0x1de107[_0x2fe079(0xbe)](_0x2fe079(0xda),this['apiSecret'])[_0x2fe079(0x134)](_0x28dc06)[_0x2fe079(0x14e)](_0x2fe079(0xc1));return _0xa8ac05['FTXUS-SIGN']=_0x1e581c,await this[_0x2fe079(0x14d)](_0xa8ac05,_0x5044d6,_0x5d953d||undefined);}async['getOrderStatusByClientId'](_0x32097d,_0x19d051){const _0x27bf4a=a6_0xcf80f5;if(!_0x32097d||!_0x32097d['clientId'])throw _0x27bf4a(0x187);let _0x2efe77=this[_0x27bf4a(0x173)](),_0x50f553='orders/by_client_id/'+_0x32097d[_0x27bf4a(0x15a)],_0x32eef8=_0x2efe77['FTXUS-TS']+'GET/api/'+_0x50f553;const _0x302408=a6_0x1de107[_0x27bf4a(0xbe)](_0x27bf4a(0xda),this[_0x27bf4a(0x181)])['update'](_0x32eef8)['digest'](_0x27bf4a(0xc1));return _0x2efe77['FTXUS-SIGN']=_0x302408,await this[_0x27bf4a(0x14d)](_0x2efe77,_0x50f553,_0x19d051||undefined);}async['cancelOrder'](_0x901ac8,_0x40cb5d){const _0x1026c3=a6_0xcf80f5;if(!_0x901ac8||!_0x901ac8['orderId'])throw _0x1026c3(0xc2);let _0x132a3d=this['createPostHeader'](_0x901ac8),_0x65a8ed=_0x1026c3(0x108)+_0x901ac8[_0x1026c3(0x16c)],_0x17fd56=_0x132a3d[_0x1026c3(0x100)]+_0x1026c3(0xf2)+_0x1026c3(0x179)+_0x65a8ed+(_0x901ac8?JSON[_0x1026c3(0xe3)](_0x901ac8):'');const _0x3e3027=a6_0x1de107['Hmac']('sha256',this[_0x1026c3(0x181)])[_0x1026c3(0x134)](_0x17fd56)['digest'](_0x1026c3(0xc1));return _0x132a3d[_0x1026c3(0xe9)]=_0x3e3027,await this[_0x1026c3(0x159)](_0x132a3d,_0x901ac8,_0x65a8ed,_0x40cb5d||undefined);}async[a6_0xcf80f5(0x13a)](_0x5a1106,_0x5cd8d3){const _0x1e0406=a6_0xcf80f5;if(!_0x5a1106||!_0x5a1106['clientId'])throw _0x1e0406(0x187);let _0x2c2335=this[_0x1e0406(0x163)](_0x5a1106),_0x165c94=_0x1e0406(0x180)+_0x5a1106[_0x1e0406(0x15a)],_0xf1e516=_0x2c2335['FTXUS-TS']+_0x1e0406(0xf2)+_0x1e0406(0x179)+_0x165c94+(_0x5a1106?JSON['stringify'](_0x5a1106):'');const _0x19a38d=a6_0x1de107[_0x1e0406(0xbe)](_0x1e0406(0xda),this['apiSecret'])[_0x1e0406(0x134)](_0xf1e516)[_0x1e0406(0x14e)](_0x1e0406(0xc1));return _0x2c2335[_0x1e0406(0xe9)]=_0x19a38d,await this[_0x1e0406(0x159)](_0x2c2335,_0x5a1106,_0x165c94,_0x5cd8d3||undefined);}async[a6_0xcf80f5(0x188)](_0xb6cd70,_0x16a4d9){const _0x1de138=a6_0xcf80f5;let _0x5b7673=this[_0x1de138(0x173)](),_0x49be9c='?';if(_0xb6cd70['market']){if(_0x1de138(0x10a)===_0x1de138(0xe7)){let _0x5c2b2a=_0x2e7676;return _0x5c2b2a[_0x1de138(0x12d)]==_0x1de138(0xcd)&&(_0x5c2b2a[_0x1de138(0x128)]=null),_0x5c2b2a;}else _0x49be9c=_0x49be9c+_0x1de138(0x121)+_0xb6cd70[_0x1de138(0xcd)];}_0xb6cd70[_0x1de138(0xf6)]&&(_0x1de138(0x176)===_0x1de138(0x176)?(_0x49be9c=_0x49be9c+(_0x49be9c=='?'?'':'&'),_0x49be9c=_0x49be9c+_0x1de138(0x148)+_0xb6cd70[_0x1de138(0xf6)]):_0x5c93f7=_0x2c850c+_0x1de138(0xf3)+_0x348610['end_time']);if(_0xb6cd70[_0x1de138(0x191)]){if(_0x1de138(0xcc)!==_0x1de138(0xe8))_0x49be9c=_0x49be9c+(_0x49be9c=='?'?'':'&'),_0x49be9c=_0x49be9c+_0x1de138(0xf3)+_0xb6cd70['end_time'];else throw _0x1de138(0xc2);}_0xb6cd70[_0x1de138(0xd2)]&&(_0x49be9c=_0x49be9c+(_0x49be9c=='?'?'':'&'),_0x49be9c=_0x49be9c+_0x1de138(0x142)+_0xb6cd70['order']);_0xb6cd70['orderId']&&(_0x1de138(0x130)===_0x1de138(0x135)?(_0x20c02e=_0x2cf4c0+(_0x1de25e=='?'?'':'&'),_0x56de4c=_0x3115d2+_0x1de138(0x192)+_0x57a1e6[_0x1de138(0x18b)]):(_0x49be9c=_0x49be9c+(_0x49be9c=='?'?'':'&'),_0x49be9c=_0x49be9c+_0x1de138(0x10f)+_0xb6cd70['orderId']));let _0x49fb83='fills'+(_0x49be9c=='?'?'':_0x49be9c),_0x4c1e7b=_0x5b7673['FTXUS-TS']+_0x1de138(0x164)+_0x49fb83;const _0x219ce8=a6_0x1de107[_0x1de138(0xbe)](_0x1de138(0xda),this[_0x1de138(0x181)])['update'](_0x4c1e7b)[_0x1de138(0x14e)]('hex');return _0x5b7673[_0x1de138(0xe9)]=_0x219ce8,await this[_0x1de138(0x14d)](_0x5b7673,_0x49fb83,_0x16a4d9||undefined);}}