snaptrade-typescript-sdk 12.2.19 → 12.2.20

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.
package/README.md CHANGED
@@ -63,7 +63,7 @@ backoff with jitter rather than from the headers.
63
63
  See https://docs.snaptrade.com/docs/ratelimiting.
64
64
 
65
65
 
66
- [![npm](https://img.shields.io/badge/npm-v12.2.19-blue)](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/12.2.19)
66
+ [![npm](https://img.shields.io/badge/npm-v12.2.20-blue)](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/12.2.20)
67
67
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
68
68
 
69
69
  </div>
@@ -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=I(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&cr.assertOptions(n,{silentJSONParsing:L.transitional(L.boolean),forcedJSONParsing:L.transitional(L.boolean),clarifyTimeoutError:L.transitional(L.boolean),legacyInterceptorReqResOrdering:L.transitional(L.boolean),advertiseZstdAcceptEncoding:L.transitional(L.boolean),validateStatusUndefinedResolves:L.transitional(L.boolean)},!1),r!=null&&(M.isFunction(r)?t.paramsSerializer={serialize:r}:cr.assertOptions(r,{encode:L.function,serialize:L.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),cr.assertOptions(t,{baseUrl:L.spelling(`baseURL`),withXsrfToken:L.spelling(`withXSRFToken`)},!0),t.method=(M.getSafeProp(t,`method`)||M.getSafeProp(this.defaults,`method`)||`get`).toLowerCase();let a=i&&M.merge(i.common,i[t.method]);i&&M.forEach(qt.concat(`common`),e=>{delete i[e]}),t.headers=N.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||Pt;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=[ir.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);M.isThenable(n)&&(l=Promise.resolve(n).then(()=>ir.call(this,f)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=ir.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=I(this.defaults,e),Ot(vn(e.baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};M.forEach([`delete`,`get`,`head`,`options`],function(e){lr.prototype[e]=function(t,n){return this.request(I(n||{},{method:e,url:t,data:n&&M.hasOwnProp(n,`data`)?n.data:void 0}))}}),M.forEach([`post`,`put`,`patch`,`query`],function(e){function t(t){return function(n,r,i){return this.request(I(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}lr.prototype[e]=t(),e!==`query`&&(lr.prototype[e+`Form`]=t(!0))});var ur=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 $t(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 dr(e){return function(t){return e.apply(null,t)}}function fr(e){return M.isObject(e)&&e.isAxiosError===!0}let pr={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(pr).forEach(([e,t])=>{pr[t]===void 0&&(pr[t]=e)});function mr(e){let t=new lr(e),n=r(lr.prototype.request,t);return M.extend(n,lr.prototype,t,{allOwnKeys:!0}),M.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return mr(I(e,t))},n}let R=mr(Xt);R.Axios=lr,R.CanceledError=$t,R.CancelToken=ur,R.isCancel=Qt,R.VERSION=Vn,R.toFormData=Ct,R.AxiosError=P,R.Cancel=R.CanceledError,R.all=function(e){return Promise.all(e)},R.spread=dr,R.isAxiosError=fr,R.mergeConfig=I,R.AxiosHeaders=N,R.formToJSON=e=>Kt(M.isHTMLForm(e)?new FormData(e):e),R.getAdapter=nr.getAdapter,R.HttpStatusCode=pr,R.default=R;let z=`https://api.snaptrade.com`.replace(/\/+$/,``);var hr=class{constructor(e,t=z,n=R){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}},gr=class extends Error{constructor(e,t){super(t),this.field=e,this.name=`RequiredError`}};function _r(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 vr(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 _r(new Uint8Array(o))}let yr=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 br(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 vr(yr({content:u,path:d,query:i.replace(n,``).replace(d,``).replace(`?`,``)}),l);r.options.headers&&(r.options.headers.Signature=f)}let xr=new Set([`clientid`,`timestamp`,`userid`,`usersecret`]);function Sr(e){if(e===void 0||xr.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;xr.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 Cr(e,t,n){return t===void 0||!e.includes(t)?e:e.split(t).join(n??`[REDACTED URL]`)}var wr=class extends Error{constructor(e,t,n){let r=e.config?.url,i=Sr(r),a=Cr(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 Tr(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 Er(e){if(typeof e!=`string`)return e;try{let t=JSON.parse(e);return typeof t==`object`&&t?t:e}catch{return e}}let B=`https://example.com`,V=function(e,t,n){if(n==null)throw new gr(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},H=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]}`))};function Dr(e,t,n=``){typeof t==`object`?Array.isArray(t)?t.forEach(t=>Dr(e,t,n)):Object.keys(t).forEach(r=>Dr(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);Dr(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 Or(e.pathname)+e.search+e.hash},Or=function(e){return e.replace(/\/$/,``)};async function kr(e){let t=0,n=5e3;for(;t<3;)try{return await e()}catch(e){if(R.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 Tr(t)),r=Er(r)}catch{r=void 0}throw new wr(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 br({axiosArgs:e,basePath:o,url:s,configuration:r,operationAuth:i?{...i,selectedAuthMode:r?.authMode}:void 0}),kr(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 Ar=function(e){return{getAccountActivities:async(t,n,r,i,a,o,s,c,l={})=>{V(`getAccountActivities`,`accountId`,t);let u=`/accounts/{accountId}/activities`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),d=new URL(u,B),f;e&&(f=e.baseOptions);let p={method:`GET`,...f,...l},m=e&&!q()?{"User-Agent":e.userAgent}:{},h={};e?.authMode===`commercialApiKey`&&(await H({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),s!==void 0&&(h.userId=s),c!==void 0&&(h.userSecret=c)),e?.authMode===`personalApiKey`&&await H({object:h,key:`clientId`,keyParamName:`clientId`,configuration: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`],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={})=>{V(`getAccountBalanceHistory`,`accountId`,t);let a=`/accounts/{accountId}/balanceHistory`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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}/balanceHistory`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAllAccountPositions:async(t,n,r,i={})=>{V(`getAllAccountPositions`,`accountId`,t);let a=`/accounts/{accountId}/positions/all`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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}/positions/all`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountBalance:async(t,n,r,i={})=>{V(`getUserAccountBalance`,`accountId`,t);let a=`/accounts/{accountId}/balances`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountDetails:async(t,n,r,i={})=>{V(`getUserAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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}`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountOrderDetail:async(t,n,r,i,a={})=>{V(`getUserAccountOrderDetail`,`accountId`,t),V(`getUserAccountOrderDetail`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/orders/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`getUserAccountOrders`,`accountId`,t);let s=`/accounts/{accountId}/orders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,B),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await H({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await H({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`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountRecentOrders:async(t,n,r,i,a={})=>{V(`getUserAccountRecentOrders`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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}/recentOrders`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountReturnRates:async(t,n,r,i,a={})=>{V(`getUserAccountReturnRates`,`accountId`,t);let o=`/accounts/{accountId}/returnRates`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`getUserHoldings`,`accountId`,t);let a=`/accounts/{accountId}/holdings`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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}/holdings`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listUserAccounts:async(t,n,r={})=>{let i=`/accounts`,a=new URL(i,B),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await H({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await H({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e});let u={authModes:[`commercialApiKey`,`personalApiKey`],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={})=>{V(`updateUserAccount`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`PUT`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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}`,httpMethod:`PUT`,operationAuth:d}),U(o,u),{url:G(o),options:c}}}},Y=function(e){let t=Ar(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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},jr=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))},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))},listUserAccounts(...e){return r.listUserAccounts(...e).then(e=>e(n,t))},updateUserAccount(...e){return r.updateUserAccount(...e).then(e=>e(n,t))}}};var Mr=class extends hr{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))}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))}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))}},Nr=class extends Mr{};let Pr=function(e){return{check:async(t={})=>{let n=new URL(`/`,B),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}}}},Fr=function(e){let t=Pr(e);return{async check(n){return K(await t.check(n),R,z,e,{authModes:[`public`]})}}},Ir=function(e,t,n){let r=Fr(e);return{check(e){return r.check(e).then(e=>e(n,t))}}};var Lr=class extends hr{check(e){return Fr(this.configuration).check(e).then(e=>e(this.axios,this.basePath))}},Rr=class extends Lr{};let zr=function(e){return{deleteSnapTradeUser:async(t,n={})=>{let r=`/snapTrade/deleteUser`,i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`DELETE`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&(await H({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,B),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await H({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,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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/login`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},registerSnapTradeUser:async(t,n={})=>{V(`registerSnapTradeUser`,`snapTradeRegisterUserRequestBody`,t);let r=`/snapTrade/registerUser`,i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({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={})=>{V(`resetSnapTradeUserSecret`,`userIDandSecret`,t);let r=`/snapTrade/resetUserSecret`,i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({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}}}},Br=function(e){let t=zr(e);return{async deleteSnapTradeUser(...n){let[r={},i]=n;return K(await t.deleteSnapTradeUser(r.userId,i),R,z,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async listSnapTradeUsers(...n){let[r]=n;return K(await t.listSnapTradeUsers(r),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,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),R,z,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})}}},Vr=function(e,t,n){let r=Br(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 Hr=class extends hr{deleteSnapTradeUser(...e){return Br(this.configuration).deleteSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}listSnapTradeUsers(...e){return Br(this.configuration).listSnapTradeUsers(...e).then(e=>e(this.axios,this.basePath))}loginSnapTradeUser(...e){return Br(this.configuration).loginSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}registerSnapTradeUser(...e){return Br(this.configuration).registerSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}resetSnapTradeUserSecret(...e){return Br(this.configuration).resetSnapTradeUserSecret(...e).then(e=>e(this.axios,this.basePath))}},Ur=class extends Hr{};let Wr=function(e){return{deleteConnection:async(t,n,r,i={})=>{V(`deleteConnection`,`connectionId`,t);let a=`/connection/{connectionId}`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`DELETE`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`detailBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/authorizations/{authorizationId}`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},disableBrokerageAuthorization:async(t,n,r,i={})=>{V(`disableBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/disable`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/authorizations/{authorizationId}/disable`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listBrokerageAuthorizationAccounts:async(t,n,r,i={})=>{V(`listBrokerageAuthorizationAccounts`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/accounts`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/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,B),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await H({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await H({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e});let u={authModes:[`commercialApiKey`,`personalApiKey`],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={})=>{V(`listConnectionAccounts`,`connectionId`,t);let a=`/connections/{connectionId}/accounts`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/connections/{connectionId}/accounts`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},refreshBrokerageAuthorization:async(t,n,r,i={})=>{V(`refreshBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/refresh`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/authorizations/{authorizationId}/refresh`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}},returnRates:async(t,n,r,i,a={})=>{V(`returnRates`,`authorizationId`,t);let o=`/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`syncBrokerageAuthorizationTransactions`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/authorizations/{authorizationId}/transactions/sync`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}}}},X=function(e){let t=Wr(e);return{async deleteConnection(...n){let[r={},i]=n;return K(await t.deleteConnection(r.connectionId,r.userId,r.userSecret,i),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Gr=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 Kr=class extends hr{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))}},qr=class extends Kr{};let Jr=function(e){return{addSubscription:async(t,n,r,i={})=>{V(`addSubscription`,`tradeDetectionAddSubscriptionRequest`,t);let a=`/snapTrade/tradeDetection/subscriptions`,o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`cancelSubscription`,`tradeDetectionCancelSubscriptionRequest`,t);let r=`/snapTrade/tradeDetection/subscriptions/cancel`,i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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}},getAccountDetails:async(t,n,r,i={})=>{V(`getAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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}/details`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountOrderDetailV2:async(t,n,r,i,a={})=>{V(`getUserAccountOrderDetailV2`,`accountId`,t),V(`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,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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/details/v2/{brokerageOrderId}`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountOrdersV2:async(t,n,r,i,a,o={})=>{V(`getUserAccountOrdersV2`,`accountId`,t);let s=`/accounts/{accountId}/orders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,B),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await H({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await H({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/v2`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountRecentOrdersV2:async(t,n,r,i,a={})=>{V(`getUserAccountRecentOrdersV2`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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}/recentOrders/v2`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},listAllUserAccounts:async(t,n,r={})=>{let i=`/accounts/all`,a=new URL(i,B),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await H({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await H({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e});let u={authModes:[`commercialApiKey`,`personalApiKey`],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}},listSubscriptions:async(t={})=>{let n=`/snapTrade/tradeDetection/subscriptions`,r=new URL(n,B),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await H({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`placeSimpleOrder`,`accountId`,t),V(`placeSimpleOrder`,`simpleTradeForm`,n);let o=`/accounts/{accountId}/trading/simple`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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=Jr(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),R,z,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),R,z,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),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Yr=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))},getAccountDetails(...e){return r.getAccountDetails(...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))},listAllUserAccounts(...e){return r.listAllUserAccounts(...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 Xr=class extends hr{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))}getAccountDetails(...e){return Z(this.configuration).getAccountDetails(...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))}listAllUserAccounts(...e){return Z(this.configuration).listAllUserAccounts(...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))}},Zr=class extends Xr{};let Qr=function(e){return{getPartnerInfo:async(t={})=>{let n=`/snapTrade/partners`,r=new URL(n,B),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await H({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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/partners`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},getStockExchanges:async(t={})=>{let n=`/exchanges`,r=new URL(n,B),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await H({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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:`/exchanges`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},getSymbols:async(t,n={})=>{let r=`/symbols`,i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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:`/symbols`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},getSymbolsByTicker:async(t,n={})=>{V(`getSymbolsByTicker`,`query`,t);let r=`/symbols/{query}`.replace(`{query}`,encodeURIComponent(String(t===void 0?`-query-`:t))),i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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},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,B),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`listAllBrokerageInstruments`,`slug`,t);let r=`/brokerages/{slug}/instruments`.replace(`{slug}`,encodeURIComponent(String(t===void 0?`-slug-`:t))),i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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},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,B),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await H({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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:`/brokerages`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},listInstitutions:async(t={})=>{let n=`/institutions`,r=new URL(n,B),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={})=>{V(`symbolSearchUserAccount`,`accountId`,t);let o=`/accounts/{accountId}/symbols`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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=Qr(e);return{async getPartnerInfo(...n){let[r]=n;return K(await t.getPartnerInfo(r),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listInstitutions(n){return K(await t.listInstitutions(n),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},$r=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 ei=class extends hr{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))}},ti=class extends ei{};let ni=function(e){return{cancelOrder:async(t,n,r,i,a={})=>{V(`cancelOrder`,`accountId`,t),V(`cancelOrder`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/trading/cancel`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`getCryptocurrencyPairQuote`,`accountId`,t),V(`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,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getOptionImpact:async(t,n,r,i,a={})=>{V(`getOptionImpact`,`accountId`,t),V(`getOptionImpact`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options/impact`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`getOrderImpact`,`manualTradeForm`,t);let a=`/trade/impact`,o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/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={})=>{V(`getUserAccountOptionQuotes`,`accountId`,t),V(`getUserAccountOptionQuotes`,`symbol`,n);let o=`/accounts/{accountId}/quotes/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`getUserAccountQuotes`,`symbols`,t),V(`getUserAccountQuotes`,`accountId`,n);let s=`/accounts/{accountId}/quotes`.replace(`{accountId}`,encodeURIComponent(String(n===void 0?`-accountId-`:n))),c=new URL(s,B),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await H({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await H({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(f.symbols=t),r!==void 0&&(f.use_ticker=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}/quotes`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},placeComplexOrder:async(t,n,r,i,a={})=>{V(`placeComplexOrder`,`accountId`,t),V(`placeComplexOrder`,`manualTradeFormComplex`,n);let o=`/accounts/{accountId}/trading/complex`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`placeCryptoOrder`,`accountId`,t),V(`placeCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`placeForceOrder`,`manualTradeFormWithOptions`,t);let a=`/trade/place`,o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/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={})=>{V(`placeMlegOrder`,`accountId`,t),V(`placeMlegOrder`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`placeOrder`,`tradeId`,t);let o=`/trade/{tradeId}`.replace(`{tradeId}`,encodeURIComponent(String(t===void 0?`-tradeId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`previewCryptoOrder`,`accountId`,t),V(`previewCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto/preview`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`replaceOrder`,`accountId`,t),V(`replaceOrder`,`manualTradeReplaceForm`,n);let o=`/accounts/{accountId}/trading/replace`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`searchCryptocurrencyPairInstruments`,`accountId`,t);let s=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,B),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await H({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await H({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(f.base=n),r!==void 0&&(f.quote=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}/trading/instruments/cryptocurrencyPairs`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}}}},$=function(e){let t=ni(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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},ri=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 ii=class extends hr{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))}},ai=class extends ii{},oi=class e{constructor(e){this.mode=`commercialApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},si=class e{constructor(e){this.mode=`personalApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},ci=class{constructor(){}static commercialApiKey(e){return oi.create(e)}static personalApiKey(e){return si.create(e)}},li=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)),this.basePath=e.basePath,this.baseOptions=e.baseOptions??{},this.userAgent=e.userAgent===void 0?`Konfig/12.2.19/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`)}},ui=class{constructor(e){}},di=class extends ui{constructor(e){super(e);let t=new li(e);this.accountInformation=new Nr(t),this.apiStatus=new Rr(t),this.authentication=new Ur(t),this.connections=new qr(t),this.experimentalEndpoints=new Zr(t),this.referenceData=new ti(t),this.trading=new ai(t)}};e.AccountInformationApi=Nr,e.AccountInformationApiAxiosParamCreator=Ar,e.AccountInformationApiFactory=jr,e.AccountInformationApiFp=Y,e.AccountInformationApiGenerated=Mr,e.ApiStatusApi=Rr,e.ApiStatusApiAxiosParamCreator=Pr,e.ApiStatusApiFactory=Ir,e.ApiStatusApiFp=Fr,e.ApiStatusApiGenerated=Lr,e.AuthenticationApi=Ur,e.AuthenticationApiAxiosParamCreator=zr,e.AuthenticationApiFactory=Vr,e.AuthenticationApiFp=Br,e.AuthenticationApiGenerated=Hr,e.CommercialApiKeyAuth=oi,e.Configuration=li,e.ConnectionsApi=qr,e.ConnectionsApiAxiosParamCreator=Wr,e.ConnectionsApiFactory=Gr,e.ConnectionsApiFp=X,e.ConnectionsApiGenerated=Kr,e.ExperimentalEndpointsApi=Zr,e.ExperimentalEndpointsApiAxiosParamCreator=Jr,e.ExperimentalEndpointsApiFactory=Yr,e.ExperimentalEndpointsApiFp=Z,e.ExperimentalEndpointsApiGenerated=Xr,e.PersonalApiKeyAuth=si,e.ReferenceDataApi=ti,e.ReferenceDataApiAxiosParamCreator=Qr,e.ReferenceDataApiFactory=$r,e.ReferenceDataApiFp=Q,e.ReferenceDataApiGenerated=ei,e.Snaptrade=di,e.SnaptradeAuth=ci,e.SnaptradeError=wr,e.TradingApi=ai,e.TradingApiAxiosParamCreator=ni,e.TradingApiFactory=ri,e.TradingApiFp=$,e.TradingApiGenerated=ii,e.parseIfJson=Er,e.readableStreamToString=Tr});
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 Tr(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 Er(e){if(typeof e!=`string`)return e;try{let t=JSON.parse(e);return typeof t==`object`&&t?t:e}catch{return e}}let B=`https://example.com`,V=function(e,t,n){if(n==null)throw new gr(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},H=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]}`))};function Dr(e,t,n=``){typeof t==`object`?Array.isArray(t)?t.forEach(t=>Dr(e,t,n)):Object.keys(t).forEach(r=>Dr(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);Dr(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 Or(e.pathname)+e.search+e.hash},Or=function(e){return e.replace(/\/$/,``)};async function kr(e){let t=0,n=5e3;for(;t<3;)try{return await e()}catch(e){if(R.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 Tr(t)),r=Er(r)}catch{r=void 0}throw new wr(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 br({axiosArgs:e,basePath:o,url:s,configuration:r,operationAuth:i?{...i,selectedAuthMode:r?.authMode}:void 0}),kr(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 Ar=function(e){return{getAccountActivities:async(t,n,r,i,a,o,s,c,l={})=>{V(`getAccountActivities`,`accountId`,t);let u=`/accounts/{accountId}/activities`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),d=new URL(u,B),f;e&&(f=e.baseOptions);let p={method:`GET`,...f,...l},m=e&&!q()?{"User-Agent":e.userAgent}:{},h={};e?.authMode===`commercialApiKey`&&(await H({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),s!==void 0&&(h.userId=s),c!==void 0&&(h.userSecret=c)),e?.authMode===`personalApiKey`&&await H({object:h,key:`clientId`,keyParamName:`clientId`,configuration: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`],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={})=>{V(`getAccountBalanceHistory`,`accountId`,t);let a=`/accounts/{accountId}/balanceHistory`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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}/balanceHistory`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAllAccountPositions:async(t,n,r,i={})=>{V(`getAllAccountPositions`,`accountId`,t);let a=`/accounts/{accountId}/positions/all`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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}/positions/all`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountBalance:async(t,n,r,i={})=>{V(`getUserAccountBalance`,`accountId`,t);let a=`/accounts/{accountId}/balances`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountDetails:async(t,n,r,i={})=>{V(`getUserAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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}`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountOrderDetail:async(t,n,r,i,a={})=>{V(`getUserAccountOrderDetail`,`accountId`,t),V(`getUserAccountOrderDetail`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/orders/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`getUserAccountOrders`,`accountId`,t);let s=`/accounts/{accountId}/orders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,B),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await H({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await H({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`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountRecentOrders:async(t,n,r,i,a={})=>{V(`getUserAccountRecentOrders`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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}/recentOrders`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountReturnRates:async(t,n,r,i,a={})=>{V(`getUserAccountReturnRates`,`accountId`,t);let o=`/accounts/{accountId}/returnRates`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`getUserHoldings`,`accountId`,t);let a=`/accounts/{accountId}/holdings`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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}/holdings`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listUserAccounts:async(t,n,r={})=>{let i=`/accounts`,a=new URL(i,B),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await H({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await H({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e});let u={authModes:[`commercialApiKey`,`personalApiKey`],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={})=>{V(`updateUserAccount`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`PUT`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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}`,httpMethod:`PUT`,operationAuth:d}),U(o,u),{url:G(o),options:c}}}},Y=function(e){let t=Ar(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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},jr=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))},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))},listUserAccounts(...e){return r.listUserAccounts(...e).then(e=>e(n,t))},updateUserAccount(...e){return r.updateUserAccount(...e).then(e=>e(n,t))}}};var Mr=class extends hr{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))}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))}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))}},Nr=class extends Mr{};let Pr=function(e){return{check:async(t={})=>{let n=new URL(`/`,B),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}}}},Fr=function(e){let t=Pr(e);return{async check(n){return K(await t.check(n),R,z,e,{authModes:[`public`]})}}},Ir=function(e,t,n){let r=Fr(e);return{check(e){return r.check(e).then(e=>e(n,t))}}};var Lr=class extends hr{check(e){return Fr(this.configuration).check(e).then(e=>e(this.axios,this.basePath))}},Rr=class extends Lr{};let zr=function(e){return{deleteSnapTradeUser:async(t,n={})=>{let r=`/snapTrade/deleteUser`,i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`DELETE`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&(await H({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,B),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await H({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,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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/login`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},registerSnapTradeUser:async(t,n={})=>{V(`registerSnapTradeUser`,`snapTradeRegisterUserRequestBody`,t);let r=`/snapTrade/registerUser`,i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({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={})=>{V(`resetSnapTradeUserSecret`,`userIDandSecret`,t);let r=`/snapTrade/resetUserSecret`,i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({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}}}},Br=function(e){let t=zr(e);return{async deleteSnapTradeUser(...n){let[r={},i]=n;return K(await t.deleteSnapTradeUser(r.userId,i),R,z,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async listSnapTradeUsers(...n){let[r]=n;return K(await t.listSnapTradeUsers(r),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,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),R,z,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})}}},Vr=function(e,t,n){let r=Br(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 Hr=class extends hr{deleteSnapTradeUser(...e){return Br(this.configuration).deleteSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}listSnapTradeUsers(...e){return Br(this.configuration).listSnapTradeUsers(...e).then(e=>e(this.axios,this.basePath))}loginSnapTradeUser(...e){return Br(this.configuration).loginSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}registerSnapTradeUser(...e){return Br(this.configuration).registerSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}resetSnapTradeUserSecret(...e){return Br(this.configuration).resetSnapTradeUserSecret(...e).then(e=>e(this.axios,this.basePath))}},Ur=class extends Hr{};let Wr=function(e){return{deleteConnection:async(t,n,r,i={})=>{V(`deleteConnection`,`connectionId`,t);let a=`/connection/{connectionId}`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`DELETE`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`detailBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/authorizations/{authorizationId}`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},disableBrokerageAuthorization:async(t,n,r,i={})=>{V(`disableBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/disable`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/authorizations/{authorizationId}/disable`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listBrokerageAuthorizationAccounts:async(t,n,r,i={})=>{V(`listBrokerageAuthorizationAccounts`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/accounts`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/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,B),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await H({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await H({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e});let u={authModes:[`commercialApiKey`,`personalApiKey`],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={})=>{V(`listConnectionAccounts`,`connectionId`,t);let a=`/connections/{connectionId}/accounts`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/connections/{connectionId}/accounts`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},refreshBrokerageAuthorization:async(t,n,r,i={})=>{V(`refreshBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/refresh`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/authorizations/{authorizationId}/refresh`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}},returnRates:async(t,n,r,i,a={})=>{V(`returnRates`,`authorizationId`,t);let o=`/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`syncBrokerageAuthorizationTransactions`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/authorizations/{authorizationId}/transactions/sync`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}}}},X=function(e){let t=Wr(e);return{async deleteConnection(...n){let[r={},i]=n;return K(await t.deleteConnection(r.connectionId,r.userId,r.userSecret,i),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Gr=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 Kr=class extends hr{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))}},qr=class extends Kr{};let Jr=function(e){return{addSubscription:async(t,n,r,i={})=>{V(`addSubscription`,`tradeDetectionAddSubscriptionRequest`,t);let a=`/snapTrade/tradeDetection/subscriptions`,o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`cancelSubscription`,`tradeDetectionCancelSubscriptionRequest`,t);let r=`/snapTrade/tradeDetection/subscriptions/cancel`,i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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}},getAccountDetails:async(t,n,r,i={})=>{V(`getAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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}/details`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountOrderDetailV2:async(t,n,r,i,a={})=>{V(`getUserAccountOrderDetailV2`,`accountId`,t),V(`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,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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/details/v2/{brokerageOrderId}`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountOrdersV2:async(t,n,r,i,a,o={})=>{V(`getUserAccountOrdersV2`,`accountId`,t);let s=`/accounts/{accountId}/orders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,B),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await H({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await H({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/v2`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountRecentOrdersV2:async(t,n,r,i,a={})=>{V(`getUserAccountRecentOrdersV2`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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}/recentOrders/v2`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},listAllUserAccounts:async(t,n,r={})=>{let i=`/accounts/all`,a=new URL(i,B),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await H({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await H({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e});let u={authModes:[`commercialApiKey`,`personalApiKey`],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}},listSubscriptions:async(t={})=>{let n=`/snapTrade/tradeDetection/subscriptions`,r=new URL(n,B),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await H({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`placeSimpleOrder`,`accountId`,t),V(`placeSimpleOrder`,`simpleTradeForm`,n);let o=`/accounts/{accountId}/trading/simple`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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=Jr(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),R,z,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),R,z,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),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Yr=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))},getAccountDetails(...e){return r.getAccountDetails(...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))},listAllUserAccounts(...e){return r.listAllUserAccounts(...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 Xr=class extends hr{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))}getAccountDetails(...e){return Z(this.configuration).getAccountDetails(...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))}listAllUserAccounts(...e){return Z(this.configuration).listAllUserAccounts(...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))}},Zr=class extends Xr{};let Qr=function(e){return{getPartnerInfo:async(t={})=>{let n=`/snapTrade/partners`,r=new URL(n,B),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await H({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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/partners`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},getStockExchanges:async(t={})=>{let n=`/exchanges`,r=new URL(n,B),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await H({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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:`/exchanges`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},getSymbols:async(t,n={})=>{let r=`/symbols`,i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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:`/symbols`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},getSymbolsByTicker:async(t,n={})=>{V(`getSymbolsByTicker`,`query`,t);let r=`/symbols/{query}`.replace(`{query}`,encodeURIComponent(String(t===void 0?`-query-`:t))),i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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},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,B),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`listAllBrokerageInstruments`,`slug`,t);let r=`/brokerages/{slug}/instruments`.replace(`{slug}`,encodeURIComponent(String(t===void 0?`-slug-`:t))),i=new URL(r,B),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await H({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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},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,B),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await H({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await H({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:`/brokerages`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},listInstitutions:async(t={})=>{let n=`/institutions`,r=new URL(n,B),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={})=>{V(`symbolSearchUserAccount`,`accountId`,t);let o=`/accounts/{accountId}/symbols`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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=Qr(e);return{async getPartnerInfo(...n){let[r]=n;return K(await t.getPartnerInfo(r),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listInstitutions(n){return K(await t.listInstitutions(n),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},$r=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 ei=class extends hr{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))}},ti=class extends ei{};let ni=function(e){return{cancelOrder:async(t,n,r,i,a={})=>{V(`cancelOrder`,`accountId`,t),V(`cancelOrder`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/trading/cancel`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`getCryptocurrencyPairQuote`,`accountId`,t),V(`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,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getOptionImpact:async(t,n,r,i,a={})=>{V(`getOptionImpact`,`accountId`,t),V(`getOptionImpact`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options/impact`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`getOrderImpact`,`manualTradeForm`,t);let a=`/trade/impact`,o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/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={})=>{V(`getUserAccountOptionQuotes`,`accountId`,t),V(`getUserAccountOptionQuotes`,`symbol`,n);let o=`/accounts/{accountId}/quotes/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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={})=>{V(`getUserAccountQuotes`,`symbols`,t),V(`getUserAccountQuotes`,`accountId`,n);let s=`/accounts/{accountId}/quotes`.replace(`{accountId}`,encodeURIComponent(String(n===void 0?`-accountId-`:n))),c=new URL(s,B),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await H({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await H({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(f.symbols=t),r!==void 0&&(f.use_ticker=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}/quotes`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},placeComplexOrder:async(t,n,r,i,a={})=>{V(`placeComplexOrder`,`accountId`,t),V(`placeComplexOrder`,`manualTradeFormComplex`,n);let o=`/accounts/{accountId}/trading/complex`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`placeCryptoOrder`,`accountId`,t),V(`placeCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`placeForceOrder`,`manualTradeFormWithOptions`,t);let a=`/trade/place`,o=new URL(a,B),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await H({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await H({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:`/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={})=>{V(`placeMlegOrder`,`accountId`,t),V(`placeMlegOrder`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`placeOrder`,`tradeId`,t);let o=`/trade/{tradeId}`.replace(`{tradeId}`,encodeURIComponent(String(t===void 0?`-tradeId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`previewCryptoOrder`,`accountId`,t),V(`previewCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto/preview`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`replaceOrder`,`accountId`,t),V(`replaceOrder`,`manualTradeReplaceForm`,n);let o=`/accounts/{accountId}/trading/replace`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,B),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await H({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await H({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};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={})=>{V(`searchCryptocurrencyPairInstruments`,`accountId`,t);let s=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,B),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await H({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await H({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(f.base=n),r!==void 0&&(f.quote=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}/trading/instruments/cryptocurrencyPairs`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}}}},$=function(e){let t=ni(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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],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),R,z,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},ri=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 ii=class extends hr{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))}},ai=class extends ii{},oi=class e{constructor(e){this.mode=`commercialApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},si=class e{constructor(e){this.mode=`personalApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},ci=class{constructor(){}static commercialApiKey(e){return oi.create(e)}static personalApiKey(e){return si.create(e)}},li=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)),this.basePath=e.basePath,this.baseOptions=e.baseOptions??{},this.userAgent=e.userAgent===void 0?`Konfig/12.2.20/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`)}},ui=class{constructor(e){}},di=class extends ui{constructor(e){super(e);let t=new li(e);this.accountInformation=new Nr(t),this.apiStatus=new Rr(t),this.authentication=new Ur(t),this.connections=new qr(t),this.experimentalEndpoints=new Zr(t),this.referenceData=new ti(t),this.trading=new ai(t)}};e.AccountInformationApi=Nr,e.AccountInformationApiAxiosParamCreator=Ar,e.AccountInformationApiFactory=jr,e.AccountInformationApiFp=Y,e.AccountInformationApiGenerated=Mr,e.ApiStatusApi=Rr,e.ApiStatusApiAxiosParamCreator=Pr,e.ApiStatusApiFactory=Ir,e.ApiStatusApiFp=Fr,e.ApiStatusApiGenerated=Lr,e.AuthenticationApi=Ur,e.AuthenticationApiAxiosParamCreator=zr,e.AuthenticationApiFactory=Vr,e.AuthenticationApiFp=Br,e.AuthenticationApiGenerated=Hr,e.CommercialApiKeyAuth=oi,e.Configuration=li,e.ConnectionsApi=qr,e.ConnectionsApiAxiosParamCreator=Wr,e.ConnectionsApiFactory=Gr,e.ConnectionsApiFp=X,e.ConnectionsApiGenerated=Kr,e.ExperimentalEndpointsApi=Zr,e.ExperimentalEndpointsApiAxiosParamCreator=Jr,e.ExperimentalEndpointsApiFactory=Yr,e.ExperimentalEndpointsApiFp=Z,e.ExperimentalEndpointsApiGenerated=Xr,e.PersonalApiKeyAuth=si,e.ReferenceDataApi=ti,e.ReferenceDataApiAxiosParamCreator=Qr,e.ReferenceDataApiFactory=$r,e.ReferenceDataApiFp=Q,e.ReferenceDataApiGenerated=ei,e.Snaptrade=di,e.SnaptradeAuth=ci,e.SnaptradeError=wr,e.TradingApi=ai,e.TradingApiAxiosParamCreator=ni,e.TradingApiFactory=ri,e.TradingApiFp=$,e.TradingApiGenerated=ii,e.parseIfJson=Er,e.readableStreamToString=Tr});
package/dist/index.cjs CHANGED
@@ -7517,7 +7517,7 @@ var Configuration = class {
7517
7517
  }
7518
7518
  this.basePath = param.basePath;
7519
7519
  this.baseOptions = param.baseOptions ?? {};
7520
- this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.19/typescript" : param.userAgent;
7520
+ this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.20/typescript" : param.userAgent;
7521
7521
  this.formDataCtor = param.formDataCtor;
7522
7522
  }
7523
7523
  /**
package/dist/index.mjs CHANGED
@@ -7493,7 +7493,7 @@ var Configuration = class {
7493
7493
  }
7494
7494
  this.basePath = param.basePath;
7495
7495
  this.baseOptions = param.baseOptions ?? {};
7496
- this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.19/typescript" : param.userAgent;
7496
+ this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.20/typescript" : param.userAgent;
7497
7497
  this.formDataCtor = param.formDataCtor;
7498
7498
  }
7499
7499
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snaptrade-typescript-sdk",
3
- "version": "12.2.19",
3
+ "version": "12.2.20",
4
4
  "description": "Client for SnapTrade",
5
5
  "author": "Konfig",
6
6
  "engines": {