snaptrade-typescript-sdk 13.2.3 → 13.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,4 +8,4 @@
8
8
  `,t+1),i=n===-1?``:r.slice(n+1);String(e.stack).endsWith(i)||(e.stack+=`
9
9
  `+r)}}catch{}throw e}}_request(e,t){typeof e==`string`?(t=t||{},t.url=e):t=e||{},t=Sn(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&ur.assertOptions(n,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean),legacyInterceptorReqResOrdering:F.transitional(F.boolean),advertiseZstdAcceptEncoding:F.transitional(F.boolean),validateStatusUndefinedResolves:F.transitional(F.boolean)},!1),r!=null&&(j.isFunction(r)?t.paramsSerializer={serialize:r}:ur.assertOptions(r,{encode:F.function,serialize:F.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),ur.assertOptions(t,{baseUrl:F.spelling(`baseURL`),withXsrfToken:F.spelling(`withXSRFToken`)},!0),t.method=(j.getSafeProp(t,`method`)||j.getSafeProp(this.defaults,`method`)||`get`).toLowerCase();let a=i&&j.merge(i.common,i[t.method]);i&&j.forEach(Jt.concat(`common`),e=>{delete i[e]}),t.headers=M.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s=s&&e.synchronous;let n=t.transitional||Ft;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[or.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e?e(f):f}catch(e){if(!t){l=Promise.reject(e);break}try{let n=t.call(this,e);j.isThenable(n)&&(l=Promise.resolve(n).then(()=>or.call(this,f)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=or.call(this,f)}catch(e){l=Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=Sn(this.defaults,e),kt(yn(e.baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};j.forEach([`delete`,`get`,`head`,`options`],function(e){dr.prototype[e]=function(t,n){return this.request(Sn(n||{},{method:e,url:t,data:n&&j.hasOwnProp(n,`data`)?n.data:void 0}))}}),j.forEach([`post`,`put`,`patch`,`query`],function(e){function t(t){return function(n,r,i){return this.request(Sn(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}dr.prototype[e]=t(),e!==`query`&&(dr.prototype[e+`Form`]=t(!0))});var fr=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new en(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function pr(e){return function(t){return e.apply(null,t)}}function mr(e){return j.isObject(e)&&e.isAxiosError===!0}let hr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(hr).forEach(([e,t])=>{hr[t]===void 0&&(hr[t]=e)});function gr(e){let t=new dr(e),n=r(dr.prototype.request,t);return j.extend(n,dr.prototype,t,{allOwnKeys:!0}),j.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return gr(Sn(e,t))},n}let I=gr(Zt);I.Axios=dr,I.CanceledError=en,I.CancelToken=fr,I.isCancel=$t,I.VERSION=Un,I.toFormData=wt,I.AxiosError=N,I.Cancel=I.CanceledError,I.all=function(e){return Promise.all(e)},I.spread=pr,I.isAxiosError=mr,I.mergeConfig=Sn,I.AxiosHeaders=M,I.formToJSON=e=>qt(j.isHTMLForm(e)?new FormData(e):e),I.getAdapter=ir.getAdapter,I.HttpStatusCode=hr,I.default=I;let L=`https://api.snaptrade.com`.replace(/\/+$/,``);var R=class{constructor(e,t=L,n=I){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}},_r=class extends Error{constructor(e,t){super(t),this.field=e,this.name=`RequiredError`}};function vr(e){let t=``;for(let n of e)t+=String.fromCharCode(n);if(typeof globalThis.btoa==`function`)return globalThis.btoa(t);if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);throw Error(`Base64 encoding is not available in this runtime`)}async function yr(e,t){if(!globalThis.crypto?.subtle)throw Error(`Web Crypto API is required to compute SnapTrade request signatures`);let n=new TextEncoder,r=n.encode(t),i=n.encode(e),a=await globalThis.crypto.subtle.importKey(`raw`,r,{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]),o=await globalThis.crypto.subtle.sign(`HMAC`,a,i);return vr(new Uint8Array(o))}let br=e=>{var t=[],n={};return JSON.stringify(e,function(e,r){return e in n||(t.push(e),n[e]=null),r}),t.sort(),JSON.stringify(e,t)};async function xr(e){let{configuration:t,basePath:n,axiosArgs:r,url:i,operationAuth:a}=e,o=a?.selectedAuthMode,s=o===void 0?void 0:a?.requestSigningByAuthMode?.[o];if(s===void 0||s.signedSecuritySchemes.find(e=>e.toLowerCase().endsWith(`signature`))===void 0)return;let c=t?.[s.secretParameter];if(typeof c!=`string`)throw Error(`${s.secretParameter} is required`);let l=encodeURI(c),u=r.options.data===void 0||r.options.data===`{}`?null:JSON.parse(r.options.data),d=r.url.indexOf(`?`)===-1?`${r.url}`:`${r.url.split(`?`)[0]}`,f=await yr(br({content:u,path:d,query:i.replace(n,``).replace(d,``).replace(`?`,``)}),l);r.options.headers&&(r.options.headers.Signature=f)}let Sr=new Set([`clientid`,`timestamp`,`userid`,`usersecret`]);function Cr(e){if(e===void 0||Sr.size===0)return e;try{let t=/^[a-z][a-z\d+.-]*:/i.test(e),n=new URL(e,`http://konfig.invalid`),r=new URLSearchParams;for(let[e,t]of n.searchParams.entries()){let n=t;Sr.has(e.toLowerCase())&&(n=`[REDACTED]`),r.append(e,n)}return n.search=r.toString(),t?n.toString():n.pathname+n.search+n.hash}catch{return}}function wr(e,t,n){return t===void 0||!e.includes(t)?e:e.split(t).join(n??`[REDACTED URL]`)}var Tr=class extends Error{constructor(e,t,n){let r=e.config?.url,i=Cr(r),a=wr(e.message,r,i)+`
10
10
  RESPONSE HEADERS:
