snaptrade-typescript-sdk 12.2.4 → 12.2.5
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 +17 -1
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +5 -5
- package/package.json +1 -1
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
|
-
[](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/12.2.5)
|
|
67
67
|
[](https://snaptrade.com/)
|
|
68
68
|
|
|
69
69
|
</div>
|
|
@@ -2955,6 +2955,22 @@ Please refer to the [brokerage trading support page](https://support.snaptrade.c
|
|
|
2955
2955
|
- **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order.
|
|
2956
2956
|
- **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
2957
2957
|
|
|
2958
|
+
Option OCO peers must trade the same OCC option symbol with the same closing
|
|
2959
|
+
action and positive whole-contract quantity.
|
|
2960
|
+
|
|
2961
|
+
On tastytrade, option OCO supports closing an existing long or short option
|
|
2962
|
+
position with one `Limit` order and one `Stop` or `StopLimit` order. Both
|
|
2963
|
+
`PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with
|
|
2964
|
+
`Day` or `GTC` time in force. Opening option OCOs are not supported.
|
|
2965
|
+
|
|
2966
|
+
On enabled Webull US v3 accounts, option OCO supports closing an existing long
|
|
2967
|
+
option position with one `Limit` take-profit order and one `Stop` stop-loss order.
|
|
2968
|
+
Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol,
|
|
2969
|
+
and the same positive whole-contract quantity. Webull receives these as
|
|
2970
|
+
`STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order.
|
|
2971
|
+
Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs
|
|
2972
|
+
are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
2973
|
+
|
|
2958
2974
|
|
|
2959
2975
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2960
2976
|
|
package/dist/browser.umd.js
CHANGED
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
|
|
9
9
|
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t=t||{},t.url=e):t=e||{},t=N(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Rn.assertOptions(n,{silentJSONParsing:P.transitional(P.boolean),forcedJSONParsing:P.transitional(P.boolean),clarifyTimeoutError:P.transitional(P.boolean),legacyInterceptorReqResOrdering:P.transitional(P.boolean),advertiseZstdAcceptEncoding:P.transitional(P.boolean),validateStatusUndefinedResolves:P.transitional(P.boolean)},!1),r!=null&&(k.isFunction(r)?t.paramsSerializer={serialize:r}:Rn.assertOptions(r,{encode:P.function,serialize:P.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Rn.assertOptions(t,{baseUrl:P.spelling(`baseURL`),withXsrfToken:P.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&k.merge(i.common,i[t.method]);i&&k.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=A.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||xt;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=[Pn.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(f)}catch(e){t.call(this,e);break}}try{l=Pn.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=N(this.defaults,e),yt(nn(e.baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};k.forEach([`delete`,`get`,`head`,`options`],function(e){F.prototype[e]=function(t,n){return this.request(N(n||{},{method:e,url:t,data:n&&k.hasOwnProp(n,`data`)?n.data:void 0}))}}),k.forEach([`post`,`put`,`patch`,`query`],function(e){function t(t){return function(n,r,i){return this.request(N(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}F.prototype[e]=t(),e!==`query`&&(F.prototype[e+`Form`]=t(!0))});var zn=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 zt(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 Bn(e){return function(t){return e.apply(null,t)}}function Vn(e){return k.isObject(e)&&e.isAxiosError===!0}let Hn={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,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity: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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Hn).forEach(([e,t])=>{Hn[t]=e});function Un(e){let t=new F(e),n=r(F.prototype.request,t);return k.extend(n,F.prototype,t,{allOwnKeys:!0}),k.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Un(N(e,t))},n}let I=Un(It);I.Axios=F,I.CanceledError=zt,I.CancelToken=zn,I.isCancel=Rt,I.VERSION=vn,I.toFormData=mt,I.AxiosError=j,I.Cancel=I.CanceledError,I.all=function(e){return Promise.all(e)},I.spread=Bn,I.isAxiosError=Vn,I.mergeConfig=N,I.AxiosHeaders=A,I.formToJSON=e=>Nt(k.isHTMLForm(e)?new FormData(e):e),I.getAdapter=Mn.getAdapter,I.HttpStatusCode=Hn,I.default=I;let L=`https://api.snaptrade.com`.replace(/\/+$/,``);var R=class{constructor(e,t=L,n=I){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}},Wn=class extends Error{constructor(e,t){super(t),this.field=e,this.name=`RequiredError`}};function Gn(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 Kn(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 Gn(new Uint8Array(o))}let qn=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 Jn(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 Kn(qn({content:u,path:d,query:i.replace(n,``).replace(d,``).replace(`?`,``)}),l);r.options.headers&&(r.options.headers.Signature=f)}let Yn=new Set([`clientid`,`timestamp`,`userid`,`usersecret`]);function Xn(e){if(e===void 0||Yn.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;Yn.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 Zn(e,t,n){return t===void 0||!e.includes(t)?e:e.split(t).join(n??`[REDACTED URL]`)}var Qn=class extends Error{constructor(e,t,n){let r=e.config?.url,i=Xn(r),a=Zn(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 $n(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 z=`https://example.com`,B=function(e,t,n){if(n==null)throw new Wn(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},V=async function({object:e,key:t,type:n,keyParamName:r,configuration:i,prefix:a}){t=t||r;let o=null;if(i&&i.apiKey)if(typeof i.apiKey==`function`)o=await i.apiKey(r);else if(typeof i.apiKey==`string`)o=i.apiKey;else if(typeof i.apiKey==`object`)r in i.apiKey&&(o=i.apiKey[r]);else throw Error(`Unexpected type ${typeof i.apiKey} for Configuration.apiKey`);o&&(e[t]=a===void 0?o:`${a}${o}`,n===`Cookie`&&(e[t]=`${r}=${e[t]}`))};function tr(e,t,n=``){typeof t==`object`?Array.isArray(t)?t.forEach(t=>tr(e,t,n)):Object.keys(t).forEach(r=>tr(e,t[r],`${n}${n===``?``:`.`}${r}`)):e.has(n)?e.append(n,t):e.set(n,t)}let H=function(e,...t){let n=new URLSearchParams(e.search);tr(n,t),e.search=n.toString()},U=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||``},W=function(e){return nr(e.pathname)+e.search+e.hash},nr=function(e){return e.replace(/\/$/,``)};async function rr(e){let t=0,n=5e3;for(;t<3;)try{return await e()}catch(e){if(I.isAxiosError(e)){if(e.response?.status==429){t++,console.log(`429 error encountered, retrying in ${n/1e3} seconds...`),await new Promise(e=>setTimeout(e,n)),n*=2;continue}let r;try{let t=e.response?.data;r=t,typeof ReadableStream<`u`&&t instanceof ReadableStream&&(r=await $n(t)),r=er(r)}catch{r=void 0}throw new Qn(e,r,e.response?.headers)}throw e}throw Error(`Request failed after 3 retries due to 429 (rate limit) errors.`)}let G=function(e,t,n,r,i){return async(a=t,o=n)=>{let s=(r?.basePath||o)+e.url;return await Jn({axiosArgs:e,basePath:o,url:s,configuration:r,operationAuth:i?{...i,selectedAuthMode:r?.authMode}:void 0}),rr(async()=>await a.request({...e.options,url:s}))}};function K(){return typeof window<`u`}function q(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 ir=function(e){return{getAccountActivities:async(t,n,r,i,a,o,s,c,l={})=>{B(`getAccountActivities`,`accountId`,t);let u=`/accounts/{accountId}/activities`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),d=new URL(u,z),f;e&&(f=e.baseOptions);let p={method:`GET`,...f,...l},m=e&&!K()?{"User-Agent":e.userAgent}:{},h={};e?.authMode===`commercialApiKey`&&(await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),s!==void 0&&(h.userId=s),c!==void 0&&(h.userSecret=c)),e?.authMode===`personalApiKey`&&await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),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},q({queryParameters:h,requestConfig:p,path:u,configuration:e,pathTemplate:`/accounts/{accountId}/activities`,httpMethod:`GET`,operationAuth:g}),H(d,h),{url:W(d),options:p}},getAccountBalanceHistory:async(t,n,r,i={})=>{B(`getAccountBalanceHistory`,`accountId`,t);let a=`/accounts/{accountId}/balanceHistory`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balanceHistory`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},getAllAccountPositions:async(t,n,r,i={})=>{B(`getAllAccountPositions`,`accountId`,t);let a=`/accounts/{accountId}/positions/all`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/positions/all`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},getUserAccountBalance:async(t,n,r,i={})=>{B(`getUserAccountBalance`,`accountId`,t);let a=`/accounts/{accountId}/balances`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balances`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},getUserAccountDetails:async(t,n,r,i={})=>{B(`getUserAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},getUserAccountOrderDetail:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetail`,`accountId`,t),B(`getUserAccountOrderDetail`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/orders/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},getUserAccountOrders:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrders`,`accountId`,t);let s=`/accounts/{accountId}/orders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders`,httpMethod:`GET`,operationAuth:p}),H(c,f),{url:W(c),options:u}},getUserAccountRecentOrders:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrders`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},getUserAccountReturnRates:async(t,n,r,i,a={})=>{B(`getUserAccountReturnRates`,`accountId`,t);let o=`/accounts/{accountId}/returnRates`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.timeframes=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/returnRates`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},getUserHoldings:async(t,n,r,i={})=>{B(`getUserHoldings`,`accountId`,t);let a=`/accounts/{accountId}/holdings`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/holdings`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},listUserAccounts:async(t,n,r={})=>{let i=`/accounts`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!K()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e});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},q({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/accounts`,httpMethod:`GET`,operationAuth:u}),H(a,l),{url:W(a),options:s}},updateUserAccount:async(t,n,r,i={})=>{B(`updateUserAccount`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`PUT`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`PUT`,operationAuth:d}),H(o,u),{url:W(o),options:c}}}},J=function(e){let t=ir(e);return{async getAccountActivities(...n){let[r={},i]=n;return G(await t.getAccountActivities(r.accountId,r.startDate,r.endDate,r.offset,r.limit,r.type,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountBalanceHistory(...n){let[r={},i]=n;return G(await t.getAccountBalanceHistory(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountPositions(...n){let[r={},i]=n;return G(await t.getAllAccountPositions(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountBalance(...n){let[r={},i]=n;return G(await t.getUserAccountBalance(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountDetails(...n){let[r={},i]=n;return G(await t.getUserAccountDetails(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrderDetail(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id};return G(await t.getUserAccountOrderDetail(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrders(...n){let[r={},i]=n;return G(await t.getUserAccountOrders(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountRecentOrders(...n){let[r={},i]=n;return G(await t.getUserAccountRecentOrders(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountReturnRates(...n){let[r={},i]=n;return G(await t.getUserAccountReturnRates(r.accountId,r.timeframes,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserHoldings(...n){let[r={},i]=n;return G(await t.getUserHoldings(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listUserAccounts(...n){let[r={},i]=n;return G(await t.listUserAccounts(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async updateUserAccount(...n){let[r={},i]=n;return G(await t.updateUserAccount(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},ar=function(e,t,n){let r=J(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 or=class extends R{getAccountActivities(...e){return J(this.configuration).getAccountActivities(...e).then(e=>e(this.axios,this.basePath))}getAccountBalanceHistory(...e){return J(this.configuration).getAccountBalanceHistory(...e).then(e=>e(this.axios,this.basePath))}getAllAccountPositions(...e){return J(this.configuration).getAllAccountPositions(...e).then(e=>e(this.axios,this.basePath))}getUserAccountBalance(...e){return J(this.configuration).getUserAccountBalance(...e).then(e=>e(this.axios,this.basePath))}getUserAccountDetails(...e){return J(this.configuration).getUserAccountDetails(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetail(...e){return J(this.configuration).getUserAccountOrderDetail(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrders(...e){return J(this.configuration).getUserAccountOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrders(...e){return J(this.configuration).getUserAccountRecentOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountReturnRates(...e){return J(this.configuration).getUserAccountReturnRates(...e).then(e=>e(this.axios,this.basePath))}getUserHoldings(...e){return J(this.configuration).getUserHoldings(...e).then(e=>e(this.axios,this.basePath))}listUserAccounts(...e){return J(this.configuration).listUserAccounts(...e).then(e=>e(this.axios,this.basePath))}updateUserAccount(...e){return J(this.configuration).updateUserAccount(...e).then(e=>e(this.axios,this.basePath))}},sr=class extends or{};let cr=function(e){return{check:async(t={})=>{let n=new URL(`/`,z),r;e&&(r=e.baseOptions);let i={method:`GET`,...r,...t},a=e&&!K()?{"User-Agent":e.userAgent}:{},o={},s={authModes:[`public`],selectedAuthMode:e?.authMode},c=r&&r.headers?r.headers:{};return i.headers={...a,...c,...t.headers},q({queryParameters:o,requestConfig:i,path:`/`,configuration:e,pathTemplate:`/`,httpMethod:`GET`,operationAuth:s}),H(n,o),{url:W(n),options:i}}}},lr=function(e){let t=cr(e);return{async check(n){return G(await t.check(n),I,L,e,{authModes:[`public`]})}}},ur=function(e,t,n){let r=lr(e);return{check(e){return r.check(e).then(e=>e(n,t))}}};var dr=class extends R{check(e){return lr(this.configuration).check(e).then(e=>e(this.axios,this.basePath))}},fr=class extends dr{};let pr=function(e){return{deleteSnapTradeUser:async(t,n={})=>{let r=`/snapTrade/deleteUser`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`DELETE`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&(await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.userId=t));let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/deleteUser`,httpMethod:`DELETE`,operationAuth:l}),H(i,c),{url:W(i),options:o}},listSnapTradeUsers:async(t={})=>{let n=`/snapTrade/listUsers`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/listUsers`,httpMethod:`GET`,operationAuth:c}),H(r,s),{url:W(r),options:a}},loginSnapTradeUser:async(t,n,r,i={})=>{let a=`/snapTrade/login`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/login`,httpMethod:`POST`,operationAuth:d}),c.data=U(t,c,e),H(o,u),{url:W(o),options:c}},registerSnapTradeUser:async(t,n={})=>{B(`registerSnapTradeUser`,`snapTradeRegisterUserRequestBody`,t);let r=`/snapTrade/registerUser`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/registerUser`,httpMethod:`POST`,operationAuth:l}),o.data=U(t,o,e),H(i,c),{url:W(i),options:o}},resetSnapTradeUserSecret:async(t,n={})=>{B(`resetSnapTradeUserSecret`,`userIDandSecret`,t);let r=`/snapTrade/resetUserSecret`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/resetUserSecret`,httpMethod:`POST`,operationAuth:l}),o.data=U(t,o,e),H(i,c),{url:W(i),options:o}}}},Y=function(e){let t=pr(e);return{async deleteSnapTradeUser(...n){let[r={},i]=n;return G(await t.deleteSnapTradeUser(r.userId,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async listSnapTradeUsers(...n){let[r]=n;return G(await t.listSnapTradeUsers(r),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async loginSnapTradeUser(...n){let[r={},i]=n,a={broker:r.broker,immediateRedirect:r.immediateRedirect,customRedirect:r.customRedirect,reconnect:r.reconnect,connectionType:r.connectionType,showCloseButton:r.showCloseButton,darkMode:r.darkMode,locale:r.locale,connectionPortalVersion:r.connectionPortalVersion};return G(await t.loginSnapTradeUser(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async registerSnapTradeUser(...n){let[r={},i]=n,a={userId:r.userId};return G(await t.registerSnapTradeUser(a,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async resetSnapTradeUserSecret(...n){let[r={},i]=n,a={userId:r.userId,userSecret:r.userSecret};return G(await t.resetSnapTradeUserSecret(a,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})}}},mr=function(e,t,n){let r=Y(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 R{deleteSnapTradeUser(...e){return Y(this.configuration).deleteSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}listSnapTradeUsers(...e){return Y(this.configuration).listSnapTradeUsers(...e).then(e=>e(this.axios,this.basePath))}loginSnapTradeUser(...e){return Y(this.configuration).loginSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}registerSnapTradeUser(...e){return Y(this.configuration).registerSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}resetSnapTradeUserSecret(...e){return Y(this.configuration).resetSnapTradeUserSecret(...e).then(e=>e(this.axios,this.basePath))}},gr=class extends hr{};let _r=function(e){return{deleteConnection:async(t,n,r,i={})=>{B(`deleteConnection`,`connectionId`,t);let a=`/connection/{connectionId}`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`DELETE`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connection/{connectionId}`,httpMethod:`DELETE`,operationAuth:d}),H(o,u),{url:W(o),options:c}},detailBrokerageAuthorization:async(t,n,r,i={})=>{B(`detailBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},disableBrokerageAuthorization:async(t,n,r,i={})=>{B(`disableBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/disable`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/disable`,httpMethod:`POST`,operationAuth:d}),H(o,u),{url:W(o),options:c}},listBrokerageAuthorizationAccounts:async(t,n,r,i={})=>{B(`listBrokerageAuthorizationAccounts`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/accounts`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/accounts`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},listBrokerageAuthorizations:async(t,n,r={})=>{let i=`/authorizations`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!K()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e});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},q({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/authorizations`,httpMethod:`GET`,operationAuth:u}),H(a,l),{url:W(a),options:s}},refreshBrokerageAuthorization:async(t,n,r,i={})=>{B(`refreshBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/refresh`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/refresh`,httpMethod:`POST`,operationAuth:d}),H(o,u),{url:W(o),options:c}},returnRates:async(t,n,r,i,a={})=>{B(`returnRates`,`authorizationId`,t);let o=`/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.timeframes=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/authorizations/{authorizationId}/returnRates`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},syncBrokerageAuthorizationTransactions:async(t,n,r,i={})=>{B(`syncBrokerageAuthorizationTransactions`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/transactions/sync`,httpMethod:`POST`,operationAuth:d}),H(o,u),{url:W(o),options:c}}}},X=function(e){let t=_r(e);return{async deleteConnection(...n){let[r={},i]=n;return G(await t.deleteConnection(r.connectionId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async detailBrokerageAuthorization(...n){let[r={},i]=n;return G(await t.detailBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async disableBrokerageAuthorization(...n){let[r={},i]=n;return G(await t.disableBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listBrokerageAuthorizationAccounts(...n){let[r={},i]=n;return G(await t.listBrokerageAuthorizationAccounts(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listBrokerageAuthorizations(...n){let[r={},i]=n;return G(await t.listBrokerageAuthorizations(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async refreshBrokerageAuthorization(...n){let[r={},i]=n;return G(await t.refreshBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async returnRates(...n){let[r={},i]=n;return G(await t.returnRates(r.authorizationId,r.timeframes,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async syncBrokerageAuthorizationTransactions(...n){let[r={},i]=n;return G(await t.syncBrokerageAuthorizationTransactions(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},vr=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))},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 yr=class extends R{deleteConnection(...e){return X(this.configuration).deleteConnection(...e).then(e=>e(this.axios,this.basePath))}detailBrokerageAuthorization(...e){return X(this.configuration).detailBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}disableBrokerageAuthorization(...e){return X(this.configuration).disableBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizationAccounts(...e){return X(this.configuration).listBrokerageAuthorizationAccounts(...e).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizations(...e){return X(this.configuration).listBrokerageAuthorizations(...e).then(e=>e(this.axios,this.basePath))}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))}},br=class extends yr{};let xr=function(e){return{addSubscription:async(t,n,r,i={})=>{B(`addSubscription`,`tradeDetectionAddSubscriptionRequest`,t);let a=`/snapTrade/tradeDetection/subscriptions`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`POST`,operationAuth:d}),c.data=U(t,c,e),H(o,u),{url:W(o),options:c}},cancelSubscription:async(t,n={})=>{B(`cancelSubscription`,`tradeDetectionCancelSubscriptionRequest`,t);let r=`/snapTrade/tradeDetection/subscriptions/cancel`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions/cancel`,httpMethod:`POST`,operationAuth:l}),o.data=U(t,o,e),H(i,c),{url:W(i),options:o}},getUserAccountOrderDetailV2:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetailV2`,`accountId`,t),B(`getUserAccountOrderDetailV2`,`brokerageOrderId`,n);let o=`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{brokerageOrderId}`,encodeURIComponent(String(n===void 0?`-brokerageOrderId-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},getUserAccountOrdersV2:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrdersV2`,`accountId`,t);let s=`/accounts/{accountId}/orders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders/v2`,httpMethod:`GET`,operationAuth:p}),H(c,f),{url:W(c),options:u}},getUserAccountRecentOrdersV2:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrdersV2`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders/v2`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},listConnectionAccounts:async(t,n,r,i={})=>{B(`listConnectionAccounts`,`connectionId`,t);let a=`/connections/{connectionId}/accounts`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connections/{connectionId}/accounts`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},listSubscriptions:async(t={})=>{let n=`/snapTrade/tradeDetection/subscriptions`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`GET`,operationAuth:c}),H(r,s),{url:W(r),options:a}}}},Z=function(e){let t=xr(e);return{async addSubscription(...n){let[r={},i]=n,a={account_id:r.account_id,check_interval_seconds:r.check_interval_seconds};return G(await t.addSubscription(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async cancelSubscription(...n){let[r={},i]=n,a={account_id:r.account_id};return G(await t.cancelSubscription(a,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrderDetailV2(...n){let[r={},i]=n;return G(await t.getUserAccountOrderDetailV2(r.accountId,r.brokerageOrderId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrdersV2(...n){let[r={},i]=n;return G(await t.getUserAccountOrdersV2(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountRecentOrdersV2(...n){let[r={},i]=n;return G(await t.getUserAccountRecentOrdersV2(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listConnectionAccounts(...n){let[r={},i]=n;return G(await t.listConnectionAccounts(r.connectionId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listSubscriptions(...n){let[r]=n;return G(await t.listSubscriptions(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Sr=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))},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))},listConnectionAccounts(...e){return r.listConnectionAccounts(...e).then(e=>e(n,t))},listSubscriptions(...e){return r.listSubscriptions(...e).then(e=>e(n,t))}}};var Cr=class extends R{addSubscription(...e){return Z(this.configuration).addSubscription(...e).then(e=>e(this.axios,this.basePath))}cancelSubscription(...e){return Z(this.configuration).cancelSubscription(...e).then(e=>e(this.axios,this.basePath))}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))}listConnectionAccounts(...e){return Z(this.configuration).listConnectionAccounts(...e).then(e=>e(this.axios,this.basePath))}listSubscriptions(...e){return Z(this.configuration).listSubscriptions(...e).then(e=>e(this.axios,this.basePath))}},wr=class extends Cr{};let Tr=function(e){return{getPartnerInfo:async(t={})=>{let n=`/snapTrade/partners`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/partners`,httpMethod:`GET`,operationAuth:c}),H(r,s),{url:W(r),options:a}},getStockExchanges:async(t={})=>{let n=`/exchanges`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/exchanges`,httpMethod:`GET`,operationAuth:c}),H(r,s),{url:W(r),options:a}},getSymbols:async(t,n={})=>{let r=`/symbols`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols`,httpMethod:`POST`,operationAuth:l}),o.data=U(t,o,e),H(i,c),{url:W(i),options:o}},getSymbolsByTicker:async(t,n={})=>{B(`getSymbolsByTicker`,`query`,t);let r=`/symbols/{query}`.replace(`{query}`,encodeURIComponent(String(t===void 0?`-query-`:t))),i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols/{query}`,httpMethod:`GET`,operationAuth:l}),H(i,c),{url:W(i),options:o}},listAllBrokerageAuthorizationType:async(t,n={})=>{let r=`/brokerageAuthorizationTypes`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.brokerage=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerageAuthorizationTypes`,httpMethod:`GET`,operationAuth:l}),H(i,c),{url:W(i),options:o}},listAllBrokerageInstruments:async(t,n={})=>{B(`listAllBrokerageInstruments`,`slug`,t);let r=`/brokerages/{slug}/instruments`.replace(`{slug}`,encodeURIComponent(String(t===void 0?`-slug-`:t))),i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerages/{slug}/instruments`,httpMethod:`GET`,operationAuth:l}),H(i,c),{url:W(i),options:o}},listAllBrokerages:async(t={})=>{let n=`/brokerages`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/brokerages`,httpMethod:`GET`,operationAuth:c}),H(r,s),{url:W(r),options:a}},symbolSearchUserAccount:async(t,n,r,i,a={})=>{B(`symbolSearchUserAccount`,`accountId`,t);let o=`/accounts/{accountId}/symbols`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/symbols`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}}}},Q=function(e){let t=Tr(e);return{async getPartnerInfo(...n){let[r]=n;return G(await t.getPartnerInfo(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getStockExchanges(...n){let[r]=n;return G(await t.getStockExchanges(r),I,L,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 G(await t.getSymbols(a,i),I,L,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 G(await t.getSymbolsByTicker(r.query,i),I,L,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 G(await t.listAllBrokerageAuthorizationType(r.brokerage,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerageInstruments(...n){let[r={},i]=n;return G(await t.listAllBrokerageInstruments(r.slug,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerages(...n){let[r]=n;return G(await t.listAllBrokerages(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async symbolSearchUserAccount(...n){let[r={},i]=n,a={substring:r.substring};return G(await t.symbolSearchUserAccount(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Er=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))},symbolSearchUserAccount(...e){return r.symbolSearchUserAccount(...e).then(e=>e(n,t))}}};var Dr=class extends R{getPartnerInfo(...e){return Q(this.configuration).getPartnerInfo(...e).then(e=>e(this.axios,this.basePath))}getStockExchanges(...e){return Q(this.configuration).getStockExchanges(...e).then(e=>e(this.axios,this.basePath))}getSymbols(...e){return Q(this.configuration).getSymbols(...e).then(e=>e(this.axios,this.basePath))}getSymbolsByTicker(...e){return Q(this.configuration).getSymbolsByTicker(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerageAuthorizationType(...e){return Q(this.configuration).listAllBrokerageAuthorizationType(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerageInstruments(...e){return Q(this.configuration).listAllBrokerageInstruments(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerages(...e){return Q(this.configuration).listAllBrokerages(...e).then(e=>e(this.axios,this.basePath))}symbolSearchUserAccount(...e){return Q(this.configuration).symbolSearchUserAccount(...e).then(e=>e(this.axios,this.basePath))}},Or=class extends Dr{};let kr=function(e){return{cancelOrder:async(t,n,r,i,a={})=>{B(`cancelOrder`,`accountId`,t),B(`cancelOrder`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/trading/cancel`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/cancel`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},getCryptocurrencyPairQuote:async(t,n,r,i,a={})=>{B(`getCryptocurrencyPairQuote`,`accountId`,t),B(`getCryptocurrencyPairQuote`,`instrumentSymbol`,n);let o=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{instrumentSymbol}`,encodeURIComponent(String(n===void 0?`-instrumentSymbol-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},getOptionImpact:async(t,n,r,i,a={})=>{B(`getOptionImpact`,`accountId`,t),B(`getOptionImpact`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options/impact`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options/impact`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},getOrderImpact:async(t,n,r,i={})=>{B(`getOrderImpact`,`manualTradeForm`,t);let a=`/trade/impact`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/impact`,httpMethod:`POST`,operationAuth:d}),c.data=U(t,c,e),H(o,u),{url:W(o),options:c}},getUserAccountOptionQuotes:async(t,n,r,i,a={})=>{B(`getUserAccountOptionQuotes`,`accountId`,t),B(`getUserAccountOptionQuotes`,`symbol`,n);let o=`/accounts/{accountId}/quotes/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.symbol=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/quotes/options`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},getUserAccountQuotes:async(t,n,r,i,a,o={})=>{B(`getUserAccountQuotes`,`symbols`,t),B(`getUserAccountQuotes`,`accountId`,n);let s=`/accounts/{accountId}/quotes`.replace(`{accountId}`,encodeURIComponent(String(n===void 0?`-accountId-`:n))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),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},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/quotes`,httpMethod:`GET`,operationAuth:p}),H(c,f),{url:W(c),options:u}},placeComplexOrder:async(t,n,r,i,a={})=>{B(`placeComplexOrder`,`accountId`,t),B(`placeComplexOrder`,`manualTradeFormComplex`,n);let o=`/accounts/{accountId}/trading/complex`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/complex`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},placeCryptoOrder:async(t,n,r,i,a={})=>{B(`placeCryptoOrder`,`accountId`,t),B(`placeCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},placeForceOrder:async(t,n,r,i={})=>{B(`placeForceOrder`,`manualTradeFormWithOptions`,t);let a=`/trade/place`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/place`,httpMethod:`POST`,operationAuth:d}),c.data=U(t,c,e),H(o,u),{url:W(o),options:c}},placeMlegOrder:async(t,n,r,i,a={})=>{B(`placeMlegOrder`,`accountId`,t),B(`placeMlegOrder`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},placeOrder:async(t,n,r,i,a={})=>{B(`placeOrder`,`tradeId`,t);let o=`/trade/{tradeId}`.replace(`{tradeId}`,encodeURIComponent(String(t===void 0?`-tradeId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/trade/{tradeId}`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},previewCryptoOrder:async(t,n,r,i,a={})=>{B(`previewCryptoOrder`,`accountId`,t),B(`previewCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto/preview`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto/preview`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},replaceOrder:async(t,n,r,i,a={})=>{B(`replaceOrder`,`accountId`,t),B(`replaceOrder`,`manualTradeReplaceForm`,n);let o=`/accounts/{accountId}/trading/replace`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/replace`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},searchCryptocurrencyPairInstruments:async(t,n,r,i,a,o={})=>{B(`searchCryptocurrencyPairInstruments`,`accountId`,t);let s=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(f.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},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`,httpMethod:`GET`,operationAuth:p}),H(c,f),{url:W(c),options:u}}}},$=function(e){let t=kr(e);return{async cancelOrder(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id};return G(await t.cancelOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getCryptocurrencyPairQuote(...n){let[r={},i]=n;return G(await t.getCryptocurrencyPairQuote(r.accountId,r.instrumentSymbol,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.getOptionImpact(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.getOrderImpact(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOptionQuotes(...n){let[r={},i]=n;return G(await t.getUserAccountOptionQuotes(r.accountId,r.symbol,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountQuotes(...n){let[r={},i]=n;return G(await t.getUserAccountQuotes(r.symbols,r.accountId,r.useTicker,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeComplexOrder(...n){let[r={},i]=n,a={type:r.type,orders:r.orders,client_order_id:r.client_order_id};return G(await t.placeComplexOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.placeCryptoOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.placeForceOrder(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.placeMlegOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeOrder(...n){let[r={},i]=n,a={wait_to_confirm:r.wait_to_confirm};return G(await t.placeOrder(r.tradeId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.previewCryptoOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.replaceOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async searchCryptocurrencyPairInstruments(...n){let[r={},i]=n;return G(await t.searchCryptocurrencyPairInstruments(r.accountId,r.base,r.quote,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Ar=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 jr=class extends R{cancelOrder(...e){return $(this.configuration).cancelOrder(...e).then(e=>e(this.axios,this.basePath))}getCryptocurrencyPairQuote(...e){return $(this.configuration).getCryptocurrencyPairQuote(...e).then(e=>e(this.axios,this.basePath))}getOptionImpact(...e){return $(this.configuration).getOptionImpact(...e).then(e=>e(this.axios,this.basePath))}getOrderImpact(...e){return $(this.configuration).getOrderImpact(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOptionQuotes(...e){return $(this.configuration).getUserAccountOptionQuotes(...e).then(e=>e(this.axios,this.basePath))}getUserAccountQuotes(...e){return $(this.configuration).getUserAccountQuotes(...e).then(e=>e(this.axios,this.basePath))}placeComplexOrder(...e){return $(this.configuration).placeComplexOrder(...e).then(e=>e(this.axios,this.basePath))}placeCryptoOrder(...e){return $(this.configuration).placeCryptoOrder(...e).then(e=>e(this.axios,this.basePath))}placeForceOrder(...e){return $(this.configuration).placeForceOrder(...e).then(e=>e(this.axios,this.basePath))}placeMlegOrder(...e){return $(this.configuration).placeMlegOrder(...e).then(e=>e(this.axios,this.basePath))}placeOrder(...e){return $(this.configuration).placeOrder(...e).then(e=>e(this.axios,this.basePath))}previewCryptoOrder(...e){return $(this.configuration).previewCryptoOrder(...e).then(e=>e(this.axios,this.basePath))}replaceOrder(...e){return $(this.configuration).replaceOrder(...e).then(e=>e(this.axios,this.basePath))}searchCryptocurrencyPairInstruments(...e){return $(this.configuration).searchCryptocurrencyPairInstruments(...e).then(e=>e(this.axios,this.basePath))}},Mr=class extends jr{},Nr=class e{constructor(e){this.mode=`commercialApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},Pr=class e{constructor(e){this.mode=`personalApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},Fr=class{constructor(){}static commercialApiKey(e){return Nr.create(e)}static personalApiKey(e){return Pr.create(e)}},Ir=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.4/typescript`:e.userAgent,this.formDataCtor=e.formDataCtor}isJsonMime(e){return e!==null&&(RegExp(`^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$`,`i`).test(e)||e.toLowerCase()===`application/json-patch+json`)}},Lr=class{constructor(e){}},Rr=class extends Lr{constructor(e){super(e);let t=new Ir(e);this.accountInformation=new sr(t),this.apiStatus=new fr(t),this.authentication=new gr(t),this.connections=new br(t),this.experimentalEndpoints=new wr(t),this.referenceData=new Or(t),this.trading=new Mr(t)}};e.AccountInformationApi=sr,e.AccountInformationApiAxiosParamCreator=ir,e.AccountInformationApiFactory=ar,e.AccountInformationApiFp=J,e.AccountInformationApiGenerated=or,e.ApiStatusApi=fr,e.ApiStatusApiAxiosParamCreator=cr,e.ApiStatusApiFactory=ur,e.ApiStatusApiFp=lr,e.ApiStatusApiGenerated=dr,e.AuthenticationApi=gr,e.AuthenticationApiAxiosParamCreator=pr,e.AuthenticationApiFactory=mr,e.AuthenticationApiFp=Y,e.AuthenticationApiGenerated=hr,e.CommercialApiKeyAuth=Nr,e.Configuration=Ir,e.ConnectionsApi=br,e.ConnectionsApiAxiosParamCreator=_r,e.ConnectionsApiFactory=vr,e.ConnectionsApiFp=X,e.ConnectionsApiGenerated=yr,e.ExperimentalEndpointsApi=wr,e.ExperimentalEndpointsApiAxiosParamCreator=xr,e.ExperimentalEndpointsApiFactory=Sr,e.ExperimentalEndpointsApiFp=Z,e.ExperimentalEndpointsApiGenerated=Cr,e.PersonalApiKeyAuth=Pr,e.ReferenceDataApi=Or,e.ReferenceDataApiAxiosParamCreator=Tr,e.ReferenceDataApiFactory=Er,e.ReferenceDataApiFp=Q,e.ReferenceDataApiGenerated=Dr,e.Snaptrade=Rr,e.SnaptradeAuth=Fr,e.SnaptradeError=Qn,e.TradingApi=Mr,e.TradingApiAxiosParamCreator=kr,e.TradingApiFactory=Ar,e.TradingApiFp=$,e.TradingApiGenerated=jr,e.parseIfJson=er,e.readableStreamToString=$n});
|
|
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 $n(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 z=`https://example.com`,B=function(e,t,n){if(n==null)throw new Wn(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},V=async function({object:e,key:t,type:n,keyParamName:r,configuration:i,prefix:a}){t=t||r;let o=null;if(i&&i.apiKey)if(typeof i.apiKey==`function`)o=await i.apiKey(r);else if(typeof i.apiKey==`string`)o=i.apiKey;else if(typeof i.apiKey==`object`)r in i.apiKey&&(o=i.apiKey[r]);else throw Error(`Unexpected type ${typeof i.apiKey} for Configuration.apiKey`);o&&(e[t]=a===void 0?o:`${a}${o}`,n===`Cookie`&&(e[t]=`${r}=${e[t]}`))};function tr(e,t,n=``){typeof t==`object`?Array.isArray(t)?t.forEach(t=>tr(e,t,n)):Object.keys(t).forEach(r=>tr(e,t[r],`${n}${n===``?``:`.`}${r}`)):e.has(n)?e.append(n,t):e.set(n,t)}let H=function(e,...t){let n=new URLSearchParams(e.search);tr(n,t),e.search=n.toString()},U=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||``},W=function(e){return nr(e.pathname)+e.search+e.hash},nr=function(e){return e.replace(/\/$/,``)};async function rr(e){let t=0,n=5e3;for(;t<3;)try{return await e()}catch(e){if(I.isAxiosError(e)){if(e.response?.status==429){t++,console.log(`429 error encountered, retrying in ${n/1e3} seconds...`),await new Promise(e=>setTimeout(e,n)),n*=2;continue}let r;try{let t=e.response?.data;r=t,typeof ReadableStream<`u`&&t instanceof ReadableStream&&(r=await $n(t)),r=er(r)}catch{r=void 0}throw new Qn(e,r,e.response?.headers)}throw e}throw Error(`Request failed after 3 retries due to 429 (rate limit) errors.`)}let G=function(e,t,n,r,i){return async(a=t,o=n)=>{let s=(r?.basePath||o)+e.url;return await Jn({axiosArgs:e,basePath:o,url:s,configuration:r,operationAuth:i?{...i,selectedAuthMode:r?.authMode}:void 0}),rr(async()=>await a.request({...e.options,url:s}))}};function K(){return typeof window<`u`}function q(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 ir=function(e){return{getAccountActivities:async(t,n,r,i,a,o,s,c,l={})=>{B(`getAccountActivities`,`accountId`,t);let u=`/accounts/{accountId}/activities`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),d=new URL(u,z),f;e&&(f=e.baseOptions);let p={method:`GET`,...f,...l},m=e&&!K()?{"User-Agent":e.userAgent}:{},h={};e?.authMode===`commercialApiKey`&&(await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),s!==void 0&&(h.userId=s),c!==void 0&&(h.userSecret=c)),e?.authMode===`personalApiKey`&&await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),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},q({queryParameters:h,requestConfig:p,path:u,configuration:e,pathTemplate:`/accounts/{accountId}/activities`,httpMethod:`GET`,operationAuth:g}),H(d,h),{url:W(d),options:p}},getAccountBalanceHistory:async(t,n,r,i={})=>{B(`getAccountBalanceHistory`,`accountId`,t);let a=`/accounts/{accountId}/balanceHistory`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balanceHistory`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},getAllAccountPositions:async(t,n,r,i={})=>{B(`getAllAccountPositions`,`accountId`,t);let a=`/accounts/{accountId}/positions/all`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/positions/all`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},getUserAccountBalance:async(t,n,r,i={})=>{B(`getUserAccountBalance`,`accountId`,t);let a=`/accounts/{accountId}/balances`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balances`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},getUserAccountDetails:async(t,n,r,i={})=>{B(`getUserAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},getUserAccountOrderDetail:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetail`,`accountId`,t),B(`getUserAccountOrderDetail`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/orders/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},getUserAccountOrders:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrders`,`accountId`,t);let s=`/accounts/{accountId}/orders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders`,httpMethod:`GET`,operationAuth:p}),H(c,f),{url:W(c),options:u}},getUserAccountRecentOrders:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrders`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},getUserAccountReturnRates:async(t,n,r,i,a={})=>{B(`getUserAccountReturnRates`,`accountId`,t);let o=`/accounts/{accountId}/returnRates`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.timeframes=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/returnRates`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},getUserHoldings:async(t,n,r,i={})=>{B(`getUserHoldings`,`accountId`,t);let a=`/accounts/{accountId}/holdings`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/holdings`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},listUserAccounts:async(t,n,r={})=>{let i=`/accounts`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!K()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e});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},q({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/accounts`,httpMethod:`GET`,operationAuth:u}),H(a,l),{url:W(a),options:s}},updateUserAccount:async(t,n,r,i={})=>{B(`updateUserAccount`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`PUT`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`PUT`,operationAuth:d}),H(o,u),{url:W(o),options:c}}}},J=function(e){let t=ir(e);return{async getAccountActivities(...n){let[r={},i]=n;return G(await t.getAccountActivities(r.accountId,r.startDate,r.endDate,r.offset,r.limit,r.type,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountBalanceHistory(...n){let[r={},i]=n;return G(await t.getAccountBalanceHistory(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountPositions(...n){let[r={},i]=n;return G(await t.getAllAccountPositions(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountBalance(...n){let[r={},i]=n;return G(await t.getUserAccountBalance(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountDetails(...n){let[r={},i]=n;return G(await t.getUserAccountDetails(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrderDetail(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id};return G(await t.getUserAccountOrderDetail(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrders(...n){let[r={},i]=n;return G(await t.getUserAccountOrders(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountRecentOrders(...n){let[r={},i]=n;return G(await t.getUserAccountRecentOrders(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountReturnRates(...n){let[r={},i]=n;return G(await t.getUserAccountReturnRates(r.accountId,r.timeframes,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserHoldings(...n){let[r={},i]=n;return G(await t.getUserHoldings(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listUserAccounts(...n){let[r={},i]=n;return G(await t.listUserAccounts(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async updateUserAccount(...n){let[r={},i]=n;return G(await t.updateUserAccount(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},ar=function(e,t,n){let r=J(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 or=class extends R{getAccountActivities(...e){return J(this.configuration).getAccountActivities(...e).then(e=>e(this.axios,this.basePath))}getAccountBalanceHistory(...e){return J(this.configuration).getAccountBalanceHistory(...e).then(e=>e(this.axios,this.basePath))}getAllAccountPositions(...e){return J(this.configuration).getAllAccountPositions(...e).then(e=>e(this.axios,this.basePath))}getUserAccountBalance(...e){return J(this.configuration).getUserAccountBalance(...e).then(e=>e(this.axios,this.basePath))}getUserAccountDetails(...e){return J(this.configuration).getUserAccountDetails(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetail(...e){return J(this.configuration).getUserAccountOrderDetail(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrders(...e){return J(this.configuration).getUserAccountOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrders(...e){return J(this.configuration).getUserAccountRecentOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountReturnRates(...e){return J(this.configuration).getUserAccountReturnRates(...e).then(e=>e(this.axios,this.basePath))}getUserHoldings(...e){return J(this.configuration).getUserHoldings(...e).then(e=>e(this.axios,this.basePath))}listUserAccounts(...e){return J(this.configuration).listUserAccounts(...e).then(e=>e(this.axios,this.basePath))}updateUserAccount(...e){return J(this.configuration).updateUserAccount(...e).then(e=>e(this.axios,this.basePath))}},sr=class extends or{};let cr=function(e){return{check:async(t={})=>{let n=new URL(`/`,z),r;e&&(r=e.baseOptions);let i={method:`GET`,...r,...t},a=e&&!K()?{"User-Agent":e.userAgent}:{},o={},s={authModes:[`public`],selectedAuthMode:e?.authMode},c=r&&r.headers?r.headers:{};return i.headers={...a,...c,...t.headers},q({queryParameters:o,requestConfig:i,path:`/`,configuration:e,pathTemplate:`/`,httpMethod:`GET`,operationAuth:s}),H(n,o),{url:W(n),options:i}}}},lr=function(e){let t=cr(e);return{async check(n){return G(await t.check(n),I,L,e,{authModes:[`public`]})}}},ur=function(e,t,n){let r=lr(e);return{check(e){return r.check(e).then(e=>e(n,t))}}};var dr=class extends R{check(e){return lr(this.configuration).check(e).then(e=>e(this.axios,this.basePath))}},fr=class extends dr{};let pr=function(e){return{deleteSnapTradeUser:async(t,n={})=>{let r=`/snapTrade/deleteUser`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`DELETE`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&(await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.userId=t));let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/deleteUser`,httpMethod:`DELETE`,operationAuth:l}),H(i,c),{url:W(i),options:o}},listSnapTradeUsers:async(t={})=>{let n=`/snapTrade/listUsers`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/listUsers`,httpMethod:`GET`,operationAuth:c}),H(r,s),{url:W(r),options:a}},loginSnapTradeUser:async(t,n,r,i={})=>{let a=`/snapTrade/login`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/login`,httpMethod:`POST`,operationAuth:d}),c.data=U(t,c,e),H(o,u),{url:W(o),options:c}},registerSnapTradeUser:async(t,n={})=>{B(`registerSnapTradeUser`,`snapTradeRegisterUserRequestBody`,t);let r=`/snapTrade/registerUser`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/registerUser`,httpMethod:`POST`,operationAuth:l}),o.data=U(t,o,e),H(i,c),{url:W(i),options:o}},resetSnapTradeUserSecret:async(t,n={})=>{B(`resetSnapTradeUserSecret`,`userIDandSecret`,t);let r=`/snapTrade/resetUserSecret`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/resetUserSecret`,httpMethod:`POST`,operationAuth:l}),o.data=U(t,o,e),H(i,c),{url:W(i),options:o}}}},Y=function(e){let t=pr(e);return{async deleteSnapTradeUser(...n){let[r={},i]=n;return G(await t.deleteSnapTradeUser(r.userId,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async listSnapTradeUsers(...n){let[r]=n;return G(await t.listSnapTradeUsers(r),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async loginSnapTradeUser(...n){let[r={},i]=n,a={broker:r.broker,immediateRedirect:r.immediateRedirect,customRedirect:r.customRedirect,reconnect:r.reconnect,connectionType:r.connectionType,showCloseButton:r.showCloseButton,darkMode:r.darkMode,locale:r.locale,connectionPortalVersion:r.connectionPortalVersion};return G(await t.loginSnapTradeUser(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async registerSnapTradeUser(...n){let[r={},i]=n,a={userId:r.userId};return G(await t.registerSnapTradeUser(a,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async resetSnapTradeUserSecret(...n){let[r={},i]=n,a={userId:r.userId,userSecret:r.userSecret};return G(await t.resetSnapTradeUserSecret(a,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})}}},mr=function(e,t,n){let r=Y(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 R{deleteSnapTradeUser(...e){return Y(this.configuration).deleteSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}listSnapTradeUsers(...e){return Y(this.configuration).listSnapTradeUsers(...e).then(e=>e(this.axios,this.basePath))}loginSnapTradeUser(...e){return Y(this.configuration).loginSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}registerSnapTradeUser(...e){return Y(this.configuration).registerSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}resetSnapTradeUserSecret(...e){return Y(this.configuration).resetSnapTradeUserSecret(...e).then(e=>e(this.axios,this.basePath))}},gr=class extends hr{};let _r=function(e){return{deleteConnection:async(t,n,r,i={})=>{B(`deleteConnection`,`connectionId`,t);let a=`/connection/{connectionId}`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`DELETE`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connection/{connectionId}`,httpMethod:`DELETE`,operationAuth:d}),H(o,u),{url:W(o),options:c}},detailBrokerageAuthorization:async(t,n,r,i={})=>{B(`detailBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},disableBrokerageAuthorization:async(t,n,r,i={})=>{B(`disableBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/disable`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/disable`,httpMethod:`POST`,operationAuth:d}),H(o,u),{url:W(o),options:c}},listBrokerageAuthorizationAccounts:async(t,n,r,i={})=>{B(`listBrokerageAuthorizationAccounts`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/accounts`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/accounts`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},listBrokerageAuthorizations:async(t,n,r={})=>{let i=`/authorizations`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!K()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e});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},q({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/authorizations`,httpMethod:`GET`,operationAuth:u}),H(a,l),{url:W(a),options:s}},refreshBrokerageAuthorization:async(t,n,r,i={})=>{B(`refreshBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/refresh`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/refresh`,httpMethod:`POST`,operationAuth:d}),H(o,u),{url:W(o),options:c}},returnRates:async(t,n,r,i,a={})=>{B(`returnRates`,`authorizationId`,t);let o=`/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.timeframes=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/authorizations/{authorizationId}/returnRates`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},syncBrokerageAuthorizationTransactions:async(t,n,r,i={})=>{B(`syncBrokerageAuthorizationTransactions`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/transactions/sync`,httpMethod:`POST`,operationAuth:d}),H(o,u),{url:W(o),options:c}}}},X=function(e){let t=_r(e);return{async deleteConnection(...n){let[r={},i]=n;return G(await t.deleteConnection(r.connectionId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async detailBrokerageAuthorization(...n){let[r={},i]=n;return G(await t.detailBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async disableBrokerageAuthorization(...n){let[r={},i]=n;return G(await t.disableBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listBrokerageAuthorizationAccounts(...n){let[r={},i]=n;return G(await t.listBrokerageAuthorizationAccounts(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listBrokerageAuthorizations(...n){let[r={},i]=n;return G(await t.listBrokerageAuthorizations(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async refreshBrokerageAuthorization(...n){let[r={},i]=n;return G(await t.refreshBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async returnRates(...n){let[r={},i]=n;return G(await t.returnRates(r.authorizationId,r.timeframes,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async syncBrokerageAuthorizationTransactions(...n){let[r={},i]=n;return G(await t.syncBrokerageAuthorizationTransactions(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},vr=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))},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 yr=class extends R{deleteConnection(...e){return X(this.configuration).deleteConnection(...e).then(e=>e(this.axios,this.basePath))}detailBrokerageAuthorization(...e){return X(this.configuration).detailBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}disableBrokerageAuthorization(...e){return X(this.configuration).disableBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizationAccounts(...e){return X(this.configuration).listBrokerageAuthorizationAccounts(...e).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizations(...e){return X(this.configuration).listBrokerageAuthorizations(...e).then(e=>e(this.axios,this.basePath))}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))}},br=class extends yr{};let xr=function(e){return{addSubscription:async(t,n,r,i={})=>{B(`addSubscription`,`tradeDetectionAddSubscriptionRequest`,t);let a=`/snapTrade/tradeDetection/subscriptions`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`POST`,operationAuth:d}),c.data=U(t,c,e),H(o,u),{url:W(o),options:c}},cancelSubscription:async(t,n={})=>{B(`cancelSubscription`,`tradeDetectionCancelSubscriptionRequest`,t);let r=`/snapTrade/tradeDetection/subscriptions/cancel`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions/cancel`,httpMethod:`POST`,operationAuth:l}),o.data=U(t,o,e),H(i,c),{url:W(i),options:o}},getUserAccountOrderDetailV2:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetailV2`,`accountId`,t),B(`getUserAccountOrderDetailV2`,`brokerageOrderId`,n);let o=`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{brokerageOrderId}`,encodeURIComponent(String(n===void 0?`-brokerageOrderId-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},getUserAccountOrdersV2:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrdersV2`,`accountId`,t);let s=`/accounts/{accountId}/orders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders/v2`,httpMethod:`GET`,operationAuth:p}),H(c,f),{url:W(c),options:u}},getUserAccountRecentOrdersV2:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrdersV2`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders/v2`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},listConnectionAccounts:async(t,n,r,i={})=>{B(`listConnectionAccounts`,`connectionId`,t);let a=`/connections/{connectionId}/accounts`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connections/{connectionId}/accounts`,httpMethod:`GET`,operationAuth:d}),H(o,u),{url:W(o),options:c}},listSubscriptions:async(t={})=>{let n=`/snapTrade/tradeDetection/subscriptions`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`GET`,operationAuth:c}),H(r,s),{url:W(r),options:a}}}},Z=function(e){let t=xr(e);return{async addSubscription(...n){let[r={},i]=n,a={account_id:r.account_id,check_interval_seconds:r.check_interval_seconds};return G(await t.addSubscription(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async cancelSubscription(...n){let[r={},i]=n,a={account_id:r.account_id};return G(await t.cancelSubscription(a,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrderDetailV2(...n){let[r={},i]=n;return G(await t.getUserAccountOrderDetailV2(r.accountId,r.brokerageOrderId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrdersV2(...n){let[r={},i]=n;return G(await t.getUserAccountOrdersV2(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountRecentOrdersV2(...n){let[r={},i]=n;return G(await t.getUserAccountRecentOrdersV2(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listConnectionAccounts(...n){let[r={},i]=n;return G(await t.listConnectionAccounts(r.connectionId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listSubscriptions(...n){let[r]=n;return G(await t.listSubscriptions(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Sr=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))},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))},listConnectionAccounts(...e){return r.listConnectionAccounts(...e).then(e=>e(n,t))},listSubscriptions(...e){return r.listSubscriptions(...e).then(e=>e(n,t))}}};var Cr=class extends R{addSubscription(...e){return Z(this.configuration).addSubscription(...e).then(e=>e(this.axios,this.basePath))}cancelSubscription(...e){return Z(this.configuration).cancelSubscription(...e).then(e=>e(this.axios,this.basePath))}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))}listConnectionAccounts(...e){return Z(this.configuration).listConnectionAccounts(...e).then(e=>e(this.axios,this.basePath))}listSubscriptions(...e){return Z(this.configuration).listSubscriptions(...e).then(e=>e(this.axios,this.basePath))}},wr=class extends Cr{};let Tr=function(e){return{getPartnerInfo:async(t={})=>{let n=`/snapTrade/partners`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/partners`,httpMethod:`GET`,operationAuth:c}),H(r,s),{url:W(r),options:a}},getStockExchanges:async(t={})=>{let n=`/exchanges`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/exchanges`,httpMethod:`GET`,operationAuth:c}),H(r,s),{url:W(r),options:a}},getSymbols:async(t,n={})=>{let r=`/symbols`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols`,httpMethod:`POST`,operationAuth:l}),o.data=U(t,o,e),H(i,c),{url:W(i),options:o}},getSymbolsByTicker:async(t,n={})=>{B(`getSymbolsByTicker`,`query`,t);let r=`/symbols/{query}`.replace(`{query}`,encodeURIComponent(String(t===void 0?`-query-`:t))),i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols/{query}`,httpMethod:`GET`,operationAuth:l}),H(i,c),{url:W(i),options:o}},listAllBrokerageAuthorizationType:async(t,n={})=>{let r=`/brokerageAuthorizationTypes`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.brokerage=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerageAuthorizationTypes`,httpMethod:`GET`,operationAuth:l}),H(i,c),{url:W(i),options:o}},listAllBrokerageInstruments:async(t,n={})=>{B(`listAllBrokerageInstruments`,`slug`,t);let r=`/brokerages/{slug}/instruments`.replace(`{slug}`,encodeURIComponent(String(t===void 0?`-slug-`:t))),i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!K()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerages/{slug}/instruments`,httpMethod:`GET`,operationAuth:l}),H(i,c),{url:W(i),options:o}},listAllBrokerages:async(t={})=>{let n=`/brokerages`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/brokerages`,httpMethod:`GET`,operationAuth:c}),H(r,s),{url:W(r),options:a}},symbolSearchUserAccount:async(t,n,r,i,a={})=>{B(`symbolSearchUserAccount`,`accountId`,t);let o=`/accounts/{accountId}/symbols`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/symbols`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}}}},Q=function(e){let t=Tr(e);return{async getPartnerInfo(...n){let[r]=n;return G(await t.getPartnerInfo(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getStockExchanges(...n){let[r]=n;return G(await t.getStockExchanges(r),I,L,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 G(await t.getSymbols(a,i),I,L,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 G(await t.getSymbolsByTicker(r.query,i),I,L,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 G(await t.listAllBrokerageAuthorizationType(r.brokerage,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerageInstruments(...n){let[r={},i]=n;return G(await t.listAllBrokerageInstruments(r.slug,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerages(...n){let[r]=n;return G(await t.listAllBrokerages(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async symbolSearchUserAccount(...n){let[r={},i]=n,a={substring:r.substring};return G(await t.symbolSearchUserAccount(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Er=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))},symbolSearchUserAccount(...e){return r.symbolSearchUserAccount(...e).then(e=>e(n,t))}}};var Dr=class extends R{getPartnerInfo(...e){return Q(this.configuration).getPartnerInfo(...e).then(e=>e(this.axios,this.basePath))}getStockExchanges(...e){return Q(this.configuration).getStockExchanges(...e).then(e=>e(this.axios,this.basePath))}getSymbols(...e){return Q(this.configuration).getSymbols(...e).then(e=>e(this.axios,this.basePath))}getSymbolsByTicker(...e){return Q(this.configuration).getSymbolsByTicker(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerageAuthorizationType(...e){return Q(this.configuration).listAllBrokerageAuthorizationType(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerageInstruments(...e){return Q(this.configuration).listAllBrokerageInstruments(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerages(...e){return Q(this.configuration).listAllBrokerages(...e).then(e=>e(this.axios,this.basePath))}symbolSearchUserAccount(...e){return Q(this.configuration).symbolSearchUserAccount(...e).then(e=>e(this.axios,this.basePath))}},Or=class extends Dr{};let kr=function(e){return{cancelOrder:async(t,n,r,i,a={})=>{B(`cancelOrder`,`accountId`,t),B(`cancelOrder`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/trading/cancel`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/cancel`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},getCryptocurrencyPairQuote:async(t,n,r,i,a={})=>{B(`getCryptocurrencyPairQuote`,`accountId`,t),B(`getCryptocurrencyPairQuote`,`instrumentSymbol`,n);let o=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{instrumentSymbol}`,encodeURIComponent(String(n===void 0?`-instrumentSymbol-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},getOptionImpact:async(t,n,r,i,a={})=>{B(`getOptionImpact`,`accountId`,t),B(`getOptionImpact`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options/impact`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options/impact`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},getOrderImpact:async(t,n,r,i={})=>{B(`getOrderImpact`,`manualTradeForm`,t);let a=`/trade/impact`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/impact`,httpMethod:`POST`,operationAuth:d}),c.data=U(t,c,e),H(o,u),{url:W(o),options:c}},getUserAccountOptionQuotes:async(t,n,r,i,a={})=>{B(`getUserAccountOptionQuotes`,`accountId`,t),B(`getUserAccountOptionQuotes`,`symbol`,n);let o=`/accounts/{accountId}/quotes/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.symbol=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/quotes/options`,httpMethod:`GET`,operationAuth:f}),H(s,d),{url:W(s),options:l}},getUserAccountQuotes:async(t,n,r,i,a,o={})=>{B(`getUserAccountQuotes`,`symbols`,t),B(`getUserAccountQuotes`,`accountId`,n);let s=`/accounts/{accountId}/quotes`.replace(`{accountId}`,encodeURIComponent(String(n===void 0?`-accountId-`:n))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),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},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/quotes`,httpMethod:`GET`,operationAuth:p}),H(c,f),{url:W(c),options:u}},placeComplexOrder:async(t,n,r,i,a={})=>{B(`placeComplexOrder`,`accountId`,t),B(`placeComplexOrder`,`manualTradeFormComplex`,n);let o=`/accounts/{accountId}/trading/complex`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/complex`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},placeCryptoOrder:async(t,n,r,i,a={})=>{B(`placeCryptoOrder`,`accountId`,t),B(`placeCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},placeForceOrder:async(t,n,r,i={})=>{B(`placeForceOrder`,`manualTradeFormWithOptions`,t);let a=`/trade/place`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},q({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/place`,httpMethod:`POST`,operationAuth:d}),c.data=U(t,c,e),H(o,u),{url:W(o),options:c}},placeMlegOrder:async(t,n,r,i,a={})=>{B(`placeMlegOrder`,`accountId`,t),B(`placeMlegOrder`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},placeOrder:async(t,n,r,i,a={})=>{B(`placeOrder`,`tradeId`,t);let o=`/trade/{tradeId}`.replace(`{tradeId}`,encodeURIComponent(String(t===void 0?`-tradeId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/trade/{tradeId}`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},previewCryptoOrder:async(t,n,r,i,a={})=>{B(`previewCryptoOrder`,`accountId`,t),B(`previewCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto/preview`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto/preview`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},replaceOrder:async(t,n,r,i,a={})=>{B(`replaceOrder`,`accountId`,t),B(`replaceOrder`,`manualTradeReplaceForm`,n);let o=`/accounts/{accountId}/trading/replace`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},q({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/replace`,httpMethod:`POST`,operationAuth:f}),l.data=U(n,l,e),H(s,d),{url:W(s),options:l}},searchCryptocurrencyPairInstruments:async(t,n,r,i,a,o={})=>{B(`searchCryptocurrencyPairInstruments`,`accountId`,t);let s=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(f.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},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`,httpMethod:`GET`,operationAuth:p}),H(c,f),{url:W(c),options:u}}}},$=function(e){let t=kr(e);return{async cancelOrder(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id};return G(await t.cancelOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getCryptocurrencyPairQuote(...n){let[r={},i]=n;return G(await t.getCryptocurrencyPairQuote(r.accountId,r.instrumentSymbol,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.getOptionImpact(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.getOrderImpact(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOptionQuotes(...n){let[r={},i]=n;return G(await t.getUserAccountOptionQuotes(r.accountId,r.symbol,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountQuotes(...n){let[r={},i]=n;return G(await t.getUserAccountQuotes(r.symbols,r.accountId,r.useTicker,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeComplexOrder(...n){let[r={},i]=n,a={type:r.type,orders:r.orders,client_order_id:r.client_order_id};return G(await t.placeComplexOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.placeCryptoOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.placeForceOrder(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.placeMlegOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeOrder(...n){let[r={},i]=n,a={wait_to_confirm:r.wait_to_confirm};return G(await t.placeOrder(r.tradeId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.previewCryptoOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async 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 G(await t.replaceOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async searchCryptocurrencyPairInstruments(...n){let[r={},i]=n;return G(await t.searchCryptocurrencyPairInstruments(r.accountId,r.base,r.quote,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Ar=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 jr=class extends R{cancelOrder(...e){return $(this.configuration).cancelOrder(...e).then(e=>e(this.axios,this.basePath))}getCryptocurrencyPairQuote(...e){return $(this.configuration).getCryptocurrencyPairQuote(...e).then(e=>e(this.axios,this.basePath))}getOptionImpact(...e){return $(this.configuration).getOptionImpact(...e).then(e=>e(this.axios,this.basePath))}getOrderImpact(...e){return $(this.configuration).getOrderImpact(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOptionQuotes(...e){return $(this.configuration).getUserAccountOptionQuotes(...e).then(e=>e(this.axios,this.basePath))}getUserAccountQuotes(...e){return $(this.configuration).getUserAccountQuotes(...e).then(e=>e(this.axios,this.basePath))}placeComplexOrder(...e){return $(this.configuration).placeComplexOrder(...e).then(e=>e(this.axios,this.basePath))}placeCryptoOrder(...e){return $(this.configuration).placeCryptoOrder(...e).then(e=>e(this.axios,this.basePath))}placeForceOrder(...e){return $(this.configuration).placeForceOrder(...e).then(e=>e(this.axios,this.basePath))}placeMlegOrder(...e){return $(this.configuration).placeMlegOrder(...e).then(e=>e(this.axios,this.basePath))}placeOrder(...e){return $(this.configuration).placeOrder(...e).then(e=>e(this.axios,this.basePath))}previewCryptoOrder(...e){return $(this.configuration).previewCryptoOrder(...e).then(e=>e(this.axios,this.basePath))}replaceOrder(...e){return $(this.configuration).replaceOrder(...e).then(e=>e(this.axios,this.basePath))}searchCryptocurrencyPairInstruments(...e){return $(this.configuration).searchCryptocurrencyPairInstruments(...e).then(e=>e(this.axios,this.basePath))}},Mr=class extends jr{},Nr=class e{constructor(e){this.mode=`commercialApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},Pr=class e{constructor(e){this.mode=`personalApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},Fr=class{constructor(){}static commercialApiKey(e){return Nr.create(e)}static personalApiKey(e){return Pr.create(e)}},Ir=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.5/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`)}},Lr=class{constructor(e){}},Rr=class extends Lr{constructor(e){super(e);let t=new Ir(e);this.accountInformation=new sr(t),this.apiStatus=new fr(t),this.authentication=new gr(t),this.connections=new br(t),this.experimentalEndpoints=new wr(t),this.referenceData=new Or(t),this.trading=new Mr(t)}};e.AccountInformationApi=sr,e.AccountInformationApiAxiosParamCreator=ir,e.AccountInformationApiFactory=ar,e.AccountInformationApiFp=J,e.AccountInformationApiGenerated=or,e.ApiStatusApi=fr,e.ApiStatusApiAxiosParamCreator=cr,e.ApiStatusApiFactory=ur,e.ApiStatusApiFp=lr,e.ApiStatusApiGenerated=dr,e.AuthenticationApi=gr,e.AuthenticationApiAxiosParamCreator=pr,e.AuthenticationApiFactory=mr,e.AuthenticationApiFp=Y,e.AuthenticationApiGenerated=hr,e.CommercialApiKeyAuth=Nr,e.Configuration=Ir,e.ConnectionsApi=br,e.ConnectionsApiAxiosParamCreator=_r,e.ConnectionsApiFactory=vr,e.ConnectionsApiFp=X,e.ConnectionsApiGenerated=yr,e.ExperimentalEndpointsApi=wr,e.ExperimentalEndpointsApiAxiosParamCreator=xr,e.ExperimentalEndpointsApiFactory=Sr,e.ExperimentalEndpointsApiFp=Z,e.ExperimentalEndpointsApiGenerated=Cr,e.PersonalApiKeyAuth=Pr,e.ReferenceDataApi=Or,e.ReferenceDataApiAxiosParamCreator=Tr,e.ReferenceDataApiFactory=Er,e.ReferenceDataApiFp=Q,e.ReferenceDataApiGenerated=Dr,e.Snaptrade=Rr,e.SnaptradeAuth=Fr,e.SnaptradeError=Qn,e.TradingApi=Mr,e.TradingApiAxiosParamCreator=kr,e.TradingApiFactory=Ar,e.TradingApiFp=$,e.TradingApiGenerated=jr,e.parseIfJson=er,e.readableStreamToString=$n});
|
package/dist/index.cjs
CHANGED
|
@@ -5683,7 +5683,7 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
5683
5683
|
};
|
|
5684
5684
|
},
|
|
5685
5685
|
/**
|
|
5686
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
5686
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
5687
5687
|
* @summary Place complex order
|
|
5688
5688
|
* @param {string} accountId The ID of the account to execute the trade on.
|
|
5689
5689
|
* @param {ManualTradeFormComplex} manualTradeFormComplex
|
|
@@ -6471,7 +6471,7 @@ const TradingApiFp = function(configuration) {
|
|
|
6471
6471
|
});
|
|
6472
6472
|
},
|
|
6473
6473
|
/**
|
|
6474
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
6474
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
6475
6475
|
* @summary Place complex order
|
|
6476
6476
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
6477
6477
|
* @param {*} [options] Override http request option.
|
|
@@ -6786,7 +6786,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
6786
6786
|
return localVarFp.getUserAccountQuotes(...args).then((request) => request(axios$2, basePath));
|
|
6787
6787
|
},
|
|
6788
6788
|
/**
|
|
6789
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
6789
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
6790
6790
|
* @summary Place complex order
|
|
6791
6791
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
6792
6792
|
* @param {*} [options] Override http request option.
|
|
@@ -6942,7 +6942,7 @@ var TradingApiGenerated = class extends BaseAPI {
|
|
|
6942
6942
|
return TradingApiFp(this.configuration).getUserAccountQuotes(...args).then((request) => request(this.axios, this.basePath));
|
|
6943
6943
|
}
|
|
6944
6944
|
/**
|
|
6945
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
6945
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
6946
6946
|
* @summary Place complex order
|
|
6947
6947
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
6948
6948
|
* @param {*} [options] Override http request option.
|
|
@@ -7080,7 +7080,7 @@ var Configuration = class {
|
|
|
7080
7080
|
}
|
|
7081
7081
|
this.basePath = param.basePath;
|
|
7082
7082
|
this.baseOptions = param.baseOptions ?? {};
|
|
7083
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.
|
|
7083
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.5/typescript" : param.userAgent;
|
|
7084
7084
|
this.formDataCtor = param.formDataCtor;
|
|
7085
7085
|
}
|
|
7086
7086
|
/**
|
package/dist/index.d.cts
CHANGED
|
@@ -10142,7 +10142,7 @@ declare const TradingApiAxiosParamCreator: (configuration?: Configuration<AuthMo
|
|
|
10142
10142
|
*/
|
|
10143
10143
|
getUserAccountQuotes: (symbols: string, accountId: string, useTicker?: boolean, userId?: string, userSecret?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
10144
10144
|
/**
|
|
10145
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
10145
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
10146
10146
|
* @summary Place complex order
|
|
10147
10147
|
* @param {string} accountId The ID of the account to execute the trade on.
|
|
10148
10148
|
* @param {ManualTradeFormComplex} manualTradeFormComplex
|
|
@@ -10285,7 +10285,7 @@ declare const TradingApiFp: <TAuth extends AuthMode>(configuration?: Configurati
|
|
|
10285
10285
|
*/
|
|
10286
10286
|
getUserAccountQuotes(...args: TradingApiGetUserAccountQuotesArgs<TAuth>): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<SymbolsQuotesInner>>>;
|
|
10287
10287
|
/**
|
|
10288
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
10288
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
10289
10289
|
* @summary Place complex order
|
|
10290
10290
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
10291
10291
|
* @param {*} [options] Override http request option.
|
|
@@ -10404,7 +10404,7 @@ declare const TradingApiFactory: <TAuth extends AuthMode>(configuration?: Config
|
|
|
10404
10404
|
*/
|
|
10405
10405
|
getUserAccountQuotes(...args: TradingApiGetUserAccountQuotesArgs<TAuth>): AxiosPromise<Array<SymbolsQuotesInner>>;
|
|
10406
10406
|
/**
|
|
10407
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
10407
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
10408
10408
|
* @summary Place complex order
|
|
10409
10409
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
10410
10410
|
* @param {*} [options] Override http request option.
|
|
@@ -10931,7 +10931,7 @@ declare class TradingApiGenerated<TAuth extends AuthMode> extends BaseAPI<TAuth>
|
|
|
10931
10931
|
*/
|
|
10932
10932
|
getUserAccountQuotes(...args: TradingApiGetUserAccountQuotesArgs<TAuth>): Promise<_$axios.AxiosResponse<SymbolsQuotesInner[], any, {}>>;
|
|
10933
10933
|
/**
|
|
10934
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
10934
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
10935
10935
|
* @summary Place complex order
|
|
10936
10936
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
10937
10937
|
* @param {*} [options] Override http request option.
|
package/dist/index.d.mts
CHANGED
|
@@ -10142,7 +10142,7 @@ declare const TradingApiAxiosParamCreator: (configuration?: Configuration<AuthMo
|
|
|
10142
10142
|
*/
|
|
10143
10143
|
getUserAccountQuotes: (symbols: string, accountId: string, useTicker?: boolean, userId?: string, userSecret?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
10144
10144
|
/**
|
|
10145
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
10145
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
10146
10146
|
* @summary Place complex order
|
|
10147
10147
|
* @param {string} accountId The ID of the account to execute the trade on.
|
|
10148
10148
|
* @param {ManualTradeFormComplex} manualTradeFormComplex
|
|
@@ -10285,7 +10285,7 @@ declare const TradingApiFp: <TAuth extends AuthMode>(configuration?: Configurati
|
|
|
10285
10285
|
*/
|
|
10286
10286
|
getUserAccountQuotes(...args: TradingApiGetUserAccountQuotesArgs<TAuth>): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<SymbolsQuotesInner>>>;
|
|
10287
10287
|
/**
|
|
10288
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
10288
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
10289
10289
|
* @summary Place complex order
|
|
10290
10290
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
10291
10291
|
* @param {*} [options] Override http request option.
|
|
@@ -10404,7 +10404,7 @@ declare const TradingApiFactory: <TAuth extends AuthMode>(configuration?: Config
|
|
|
10404
10404
|
*/
|
|
10405
10405
|
getUserAccountQuotes(...args: TradingApiGetUserAccountQuotesArgs<TAuth>): AxiosPromise<Array<SymbolsQuotesInner>>;
|
|
10406
10406
|
/**
|
|
10407
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
10407
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
10408
10408
|
* @summary Place complex order
|
|
10409
10409
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
10410
10410
|
* @param {*} [options] Override http request option.
|
|
@@ -10931,7 +10931,7 @@ declare class TradingApiGenerated<TAuth extends AuthMode> extends BaseAPI<TAuth>
|
|
|
10931
10931
|
*/
|
|
10932
10932
|
getUserAccountQuotes(...args: TradingApiGetUserAccountQuotesArgs<TAuth>): Promise<_$axios.AxiosResponse<SymbolsQuotesInner[], any, {}>>;
|
|
10933
10933
|
/**
|
|
10934
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
10934
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
10935
10935
|
* @summary Place complex order
|
|
10936
10936
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
10937
10937
|
* @param {*} [options] Override http request option.
|
package/dist/index.d.ts
CHANGED
|
@@ -10142,7 +10142,7 @@ declare const TradingApiAxiosParamCreator: (configuration?: Configuration<AuthMo
|
|
|
10142
10142
|
*/
|
|
10143
10143
|
getUserAccountQuotes: (symbols: string, accountId: string, useTicker?: boolean, userId?: string, userSecret?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
10144
10144
|
/**
|
|
10145
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
10145
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
10146
10146
|
* @summary Place complex order
|
|
10147
10147
|
* @param {string} accountId The ID of the account to execute the trade on.
|
|
10148
10148
|
* @param {ManualTradeFormComplex} manualTradeFormComplex
|
|
@@ -10285,7 +10285,7 @@ declare const TradingApiFp: <TAuth extends AuthMode>(configuration?: Configurati
|
|
|
10285
10285
|
*/
|
|
10286
10286
|
getUserAccountQuotes(...args: TradingApiGetUserAccountQuotesArgs<TAuth>): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<SymbolsQuotesInner>>>;
|
|
10287
10287
|
/**
|
|
10288
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
10288
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
10289
10289
|
* @summary Place complex order
|
|
10290
10290
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
10291
10291
|
* @param {*} [options] Override http request option.
|
|
@@ -10404,7 +10404,7 @@ declare const TradingApiFactory: <TAuth extends AuthMode>(configuration?: Config
|
|
|
10404
10404
|
*/
|
|
10405
10405
|
getUserAccountQuotes(...args: TradingApiGetUserAccountQuotesArgs<TAuth>): AxiosPromise<Array<SymbolsQuotesInner>>;
|
|
10406
10406
|
/**
|
|
10407
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
10407
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
10408
10408
|
* @summary Place complex order
|
|
10409
10409
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
10410
10410
|
* @param {*} [options] Override http request option.
|
|
@@ -10931,7 +10931,7 @@ declare class TradingApiGenerated<TAuth extends AuthMode> extends BaseAPI<TAuth>
|
|
|
10931
10931
|
*/
|
|
10932
10932
|
getUserAccountQuotes(...args: TradingApiGetUserAccountQuotesArgs<TAuth>): Promise<_$axios.AxiosResponse<SymbolsQuotesInner[], any, {}>>;
|
|
10933
10933
|
/**
|
|
10934
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
10934
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
10935
10935
|
* @summary Place complex order
|
|
10936
10936
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
10937
10937
|
* @param {*} [options] Override http request option.
|
package/dist/index.mjs
CHANGED
|
@@ -5659,7 +5659,7 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
5659
5659
|
};
|
|
5660
5660
|
},
|
|
5661
5661
|
/**
|
|
5662
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
5662
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
5663
5663
|
* @summary Place complex order
|
|
5664
5664
|
* @param {string} accountId The ID of the account to execute the trade on.
|
|
5665
5665
|
* @param {ManualTradeFormComplex} manualTradeFormComplex
|
|
@@ -6447,7 +6447,7 @@ const TradingApiFp = function(configuration) {
|
|
|
6447
6447
|
});
|
|
6448
6448
|
},
|
|
6449
6449
|
/**
|
|
6450
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
6450
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
6451
6451
|
* @summary Place complex order
|
|
6452
6452
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
6453
6453
|
* @param {*} [options] Override http request option.
|
|
@@ -6762,7 +6762,7 @@ const TradingApiFactory = function(configuration, basePath, axios) {
|
|
|
6762
6762
|
return localVarFp.getUserAccountQuotes(...args).then((request) => request(axios, basePath));
|
|
6763
6763
|
},
|
|
6764
6764
|
/**
|
|
6765
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
6765
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
6766
6766
|
* @summary Place complex order
|
|
6767
6767
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
6768
6768
|
* @param {*} [options] Override http request option.
|
|
@@ -6918,7 +6918,7 @@ var TradingApiGenerated = class extends BaseAPI {
|
|
|
6918
6918
|
return TradingApiFp(this.configuration).getUserAccountQuotes(...args).then((request) => request(this.axios, this.basePath));
|
|
6919
6919
|
}
|
|
6920
6920
|
/**
|
|
6921
|
-
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
6921
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
6922
6922
|
* @summary Place complex order
|
|
6923
6923
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
6924
6924
|
* @param {*} [options] Override http request option.
|
|
@@ -7056,7 +7056,7 @@ var Configuration = class {
|
|
|
7056
7056
|
}
|
|
7057
7057
|
this.basePath = param.basePath;
|
|
7058
7058
|
this.baseOptions = param.baseOptions ?? {};
|
|
7059
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.
|
|
7059
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.5/typescript" : param.userAgent;
|
|
7060
7060
|
this.formDataCtor = param.formDataCtor;
|
|
7061
7061
|
}
|
|
7062
7062
|
/**
|