ccxt
Version:
1 lines • 5.23 MB
JavaScript
(()=>{var __webpack_modules__={8045:e=>{"use strict";e.exports=function(e,t){var i=new Array(arguments.length-1),s=0,r=2,a=!0;for(;r<arguments.length;)i[s++]=arguments[r++];return new Promise((function(r,o){i[s]=function(e){if(a)if(a=!1,e)o(e);else{for(var t=new Array(arguments.length-1),i=0;i<t.length;)t[i++]=arguments[i];r.apply(null,t)}};try{e.apply(t||null,i)}catch(e){a&&(a=!1,o(e))}}))}},8839:(e,t)=>{"use strict";var i=t;i.length=function(e){var t=e.length;if(!t)return 0;for(var i=0;--t%4>1&&"="===e.charAt(t);)++i;return Math.ceil(3*e.length)/4-i};for(var s=new Array(64),r=new Array(123),a=0;a<64;)r[s[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;i.encode=function(e,t,i){for(var r,a=null,o=[],n=0,d=0;t<i;){var c=e[t++];switch(d){case 0:o[n++]=s[c>>2],r=(3&c)<<4,d=1;break;case 1:o[n++]=s[r|c>>4],r=(15&c)<<2,d=2;break;case 2:o[n++]=s[r|c>>6],o[n++]=s[63&c],d=0}n>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,o)),n=0)}return d&&(o[n++]=s[r],o[n++]=61,1===d&&(o[n++]=61)),a?(n&&a.push(String.fromCharCode.apply(String,o.slice(0,n))),a.join("")):String.fromCharCode.apply(String,o.slice(0,n))};var o="invalid encoding";i.decode=function(e,t,i){for(var s,a=i,n=0,d=0;d<e.length;){var c=e.charCodeAt(d++);if(61===c&&n>1)break;if(void 0===(c=r[c]))throw Error(o);switch(n){case 0:s=c,n=1;break;case 1:t[i++]=s<<2|(48&c)>>4,s=c,n=2;break;case 2:t[i++]=(15&s)<<4|(60&c)>>2,s=c,n=3;break;case 3:t[i++]=(3&s)<<6|c,n=0}}if(1===n)throw Error(o);return i-a},i.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},4358:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,i){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:i||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var i=this._listeners[e],s=0;s<i.length;)i[s].fn===t?i.splice(s,1):++s;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var i=[],s=1;s<arguments.length;)i.push(arguments[s++]);for(s=0;s<t.length;)t[s].fn.apply(t[s++].ctx,i)}return this}},9410:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),i=new Uint8Array(t.buffer),s=128===i[3];function r(e,s,r){t[0]=e,s[r]=i[0],s[r+1]=i[1],s[r+2]=i[2],s[r+3]=i[3]}function a(e,s,r){t[0]=e,s[r]=i[3],s[r+1]=i[2],s[r+2]=i[1],s[r+3]=i[0]}function o(e,s){return i[0]=e[s],i[1]=e[s+1],i[2]=e[s+2],i[3]=e[s+3],t[0]}function n(e,s){return i[3]=e[s],i[2]=e[s+1],i[1]=e[s+2],i[0]=e[s+3],t[0]}e.writeFloatLE=s?r:a,e.writeFloatBE=s?a:r,e.readFloatLE=s?o:n,e.readFloatBE=s?n:o}():function(){function t(e,t,i,s){var r=t<0?1:0;if(r&&(t=-t),0===t)e(1/t>0?0:2147483648,i,s);else if(isNaN(t))e(2143289344,i,s);else if(t>34028234663852886e22)e((r<<31|2139095040)>>>0,i,s);else if(t<11754943508222875e-54)e((r<<31|Math.round(t/1401298464324817e-60))>>>0,i,s);else{var a=Math.floor(Math.log(t)/Math.LN2);e((r<<31|a+127<<23|8388607&Math.round(t*Math.pow(2,-a)*8388608))>>>0,i,s)}}function o(e,t,i){var s=e(t,i),r=2*(s>>31)+1,a=s>>>23&255,o=8388607&s;return 255===a?o?NaN:r*(1/0):0===a?1401298464324817e-60*r*o:r*Math.pow(2,a-150)*(o+8388608)}e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,s),e.readFloatLE=o.bind(null,r),e.readFloatBE=o.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),i=new Uint8Array(t.buffer),s=128===i[7];function r(e,s,r){t[0]=e,s[r]=i[0],s[r+1]=i[1],s[r+2]=i[2],s[r+3]=i[3],s[r+4]=i[4],s[r+5]=i[5],s[r+6]=i[6],s[r+7]=i[7]}function a(e,s,r){t[0]=e,s[r]=i[7],s[r+1]=i[6],s[r+2]=i[5],s[r+3]=i[4],s[r+4]=i[3],s[r+5]=i[2],s[r+6]=i[1],s[r+7]=i[0]}function o(e,s){return i[0]=e[s],i[1]=e[s+1],i[2]=e[s+2],i[3]=e[s+3],i[4]=e[s+4],i[5]=e[s+5],i[6]=e[s+6],i[7]=e[s+7],t[0]}function n(e,s){return i[7]=e[s],i[6]=e[s+1],i[5]=e[s+2],i[4]=e[s+3],i[3]=e[s+4],i[2]=e[s+5],i[1]=e[s+6],i[0]=e[s+7],t[0]}e.writeDoubleLE=s?r:a,e.writeDoubleBE=s?a:r,e.readDoubleLE=s?o:n,e.readDoubleBE=s?n:o}():function(){function t(e,t,i,s,r,a){var o=s<0?1:0;if(o&&(s=-s),0===s)e(0,r,a+t),e(1/s>0?0:2147483648,r,a+i);else if(isNaN(s))e(0,r,a+t),e(2146959360,r,a+i);else if(s>17976931348623157e292)e(0,r,a+t),e((o<<31|2146435072)>>>0,r,a+i);else{var n;if(s<22250738585072014e-324)e((n=s/5e-324)>>>0,r,a+t),e((o<<31|n/4294967296)>>>0,r,a+i);else{var d=Math.floor(Math.log(s)/Math.LN2);1024===d&&(d=1023),e(4503599627370496*(n=s*Math.pow(2,-d))>>>0,r,a+t),e((o<<31|d+1023<<20|1048576*n&1048575)>>>0,r,a+i)}}}function o(e,t,i,s,r){var a=e(s,r+t),o=e(s,r+i),n=2*(o>>31)+1,d=o>>>20&2047,c=4294967296*(1048575&o)+a;return 2047===d?c?NaN:n*(1/0):0===d?5e-324*n*c:n*Math.pow(2,d-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,i,0,4),e.writeDoubleBE=t.bind(null,s,4,0),e.readDoubleLE=o.bind(null,r,0,4),e.readDoubleBE=o.bind(null,a,4,0)}(),e}function i(e,t,i){t[i]=255&e,t[i+1]=e>>>8&255,t[i+2]=e>>>16&255,t[i+3]=e>>>24}function s(e,t,i){t[i]=e>>>24,t[i+1]=e>>>16&255,t[i+2]=e>>>8&255,t[i+3]=255&e}function r(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},4153:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},9390:e=>{"use strict";e.exports=function(e,t,i){var s=i||8192,r=s>>>1,a=null,o=s;return function(i){if(i<1||i>r)return e(i);o+i>s&&(a=e(s),o=0);var n=t.call(a,o,o+=i);return 7&o&&(o=1+(7|o)),n}}},1447:(e,t)=>{"use strict";var i=t;i.length=function(e){for(var t=0,i=0,s=0;s<e.length;++s)(i=e.charCodeAt(s))<128?t+=1:i<2048?t+=2:55296==(64512&i)&&56320==(64512&e.charCodeAt(s+1))?(++s,t+=4):t+=3;return t},i.read=function(e,t,i){if(i-t<1)return"";for(var s,r=null,a=[],o=0;t<i;)(s=e[t++])<128?a[o++]=s:s>191&&s<224?a[o++]=(31&s)<<6|63&e[t++]:s>239&&s<365?(s=((7&s)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[o++]=55296+(s>>10),a[o++]=56320+(1023&s)):a[o++]=(15&s)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,a)),o=0);return r?(o&&r.push(String.fromCharCode.apply(String,a.slice(0,o))),r.join("")):String.fromCharCode.apply(String,a.slice(0,o))},i.write=function(e,t,i){for(var s,r,a=i,o=0;o<e.length;++o)(s=e.charCodeAt(o))<128?t[i++]=s:s<2048?(t[i++]=s>>6|192,t[i++]=63&s|128):55296==(64512&s)&&56320==(64512&(r=e.charCodeAt(o+1)))?(s=65536+((1023&s)<<10)+(1023&r),++o,t[i++]=s>>18|240,t[i++]=s>>12&63|128,t[i++]=s>>6&63|128,t[i++]=63&s|128):(t[i++]=s>>12|224,t[i++]=s>>6&63|128,t[i++]=63&s|128);return i-a}},6946:(e,t,i)=>{"use strict";e.exports=i(4394)},4394:(e,t,i)=>{"use strict";var s=t;function r(){s.util._configure(),s.Writer._configure(s.BufferWriter),s.Reader._configure(s.BufferReader)}s.build="minimal",s.Writer=i(3449),s.BufferWriter=i(818),s.Reader=i(6237),s.BufferReader=i(3158),s.util=i(3610),s.rpc=i(5047),s.roots=i(4529),s.configure=r,r()},6237:(e,t,i)=>{"use strict";e.exports=d;var s,r=i(3610),a=r.LongBits,o=r.utf8;function n(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function d(e){this.buf=e,this.pos=0,this.len=e.length}var c,h="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new d(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new d(e);throw Error("illegal buffer")},l=function(){return r.Buffer?function(e){return(d.create=function(e){return r.Buffer.isBuffer(e)?new s(e):h(e)})(e)}:h};function u(){var e=new a(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw n(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw n(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw n(this,8);return new a(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}d.create=l(),d.prototype._slice=r.Array.prototype.subarray||r.Array.prototype.slice,d.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,n(this,10);return c}),d.prototype.int32=function(){return 0|this.uint32()},d.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},d.prototype.bool=function(){return 0!==this.uint32()},d.prototype.fixed32=function(){if(this.pos+4>this.len)throw n(this,4);return p(this.buf,this.pos+=4)},d.prototype.sfixed32=function(){if(this.pos+4>this.len)throw n(this,4);return 0|p(this.buf,this.pos+=4)},d.prototype.float=function(){if(this.pos+4>this.len)throw n(this,4);var e=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},d.prototype.double=function(){if(this.pos+8>this.len)throw n(this,4);var e=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},d.prototype.bytes=function(){var e=this.uint32(),t=this.pos,i=this.pos+e;if(i>this.len)throw n(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,i);if(t===i){var s=r.Buffer;return s?s.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,i)},d.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},d.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw n(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw n(this)}while(128&this.buf[this.pos++]);return this},d.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},d._configure=function(e){s=e,d.create=l(),s._configure();var t=r.Long?"toLong":"toNumber";r.merge(d.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},3158:(e,t,i)=>{"use strict";e.exports=a;var s=i(6237);(a.prototype=Object.create(s.prototype)).constructor=a;var r=i(3610);function a(e){s.call(this,e)}a._configure=function(){r.Buffer&&(a.prototype._slice=r.Buffer.prototype.slice)},a.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},a._configure()},4529:e=>{"use strict";e.exports={}},5047:(e,t,i)=>{"use strict";t.Service=i(7595)},7595:(e,t,i)=>{"use strict";e.exports=r;var s=i(3610);function r(e,t,i){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");s.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(i)}(r.prototype=Object.create(s.EventEmitter.prototype)).constructor=r,r.prototype.rpcCall=function e(t,i,r,a,o){if(!a)throw TypeError("request must be specified");var n=this;if(!o)return s.asPromise(e,n,t,i,r,a);if(n.rpcImpl)try{return n.rpcImpl(t,i[n.requestDelimited?"encodeDelimited":"encode"](a).finish(),(function(e,i){if(e)return n.emit("error",e,t),o(e);if(null!==i){if(!(i instanceof r))try{i=r[n.responseDelimited?"decodeDelimited":"decode"](i)}catch(e){return n.emit("error",e,t),o(e)}return n.emit("data",i,t),o(null,i)}n.end(!0)}))}catch(e){return n.emit("error",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},2239:(e,t,i)=>{"use strict";e.exports=r;var s=i(3610);function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var a=r.zero=new r(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var o=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(e){if(0===e)return a;var t=e<0;t&&(e=-e);var i=e>>>0,s=(e-i)/4294967296>>>0;return t&&(s=~s>>>0,i=~i>>>0,++i>4294967295&&(i=0,++s>4294967295&&(s=0))),new r(i,s)},r.from=function(e){if("number"==typeof e)return r.fromNumber(e);if(s.isString(e)){if(!s.Long)return r.fromNumber(parseInt(e,10));e=s.Long.fromString(e)}return e.low||e.high?new r(e.low>>>0,e.high>>>0):a},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,i=~this.hi>>>0;return t||(i=i+1>>>0),-(t+4294967296*i)}return this.lo+4294967296*this.hi},r.prototype.toLong=function(e){return s.Long?new s.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var n=String.prototype.charCodeAt;r.fromHash=function(e){return e===o?a:new r((n.call(e,0)|n.call(e,1)<<8|n.call(e,2)<<16|n.call(e,3)<<24)>>>0,(n.call(e,4)|n.call(e,5)<<8|n.call(e,6)<<16|n.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10}},3610:function(e,t,i){"use strict";var s=t;function r(e,t,i){for(var s=Object.keys(t),r=0;r<s.length;++r)void 0!==e[s[r]]&&i||(e[s[r]]=t[s[r]]);return e}function a(e){function t(e,i){if(!(this instanceof t))return new t(e,i);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),i&&r(this,i)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}s.asPromise=i(8045),s.base64=i(8839),s.EventEmitter=i(4358),s.float=i(9410),s.inquire=i(4153),s.utf8=i(1447),s.pool=i(9390),s.LongBits=i(2239),s.isNode=Boolean(void 0!==i.g&&i.g&&i.g.process&&i.g.process.versions&&i.g.process.versions.node),s.global=s.isNode&&i.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,s.emptyArray=Object.freeze?Object.freeze([]):[],s.emptyObject=Object.freeze?Object.freeze({}):{},s.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},s.isString=function(e){return"string"==typeof e||e instanceof String},s.isObject=function(e){return e&&"object"==typeof e},s.isset=s.isSet=function(e,t){var i=e[t];return!(null==i||!e.hasOwnProperty(t))&&("object"!=typeof i||(Array.isArray(i)?i.length:Object.keys(i).length)>0)},s.Buffer=function(){try{var e=s.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),s._Buffer_from=null,s._Buffer_allocUnsafe=null,s.newBuffer=function(e){return"number"==typeof e?s.Buffer?s._Buffer_allocUnsafe(e):new s.Array(e):s.Buffer?s._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},s.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,s.Long=s.global.dcodeIO&&s.global.dcodeIO.Long||s.global.Long||s.inquire("long"),s.key2Re=/^true|false|0|1$/,s.key32Re=/^-?(?:0|[1-9][0-9]*)$/,s.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,s.longToHash=function(e){return e?s.LongBits.from(e).toHash():s.LongBits.zeroHash},s.longFromHash=function(e,t){var i=s.LongBits.fromHash(e);return s.Long?s.Long.fromBits(i.lo,i.hi,t):i.toNumber(Boolean(t))},s.merge=r,s.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},s.newError=a,s.ProtocolError=a("ProtocolError"),s.oneOfGetter=function(e){for(var t={},i=0;i<e.length;++i)t[e[i]]=1;return function(){for(var e=Object.keys(this),i=e.length-1;i>-1;--i)if(1===t[e[i]]&&void 0!==this[e[i]]&&null!==this[e[i]])return e[i]}},s.oneOfSetter=function(e){return function(t){for(var i=0;i<e.length;++i)e[i]!==t&&delete this[e[i]]}},s.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},s._configure=function(){var e=s.Buffer;e?(s._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,i){return new e(t,i)},s._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):s._Buffer_from=s._Buffer_allocUnsafe=null}},3449:(e,t,i)=>{"use strict";e.exports=l;var s,r=i(3610),a=r.LongBits,o=r.base64,n=r.utf8;function d(e,t,i){this.fn=e,this.len=t,this.next=void 0,this.val=i}function c(){}function h(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new d(c,0,0),this.tail=this.head,this.states=null}var u=function(){return r.Buffer?function(){return(l.create=function(){return new s})()}:function(){return new l}};function p(e,t,i){t[i]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,i){for(;e.hi;)t[i++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[i++]=127&e.lo|128,e.lo=e.lo>>>7;t[i++]=e.lo}function g(e,t,i){t[i]=255&e,t[i+1]=e>>>8&255,t[i+2]=e>>>16&255,t[i+3]=e>>>24}l.create=u(),l.alloc=function(e){return new r.Array(e)},r.Array!==Array&&(l.alloc=r.pool(l.alloc,r.Array.prototype.subarray)),l.prototype._push=function(e,t,i){return this.tail=this.tail.next=new d(e,t,i),this.len+=t,this},f.prototype=Object.create(d.prototype),f.prototype.fn=function(e,t,i){for(;e>127;)t[i++]=127&e|128,e>>>=7;t[i]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(m,10,a.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=a.from(e);return this._push(m,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=a.from(e).zzEncode();return this._push(m,t.length(),t)},l.prototype.bool=function(e){return this._push(p,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=a.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(r.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(r.float.writeDoubleLE,8,e)};var v=r.Array.prototype.set?function(e,t,i){t.set(e,i)}:function(e,t,i){for(var s=0;s<e.length;++s)t[i+s]=e[s]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(p,1,0);if(r.isString(e)){var i=l.alloc(t=o.length(e));o.decode(e,i,0),e=i}return this.uint32(t)._push(v,t,e)},l.prototype.string=function(e){var t=n.length(e);return t?this.uint32(t)._push(n.write,t,e):this._push(p,1,0)},l.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new d(c,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new d(c,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=e.next,this.tail=t,this.len+=i),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),i=0;e;)e.fn(e.val,t,i),i+=e.len,e=e.next;return t},l._configure=function(e){s=e,l.create=u(),s._configure()}},818:(e,t,i)=>{"use strict";e.exports=a;var s=i(3449);(a.prototype=Object.create(s.prototype)).constructor=a;var r=i(3610);function a(){s.call(this)}function o(e,t,i){e.length<40?r.utf8.write(e,t,i):t.utf8Write?t.utf8Write(e,i):t.write(e,i)}a._configure=function(){a.alloc=r._Buffer_allocUnsafe,a.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&"set"===r.Buffer.prototype.set.name?function(e,t,i){t.set(e,i)}:function(e,t,i){if(e.copy)e.copy(t,i,0,e.length);else for(var s=0;s<e.length;)t[i++]=e[s++]}},a.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(a.writeBytesBuffer,t,e),this},a.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},a._configure()},4523:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1185:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2975:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},566:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},6510:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5475:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3971:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},335:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4619:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3885:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2308:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5625:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9332:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1578:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9152:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3974:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1466:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8186:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7202:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8800:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9656:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5223:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8535:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7754:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8716:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5254:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1769:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9644:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3829:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2317:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8430:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7198:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1293:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5439:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5465:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5661:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1552:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2609:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5769:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2938:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5277:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8109:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1671:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},6658:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4935:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9360:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4295:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3037:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1786:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9872:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7227:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4012:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},970:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9420:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8918:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1352:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2597:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7418:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3434:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9722:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5825:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},706:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1180:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8617:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9023:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},359:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4558:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2459:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1359:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3548:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3942:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(1397);class r extends s.A{}const a=r},121:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},575:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7533:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},6928:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9174:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5362:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3414:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1426:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5531:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3800:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9401:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7849:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2134:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8563:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4158:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7733:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},995:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},334:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7999:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3016:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},6405:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5317:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3965:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7246:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5308:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3521:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3578:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8291:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4456:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5517:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7930:(e,t,i)=>{"use strict";i.d(t,{A:()=>n});var s=i(4523),r=i(5147),a=i(2079),o=i(1579);class n extends s.A{describe(){return this.deepExtend(super.describe(),{id:"alpaca",name:"Alpaca",countries:["US"],rateLimit:333,hostname:"alpaca.markets",pro:!0,urls:{logo:"https://github.com/user-attachments/assets/e9476df8-a450-4c3e-ab9a-1a7794219e1b",www:"https://alpaca.markets",api:{broker:"https://broker-api.{hostname}",trader:"https://api.{hostname}",market:"https://data.{hostname}"},test:{broker:"https://broker-api.sandbox.{hostname}",trader:"https://paper-api.{hostname}",market:"https://data.{hostname}"},doc:"https://alpaca.markets/docs/",fees:"https://docs.alpaca.markets/docs/crypto-fees"},has:{CORS:!1,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!0,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createMarketBuyOrder:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!0,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createReduceOnlyOrder:!1,createStopOrder:!0,createTriggerOrder:!0,editOrder:!0,fetchBalance:!0,fetchBidsAsks:!1,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!0,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchL1OrderBook:!0,fetchL2OrderBook:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrder:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchStatus:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTransactionFees:!1,fetchTransactions:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,sandbox:!0,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!0},api:{broker:{},trader:{private:{get:["v2/account","v2/orders","v2/orders/{order_id}","v2/positions","v2/positions/{symbol_or_asset_id}","v2/account/portfolio/history","v2/watchlists","v2/watchlists/{watchlist_id}","v2/watchlists:by_name","v2/account/configurations","v2/account/activities","v2/account/activities/{activity_type}","v2/calendar","v2/clock","v2/assets","v2/assets/{symbol_or_asset_id}","v2/corporate_actions/announcements/{id}","v2/corporate_actions/announcements","v2/wallets","v2/wallets/transfers"],post:["v2/orders","v2/watchlists","v2/watchlists/{watchlist_id}","v2/watchlists:by_name","v2/wallets/transfers"],put:["v2/orders/{order_id}","v2/watchlists/{watchlist_id}","v2/watchlists:by_name"],patch:["v2/orders/{order_id}","v2/account/configurations"],delete:["v2/orders","v2/orders/{order_id}","v2/positions","v2/positions/{symbol_or_asset_id}","v2/watchlists/{watchlist_id}","v2/watchlists:by_name","v2/watchlists/{watchlist_id}/{symbol}"]}},market:{public:{get:["v1beta3/crypto/{loc}/bars","v1beta3/crypto/{loc}/latest/bars","v1beta3/crypto/{loc}/latest/orderbooks","v1beta3/crypto/{loc}/latest/quotes","v1beta3/crypto/{loc}/latest/trades","v1beta3/crypto/{loc}/quotes","v1beta3/crypto/{loc}/snapshots","v1beta3/crypto/{loc}/trades"]},private:{get:["v1beta1/corporate-actions","v1beta1/forex/latest/rates","v1beta1/forex/rates","v1beta1/logos/{symbol}","v1beta1/news","v1beta1/screener/stocks/most-actives","v1beta1/screener/{market_type}/movers","v2/stocks/auctions","v2/stocks/bars","v2/stocks/bars/latest","v2/stocks/meta/conditions/{ticktype}","v2/stocks/meta/exchanges","v2/stocks/quotes","v2/stocks/quotes/latest","v2/stocks/snapshots","v2/stocks/trades","v2/stocks/trades/latest","v2/stocks/{symbol}/auctions","v2/stocks/{symbol}/bars","v2/stocks/{symbol}/bars/latest","v2/stocks/{symbol}/quotes","v2/stocks/{symbol}/quotes/latest","v2/stocks/{symbol}/snapshot","v2/stocks/{symbol}/trades","v2/stocks/{symbol}/trades/latest"]}}},timeframes:{"1m":"1min","3m":"3min","5m":"5min","15m":"15min","30m":"30min","1h":"1H","2h":"2H","4h":"4H","6h":"6H","8h":"8H","12h":"12H","1d":"1D","3d":"3D","1w":"1W","1M":"1M"},precisionMode:o.kb,requiredCredentials:{apiKey:!0,secret:!0},fees:{trading:{tierBased:!0,percentage:!0,maker:this.parseNumber("0.0015"),taker:this.parseNumber("0.0025"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.0025")],[this.parseNumber("100000"),this.parseNumber("0.0022")],[this.parseNumber("500000"),this.parseNumber("0.0020")],[this.parseNumber("1000000"),this.parseNumber("0.0018")],[this.parseNumber("10000000"),this.parseNumber("0.0015")],[this.parseNumber("25000000"),this.parseNumber("0.0013")],[this.parseNumber("50000000"),this.parseNumber("0.0012")],[this.parseNumber("100000000"),this.parseNumber("0.001")]],maker:[[this.parseNumber("0"),this.parseNumber("0.0015")],[this.parseNumber("100000"),this.parseNumber("0.0012")],[this.parseNumber("500000"),this.parseNumber("0.001")],[this.parseNumber("1000000"),this.parseNumber("0.0008")],[this.parseNumber("10000000"),this.parseNumber("0.0005")],[this.parseNumber("25000000"),this.parseNumber("0.0002")],[this.parseNumber("50000000"),this.parseNumber("0.0002")],[this.parseNumber("100000000"),this.parseNumber("0.00")]]}}},headers:{"APCA-PARTNER-ID":"ccxt"},options:{defaultExchange:"CBSE",exchanges:["CBSE","FTX","GNSS","ERSX"],defaultTimeInForce:"gtc",clientOrderId:"ccxt_{id}"},features:{spot:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:{triggerPriceType:{last:!0,mark:!0,index:!0},price:!0},timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!0,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:500,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:500,daysBack:1e5,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,limit:500,daysBack:1e5,daysBackCanceled:void 0,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{"forbidden.":a.PermissionDenied,4041e4:a.InvalidOrder,40010001:a.BadRequest,4011e4:a.PermissionDenied,4031e4:a.InsufficientFunds,4291e4:a.RateLimitExceeded},broad:{"Invalid format for parameter":a.BadRequest,"Invalid symbol":a.BadSymbol}}})}async fetchTime(e={}){const t=await this.traderPrivateGetV2Clock(e),i=this.safeString(t,"timestamp"),s=i.slice(0,23),r=i.length-6,a=i.length-3,o=i.slice(r,a);return this.parse8601(s)-3600*this.parseToNumeric(o)*1e3}async fetchMarkets(e={}){const t=await this.traderPrivateGetV2Assets(this.extend({asset_class:"crypto",status:"active"},e));return this.parseMarkets(t)}parseMarket(e){const t=this.safeString(e,"symbol"),i=t.split("/"),s=this.safeString(e,"class"),r=this.safeString(i,0),a=this.safeString(i,1),o=this.safeCurrencyCode(r);let n=this.safeCurrencyCode(a);void 0===n&&"us_equity"===s&&(n="USD");const d=o+"/"+n,c="active"===this.safeString(e,"status"),h=this.safeNumber(e,"min_order_size");return{id:t,symbol:d,base:o,quote:n,settle:void 0,baseId:r,quoteId:a,settleId:void 0,type:"spot",spot:!0,margin:void 0,swap:!1,future:!1,option:!1,active:c,contract:!1,linear:void 0,inverse:void 0,contractSize:void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:this.safeNumber(e,"min_trade_increment"),price:this.safeNumber(e,"price_increment")},limits:{leverage:{min:void 0,max:void 0},amount:{min:h,max:void 0},price:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},created:void 0,info:e}}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.market(e),o=r.id,n=this.safeString(s,"loc","us"),d=this.safeString(s,"method","marketPublicGetV1beta3CryptoLocTrades"),c={symbols:o,loc:n};let h;if(s=this.omit(s,["loc","method"]),"marketPublicGetV1beta3CryptoLocTrades"===d){void 0!==t&&(c.start=this.iso8601(t)),void 0!==i&&(c.limit=i);const e=await this.marketPublicGetV1beta3CryptoLocTrades(this.extend(c,s)),r=this.safeDict(e,"trades",{});h=this.safeList(r,o,[])}else{if("marketPublicGetV1beta3CryptoLocLatestTrades"!==d)throw new a.NotSupported(this.id+" fetchTrades() does not support "+d+", marketPublicGetV1beta3CryptoLocTrades and marketPublicGetV1beta3CryptoLocLatestTrades are supported");{const e=await this.marketPublicGetV1beta3CryptoLocLatestTrades(this.extend(c,s)),t=this.safeDict(e,"trades",{});h=this.safeDict(t,o,{}),h=[h]}}return this.parseTrades(h,r,t,i)}async fetchOrderBook(e,t=void 0,i={}){await this.loadMarkets();const s=this.market(e),r=s.id,a={symbols:r,loc:this.safeString(i,"loc","us")},o=await this.marketPublicGetV1beta3CryptoLocLatestOrderbooks(this.extend(a,i)),n=this.safeDict(o,"orderbooks",{}),d=this.safeDict(n,r,{}),c=this.parse8601(this.safeString(d,"t"));return this.parseOrderBook(d,s.symbol,c,"b","a","p","s")}async fetchOHLCV(e,t="1m",i=void 0,s=void 0,r={}){await this.loadMarkets();const o=this.market(e),n=o.id,d=this.safeString(r,"loc","us"),c=this.safeString(r,"method","marketPublicGetV1beta3CryptoLocBars"),h={symbols:n,loc:d};let l;if(r=this.omit(r,["loc","method"]),"marketPublicGetV1beta3CryptoLocBars"===c){void 0!==s&&(h.limit=s),void 0!==i&&(h.start=this.yyyymmdd(i)),h.timeframe=this.safeString(this.timeframes,t,t);const e=await this.marketPublicGetV1beta3CryptoLocBars(this.extend(h,r)),a=this.safeDict(e,"bars",{});l=this.safeList(a,n,[])}else{if("marketPublicGetV1beta3CryptoLocLatestBars"!==c)throw new a.NotSupported(this.id+" fetchOHLCV() does not support "+c+", marketPublicGetV1beta3CryptoLocBars and marketPublicGetV1beta3CryptoLocLatestBars are supported");{const e=await this.marketPublicGetV1beta3CryptoLocLatestBars(this.extend(h,r)),t=this.safeDict(e,"bars",{});l=this.safeDict(t,n,{}),l=[l]}}return this.parseOHLCVs(l,o,t,i,s)}parseOHLCV(e,t=void 0){const i=this.safeString(e,"t");return[this.parse8601(i),this.safeNumber(e,"o"),this.safeNumber(e,"h"),this.safeNumber(e,"l"),this.safeNumber(e,"c"),this.safeNumber(e,"v")]}async fetchTicker(e,t={}){await this.loadMarkets(),e=this.symbol(e);const i=await this.fetchTickers([e],t);return this.safeDict(i,e)}async fetchTickers(e=void 0,t={}){if(void 0===e)throw new a.ArgumentsRequired(this.id+" fetchTickers() requires a symbols argument");await this.loadMarkets(),e=this.marketSymbols(e);const i=this.safeString(t,"loc","us"),s={symbols:this.marketIds(e).join(","),loc:i};t=this.omit(t,"loc");const r=await this.marketPublicGetV1beta3CryptoLocSnapshots(this.extend(s,t)),o=[],n=this.safeDict(r,"snapshots",{}),d=Object.keys(n);for(let e=0;e<d.length;e++){const t=d[e],i=this.safeMarket(t),s=this.safeDict(n,t),r=this.safeDict(s,"dailyBar",{}),a=this.safeDict(s,"prevDailyBar",{}),c=this.safeDict(s,"latestQuote",{}),h=this.safeDict(s,"latestTrade",{}),l=this.safeString(c,"t"),u=this.safeTicker({info:s,symbol:i.symbol,timestamp:this.parse8601(l),datetime:l,high:this.safeString(r,"h"),low:this.safeString(r,"l"),bid:this.safeString(c,"bp"),bidVolume:this.safeString(c,"bs"),ask:this.safeString(c,"ap"),askVolume:this.safeString(c,"as"),vwap:this.safeString(r,"vw"),open:this.safeString(r,"o"),close:this.safeString(r,"c"),last:this.safeString(h,"p"),previousClose:this.safeString(a,"c"),change:void 0,percentage:void 0,average:void 0,baseVolume:this.safeString(r,"v"),quoteVolume:this.safeString(r,"n")},i);o.push(u)}return this.filterByArray(o,"symbol",e)}generateClientOrderId(e){const t=this.safeString(this.options,"clientOrderId"),i=this.uuid().split("-").join(""),s=this.implodeParams(t,{id:i});return this.safeString(e,"clientOrderId",s)}async createMarketOrderWithCost(e,t,i,s={}){await this.loadMarkets();const r={cost:i};return await this.createOrder(e,"market",t,0,void 0,this.extend(r,s))}async createMarketBuyOrderWithCost(e,t,i={}){await this.loadMarkets();const s={cost:t};return await this.createOrder(e,"market","buy",0,void 0,this.extend(s,i))}async createMarketSellOrderWithCost(e,t,i={}){await this.loadMarkets();const s={cost:t};return await this.createOrder(e,"market","sell",t,void 0,this.extend(s,i))}async createOrder(e,t,i,s,r=void 0,o={}){await this.loadMarkets();const n=this.market(e),d={symbol:n.id,side:i,type:t},c=this.safeStringN(o,["triggerPrice","stop_price"]);if(void 0!==c){let i;if(!(t.indexOf("limit")>=0))throw new a.NotSupported(this.id+" createOrder() does not support stop orders for "+t+" orders, only stop_limit orders are supported");i="stop_limit",d.stop_price=this.priceToPrecision(e,c),d.type=i}t.indexOf("limit")>=0&&(d.limit_price=this.priceToPrecision(e,r));const h=this.safeString(o,"cost");void 0!==h?(o=this.omit(o,"cost"),d.notional=this.costToPrecision(e,h)):d.qty=this.amountToPrecision(e,s);const l=this.safeString(this.options,"defaultTimeInForce");d.time_in_force=this.safeString(o,"timeInForce",l),o=this.omit(o,["timeInForce","triggerPrice"]),d.client_order_id=this.generateClientOrderId(o),o=this.omit(o,["clientOrderId"]);const u=await this.traderPrivatePostV2Orders(this.extend(d,o));return this.parseOrder(u,n)}async cancelOrder(e,t=void 0,i={}){const s={order_id:e},r=await this.traderPrivateDeleteV2OrdersOrderId(this.extend(s,i));return this.parseOrder(r)}async cancelAllOrders(e=void 0,t={}){await this.loadMarkets();const i=await this.traderPrivateDeleteV2Orders(t);return Array.isArray(i)?this.parseOrders(i,void 0):[this.safeOrder({info:i})]}async fetchOrder(e,t=void 0,i={}){await this.loadMarkets();const s={order_id:e},r=await this.traderPrivateGetV2OrdersOrderId(this.extend(s,i)),a=this.safeString(r,"symbol"),o=this.safeMarket(a);return this.parseOrder(r,o)}async fetchOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={status:"all"};let a;void 0!==e&&(a=this.market(e),r.symbols=a.id);const o=this.safeInteger(s,"until");void 0!==o&&(s=this.omit(s,"until"),r.endTime=this.iso8601(o)),void 0!==t&&(r.after=this.iso8601(t)),void 0!==i&&(r.limit=i);const n=await this.traderPrivateGetV2Orders(this.extend(r,s));return this.parseOrders(n,a,t,i)}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchOrders(e,t,i,this.extend({status:"open"},s))}async fetchClosedOrders(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchOrders(e,t,i,this.extend({status:"closed"},s))}async editOrder(e,t,i,s,r=void 0,a=void 0,o={}){await this.loadMarkets();const n={order_id:e};let d;void 0!==t&&(d=this.market(t)),void 0!==r&&(n.qty=this.amountToPrecision(t,r));const c=this.safeStringN(o,["triggerPrice","stop_price"]);let h;void 0!==c&&(n.stop_price=this.priceToPrecision(t,c),o=this.omit(o,"triggerPrice")),void 0!==a&&(n.limit_price=this.priceToPrecision(t,a)),[h,o]=this.handleOptionAndParams2(o,"editOrder","timeInForce","defaultTimeInForce"),void 0!==h&&(n.time_in_force=h),n.client_order_id=this.generateClientOrderId(o),o=this.omit(o,["clientOrderId"]);const l=await this.traderPrivatePatchV2OrdersOrderId(this.extend(n,o));return this.parseOrder(l,d)}parseOrder(e,t=void 0){const i=this.safeString(e,"symbol"),s=(t=this.safeMarket(i,t)).symbol,r=this.safeString(e,"status"),a=this.parseOrderStatus(r),o=this.safeString(e,"commission");let n;void 0!==o&&(n={cost:o,currency:"USD"});let d=this.safeString(e,"order_type");void 0!==d&&d.indexOf("limit")>=0&&(d="limit");const c=this.safeString(e,"submitted_at"),h=this.parse8601(c);return this.safeOrder({id:this.safeString(e,"id"),clientOrderId:this.safeString(e,"client_order_id"),timestamp:h,datetime:c,lastTradeTimeStamp:void 0,status:a,symbol:s,type:d,timeInForce:this.parseTimeInForce(this.safeString(e,"time_in_force")),postOnly:void 0,side:this.safeString(e,"side"),price:this.safeNumber(e,"limit_price"),triggerPrice:this.safeNumber(e,"stop_price"),cost:void 0,average:this.safeNumber(e,"filled_avg_price"),amount:this.safeNumber(e,"qty"),filled:this.safeNumber(e,"filled_qty"),remaining:void 0,trades:void 0,fee:n,info:e},t)}parseOrderStatus(e){return this.safeString({pending_new:"open",accepted:"open",new:"open",partially_filled:"open",activated:"open",filled:"closed"},e,e)}parseTimeInForce(e){return this.safeString({day:"Day"},e,e)}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets();let a={activity_type:"FILL"};void 0!==e&&(r=this.market(e));const o=this.safeInteger(s,"until");void 0!==o&&(s=this.omit(s,"until"),a.until=this.iso8601(o)),void 0!==t&&(a.after=this.iso8601(t)),void 0!==i&&(a.page_size=i),[a,s]=this.handleUntilOption("until",a,s);const n=await this.traderPrivateGetV2AccountActivitiesActivityType(this.extend(a,s));return this.parseTrades(n,r,t,i)}parseTrade(e,t=void 0){const i=this.safeString2(e,"S","symbol"),s=this.safeSymbol(i,t),r=this.safeString2(e,"t","transaction_time"),a=this.parse8601(r),o=this.safeString(e,"tks");let n=this.safeString(e,"side");"B"===o?n="buy":"S"===o&&(n="sell");const d=this.safeString2(e,"p","price"),c=this.safeString2(e,"s","qty");return this.safeTrade({info:e,id:this.safeString2(e,"i","id"),timestamp:a,datetime:this.iso8601(a),symbol:s,order:this.safeString(e,"order_id"),type:void 0,side:n,takerOrMaker:"taker",price:d,amount:c,cost:void 0,fee:void 0},t)}async fetchDepositAddress(e,t={}){await this.loadMarkets();const i=this.currency(e),s={asset:i.id},r=await this.traderPrivateGetV2Wallets(this.extend(s,t));return this.parseDepositAddress(r,i)}parseDepositAddress(e,t=void 0){let i;return void 0!==t&&(i=t.id),{info:e,currency:i,network:void 0,address:this.safeString(e,"address"),tag:void 0}}async withdraw(e,t,i,s=void 0,r={}){[s,r]=this.handleWithdrawTagAndParams(s,r),this.checkAddress(i),await this.loadMarkets();const a=this.currency(e);s&&(i=i+":"+s);const o={asset:a.id,address:i,amount:this.numberToString(t)},n=await this.traderPrivatePostV2WalletsTransfers(this.extend(o,r));return this.parseTransaction(n,a)}async fetchTransactionsHelper(e,t,i,s,r){let a;await this.loadMarkets(),void 0!==t&&(a=this.currency(t));const o=await this.traderPrivateGetV2WalletsTransfers(r),n=[];for(let t=0;t<o.length;t++){const i=o[t];(this.safeString(i,"direction")===e||"BOTH"===e)&&n.push(i)}return this.parseTransactions(n,a,i,s,r)}async fetchDepositsWithdrawals(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchTransactionsHelper("BOTH",e,t,i,s)}async fetchDeposit