11
- `+JSON.stringify(n,null,2);super(a),this.name=`SnaptradeError`,this.code=e.code,this.method=e.config?.method?.toUpperCase(),this.url=i,this.status=e.response?.status,this.statusText=e.response?.statusText,this.responseBody=t}toJSON(){return{name:this.name,message:this.message,method:this.method,url:this.url,code:this.code,status:this.status,statusText:this.statusText,responseBody:this.responseBody}}};async function Er(e){let t=new TextDecoder,n=e.getReader(),r=``;try{for(;;){let{done:e,value:i}=await n.read();if(e)break;let a=t.decode(i,{stream:!0});r+=a}}finally{n.releaseLock()}return r}function Dr(e){if(typeof e!=`string`)return e;try{let t=JSON.parse(e);return typeof t==`object`&&t?t:e}catch{return e}}let z=`https://example.com`,B=function(e,t,n){if(n==null)throw new _r(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},V=async function({object:e,key:t,type:n,keyParamName:r,configuration:i,prefix:a}){t=t||r;let o=null;if(i&&i.apiKey)if(typeof i.apiKey==`function`)o=await i.apiKey(r);else if(typeof i.apiKey==`string`)o=i.apiKey;else if(typeof i.apiKey==`object`)r in i.apiKey&&(o=i.apiKey[r]);else throw Error(`Unexpected type ${typeof i.apiKey} for Configuration.apiKey`);o&&(e[t]=a===void 0?o:`${a}${o}`,n===`Cookie`&&(e[t]=`${r}=${e[t]}`))},H=async function(e,t){t&&t.accessToken&&(e.Authorization=`Bearer `+(typeof t.accessToken==`function`?await t.accessToken():await t.accessToken))};function Or(e,t,n=``){typeof t==`object`?Array.isArray(t)?t.forEach(t=>Or(e,t,n)):Object.keys(t).forEach(r=>Or(e,t[r],`${n}${n===``?``:`.`}${r}`)):e.has(n)?e.append(n,t):e.set(n,t)}let U=function(e,...t){let n=new URLSearchParams(e.search);Or(n,t),e.search=n.toString()},W=function(e,t,n){let r=typeof e!=`string`;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers[`Content-Type`]):r)?JSON.stringify(e===void 0?{}:e):e||``},G=function(e){return kr(e.pathname)+e.search+e.hash},kr=function(e){return e.replace(/\/$/,``)};async function Ar(e){let t=0,n=5e3;for(;t<3;)try{return await e()}catch(e){if(I.isAxiosError(e)){if(e.response?.status==429){t++,console.log(`429 error encountered, retrying in ${n/1e3} seconds...`),await new Promise(e=>setTimeout(e,n)),n*=2;continue}let r;try{let t=e.response?.data;r=t,typeof ReadableStream<`u`&&t instanceof ReadableStream&&(r=await Er(t)),r=Dr(r)}catch{r=void 0}throw new Tr(e,r,e.response?.headers)}throw e}throw Error(`Request failed after 3 retries due to 429 (rate limit) errors.`)}let K=function(e,t,n,r,i){return async(a=t,o=n)=>{let s=(r?.basePath||o)+e.url;return await xr({axiosArgs:e,basePath:o,url:s,configuration:r,operationAuth:i?{...i,selectedAuthMode:r?.authMode}:void 0}),Ar(async()=>await a.request({...e.options,url:s}))}};function q(){return typeof window<`u`}function J(e){let{queryParameters:t,operationAuth:n}=e,r=n?.selectedAuthMode;(r===void 0?void 0:n?.requestSigningByAuthMode?.[r])?.signedSecuritySchemes.find(e=>e.toLowerCase().endsWith(`timestamp`))!==void 0&&(t.timestamp=Math.round(new Date().getTime()/1e3).toString())}let jr=function(e){return{getAccountActivities:async(t,n,r,i,a,o,s,c,l={})=>{B(`getAccountActivities`,`accountId`,t);let u=`/accounts/{accountId}/activities`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),d=new URL(u,z),f;e&&(f=e.baseOptions);let p={method:`GET`,...f,...l},m=e&&!q()?{"User-Agent":e.userAgent}:{},h={};e?.authMode===`commercialApiKey`&&(await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),s!==void 0&&(h.userId=s),c!==void 0&&(h.userSecret=c)),e?.authMode===`personalApiKey`&&await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(m,e),n!==void 0&&(h.startDate=n instanceof Date?n.toISOString().substr(0,10):n),r!==void 0&&(h.endDate=r instanceof Date?r.toISOString().substr(0,10):r),i!==void 0&&(h.offset=i),a!==void 0&&(h.limit=a),o!==void 0&&(h.type=o);let g={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},_=f&&f.headers?f.headers:{};return p.headers={...m,..._,...l.headers},J({queryParameters:h,requestConfig:p,path:u,configuration:e,pathTemplate:`/accounts/{accountId}/activities`,httpMethod:`GET`,operationAuth:g}),U(d,h),{url:G(d),options:p}},getAccountBalanceHistory:async(t,n,r,i={})=>{B(`getAccountBalanceHistory`,`accountId`,t);let a=`/accounts/{accountId}/balanceHistory`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balanceHistory`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAccountBalancesV2:async(t,n,r,i={})=>{B(`getAccountBalancesV2`,`accountId`,t);let a=`/accounts/{accountId}/balances/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balances/v2`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAccountDetails:async(t,n,r,i={})=>{B(`getAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/details`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAllAccountPositions:async(t,n,r,i={})=>{B(`getAllAccountPositions`,`accountId`,t);let a=`/accounts/{accountId}/positions/all`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/positions/all`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountBalance:async(t,n,r,i={})=>{B(`getUserAccountBalance`,`accountId`,t);let a=`/accounts/{accountId}/balances`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balances`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountDetails:async(t,n,r,i={})=>{B(`getUserAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountOrderDetail:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetail`,`accountId`,t),B(`getUserAccountOrderDetail`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/orders/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},getUserAccountOrders:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrders`,`accountId`,t);let s=`/accounts/{accountId}/orders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountRecentOrders:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrders`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountReturnRates:async(t,n,r,i,a={})=>{B(`getUserAccountReturnRates`,`accountId`,t);let o=`/accounts/{accountId}/returnRates`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.timeframes=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/returnRates`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserHoldings:async(t,n,r,i={})=>{B(`getUserHoldings`,`accountId`,t);let a=`/accounts/{accountId}/holdings`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/holdings`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listAllUserAccounts:async(t,n,r={})=>{let i=`/accounts/all`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(c,e);let u={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},J({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/accounts/all`,httpMethod:`GET`,operationAuth:u}),U(a,l),{url:G(a),options:s}},listUserAccounts:async(t,n,r={})=>{let i=`/accounts`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(c,e);let u={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},J({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/accounts`,httpMethod:`GET`,operationAuth:u}),U(a,l),{url:G(a),options:s}},updateUserAccount:async(t,n,r,i={})=>{B(`updateUserAccount`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`PUT`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`PUT`,operationAuth:d}),U(o,u),{url:G(o),options:c}}}},Y=function(e){let t=jr(e);return{async getAccountActivities(...n){let[r={},i]=n;return K(await t.getAccountActivities(r.accountId,r.startDate,r.endDate,r.offset,r.limit,r.type,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountBalanceHistory(...n){let[r={},i]=n;return K(await t.getAccountBalanceHistory(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountBalancesV2(...n){let[r={},i]=n;return K(await t.getAccountBalancesV2(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountDetails(...n){let[r={},i]=n;return K(await t.getAccountDetails(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountPositions(...n){let[r={},i]=n;return K(await t.getAllAccountPositions(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountBalance(...n){let[r={},i]=n;return K(await t.getUserAccountBalance(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountDetails(...n){let[r={},i]=n;return K(await t.getUserAccountDetails(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrderDetail(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id};return K(await t.getUserAccountOrderDetail(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrders(...n){let[r={},i]=n;return K(await t.getUserAccountOrders(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountRecentOrders(...n){let[r={},i]=n;return K(await t.getUserAccountRecentOrders(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountReturnRates(...n){let[r={},i]=n;return K(await t.getUserAccountReturnRates(r.accountId,r.timeframes,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserHoldings(...n){let[r={},i]=n;return K(await t.getUserHoldings(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllUserAccounts(...n){let[r={},i]=n;return K(await t.listAllUserAccounts(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listUserAccounts(...n){let[r={},i]=n;return K(await t.listUserAccounts(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async updateUserAccount(...n){let[r={},i]=n;return K(await t.updateUserAccount(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Mr=function(e,t,n){let r=Y(e);return{getAccountActivities(...e){return r.getAccountActivities(...e).then(e=>e(n,t))},getAccountBalanceHistory(...e){return r.getAccountBalanceHistory(...e).then(e=>e(n,t))},getAccountBalancesV2(...e){return r.getAccountBalancesV2(...e).then(e=>e(n,t))},getAccountDetails(...e){return r.getAccountDetails(...e).then(e=>e(n,t))},getAllAccountPositions(...e){return r.getAllAccountPositions(...e).then(e=>e(n,t))},getUserAccountBalance(...e){return r.getUserAccountBalance(...e).then(e=>e(n,t))},getUserAccountDetails(...e){return r.getUserAccountDetails(...e).then(e=>e(n,t))},getUserAccountOrderDetail(...e){return r.getUserAccountOrderDetail(...e).then(e=>e(n,t))},getUserAccountOrders(...e){return r.getUserAccountOrders(...e).then(e=>e(n,t))},getUserAccountRecentOrders(...e){return r.getUserAccountRecentOrders(...e).then(e=>e(n,t))},getUserAccountReturnRates(...e){return r.getUserAccountReturnRates(...e).then(e=>e(n,t))},getUserHoldings(...e){return r.getUserHoldings(...e).then(e=>e(n,t))},listAllUserAccounts(...e){return r.listAllUserAccounts(...e).then(e=>e(n,t))},listUserAccounts(...e){return r.listUserAccounts(...e).then(e=>e(n,t))},updateUserAccount(...e){return r.updateUserAccount(...e).then(e=>e(n,t))}}};var Nr=class extends R{getAccountActivities(...e){return Y(this.configuration).getAccountActivities(...e).then(e=>e(this.axios,this.basePath))}getAccountBalanceHistory(...e){return Y(this.configuration).getAccountBalanceHistory(...e).then(e=>e(this.axios,this.basePath))}getAccountBalancesV2(...e){return Y(this.configuration).getAccountBalancesV2(...e).then(e=>e(this.axios,this.basePath))}getAccountDetails(...e){return Y(this.configuration).getAccountDetails(...e).then(e=>e(this.axios,this.basePath))}getAllAccountPositions(...e){return Y(this.configuration).getAllAccountPositions(...e).then(e=>e(this.axios,this.basePath))}getUserAccountBalance(...e){return Y(this.configuration).getUserAccountBalance(...e).then(e=>e(this.axios,this.basePath))}getUserAccountDetails(...e){return Y(this.configuration).getUserAccountDetails(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetail(...e){return Y(this.configuration).getUserAccountOrderDetail(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrders(...e){return Y(this.configuration).getUserAccountOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrders(...e){return Y(this.configuration).getUserAccountRecentOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountReturnRates(...e){return Y(this.configuration).getUserAccountReturnRates(...e).then(e=>e(this.axios,this.basePath))}getUserHoldings(...e){return Y(this.configuration).getUserHoldings(...e).then(e=>e(this.axios,this.basePath))}listAllUserAccounts(...e){return Y(this.configuration).listAllUserAccounts(...e).then(e=>e(this.axios,this.basePath))}listUserAccounts(...e){return Y(this.configuration).listUserAccounts(...e).then(e=>e(this.axios,this.basePath))}updateUserAccount(...e){return Y(this.configuration).updateUserAccount(...e).then(e=>e(this.axios,this.basePath))}},Pr=class extends Nr{};let Fr=function(e){return{check:async(t={})=>{let n=new URL(`/`,z),r;e&&(r=e.baseOptions);let i={method:`GET`,...r,...t},a=e&&!q()?{"User-Agent":e.userAgent}:{},o={},s={authModes:[`public`],selectedAuthMode:e?.authMode},c=r&&r.headers?r.headers:{};return i.headers={...a,...c,...t.headers},J({queryParameters:o,requestConfig:i,path:`/`,configuration:e,pathTemplate:`/`,httpMethod:`GET`,operationAuth:s}),U(n,o),{url:G(n),options:i}}}},Ir=function(e){let t=Fr(e);return{async check(n){return K(await t.check(n),I,L,e,{authModes:[`public`]})}}},Lr=function(e,t,n){let r=Ir(e);return{check(e){return r.check(e).then(e=>e(n,t))}}};var Rr=class extends R{check(e){return Ir(this.configuration).check(e).then(e=>e(this.axios,this.basePath))}},zr=class extends Rr{};let Br=function(e){return{deleteSnapTradeUser:async(t,n={})=>{let r=`/snapTrade/deleteUser`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`DELETE`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&(await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.userId=t));let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/deleteUser`,httpMethod:`DELETE`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listSnapTradeUsers:async(t={})=>{let n=`/snapTrade/listUsers`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/listUsers`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},loginSnapTradeUser:async(t,n,r,i={})=>{let a=`/snapTrade/login`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/login`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},registerSnapTradeUser:async(t,n={})=>{B(`registerSnapTradeUser`,`snapTradeRegisterUserRequestBody`,t);let r=`/snapTrade/registerUser`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/registerUser`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},resetSnapTradeUserSecret:async(t,n={})=>{B(`resetSnapTradeUserSecret`,`userIDandSecret`,t);let r=`/snapTrade/resetUserSecret`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/resetUserSecret`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}}}},Vr=function(e){let t=Br(e);return{async deleteSnapTradeUser(...n){let[r={},i]=n;return K(await t.deleteSnapTradeUser(r.userId,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async listSnapTradeUsers(...n){let[r]=n;return K(await t.listSnapTradeUsers(r),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async loginSnapTradeUser(...n){let[r={},i]=n,a={broker:r.broker,immediateRedirect:r.immediateRedirect,customRedirect:r.customRedirect,reconnect:r.reconnect,connectionType:r.connectionType,showCloseButton:r.showCloseButton,darkMode:r.darkMode,locale:r.locale,connectionPortalVersion:r.connectionPortalVersion};return K(await t.loginSnapTradeUser(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async registerSnapTradeUser(...n){let[r={},i]=n,a={userId:r.userId};return K(await t.registerSnapTradeUser(a,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async resetSnapTradeUserSecret(...n){let[r={},i]=n,a={userId:r.userId,userSecret:r.userSecret};return K(await t.resetSnapTradeUserSecret(a,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})}}},Hr=function(e,t,n){let r=Vr(e);return{deleteSnapTradeUser(...e){return r.deleteSnapTradeUser(...e).then(e=>e(n,t))},listSnapTradeUsers(...e){return r.listSnapTradeUsers(...e).then(e=>e(n,t))},loginSnapTradeUser(...e){return r.loginSnapTradeUser(...e).then(e=>e(n,t))},registerSnapTradeUser(...e){return r.registerSnapTradeUser(...e).then(e=>e(n,t))},resetSnapTradeUserSecret(...e){return r.resetSnapTradeUserSecret(...e).then(e=>e(n,t))}}};var Ur=class extends R{deleteSnapTradeUser(...e){return Vr(this.configuration).deleteSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}listSnapTradeUsers(...e){return Vr(this.configuration).listSnapTradeUsers(...e).then(e=>e(this.axios,this.basePath))}loginSnapTradeUser(...e){return Vr(this.configuration).loginSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}registerSnapTradeUser(...e){return Vr(this.configuration).registerSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}resetSnapTradeUserSecret(...e){return Vr(this.configuration).resetSnapTradeUserSecret(...e).then(e=>e(this.axios,this.basePath))}},Wr=class extends Ur{};let Gr=function(e){return{deleteConnection:async(t,n,r,i={})=>{B(`deleteConnection`,`connectionId`,t);let a=`/connection/{connectionId}`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`DELETE`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connection/{connectionId}`,httpMethod:`DELETE`,operationAuth:d}),U(o,u),{url:G(o),options:c}},detailBrokerageAuthorization:async(t,n,r,i={})=>{B(`detailBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},disableBrokerageAuthorization:async(t,n,r,i={})=>{B(`disableBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/disable`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/disable`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listBrokerageAuthorizationAccounts:async(t,n,r,i={})=>{B(`listBrokerageAuthorizationAccounts`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/accounts`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/accounts`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listBrokerageAuthorizations:async(t,n,r={})=>{let i=`/authorizations`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(c,e);let u={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},J({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/authorizations`,httpMethod:`GET`,operationAuth:u}),U(a,l),{url:G(a),options:s}},listConnectionAccounts:async(t,n,r,i={})=>{B(`listConnectionAccounts`,`connectionId`,t);let a=`/connections/{connectionId}/accounts`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connections/{connectionId}/accounts`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},refreshBrokerageAuthorization:async(t,n,r,i={})=>{B(`refreshBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/refresh`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/refresh`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}},returnRates:async(t,n,r,i,a={})=>{B(`returnRates`,`authorizationId`,t);let o=`/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.timeframes=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/authorizations/{authorizationId}/returnRates`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},syncBrokerageAuthorizationTransactions:async(t,n,r,i={})=>{B(`syncBrokerageAuthorizationTransactions`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/transactions/sync`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}}}},X=function(e){let t=Gr(e);return{async deleteConnection(...n){let[r={},i]=n;return K(await t.deleteConnection(r.connectionId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async detailBrokerageAuthorization(...n){let[r={},i]=n;return K(await t.detailBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async disableBrokerageAuthorization(...n){let[r={},i]=n;return K(await t.disableBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listBrokerageAuthorizationAccounts(...n){let[r={},i]=n;return K(await t.listBrokerageAuthorizationAccounts(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listBrokerageAuthorizations(...n){let[r={},i]=n;return K(await t.listBrokerageAuthorizations(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listConnectionAccounts(...n){let[r={},i]=n;return K(await t.listConnectionAccounts(r.connectionId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async refreshBrokerageAuthorization(...n){let[r={},i]=n;return K(await t.refreshBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async returnRates(...n){let[r={},i]=n;return K(await t.returnRates(r.authorizationId,r.timeframes,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async syncBrokerageAuthorizationTransactions(...n){let[r={},i]=n;return K(await t.syncBrokerageAuthorizationTransactions(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Kr=function(e,t,n){let r=X(e);return{deleteConnection(...e){return r.deleteConnection(...e).then(e=>e(n,t))},detailBrokerageAuthorization(...e){return r.detailBrokerageAuthorization(...e).then(e=>e(n,t))},disableBrokerageAuthorization(...e){return r.disableBrokerageAuthorization(...e).then(e=>e(n,t))},listBrokerageAuthorizationAccounts(...e){return r.listBrokerageAuthorizationAccounts(...e).then(e=>e(n,t))},listBrokerageAuthorizations(...e){return r.listBrokerageAuthorizations(...e).then(e=>e(n,t))},listConnectionAccounts(...e){return r.listConnectionAccounts(...e).then(e=>e(n,t))},refreshBrokerageAuthorization(...e){return r.refreshBrokerageAuthorization(...e).then(e=>e(n,t))},returnRates(...e){return r.returnRates(...e).then(e=>e(n,t))},syncBrokerageAuthorizationTransactions(...e){return r.syncBrokerageAuthorizationTransactions(...e).then(e=>e(n,t))}}};var qr=class extends R{deleteConnection(...e){return X(this.configuration).deleteConnection(...e).then(e=>e(this.axios,this.basePath))}detailBrokerageAuthorization(...e){return X(this.configuration).detailBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}disableBrokerageAuthorization(...e){return X(this.configuration).disableBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizationAccounts(...e){return X(this.configuration).listBrokerageAuthorizationAccounts(...e).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizations(...e){return X(this.configuration).listBrokerageAuthorizations(...e).then(e=>e(this.axios,this.basePath))}listConnectionAccounts(...e){return X(this.configuration).listConnectionAccounts(...e).then(e=>e(this.axios,this.basePath))}refreshBrokerageAuthorization(...e){return X(this.configuration).refreshBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}returnRates(...e){return X(this.configuration).returnRates(...e).then(e=>e(this.axios,this.basePath))}syncBrokerageAuthorizationTransactions(...e){return X(this.configuration).syncBrokerageAuthorizationTransactions(...e).then(e=>e(this.axios,this.basePath))}},Jr=class extends qr{};let Yr=function(e){return{addSubscription:async(t,n,r,i={})=>{B(`addSubscription`,`tradeDetectionAddSubscriptionRequest`,t);let a=`/snapTrade/tradeDetection/subscriptions`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},cancelSubscription:async(t,n={})=>{B(`cancelSubscription`,`tradeDetectionCancelSubscriptionRequest`,t);let r=`/snapTrade/tradeDetection/subscriptions/cancel`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions/cancel`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},getAllAccountOrders:async(t,n,r,i,a,o={})=>{B(`getAllAccountOrders`,`accountId`,t);let s=`/accounts/{accountId}/orders/all`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders/all`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getAllAccountRecentOrders:async(t,n,r,i,a={})=>{B(`getAllAccountRecentOrders`,`accountId`,t);let o=`/accounts/{accountId}/orders/recent`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/recent`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountOrderDetailV2:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetailV2`,`accountId`,t),B(`getUserAccountOrderDetailV2`,`brokerageOrderId`,n);let o=`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{brokerageOrderId}`,encodeURIComponent(String(n===void 0?`-brokerageOrderId-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountOrdersV2:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrdersV2`,`accountId`,t);let s=`/accounts/{accountId}/orders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders/v2`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountRecentOrdersV2:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrdersV2`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders/v2`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},listSubscriptions:async(t={})=>{let n=`/snapTrade/tradeDetection/subscriptions`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},placeSimpleOrder:async(t,n,r,i,a={})=>{B(`placeSimpleOrder`,`accountId`,t),B(`placeSimpleOrder`,`simpleTradeForm`,n);let o=`/accounts/{accountId}/trading/simple`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/simple`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}}}},Z=function(e){let t=Yr(e);return{async addSubscription(...n){let[r={},i]=n,a={account_id:r.account_id,check_interval_seconds:r.check_interval_seconds};return K(await t.addSubscription(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async cancelSubscription(...n){let[r={},i]=n,a={account_id:r.account_id};return K(await t.cancelSubscription(a,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountOrders(...n){let[r={},i]=n;return K(await t.getAllAccountOrders(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountRecentOrders(...n){let[r={},i]=n;return K(await t.getAllAccountRecentOrders(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrderDetailV2(...n){let[r={},i]=n;return K(await t.getUserAccountOrderDetailV2(r.accountId,r.brokerageOrderId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrdersV2(...n){let[r={},i]=n;return K(await t.getUserAccountOrdersV2(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountRecentOrdersV2(...n){let[r={},i]=n;return K(await t.getUserAccountRecentOrdersV2(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listSubscriptions(...n){let[r]=n;return K(await t.listSubscriptions(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeSimpleOrder(...n){let[r={},i]=n,a={order_type:r.order_type,time_in_force:r.time_in_force,legs:r.legs,limit_price:r.limit_price,stop_price:r.stop_price,price_effect:r.price_effect,client_order_id:r.client_order_id,expiry_date:r.expiry_date,notional_value:r.notional_value,trading_session:r.trading_session};return K(await t.placeSimpleOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Xr=function(e,t,n){let r=Z(e);return{addSubscription(...e){return r.addSubscription(...e).then(e=>e(n,t))},cancelSubscription(...e){return r.cancelSubscription(...e).then(e=>e(n,t))},getAllAccountOrders(...e){return r.getAllAccountOrders(...e).then(e=>e(n,t))},getAllAccountRecentOrders(...e){return r.getAllAccountRecentOrders(...e).then(e=>e(n,t))},getUserAccountOrderDetailV2(...e){return r.getUserAccountOrderDetailV2(...e).then(e=>e(n,t))},getUserAccountOrdersV2(...e){return r.getUserAccountOrdersV2(...e).then(e=>e(n,t))},getUserAccountRecentOrdersV2(...e){return r.getUserAccountRecentOrdersV2(...e).then(e=>e(n,t))},listSubscriptions(...e){return r.listSubscriptions(...e).then(e=>e(n,t))},placeSimpleOrder(...e){return r.placeSimpleOrder(...e).then(e=>e(n,t))}}};var Zr=class extends R{addSubscription(...e){return Z(this.configuration).addSubscription(...e).then(e=>e(this.axios,this.basePath))}cancelSubscription(...e){return Z(this.configuration).cancelSubscription(...e).then(e=>e(this.axios,this.basePath))}getAllAccountOrders(...e){return Z(this.configuration).getAllAccountOrders(...e).then(e=>e(this.axios,this.basePath))}getAllAccountRecentOrders(...e){return Z(this.configuration).getAllAccountRecentOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetailV2(...e){return Z(this.configuration).getUserAccountOrderDetailV2(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrdersV2(...e){return Z(this.configuration).getUserAccountOrdersV2(...e).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrdersV2(...e){return Z(this.configuration).getUserAccountRecentOrdersV2(...e).then(e=>e(this.axios,this.basePath))}listSubscriptions(...e){return Z(this.configuration).listSubscriptions(...e).then(e=>e(this.axios,this.basePath))}placeSimpleOrder(...e){return Z(this.configuration).placeSimpleOrder(...e).then(e=>e(this.axios,this.basePath))}},Qr=class extends Zr{};let $r=function(e){return{getStats:async(t,n={})=>{let r=`/management/stats`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.currency=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/management/stats`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},getStatsLegacy:async(t,n={})=>{let r=`/snapTrade/stats`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.currency=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/stats`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}}}},ei=function(e){let t=$r(e);return{async getStats(...n){let[r={},i]=n;return K(await t.getStats(r.currency,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getStatsLegacy(...n){let[r={},i]=n;return K(await t.getStatsLegacy(r.currency,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},ti=function(e,t,n){let r=ei(e);return{getStats(...e){return r.getStats(...e).then(e=>e(n,t))},getStatsLegacy(...e){return r.getStatsLegacy(...e).then(e=>e(n,t))}}};var ni=class extends R{getStats(...e){return ei(this.configuration).getStats(...e).then(e=>e(this.axios,this.basePath))}getStatsLegacy(...e){return ei(this.configuration).getStatsLegacy(...e).then(e=>e(this.axios,this.basePath))}},ri=class extends ni{};let ii=function(e){return{getPartnerInfo:async(t={})=>{let n=`/snapTrade/partners`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(o,e);let c={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/partners`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},getStockExchanges:async(t={})=>{let n=`/exchanges`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(o,e);let c={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/exchanges`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},getSymbols:async(t,n={})=>{let r=`/symbols`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(s,e);let l={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},getSymbolsByTicker:async(t,n={})=>{B(`getSymbolsByTicker`,`query`,t);let r=`/symbols/{query}`.replace(`{query}`,encodeURIComponent(String(t===void 0?`-query-`:t))),i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(s,e);let l={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols/{query}`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listAllBrokerageAuthorizationType:async(t,n={})=>{let r=`/brokerageAuthorizationTypes`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.brokerage=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerageAuthorizationTypes`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listAllBrokerageInstruments:async(t,n={})=>{B(`listAllBrokerageInstruments`,`slug`,t);let r=`/brokerages/{slug}/instruments`.replace(`{slug}`,encodeURIComponent(String(t===void 0?`-slug-`:t))),i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(s,e);let l={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerages/{slug}/instruments`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listAllBrokerages:async(t={})=>{let n=`/brokerages`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(o,e);let c={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/brokerages`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},listInstitutions:async(t={})=>{let n=`/institutions`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={},c={authModes:[`public`],selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/institutions`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},symbolSearchUserAccount:async(t,n,r,i,a={})=>{B(`symbolSearchUserAccount`,`accountId`,t);let o=`/accounts/{accountId}/symbols`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/symbols`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}}}},Q=function(e){let t=ii(e);return{async getPartnerInfo(...n){let[r]=n;return K(await t.getPartnerInfo(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getStockExchanges(...n){let[r]=n;return K(await t.getStockExchanges(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getSymbols(...n){let[r={},i]=n,a={substring:r.substring};return K(await t.getSymbols(a,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getSymbolsByTicker(...n){let[r={},i]=n;return K(await t.getSymbolsByTicker(r.query,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerageAuthorizationType(...n){let[r={},i]=n;return K(await t.listAllBrokerageAuthorizationType(r.brokerage,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerageInstruments(...n){let[r={},i]=n;return K(await t.listAllBrokerageInstruments(r.slug,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerages(...n){let[r]=n;return K(await t.listAllBrokerages(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listInstitutions(n){return K(await t.listInstitutions(n),I,L,e,{authModes:[`public`]})},async symbolSearchUserAccount(...n){let[r={},i]=n,a={substring:r.substring};return K(await t.symbolSearchUserAccount(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},ai=function(e,t,n){let r=Q(e);return{getPartnerInfo(...e){return r.getPartnerInfo(...e).then(e=>e(n,t))},getStockExchanges(...e){return r.getStockExchanges(...e).then(e=>e(n,t))},getSymbols(...e){return r.getSymbols(...e).then(e=>e(n,t))},getSymbolsByTicker(...e){return r.getSymbolsByTicker(...e).then(e=>e(n,t))},listAllBrokerageAuthorizationType(...e){return r.listAllBrokerageAuthorizationType(...e).then(e=>e(n,t))},listAllBrokerageInstruments(...e){return r.listAllBrokerageInstruments(...e).then(e=>e(n,t))},listAllBrokerages(...e){return r.listAllBrokerages(...e).then(e=>e(n,t))},listInstitutions(e){return r.listInstitutions(e).then(e=>e(n,t))},symbolSearchUserAccount(...e){return r.symbolSearchUserAccount(...e).then(e=>e(n,t))}}};var oi=class extends R{getPartnerInfo(...e){return Q(this.configuration).getPartnerInfo(...e).then(e=>e(this.axios,this.basePath))}getStockExchanges(...e){return Q(this.configuration).getStockExchanges(...e).then(e=>e(this.axios,this.basePath))}getSymbols(...e){return Q(this.configuration).getSymbols(...e).then(e=>e(this.axios,this.basePath))}getSymbolsByTicker(...e){return Q(this.configuration).getSymbolsByTicker(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerageAuthorizationType(...e){return Q(this.configuration).listAllBrokerageAuthorizationType(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerageInstruments(...e){return Q(this.configuration).listAllBrokerageInstruments(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerages(...e){return Q(this.configuration).listAllBrokerages(...e).then(e=>e(this.axios,this.basePath))}listInstitutions(e){return Q(this.configuration).listInstitutions(e).then(e=>e(this.axios,this.basePath))}symbolSearchUserAccount(...e){return Q(this.configuration).symbolSearchUserAccount(...e).then(e=>e(this.axios,this.basePath))}},si=class extends oi{};let ci=function(e){return{cancelOrder:async(t,n,r,i,a={})=>{B(`cancelOrder`,`accountId`,t),B(`cancelOrder`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/trading/cancel`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/cancel`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},getCryptocurrencyPairQuote:async(t,n,r,i,a={})=>{B(`getCryptocurrencyPairQuote`,`accountId`,t),B(`getCryptocurrencyPairQuote`,`instrumentSymbol`,n);let o=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{instrumentSymbol}`,encodeURIComponent(String(n===void 0?`-instrumentSymbol-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getOptionImpact:async(t,n,r,i,a={})=>{B(`getOptionImpact`,`accountId`,t),B(`getOptionImpact`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options/impact`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options/impact`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},getOrderImpact:async(t,n,r,i={})=>{B(`getOrderImpact`,`manualTradeForm`,t);let a=`/trade/impact`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/impact`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},getUserAccountOptionQuotes:async(t,n,r,i,a={})=>{B(`getUserAccountOptionQuotes`,`accountId`,t),B(`getUserAccountOptionQuotes`,`symbol`,n);let o=`/accounts/{accountId}/quotes/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.symbol=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/quotes/options`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountQuotes:async(t,n,r,i,a,o={})=>{B(`getUserAccountQuotes`,`symbols`,t),B(`getUserAccountQuotes`,`accountId`,n);let s=`/accounts/{accountId}/quotes`.replace(`{accountId}`,encodeURIComponent(String(n===void 0?`-accountId-`:n))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),t!==void 0&&(f.symbols=t),r!==void 0&&(f.use_ticker=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/quotes`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},placeComplexOrder:async(t,n,r,i,a={})=>{B(`placeComplexOrder`,`accountId`,t),B(`placeComplexOrder`,`manualTradeFormComplex`,n);let o=`/accounts/{accountId}/trading/complex`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/complex`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},placeCryptoOrder:async(t,n,r,i,a={})=>{B(`placeCryptoOrder`,`accountId`,t),B(`placeCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},placeForceOrder:async(t,n,r,i={})=>{B(`placeForceOrder`,`manualTradeFormWithOptions`,t);let a=`/trade/place`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/place`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},placeMlegOrder:async(t,n,r,i,a={})=>{B(`placeMlegOrder`,`accountId`,t),B(`placeMlegOrder`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},placeOrder:async(t,n,r,i,a={})=>{B(`placeOrder`,`tradeId`,t);let o=`/trade/{tradeId}`.replace(`{tradeId}`,encodeURIComponent(String(t===void 0?`-tradeId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/trade/{tradeId}`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},previewCryptoOrder:async(t,n,r,i,a={})=>{B(`previewCryptoOrder`,`accountId`,t),B(`previewCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto/preview`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto/preview`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},replaceOrder:async(t,n,r,i,a={})=>{B(`replaceOrder`,`accountId`,t),B(`replaceOrder`,`manualTradeReplaceForm`,n);let o=`/accounts/{accountId}/trading/replace`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/replace`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},searchCryptocurrencyPairInstruments:async(t,n,r,i,a,o={})=>{B(`searchCryptocurrencyPairInstruments`,`accountId`,t);let s=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),n!==void 0&&(f.base=n),r!==void 0&&(f.quote=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}}}},$=function(e){let t=ci(e);return{async cancelOrder(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id};return K(await t.cancelOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getCryptocurrencyPairQuote(...n){let[r={},i]=n;return K(await t.getCryptocurrencyPairQuote(r.accountId,r.instrumentSymbol,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getOptionImpact(...n){let[r={},i]=n,a={order_type:r.order_type,time_in_force:r.time_in_force,limit_price:r.limit_price,stop_price:r.stop_price,price_effect:r.price_effect,legs:r.legs};return K(await t.getOptionImpact(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getOrderImpact(...n){let[r={},i]=n,a={account_id:r.account_id,action:r.action,universal_symbol_id:r.universal_symbol_id,order_type:r.order_type,time_in_force:r.time_in_force,price:r.price,stop:r.stop,units:r.units,notional_value:r.notional_value};return K(await t.getOrderImpact(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOptionQuotes(...n){let[r={},i]=n;return K(await t.getUserAccountOptionQuotes(r.accountId,r.symbol,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountQuotes(...n){let[r={},i]=n;return K(await t.getUserAccountQuotes(r.symbols,r.accountId,r.useTicker,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeComplexOrder(...n){let[r={},i]=n,a={type:r.type,orders:r.orders,client_order_id:r.client_order_id};return K(await t.placeComplexOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeCryptoOrder(...n){let[r={},i]=n,a={instrument:r.instrument,side:r.side,type:r.type,time_in_force:r.time_in_force,amount:r.amount,limit_price:r.limit_price,stop_price:r.stop_price,post_only:r.post_only,expiration_date:r.expiration_date};return K(await t.placeCryptoOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeForceOrder(...n){let[r={},i]=n,a={account_id:r.account_id,action:r.action,universal_symbol_id:r.universal_symbol_id,symbol:r.symbol,order_type:r.order_type,time_in_force:r.time_in_force,trading_session:r.trading_session,expiry_date:r.expiry_date,price:r.price,stop:r.stop,units:r.units,notional_value:r.notional_value,client_order_id:r.client_order_id};return K(await t.placeForceOrder(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeMlegOrder(...n){let[r={},i]=n,a={order_type:r.order_type,time_in_force:r.time_in_force,limit_price:r.limit_price,stop_price:r.stop_price,price_effect:r.price_effect,legs:r.legs};return K(await t.placeMlegOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeOrder(...n){let[r={},i]=n,a={wait_to_confirm:r.wait_to_confirm};return K(await t.placeOrder(r.tradeId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async previewCryptoOrder(...n){let[r={},i]=n,a={instrument:r.instrument,side:r.side,type:r.type,time_in_force:r.time_in_force,amount:r.amount,limit_price:r.limit_price,stop_price:r.stop_price,post_only:r.post_only,expiration_date:r.expiration_date};return K(await t.previewCryptoOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async replaceOrder(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id,action:r.action,order_type:r.order_type,time_in_force:r.time_in_force,price:r.price,symbol:r.symbol,stop:r.stop,units:r.units};return K(await t.replaceOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async searchCryptocurrencyPairInstruments(...n){let[r={},i]=n;return K(await t.searchCryptocurrencyPairInstruments(r.accountId,r.base,r.quote,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},li=function(e,t,n){let r=$(e);return{cancelOrder(...e){return r.cancelOrder(...e).then(e=>e(n,t))},getCryptocurrencyPairQuote(...e){return r.getCryptocurrencyPairQuote(...e).then(e=>e(n,t))},getOptionImpact(...e){return r.getOptionImpact(...e).then(e=>e(n,t))},getOrderImpact(...e){return r.getOrderImpact(...e).then(e=>e(n,t))},getUserAccountOptionQuotes(...e){return r.getUserAccountOptionQuotes(...e).then(e=>e(n,t))},getUserAccountQuotes(...e){return r.getUserAccountQuotes(...e).then(e=>e(n,t))},placeComplexOrder(...e){return r.placeComplexOrder(...e).then(e=>e(n,t))},placeCryptoOrder(...e){return r.placeCryptoOrder(...e).then(e=>e(n,t))},placeForceOrder(...e){return r.placeForceOrder(...e).then(e=>e(n,t))},placeMlegOrder(...e){return r.placeMlegOrder(...e).then(e=>e(n,t))},placeOrder(...e){return r.placeOrder(...e).then(e=>e(n,t))},previewCryptoOrder(...e){return r.previewCryptoOrder(...e).then(e=>e(n,t))},replaceOrder(...e){return r.replaceOrder(...e).then(e=>e(n,t))},searchCryptocurrencyPairInstruments(...e){return r.searchCryptocurrencyPairInstruments(...e).then(e=>e(n,t))}}};var ui=class extends R{cancelOrder(...e){return $(this.configuration).cancelOrder(...e).then(e=>e(this.axios,this.basePath))}getCryptocurrencyPairQuote(...e){return $(this.configuration).getCryptocurrencyPairQuote(...e).then(e=>e(this.axios,this.basePath))}getOptionImpact(...e){return $(this.configuration).getOptionImpact(...e).then(e=>e(this.axios,this.basePath))}getOrderImpact(...e){return $(this.configuration).getOrderImpact(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOptionQuotes(...e){return $(this.configuration).getUserAccountOptionQuotes(...e).then(e=>e(this.axios,this.basePath))}getUserAccountQuotes(...e){return $(this.configuration).getUserAccountQuotes(...e).then(e=>e(this.axios,this.basePath))}placeComplexOrder(...e){return $(this.configuration).placeComplexOrder(...e).then(e=>e(this.axios,this.basePath))}placeCryptoOrder(...e){return $(this.configuration).placeCryptoOrder(...e).then(e=>e(this.axios,this.basePath))}placeForceOrder(...e){return $(this.configuration).placeForceOrder(...e).then(e=>e(this.axios,this.basePath))}placeMlegOrder(...e){return $(this.configuration).placeMlegOrder(...e).then(e=>e(this.axios,this.basePath))}placeOrder(...e){return $(this.configuration).placeOrder(...e).then(e=>e(this.axios,this.basePath))}previewCryptoOrder(...e){return $(this.configuration).previewCryptoOrder(...e).then(e=>e(this.axios,this.basePath))}replaceOrder(...e){return $(this.configuration).replaceOrder(...e).then(e=>e(this.axios,this.basePath))}searchCryptocurrencyPairInstruments(...e){return $(this.configuration).searchCryptocurrencyPairInstruments(...e).then(e=>e(this.axios,this.basePath))}},di=class extends ui{},fi=class e{constructor(e){this.mode=`commercialApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},pi=class e{constructor(e){this.mode=`personalApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},mi=class e{constructor(e){this.mode=`oauth`,this.accessToken=e.accessToken}static create(t){return new e(t)}},hi=class{constructor(){}static commercialApiKey(e){return fi.create(e)}static personalApiKey(e){return pi.create(e)}static oauth(e){return mi.create(e)}},gi=class{constructor(e){this.authMode=e.auth.mode,this.apiKey={},e.auth.mode===`commercialApiKey`&&(this.consumerKey=e.auth.consumerKey,e.auth.clientId!==void 0&&(this.apiKey.clientId=e.auth.clientId)),e.auth.mode===`personalApiKey`&&(this.consumerKey=e.auth.consumerKey,e.auth.clientId!==void 0&&(this.apiKey.clientId=e.auth.clientId)),e.auth.mode===`oauth`&&(this.accessToken=e.auth.accessToken),this.basePath=e.basePath,this.baseOptions=e.baseOptions??{},this.userAgent=e.userAgent===void 0?`Konfig/13.2.3/typescript`:e.userAgent,this.formDataCtor=e.formDataCtor}isJsonMime(e){return e!==null&&(RegExp(`^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$`,`i`).test(e)||e.toLowerCase()===`application/json-patch+json`)}},_i=class{constructor(e){}},vi=class extends _i{constructor(e){super(e);let t=new gi(e);this.accountInformation=new Pr(t),this.apiStatus=new zr(t),this.authentication=new Wr(t),this.connections=new Jr(t),this.experimentalEndpoints=new Qr(t),this.management=new ri(t),this.referenceData=new si(t),this.trading=new di(t)}};let yi=()=>Error(`Device authorization expired. Start a new authorization.`),bi=()=>Object.assign(Error(`Device authorization cancelled.`),{name:`AbortError`}),xi=(e,t)=>new Promise((n,r)=>{if(t.aborted){r(bi());return}let i=()=>{clearTimeout(a),t.removeEventListener(`abort`,i),r(bi())},a=setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);t.addEventListener(`abort`,i,{once:!0})});var Si=class{constructor(e={}){this.issuer=(e.issuer??new URL(L).origin).replace(/\/+$/,``),this.http=e.axios??I}async startDeviceAuthorization(e){let t=Date.now(),{data:n}=await this.http.post(`${this.issuer}/oauth/device_authorization/`,new URLSearchParams({client_id:e.clientId,scope:`read`}).toString(),{headers:{"Content-Type":`application/x-www-form-urlencoded`},signal:e.signal});if(typeof n.device_code!=`string`||!n.device_code||typeof n.user_code!=`string`||!n.user_code||typeof n.verification_uri!=`string`||!n.verification_uri||!Number.isFinite(n.expires_in)||n.expires_in<=0||n.interval!==void 0&&(!Number.isFinite(n.interval)||n.interval<=0))throw Error(`Invalid device authorization response.`);return{deviceCode:n.device_code,userCode:n.user_code,verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,expiresAt:t+n.expires_in*1e3,interval:n.interval??5}}async waitForDeviceToken(e){let{authorization:t,signal:n}=e;if(n?.aborted)throw bi();let r=t.expiresAt-Date.now();if(!Number.isFinite(r)||r<=0)throw yi();if(!Number.isFinite(t.interval)||t.interval<=0)throw Error(`Invalid polling interval.`);let i=new AbortController,a=()=>i.abort();n?.addEventListener(`abort`,a,{once:!0});let o=setTimeout(a,Math.min(r,2147483647)),s=t.interval*1e3;try{for(;;){if(await xi(Math.min(s,Math.max(0,t.expiresAt-Date.now())),i.signal),Date.now()>=t.expiresAt)throw yi();try{let{data:n}=await this.http.post(`${this.issuer}/oauth/token/`,new URLSearchParams({client_id:e.clientId,device_code:t.deviceCode,grant_type:`urn:ietf:params:oauth:grant-type:device_code`}).toString(),{headers:{"Content-Type":`application/x-www-form-urlencoded`},signal:i.signal,timeout:Math.min(3e4,Math.max(1,t.expiresAt-Date.now()))});if(typeof n.access_token!=`string`||!n.access_token)throw Error(`OAuth response is missing access_token.`);return{accessToken:n.access_token,refreshToken:n.refresh_token,tokenType:n.token_type,expiresIn:n.expires_in,scope:n.scope}}catch(e){let t=e,n=t.response?.data?.error;if(n===`authorization_pending`)continue;if(n===`slow_down`){s+=5e3;continue}if(t.code===`ECONNABORTED`||t.code===`ETIMEDOUT`){s*=2;continue}throw e}}}catch(e){throw n?.aborted?bi():i.signal.aborted||Date.now()>=t.expiresAt?yi():e}finally{clearTimeout(o),n?.removeEventListener(`abort`,a)}}};e.AccountInformationApi=Pr,e.AccountInformationApiAxiosParamCreator=jr,e.AccountInformationApiFactory=Mr,e.AccountInformationApiFp=Y,e.AccountInformationApiGenerated=Nr,e.ApiStatusApi=zr,e.ApiStatusApiAxiosParamCreator=Fr,e.ApiStatusApiFactory=Lr,e.ApiStatusApiFp=Ir,e.ApiStatusApiGenerated=Rr,e.AuthenticationApi=Wr,e.AuthenticationApiAxiosParamCreator=Br,e.AuthenticationApiFactory=Hr,e.AuthenticationApiFp=Vr,e.AuthenticationApiGenerated=Ur,e.CommercialApiKeyAuth=fi,e.Configuration=gi,e.ConnectionsApi=Jr,e.ConnectionsApiAxiosParamCreator=Gr,e.ConnectionsApiFactory=Kr,e.ConnectionsApiFp=X,e.ConnectionsApiGenerated=qr,e.ExperimentalEndpointsApi=Qr,e.ExperimentalEndpointsApiAxiosParamCreator=Yr,e.ExperimentalEndpointsApiFactory=Xr,e.ExperimentalEndpointsApiFp=Z,e.ExperimentalEndpointsApiGenerated=Zr,e.ManagementApi=ri,e.ManagementApiAxiosParamCreator=$r,e.ManagementApiFactory=ti,e.ManagementApiFp=ei,e.ManagementApiGenerated=ni,e.OAuthAuth=mi,e.PersonalApiKeyAuth=pi,e.ReferenceDataApi=si,e.ReferenceDataApiAxiosParamCreator=ii,e.ReferenceDataApiFactory=ai,e.ReferenceDataApiFp=Q,e.ReferenceDataApiGenerated=oi,e.Snaptrade=vi,e.SnaptradeAuth=hi,e.SnaptradeError=Tr,e.SnaptradeOAuthDevice=Si,e.TradingApi=di,e.TradingApiAxiosParamCreator=ci,e.TradingApiFactory=li,e.TradingApiFp=$,e.TradingApiGenerated=ui,e.parseIfJson=Dr,e.readableStreamToString=Er});
11
+ `+JSON.stringify(n,null,2);super(a),this.name=`SnaptradeError`,this.code=e.code,this.method=e.config?.method?.toUpperCase(),this.url=i,this.status=e.response?.status,this.statusText=e.response?.statusText,this.responseBody=t}toJSON(){return{name:this.name,message:this.message,method:this.method,url:this.url,code:this.code,status:this.status,statusText:this.statusText,responseBody:this.responseBody}}};async function Er(e){let t=new TextDecoder,n=e.getReader(),r=``;try{for(;;){let{done:e,value:i}=await n.read();if(e)break;let a=t.decode(i,{stream:!0});r+=a}}finally{n.releaseLock()}return r}function Dr(e){if(typeof e!=`string`)return e;try{let t=JSON.parse(e);return typeof t==`object`&&t?t:e}catch{return e}}let z=`https://example.com`,B=function(e,t,n){if(n==null)throw new _r(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},V=async function({object:e,key:t,type:n,keyParamName:r,configuration:i,prefix:a}){t=t||r;let o=null;if(i&&i.apiKey)if(typeof i.apiKey==`function`)o=await i.apiKey(r);else if(typeof i.apiKey==`string`)o=i.apiKey;else if(typeof i.apiKey==`object`)r in i.apiKey&&(o=i.apiKey[r]);else throw Error(`Unexpected type ${typeof i.apiKey} for Configuration.apiKey`);o&&(e[t]=a===void 0?o:`${a}${o}`,n===`Cookie`&&(e[t]=`${r}=${e[t]}`))},H=async function(e,t){t&&t.accessToken&&(e.Authorization=`Bearer `+(typeof t.accessToken==`function`?await t.accessToken():await t.accessToken))};function Or(e,t,n=``){typeof t==`object`?Array.isArray(t)?t.forEach(t=>Or(e,t,n)):Object.keys(t).forEach(r=>Or(e,t[r],`${n}${n===``?``:`.`}${r}`)):e.has(n)?e.append(n,t):e.set(n,t)}let U=function(e,...t){let n=new URLSearchParams(e.search);Or(n,t),e.search=n.toString()},W=function(e,t,n){let r=typeof e!=`string`;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers[`Content-Type`]):r)?JSON.stringify(e===void 0?{}:e):e||``},G=function(e){return kr(e.pathname)+e.search+e.hash},kr=function(e){return e.replace(/\/$/,``)};async function Ar(e){let t=0,n=5e3;for(;t<3;)try{return await e()}catch(e){if(I.isAxiosError(e)){if(e.response?.status==429){t++,console.log(`429 error encountered, retrying in ${n/1e3} seconds...`),await new Promise(e=>setTimeout(e,n)),n*=2;continue}let r;try{let t=e.response?.data;r=t,typeof ReadableStream<`u`&&t instanceof ReadableStream&&(r=await Er(t)),r=Dr(r)}catch{r=void 0}throw new Tr(e,r,e.response?.headers)}throw e}throw Error(`Request failed after 3 retries due to 429 (rate limit) errors.`)}let K=function(e,t,n,r,i){return async(a=t,o=n)=>{let s=(r?.basePath||o)+e.url;return await xr({axiosArgs:e,basePath:o,url:s,configuration:r,operationAuth:i?{...i,selectedAuthMode:r?.authMode}:void 0}),Ar(async()=>await a.request({...e.options,url:s}))}};function q(){return typeof window<`u`}function J(e){let{queryParameters:t,operationAuth:n}=e,r=n?.selectedAuthMode;(r===void 0?void 0:n?.requestSigningByAuthMode?.[r])?.signedSecuritySchemes.find(e=>e.toLowerCase().endsWith(`timestamp`))!==void 0&&(t.timestamp=Math.round(new Date().getTime()/1e3).toString())}let jr=function(e){return{getAccountActivities:async(t,n,r,i,a,o,s,c,l={})=>{B(`getAccountActivities`,`accountId`,t);let u=`/accounts/{accountId}/activities`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),d=new URL(u,z),f;e&&(f=e.baseOptions);let p={method:`GET`,...f,...l},m=e&&!q()?{"User-Agent":e.userAgent}:{},h={};e?.authMode===`commercialApiKey`&&(await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),s!==void 0&&(h.userId=s),c!==void 0&&(h.userSecret=c)),e?.authMode===`personalApiKey`&&await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(m,e),n!==void 0&&(h.startDate=n instanceof Date?n.toISOString().substr(0,10):n),r!==void 0&&(h.endDate=r instanceof Date?r.toISOString().substr(0,10):r),i!==void 0&&(h.offset=i),a!==void 0&&(h.limit=a),o!==void 0&&(h.type=o);let g={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},_=f&&f.headers?f.headers:{};return p.headers={...m,..._,...l.headers},J({queryParameters:h,requestConfig:p,path:u,configuration:e,pathTemplate:`/accounts/{accountId}/activities`,httpMethod:`GET`,operationAuth:g}),U(d,h),{url:G(d),options:p}},getAccountBalanceHistory:async(t,n,r,i={})=>{B(`getAccountBalanceHistory`,`accountId`,t);let a=`/accounts/{accountId}/balanceHistory`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balanceHistory`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAccountBalancesV2:async(t,n,r,i={})=>{B(`getAccountBalancesV2`,`accountId`,t);let a=`/accounts/{accountId}/balances/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balances/v2`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAccountDetails:async(t,n,r,i={})=>{B(`getAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/details`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAllAccountPositions:async(t,n,r,i={})=>{B(`getAllAccountPositions`,`accountId`,t);let a=`/accounts/{accountId}/positions/all`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/positions/all`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountBalance:async(t,n,r,i={})=>{B(`getUserAccountBalance`,`accountId`,t);let a=`/accounts/{accountId}/balances`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balances`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountDetails:async(t,n,r,i={})=>{B(`getUserAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountOrderDetail:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetail`,`accountId`,t),B(`getUserAccountOrderDetail`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/orders/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},getUserAccountOrders:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrders`,`accountId`,t);let s=`/accounts/{accountId}/orders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountRecentOrders:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrders`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountReturnRates:async(t,n,r,i,a={})=>{B(`getUserAccountReturnRates`,`accountId`,t);let o=`/accounts/{accountId}/returnRates`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.timeframes=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/returnRates`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserHoldings:async(t,n,r,i={})=>{B(`getUserHoldings`,`accountId`,t);let a=`/accounts/{accountId}/holdings`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/holdings`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listAllUserAccounts:async(t,n,r={})=>{let i=`/accounts/all`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(c,e);let u={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},J({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/accounts/all`,httpMethod:`GET`,operationAuth:u}),U(a,l),{url:G(a),options:s}},listUserAccounts:async(t,n,r={})=>{let i=`/accounts`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(c,e);let u={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},J({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/accounts`,httpMethod:`GET`,operationAuth:u}),U(a,l),{url:G(a),options:s}},updateUserAccount:async(t,n,r,i={})=>{B(`updateUserAccount`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`PUT`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`PUT`,operationAuth:d}),U(o,u),{url:G(o),options:c}}}},Y=function(e){let t=jr(e);return{async getAccountActivities(...n){let[r={},i]=n;return K(await t.getAccountActivities(r.accountId,r.startDate,r.endDate,r.offset,r.limit,r.type,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountBalanceHistory(...n){let[r={},i]=n;return K(await t.getAccountBalanceHistory(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountBalancesV2(...n){let[r={},i]=n;return K(await t.getAccountBalancesV2(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountDetails(...n){let[r={},i]=n;return K(await t.getAccountDetails(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountPositions(...n){let[r={},i]=n;return K(await t.getAllAccountPositions(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountBalance(...n){let[r={},i]=n;return K(await t.getUserAccountBalance(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountDetails(...n){let[r={},i]=n;return K(await t.getUserAccountDetails(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrderDetail(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id};return K(await t.getUserAccountOrderDetail(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrders(...n){let[r={},i]=n;return K(await t.getUserAccountOrders(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountRecentOrders(...n){let[r={},i]=n;return K(await t.getUserAccountRecentOrders(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountReturnRates(...n){let[r={},i]=n;return K(await t.getUserAccountReturnRates(r.accountId,r.timeframes,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserHoldings(...n){let[r={},i]=n;return K(await t.getUserHoldings(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllUserAccounts(...n){let[r={},i]=n;return K(await t.listAllUserAccounts(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listUserAccounts(...n){let[r={},i]=n;return K(await t.listUserAccounts(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async updateUserAccount(...n){let[r={},i]=n;return K(await t.updateUserAccount(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Mr=function(e,t,n){let r=Y(e);return{getAccountActivities(...e){return r.getAccountActivities(...e).then(e=>e(n,t))},getAccountBalanceHistory(...e){return r.getAccountBalanceHistory(...e).then(e=>e(n,t))},getAccountBalancesV2(...e){return r.getAccountBalancesV2(...e).then(e=>e(n,t))},getAccountDetails(...e){return r.getAccountDetails(...e).then(e=>e(n,t))},getAllAccountPositions(...e){return r.getAllAccountPositions(...e).then(e=>e(n,t))},getUserAccountBalance(...e){return r.getUserAccountBalance(...e).then(e=>e(n,t))},getUserAccountDetails(...e){return r.getUserAccountDetails(...e).then(e=>e(n,t))},getUserAccountOrderDetail(...e){return r.getUserAccountOrderDetail(...e).then(e=>e(n,t))},getUserAccountOrders(...e){return r.getUserAccountOrders(...e).then(e=>e(n,t))},getUserAccountRecentOrders(...e){return r.getUserAccountRecentOrders(...e).then(e=>e(n,t))},getUserAccountReturnRates(...e){return r.getUserAccountReturnRates(...e).then(e=>e(n,t))},getUserHoldings(...e){return r.getUserHoldings(...e).then(e=>e(n,t))},listAllUserAccounts(...e){return r.listAllUserAccounts(...e).then(e=>e(n,t))},listUserAccounts(...e){return r.listUserAccounts(...e).then(e=>e(n,t))},updateUserAccount(...e){return r.updateUserAccount(...e).then(e=>e(n,t))}}};var Nr=class extends R{getAccountActivities(...e){return Y(this.configuration).getAccountActivities(...e).then(e=>e(this.axios,this.basePath))}getAccountBalanceHistory(...e){return Y(this.configuration).getAccountBalanceHistory(...e).then(e=>e(this.axios,this.basePath))}getAccountBalancesV2(...e){return Y(this.configuration).getAccountBalancesV2(...e).then(e=>e(this.axios,this.basePath))}getAccountDetails(...e){return Y(this.configuration).getAccountDetails(...e).then(e=>e(this.axios,this.basePath))}getAllAccountPositions(...e){return Y(this.configuration).getAllAccountPositions(...e).then(e=>e(this.axios,this.basePath))}getUserAccountBalance(...e){return Y(this.configuration).getUserAccountBalance(...e).then(e=>e(this.axios,this.basePath))}getUserAccountDetails(...e){return Y(this.configuration).getUserAccountDetails(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetail(...e){return Y(this.configuration).getUserAccountOrderDetail(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrders(...e){return Y(this.configuration).getUserAccountOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrders(...e){return Y(this.configuration).getUserAccountRecentOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountReturnRates(...e){return Y(this.configuration).getUserAccountReturnRates(...e).then(e=>e(this.axios,this.basePath))}getUserHoldings(...e){return Y(this.configuration).getUserHoldings(...e).then(e=>e(this.axios,this.basePath))}listAllUserAccounts(...e){return Y(this.configuration).listAllUserAccounts(...e).then(e=>e(this.axios,this.basePath))}listUserAccounts(...e){return Y(this.configuration).listUserAccounts(...e).then(e=>e(this.axios,this.basePath))}updateUserAccount(...e){return Y(this.configuration).updateUserAccount(...e).then(e=>e(this.axios,this.basePath))}},Pr=class extends Nr{};let Fr=function(e){return{check:async(t={})=>{let n=new URL(`/`,z),r;e&&(r=e.baseOptions);let i={method:`GET`,...r,...t},a=e&&!q()?{"User-Agent":e.userAgent}:{},o={},s={authModes:[`public`],selectedAuthMode:e?.authMode},c=r&&r.headers?r.headers:{};return i.headers={...a,...c,...t.headers},J({queryParameters:o,requestConfig:i,path:`/`,configuration:e,pathTemplate:`/`,httpMethod:`GET`,operationAuth:s}),U(n,o),{url:G(n),options:i}}}},Ir=function(e){let t=Fr(e);return{async check(n){return K(await t.check(n),I,L,e,{authModes:[`public`]})}}},Lr=function(e,t,n){let r=Ir(e);return{check(e){return r.check(e).then(e=>e(n,t))}}};var Rr=class extends R{check(e){return Ir(this.configuration).check(e).then(e=>e(this.axios,this.basePath))}},zr=class extends Rr{};let Br=function(e){return{deleteSnapTradeUser:async(t,n={})=>{let r=`/snapTrade/deleteUser`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`DELETE`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&(await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.userId=t));let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/deleteUser`,httpMethod:`DELETE`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listSnapTradeUsers:async(t={})=>{let n=`/snapTrade/listUsers`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/listUsers`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},loginSnapTradeUser:async(t,n,r,i={})=>{let a=`/snapTrade/login`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/login`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},registerSnapTradeUser:async(t,n={})=>{B(`registerSnapTradeUser`,`snapTradeRegisterUserRequestBody`,t);let r=`/snapTrade/registerUser`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/registerUser`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},resetSnapTradeUserSecret:async(t,n={})=>{B(`resetSnapTradeUserSecret`,`userIDandSecret`,t);let r=`/snapTrade/resetUserSecret`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/resetUserSecret`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}}}},Vr=function(e){let t=Br(e);return{async deleteSnapTradeUser(...n){let[r={},i]=n;return K(await t.deleteSnapTradeUser(r.userId,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async listSnapTradeUsers(...n){let[r]=n;return K(await t.listSnapTradeUsers(r),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async loginSnapTradeUser(...n){let[r={},i]=n,a={broker:r.broker,immediateRedirect:r.immediateRedirect,customRedirect:r.customRedirect,reconnect:r.reconnect,connectionType:r.connectionType,showCloseButton:r.showCloseButton,darkMode:r.darkMode,locale:r.locale,connectionPortalVersion:r.connectionPortalVersion};return K(await t.loginSnapTradeUser(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async registerSnapTradeUser(...n){let[r={},i]=n,a={userId:r.userId};return K(await t.registerSnapTradeUser(a,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async resetSnapTradeUserSecret(...n){let[r={},i]=n,a={userId:r.userId,userSecret:r.userSecret};return K(await t.resetSnapTradeUserSecret(a,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})}}},Hr=function(e,t,n){let r=Vr(e);return{deleteSnapTradeUser(...e){return r.deleteSnapTradeUser(...e).then(e=>e(n,t))},listSnapTradeUsers(...e){return r.listSnapTradeUsers(...e).then(e=>e(n,t))},loginSnapTradeUser(...e){return r.loginSnapTradeUser(...e).then(e=>e(n,t))},registerSnapTradeUser(...e){return r.registerSnapTradeUser(...e).then(e=>e(n,t))},resetSnapTradeUserSecret(...e){return r.resetSnapTradeUserSecret(...e).then(e=>e(n,t))}}};var Ur=class extends R{deleteSnapTradeUser(...e){return Vr(this.configuration).deleteSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}listSnapTradeUsers(...e){return Vr(this.configuration).listSnapTradeUsers(...e).then(e=>e(this.axios,this.basePath))}loginSnapTradeUser(...e){return Vr(this.configuration).loginSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}registerSnapTradeUser(...e){return Vr(this.configuration).registerSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}resetSnapTradeUserSecret(...e){return Vr(this.configuration).resetSnapTradeUserSecret(...e).then(e=>e(this.axios,this.basePath))}},Wr=class extends Ur{};let Gr=function(e){return{deleteConnection:async(t,n,r,i={})=>{B(`deleteConnection`,`connectionId`,t);let a=`/connection/{connectionId}`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`DELETE`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connection/{connectionId}`,httpMethod:`DELETE`,operationAuth:d}),U(o,u),{url:G(o),options:c}},detailBrokerageAuthorization:async(t,n,r,i={})=>{B(`detailBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},disableBrokerageAuthorization:async(t,n,r,i={})=>{B(`disableBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/disable`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/disable`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listBrokerageAuthorizationAccounts:async(t,n,r,i={})=>{B(`listBrokerageAuthorizationAccounts`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/accounts`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/accounts`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listBrokerageAuthorizations:async(t,n,r={})=>{let i=`/authorizations`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(c,e);let u={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},J({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/authorizations`,httpMethod:`GET`,operationAuth:u}),U(a,l),{url:G(a),options:s}},listConnectionAccounts:async(t,n,r,i={})=>{B(`listConnectionAccounts`,`connectionId`,t);let a=`/connections/{connectionId}/accounts`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connections/{connectionId}/accounts`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},refreshBrokerageAuthorization:async(t,n,r,i={})=>{B(`refreshBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/refresh`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/refresh`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}},returnRates:async(t,n,r,i,a={})=>{B(`returnRates`,`authorizationId`,t);let o=`/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.timeframes=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/authorizations/{authorizationId}/returnRates`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},syncBrokerageAuthorizationTransactions:async(t,n,r,i={})=>{B(`syncBrokerageAuthorizationTransactions`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/transactions/sync`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}}}},X=function(e){let t=Gr(e);return{async deleteConnection(...n){let[r={},i]=n;return K(await t.deleteConnection(r.connectionId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async detailBrokerageAuthorization(...n){let[r={},i]=n;return K(await t.detailBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async disableBrokerageAuthorization(...n){let[r={},i]=n;return K(await t.disableBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listBrokerageAuthorizationAccounts(...n){let[r={},i]=n;return K(await t.listBrokerageAuthorizationAccounts(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listBrokerageAuthorizations(...n){let[r={},i]=n;return K(await t.listBrokerageAuthorizations(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listConnectionAccounts(...n){let[r={},i]=n;return K(await t.listConnectionAccounts(r.connectionId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async refreshBrokerageAuthorization(...n){let[r={},i]=n;return K(await t.refreshBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async returnRates(...n){let[r={},i]=n;return K(await t.returnRates(r.authorizationId,r.timeframes,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async syncBrokerageAuthorizationTransactions(...n){let[r={},i]=n;return K(await t.syncBrokerageAuthorizationTransactions(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Kr=function(e,t,n){let r=X(e);return{deleteConnection(...e){return r.deleteConnection(...e).then(e=>e(n,t))},detailBrokerageAuthorization(...e){return r.detailBrokerageAuthorization(...e).then(e=>e(n,t))},disableBrokerageAuthorization(...e){return r.disableBrokerageAuthorization(...e).then(e=>e(n,t))},listBrokerageAuthorizationAccounts(...e){return r.listBrokerageAuthorizationAccounts(...e).then(e=>e(n,t))},listBrokerageAuthorizations(...e){return r.listBrokerageAuthorizations(...e).then(e=>e(n,t))},listConnectionAccounts(...e){return r.listConnectionAccounts(...e).then(e=>e(n,t))},refreshBrokerageAuthorization(...e){return r.refreshBrokerageAuthorization(...e).then(e=>e(n,t))},returnRates(...e){return r.returnRates(...e).then(e=>e(n,t))},syncBrokerageAuthorizationTransactions(...e){return r.syncBrokerageAuthorizationTransactions(...e).then(e=>e(n,t))}}};var qr=class extends R{deleteConnection(...e){return X(this.configuration).deleteConnection(...e).then(e=>e(this.axios,this.basePath))}detailBrokerageAuthorization(...e){return X(this.configuration).detailBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}disableBrokerageAuthorization(...e){return X(this.configuration).disableBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizationAccounts(...e){return X(this.configuration).listBrokerageAuthorizationAccounts(...e).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizations(...e){return X(this.configuration).listBrokerageAuthorizations(...e).then(e=>e(this.axios,this.basePath))}listConnectionAccounts(...e){return X(this.configuration).listConnectionAccounts(...e).then(e=>e(this.axios,this.basePath))}refreshBrokerageAuthorization(...e){return X(this.configuration).refreshBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}returnRates(...e){return X(this.configuration).returnRates(...e).then(e=>e(this.axios,this.basePath))}syncBrokerageAuthorizationTransactions(...e){return X(this.configuration).syncBrokerageAuthorizationTransactions(...e).then(e=>e(this.axios,this.basePath))}},Jr=class extends qr{};let Yr=function(e){return{addSubscription:async(t,n,r,i={})=>{B(`addSubscription`,`tradeDetectionAddSubscriptionRequest`,t);let a=`/snapTrade/tradeDetection/subscriptions`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},cancelSubscription:async(t,n={})=>{B(`cancelSubscription`,`tradeDetectionCancelSubscriptionRequest`,t);let r=`/snapTrade/tradeDetection/subscriptions/cancel`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions/cancel`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},getAccountOrder:async(t,n,r,i,a={})=>{B(`getAccountOrder`,`accountId`,t),B(`getAccountOrder`,`brokerageOrderId`,n);let o=`/accounts/{accountId}/orders/{brokerageOrderId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{brokerageOrderId}`,encodeURIComponent(String(n===void 0?`-brokerageOrderId-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/{brokerageOrderId}`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getAllAccountOrders:async(t,n,r,i,a,o={})=>{B(`getAllAccountOrders`,`accountId`,t);let s=`/accounts/{accountId}/orders/all`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders/all`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getAllAccountRecentOrders:async(t,n,r,i,a={})=>{B(`getAllAccountRecentOrders`,`accountId`,t);let o=`/accounts/{accountId}/orders/recent`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/recent`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountOrderDetailV2:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetailV2`,`accountId`,t),B(`getUserAccountOrderDetailV2`,`brokerageOrderId`,n);let o=`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{brokerageOrderId}`,encodeURIComponent(String(n===void 0?`-brokerageOrderId-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountOrdersV2:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrdersV2`,`accountId`,t);let s=`/accounts/{accountId}/orders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders/v2`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountRecentOrdersV2:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrdersV2`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders/v2`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},listSubscriptions:async(t={})=>{let n=`/snapTrade/tradeDetection/subscriptions`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},placeSimpleOrder:async(t,n,r,i,a={})=>{B(`placeSimpleOrder`,`accountId`,t),B(`placeSimpleOrder`,`simpleTradeForm`,n);let o=`/accounts/{accountId}/trading/simple`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/simple`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}}}},Z=function(e){let t=Yr(e);return{async addSubscription(...n){let[r={},i]=n,a={account_id:r.account_id,check_interval_seconds:r.check_interval_seconds};return K(await t.addSubscription(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async cancelSubscription(...n){let[r={},i]=n,a={account_id:r.account_id};return K(await t.cancelSubscription(a,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountOrder(...n){let[r={},i]=n;return K(await t.getAccountOrder(r.accountId,r.brokerageOrderId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountOrders(...n){let[r={},i]=n;return K(await t.getAllAccountOrders(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountRecentOrders(...n){let[r={},i]=n;return K(await t.getAllAccountRecentOrders(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrderDetailV2(...n){let[r={},i]=n;return K(await t.getUserAccountOrderDetailV2(r.accountId,r.brokerageOrderId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrdersV2(...n){let[r={},i]=n;return K(await t.getUserAccountOrdersV2(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountRecentOrdersV2(...n){let[r={},i]=n;return K(await t.getUserAccountRecentOrdersV2(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listSubscriptions(...n){let[r]=n;return K(await t.listSubscriptions(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeSimpleOrder(...n){let[r={},i]=n,a={order_type:r.order_type,time_in_force:r.time_in_force,legs:r.legs,limit_price:r.limit_price,stop_price:r.stop_price,price_effect:r.price_effect,client_order_id:r.client_order_id,expiry_date:r.expiry_date,notional_value:r.notional_value,trading_session:r.trading_session};return K(await t.placeSimpleOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Xr=function(e,t,n){let r=Z(e);return{addSubscription(...e){return r.addSubscription(...e).then(e=>e(n,t))},cancelSubscription(...e){return r.cancelSubscription(...e).then(e=>e(n,t))},getAccountOrder(...e){return r.getAccountOrder(...e).then(e=>e(n,t))},getAllAccountOrders(...e){return r.getAllAccountOrders(...e).then(e=>e(n,t))},getAllAccountRecentOrders(...e){return r.getAllAccountRecentOrders(...e).then(e=>e(n,t))},getUserAccountOrderDetailV2(...e){return r.getUserAccountOrderDetailV2(...e).then(e=>e(n,t))},getUserAccountOrdersV2(...e){return r.getUserAccountOrdersV2(...e).then(e=>e(n,t))},getUserAccountRecentOrdersV2(...e){return r.getUserAccountRecentOrdersV2(...e).then(e=>e(n,t))},listSubscriptions(...e){return r.listSubscriptions(...e).then(e=>e(n,t))},placeSimpleOrder(...e){return r.placeSimpleOrder(...e).then(e=>e(n,t))}}};var Zr=class extends R{addSubscription(...e){return Z(this.configuration).addSubscription(...e).then(e=>e(this.axios,this.basePath))}cancelSubscription(...e){return Z(this.configuration).cancelSubscription(...e).then(e=>e(this.axios,this.basePath))}getAccountOrder(...e){return Z(this.configuration).getAccountOrder(...e).then(e=>e(this.axios,this.basePath))}getAllAccountOrders(...e){return Z(this.configuration).getAllAccountOrders(...e).then(e=>e(this.axios,this.basePath))}getAllAccountRecentOrders(...e){return Z(this.configuration).getAllAccountRecentOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetailV2(...e){return Z(this.configuration).getUserAccountOrderDetailV2(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrdersV2(...e){return Z(this.configuration).getUserAccountOrdersV2(...e).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrdersV2(...e){return Z(this.configuration).getUserAccountRecentOrdersV2(...e).then(e=>e(this.axios,this.basePath))}listSubscriptions(...e){return Z(this.configuration).listSubscriptions(...e).then(e=>e(this.axios,this.basePath))}placeSimpleOrder(...e){return Z(this.configuration).placeSimpleOrder(...e).then(e=>e(this.axios,this.basePath))}},Qr=class extends Zr{};let $r=function(e){return{getStats:async(t,n={})=>{let r=`/management/stats`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.currency=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/management/stats`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},getStatsLegacy:async(t,n={})=>{let r=`/snapTrade/stats`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.currency=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/stats`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}}}},ei=function(e){let t=$r(e);return{async getStats(...n){let[r={},i]=n;return K(await t.getStats(r.currency,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getStatsLegacy(...n){let[r={},i]=n;return K(await t.getStatsLegacy(r.currency,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},ti=function(e,t,n){let r=ei(e);return{getStats(...e){return r.getStats(...e).then(e=>e(n,t))},getStatsLegacy(...e){return r.getStatsLegacy(...e).then(e=>e(n,t))}}};var ni=class extends R{getStats(...e){return ei(this.configuration).getStats(...e).then(e=>e(this.axios,this.basePath))}getStatsLegacy(...e){return ei(this.configuration).getStatsLegacy(...e).then(e=>e(this.axios,this.basePath))}},ri=class extends ni{};let ii=function(e){return{getPartnerInfo:async(t={})=>{let n=`/snapTrade/partners`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(o,e);let c={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/partners`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},getStockExchanges:async(t={})=>{let n=`/exchanges`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(o,e);let c={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/exchanges`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},getSymbols:async(t,n={})=>{let r=`/symbols`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(s,e);let l={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},getSymbolsByTicker:async(t,n={})=>{B(`getSymbolsByTicker`,`query`,t);let r=`/symbols/{query}`.replace(`{query}`,encodeURIComponent(String(t===void 0?`-query-`:t))),i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(s,e);let l={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols/{query}`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listAllBrokerageAuthorizationType:async(t,n={})=>{let r=`/brokerageAuthorizationTypes`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.brokerage=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerageAuthorizationTypes`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listAllBrokerageInstruments:async(t,n={})=>{B(`listAllBrokerageInstruments`,`slug`,t);let r=`/brokerages/{slug}/instruments`.replace(`{slug}`,encodeURIComponent(String(t===void 0?`-slug-`:t))),i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(s,e);let l={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerages/{slug}/instruments`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listAllBrokerages:async(t={})=>{let n=`/brokerages`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(o,e);let c={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/brokerages`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},listInstitutions:async(t={})=>{let n=`/institutions`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={},c={authModes:[`public`],selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/institutions`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},symbolSearchUserAccount:async(t,n,r,i,a={})=>{B(`symbolSearchUserAccount`,`accountId`,t);let o=`/accounts/{accountId}/symbols`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/symbols`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}}}},Q=function(e){let t=ii(e);return{async getPartnerInfo(...n){let[r]=n;return K(await t.getPartnerInfo(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getStockExchanges(...n){let[r]=n;return K(await t.getStockExchanges(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getSymbols(...n){let[r={},i]=n,a={substring:r.substring};return K(await t.getSymbols(a,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getSymbolsByTicker(...n){let[r={},i]=n;return K(await t.getSymbolsByTicker(r.query,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerageAuthorizationType(...n){let[r={},i]=n;return K(await t.listAllBrokerageAuthorizationType(r.brokerage,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerageInstruments(...n){let[r={},i]=n;return K(await t.listAllBrokerageInstruments(r.slug,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerages(...n){let[r]=n;return K(await t.listAllBrokerages(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listInstitutions(n){return K(await t.listInstitutions(n),I,L,e,{authModes:[`public`]})},async symbolSearchUserAccount(...n){let[r={},i]=n,a={substring:r.substring};return K(await t.symbolSearchUserAccount(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},ai=function(e,t,n){let r=Q(e);return{getPartnerInfo(...e){return r.getPartnerInfo(...e).then(e=>e(n,t))},getStockExchanges(...e){return r.getStockExchanges(...e).then(e=>e(n,t))},getSymbols(...e){return r.getSymbols(...e).then(e=>e(n,t))},getSymbolsByTicker(...e){return r.getSymbolsByTicker(...e).then(e=>e(n,t))},listAllBrokerageAuthorizationType(...e){return r.listAllBrokerageAuthorizationType(...e).then(e=>e(n,t))},listAllBrokerageInstruments(...e){return r.listAllBrokerageInstruments(...e).then(e=>e(n,t))},listAllBrokerages(...e){return r.listAllBrokerages(...e).then(e=>e(n,t))},listInstitutions(e){return r.listInstitutions(e).then(e=>e(n,t))},symbolSearchUserAccount(...e){return r.symbolSearchUserAccount(...e).then(e=>e(n,t))}}};var oi=class extends R{getPartnerInfo(...e){return Q(this.configuration).getPartnerInfo(...e).then(e=>e(this.axios,this.basePath))}getStockExchanges(...e){return Q(this.configuration).getStockExchanges(...e).then(e=>e(this.axios,this.basePath))}getSymbols(...e){return Q(this.configuration).getSymbols(...e).then(e=>e(this.axios,this.basePath))}getSymbolsByTicker(...e){return Q(this.configuration).getSymbolsByTicker(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerageAuthorizationType(...e){return Q(this.configuration).listAllBrokerageAuthorizationType(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerageInstruments(...e){return Q(this.configuration).listAllBrokerageInstruments(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerages(...e){return Q(this.configuration).listAllBrokerages(...e).then(e=>e(this.axios,this.basePath))}listInstitutions(e){return Q(this.configuration).listInstitutions(e).then(e=>e(this.axios,this.basePath))}symbolSearchUserAccount(...e){return Q(this.configuration).symbolSearchUserAccount(...e).then(e=>e(this.axios,this.basePath))}},si=class extends oi{};let ci=function(e){return{cancelOrder:async(t,n,r,i,a={})=>{B(`cancelOrder`,`accountId`,t),B(`cancelOrder`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/trading/cancel`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/cancel`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},getCryptocurrencyPairQuote:async(t,n,r,i,a={})=>{B(`getCryptocurrencyPairQuote`,`accountId`,t),B(`getCryptocurrencyPairQuote`,`instrumentSymbol`,n);let o=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{instrumentSymbol}`,encodeURIComponent(String(n===void 0?`-instrumentSymbol-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getOptionImpact:async(t,n,r,i,a={})=>{B(`getOptionImpact`,`accountId`,t),B(`getOptionImpact`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options/impact`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options/impact`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},getOrderImpact:async(t,n,r,i={})=>{B(`getOrderImpact`,`manualTradeForm`,t);let a=`/trade/impact`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/impact`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},getUserAccountOptionQuotes:async(t,n,r,i,a={})=>{B(`getUserAccountOptionQuotes`,`accountId`,t),B(`getUserAccountOptionQuotes`,`symbol`,n);let o=`/accounts/{accountId}/quotes/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.symbol=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/quotes/options`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountQuotes:async(t,n,r,i,a,o={})=>{B(`getUserAccountQuotes`,`symbols`,t),B(`getUserAccountQuotes`,`accountId`,n);let s=`/accounts/{accountId}/quotes`.replace(`{accountId}`,encodeURIComponent(String(n===void 0?`-accountId-`:n))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),t!==void 0&&(f.symbols=t),r!==void 0&&(f.use_ticker=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/quotes`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},placeComplexOrder:async(t,n,r,i,a={})=>{B(`placeComplexOrder`,`accountId`,t),B(`placeComplexOrder`,`manualTradeFormComplex`,n);let o=`/accounts/{accountId}/trading/complex`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/complex`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},placeCryptoOrder:async(t,n,r,i,a={})=>{B(`placeCryptoOrder`,`accountId`,t),B(`placeCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},placeForceOrder:async(t,n,r,i={})=>{B(`placeForceOrder`,`manualTradeFormWithOptions`,t);let a=`/trade/place`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/place`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},placeMlegOrder:async(t,n,r,i,a={})=>{B(`placeMlegOrder`,`accountId`,t),B(`placeMlegOrder`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},placeOrder:async(t,n,r,i,a={})=>{B(`placeOrder`,`tradeId`,t);let o=`/trade/{tradeId}`.replace(`{tradeId}`,encodeURIComponent(String(t===void 0?`-tradeId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/trade/{tradeId}`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},previewCryptoOrder:async(t,n,r,i,a={})=>{B(`previewCryptoOrder`,`accountId`,t),B(`previewCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto/preview`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto/preview`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},replaceOrder:async(t,n,r,i,a={})=>{B(`replaceOrder`,`accountId`,t),B(`replaceOrder`,`manualTradeReplaceForm`,n);let o=`/accounts/{accountId}/trading/replace`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/replace`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},searchCryptocurrencyPairInstruments:async(t,n,r,i,a,o={})=>{B(`searchCryptocurrencyPairInstruments`,`accountId`,t);let s=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),n!==void 0&&(f.base=n),r!==void 0&&(f.quote=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}}}},$=function(e){let t=ci(e);return{async cancelOrder(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id};return K(await t.cancelOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getCryptocurrencyPairQuote(...n){let[r={},i]=n;return K(await t.getCryptocurrencyPairQuote(r.accountId,r.instrumentSymbol,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getOptionImpact(...n){let[r={},i]=n,a={order_type:r.order_type,time_in_force:r.time_in_force,limit_price:r.limit_price,stop_price:r.stop_price,price_effect:r.price_effect,legs:r.legs};return K(await t.getOptionImpact(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getOrderImpact(...n){let[r={},i]=n,a={account_id:r.account_id,action:r.action,universal_symbol_id:r.universal_symbol_id,order_type:r.order_type,time_in_force:r.time_in_force,price:r.price,stop:r.stop,units:r.units,notional_value:r.notional_value};return K(await t.getOrderImpact(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOptionQuotes(...n){let[r={},i]=n;return K(await t.getUserAccountOptionQuotes(r.accountId,r.symbol,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountQuotes(...n){let[r={},i]=n;return K(await t.getUserAccountQuotes(r.symbols,r.accountId,r.useTicker,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeComplexOrder(...n){let[r={},i]=n,a={type:r.type,orders:r.orders,client_order_id:r.client_order_id};return K(await t.placeComplexOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeCryptoOrder(...n){let[r={},i]=n,a={instrument:r.instrument,side:r.side,type:r.type,time_in_force:r.time_in_force,amount:r.amount,limit_price:r.limit_price,stop_price:r.stop_price,post_only:r.post_only,expiration_date:r.expiration_date};return K(await t.placeCryptoOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeForceOrder(...n){let[r={},i]=n,a={account_id:r.account_id,action:r.action,universal_symbol_id:r.universal_symbol_id,symbol:r.symbol,order_type:r.order_type,time_in_force:r.time_in_force,trading_session:r.trading_session,expiry_date:r.expiry_date,price:r.price,stop:r.stop,units:r.units,notional_value:r.notional_value,client_order_id:r.client_order_id};return K(await t.placeForceOrder(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeMlegOrder(...n){let[r={},i]=n,a={order_type:r.order_type,time_in_force:r.time_in_force,limit_price:r.limit_price,stop_price:r.stop_price,price_effect:r.price_effect,legs:r.legs};return K(await t.placeMlegOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeOrder(...n){let[r={},i]=n,a={wait_to_confirm:r.wait_to_confirm};return K(await t.placeOrder(r.tradeId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async previewCryptoOrder(...n){let[r={},i]=n,a={instrument:r.instrument,side:r.side,type:r.type,time_in_force:r.time_in_force,amount:r.amount,limit_price:r.limit_price,stop_price:r.stop_price,post_only:r.post_only,expiration_date:r.expiration_date};return K(await t.previewCryptoOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async replaceOrder(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id,action:r.action,order_type:r.order_type,time_in_force:r.time_in_force,price:r.price,symbol:r.symbol,stop:r.stop,units:r.units};return K(await t.replaceOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async searchCryptocurrencyPairInstruments(...n){let[r={},i]=n;return K(await t.searchCryptocurrencyPairInstruments(r.accountId,r.base,r.quote,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},li=function(e,t,n){let r=$(e);return{cancelOrder(...e){return r.cancelOrder(...e).then(e=>e(n,t))},getCryptocurrencyPairQuote(...e){return r.getCryptocurrencyPairQuote(...e).then(e=>e(n,t))},getOptionImpact(...e){return r.getOptionImpact(...e).then(e=>e(n,t))},getOrderImpact(...e){return r.getOrderImpact(...e).then(e=>e(n,t))},getUserAccountOptionQuotes(...e){return r.getUserAccountOptionQuotes(...e).then(e=>e(n,t))},getUserAccountQuotes(...e){return r.getUserAccountQuotes(...e).then(e=>e(n,t))},placeComplexOrder(...e){return r.placeComplexOrder(...e).then(e=>e(n,t))},placeCryptoOrder(...e){return r.placeCryptoOrder(...e).then(e=>e(n,t))},placeForceOrder(...e){return r.placeForceOrder(...e).then(e=>e(n,t))},placeMlegOrder(...e){return r.placeMlegOrder(...e).then(e=>e(n,t))},placeOrder(...e){return r.placeOrder(...e).then(e=>e(n,t))},previewCryptoOrder(...e){return r.previewCryptoOrder(...e).then(e=>e(n,t))},replaceOrder(...e){return r.replaceOrder(...e).then(e=>e(n,t))},searchCryptocurrencyPairInstruments(...e){return r.searchCryptocurrencyPairInstruments(...e).then(e=>e(n,t))}}};var ui=class extends R{cancelOrder(...e){return $(this.configuration).cancelOrder(...e).then(e=>e(this.axios,this.basePath))}getCryptocurrencyPairQuote(...e){return $(this.configuration).getCryptocurrencyPairQuote(...e).then(e=>e(this.axios,this.basePath))}getOptionImpact(...e){return $(this.configuration).getOptionImpact(...e).then(e=>e(this.axios,this.basePath))}getOrderImpact(...e){return $(this.configuration).getOrderImpact(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOptionQuotes(...e){return $(this.configuration).getUserAccountOptionQuotes(...e).then(e=>e(this.axios,this.basePath))}getUserAccountQuotes(...e){return $(this.configuration).getUserAccountQuotes(...e).then(e=>e(this.axios,this.basePath))}placeComplexOrder(...e){return $(this.configuration).placeComplexOrder(...e).then(e=>e(this.axios,this.basePath))}placeCryptoOrder(...e){return $(this.configuration).placeCryptoOrder(...e).then(e=>e(this.axios,this.basePath))}placeForceOrder(...e){return $(this.configuration).placeForceOrder(...e).then(e=>e(this.axios,this.basePath))}placeMlegOrder(...e){return $(this.configuration).placeMlegOrder(...e).then(e=>e(this.axios,this.basePath))}placeOrder(...e){return $(this.configuration).placeOrder(...e).then(e=>e(this.axios,this.basePath))}previewCryptoOrder(...e){return $(this.configuration).previewCryptoOrder(...e).then(e=>e(this.axios,this.basePath))}replaceOrder(...e){return $(this.configuration).replaceOrder(...e).then(e=>e(this.axios,this.basePath))}searchCryptocurrencyPairInstruments(...e){return $(this.configuration).searchCryptocurrencyPairInstruments(...e).then(e=>e(this.axios,this.basePath))}},di=class extends ui{},fi=class e{constructor(e){this.mode=`commercialApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},pi=class e{constructor(e){this.mode=`personalApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},mi=class e{constructor(e){this.mode=`oauth`,this.accessToken=e.accessToken}static create(t){return new e(t)}},hi=class{constructor(){}static commercialApiKey(e){return fi.create(e)}static personalApiKey(e){return pi.create(e)}static oauth(e){return mi.create(e)}},gi=class{constructor(e){this.authMode=e.auth.mode,this.apiKey={},e.auth.mode===`commercialApiKey`&&(this.consumerKey=e.auth.consumerKey,e.auth.clientId!==void 0&&(this.apiKey.clientId=e.auth.clientId)),e.auth.mode===`personalApiKey`&&(this.consumerKey=e.auth.consumerKey,e.auth.clientId!==void 0&&(this.apiKey.clientId=e.auth.clientId)),e.auth.mode===`oauth`&&(this.accessToken=e.auth.accessToken),this.basePath=e.basePath,this.baseOptions=e.baseOptions??{},this.userAgent=e.userAgent===void 0?`Konfig/13.2.4/typescript`:e.userAgent,this.formDataCtor=e.formDataCtor}isJsonMime(e){return e!==null&&(RegExp(`^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$`,`i`).test(e)||e.toLowerCase()===`application/json-patch+json`)}},_i=class{constructor(e){}},vi=class extends _i{constructor(e){super(e);let t=new gi(e);this.accountInformation=new Pr(t),this.apiStatus=new zr(t),this.authentication=new Wr(t),this.connections=new Jr(t),this.experimentalEndpoints=new Qr(t),this.management=new ri(t),this.referenceData=new si(t),this.trading=new di(t)}};let yi=()=>Error(`Device authorization expired. Start a new authorization.`),bi=()=>Object.assign(Error(`Device authorization cancelled.`),{name:`AbortError`}),xi=(e,t)=>new Promise((n,r)=>{if(t.aborted){r(bi());return}let i=()=>{clearTimeout(a),t.removeEventListener(`abort`,i),r(bi())},a=setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);t.addEventListener(`abort`,i,{once:!0})});var Si=class{constructor(e={}){this.issuer=(e.issuer??new URL(L).origin).replace(/\/+$/,``),this.http=e.axios??I}async startDeviceAuthorization(e){let t=Date.now(),{data:n}=await this.http.post(`${this.issuer}/oauth/device_authorization/`,new URLSearchParams({client_id:e.clientId,scope:`read`}).toString(),{headers:{"Content-Type":`application/x-www-form-urlencoded`},signal:e.signal});if(typeof n.device_code!=`string`||!n.device_code||typeof n.user_code!=`string`||!n.user_code||typeof n.verification_uri!=`string`||!n.verification_uri||!Number.isFinite(n.expires_in)||n.expires_in<=0||n.interval!==void 0&&(!Number.isFinite(n.interval)||n.interval<=0))throw Error(`Invalid device authorization response.`);return{deviceCode:n.device_code,userCode:n.user_code,verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,expiresAt:t+n.expires_in*1e3,interval:n.interval??5}}async waitForDeviceToken(e){let{authorization:t,signal:n}=e;if(n?.aborted)throw bi();let r=t.expiresAt-Date.now();if(!Number.isFinite(r)||r<=0)throw yi();if(!Number.isFinite(t.interval)||t.interval<=0)throw Error(`Invalid polling interval.`);let i=new AbortController,a=()=>i.abort();n?.addEventListener(`abort`,a,{once:!0});let o=setTimeout(a,Math.min(r,2147483647)),s=t.interval*1e3;try{for(;;){if(await xi(Math.min(s,Math.max(0,t.expiresAt-Date.now())),i.signal),Date.now()>=t.expiresAt)throw yi();try{let{data:n}=await this.http.post(`${this.issuer}/oauth/token/`,new URLSearchParams({client_id:e.clientId,device_code:t.deviceCode,grant_type:`urn:ietf:params:oauth:grant-type:device_code`}).toString(),{headers:{"Content-Type":`application/x-www-form-urlencoded`},signal:i.signal,timeout:Math.min(3e4,Math.max(1,t.expiresAt-Date.now()))});if(typeof n.access_token!=`string`||!n.access_token)throw Error(`OAuth response is missing access_token.`);return{accessToken:n.access_token,refreshToken:n.refresh_token,tokenType:n.token_type,expiresIn:n.expires_in,scope:n.scope}}catch(e){let t=e,n=t.response?.data?.error;if(n===`authorization_pending`)continue;if(n===`slow_down`){s+=5e3;continue}if(t.code===`ECONNABORTED`||t.code===`ETIMEDOUT`){s*=2;continue}throw e}}}catch(e){throw n?.aborted?bi():i.signal.aborted||Date.now()>=t.expiresAt?yi():e}finally{clearTimeout(o),n?.removeEventListener(`abort`,a)}}};e.AccountInformationApi=Pr,e.AccountInformationApiAxiosParamCreator=jr,e.AccountInformationApiFactory=Mr,e.AccountInformationApiFp=Y,e.AccountInformationApiGenerated=Nr,e.ApiStatusApi=zr,e.ApiStatusApiAxiosParamCreator=Fr,e.ApiStatusApiFactory=Lr,e.ApiStatusApiFp=Ir,e.ApiStatusApiGenerated=Rr,e.AuthenticationApi=Wr,e.AuthenticationApiAxiosParamCreator=Br,e.AuthenticationApiFactory=Hr,e.AuthenticationApiFp=Vr,e.AuthenticationApiGenerated=Ur,e.CommercialApiKeyAuth=fi,e.Configuration=gi,e.ConnectionsApi=Jr,e.ConnectionsApiAxiosParamCreator=Gr,e.ConnectionsApiFactory=Kr,e.ConnectionsApiFp=X,e.ConnectionsApiGenerated=qr,e.ExperimentalEndpointsApi=Qr,e.ExperimentalEndpointsApiAxiosParamCreator=Yr,e.ExperimentalEndpointsApiFactory=Xr,e.ExperimentalEndpointsApiFp=Z,e.ExperimentalEndpointsApiGenerated=Zr,e.ManagementApi=ri,e.ManagementApiAxiosParamCreator=$r,e.ManagementApiFactory=ti,e.ManagementApiFp=ei,e.ManagementApiGenerated=ni,e.OAuthAuth=mi,e.PersonalApiKeyAuth=pi,e.ReferenceDataApi=si,e.ReferenceDataApiAxiosParamCreator=ii,e.ReferenceDataApiFactory=ai,e.ReferenceDataApiFp=Q,e.ReferenceDataApiGenerated=oi,e.Snaptrade=vi,e.SnaptradeAuth=hi,e.SnaptradeError=Tr,e.SnaptradeOAuthDevice=Si,e.TradingApi=di,e.TradingApiAxiosParamCreator=ci,e.TradingApiFactory=li,e.TradingApiFp=$,e.TradingApiGenerated=ui,e.parseIfJson=Dr,e.readableStreamToString=Er});