snaptrade-typescript-sdk 10.0.7 → 10.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Connect brokerage accounts to your app for live positions and trading
8
8
 
9
- [![npm](https://img.shields.io/badge/npm-v10.0.7-blue)](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/10.0.7)
9
+ [![npm](https://img.shields.io/badge/npm-v10.0.8-blue)](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/10.0.8)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
11
11
 
12
12
  </div>
@@ -1463,6 +1463,7 @@ const addSubscriptionResponse =
1463
1463
  userId: "snaptrade-user-123",
1464
1464
  userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
1465
1465
  account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
1466
+ check_interval_seconds: 300,
1466
1467
  });
1467
1468
  ```
1468
1469
 
@@ -1472,6 +1473,10 @@ const addSubscriptionResponse =
1472
1473
 
1473
1474
  Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
1474
1475
 
1476
+ ##### check_interval_seconds: `number`<a id="check_interval_seconds-number"></a>
1477
+
1478
+ How often the subscribed account should be checked for new trades. Must match an active Trade Detection plan.
1479
+
1475
1480
  ##### userId: `string`<a id="userid-string"></a>
1476
1481
 
1477
1482
  ##### userSecret: `string`<a id="usersecret-string"></a>
@@ -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&&Sn.assertOptions(n,{silentJSONParsing:P.transitional(P.boolean),forcedJSONParsing:P.transitional(P.boolean),clarifyTimeoutError:P.transitional(P.boolean),legacyInterceptorReqResOrdering:P.transitional(P.boolean)},!1),r!=null&&(O.isFunction(r)?t.paramsSerializer={serialize:r}:Sn.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),Sn.assertOptions(t,{baseUrl:P.spelling(`baseURL`),withXsrfToken:P.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&O.merge(i.common,i[t.method]);i&&O.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=k.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||_t;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=[vn.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=vn.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),ht(Gt(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};O.forEach([`delete`,`get`,`head`,`options`],function(e){F.prototype[e]=function(t,n){return this.request(N(n||{},{method:e,url:t,data:(n||{}).data}))}}),O.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 Cn=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 Nt(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 wn(e){return function(t){return e.apply(null,t)}}function Tn(e){return O.isObject(e)&&e.isAxiosError===!0}let En={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(En).forEach(([e,t])=>{En[t]=e});function Dn(e){let t=new F(e),n=r(F.prototype.request,t);return O.extend(n,F.prototype,t,{allOwnKeys:!0}),O.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Dn(N(e,t))},n}let I=Dn(At);I.Axios=F,I.CanceledError=Nt,I.CancelToken=Cn,I.isCancel=Mt,I.VERSION=an,I.toFormData=ut,I.AxiosError=A,I.Cancel=I.CanceledError,I.all=function(e){return Promise.all(e)},I.spread=wn,I.isAxiosError=Tn,I.mergeConfig=N,I.AxiosHeaders=k,I.formToJSON=e=>Ot(O.isHTMLForm(e)?new FormData(e):e),I.getAdapter=gn.getAdapter,I.HttpStatusCode=En,I.default=I;let{Axios:On,AxiosError:kn,CanceledError:An,isCancel:jn,CancelToken:Mn,VERSION:Nn,all:Pn,Cancel:Fn,isAxiosError:In,spread:Ln,toFormData:Rn,AxiosHeaders:zn,HttpStatusCode:Bn,formToJSON:Vn,getAdapter:Hn,mergeConfig:Un,create:Wn}=I,L=`https://api.snaptrade.com/api/v1`.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)}},Gn=class extends Error{constructor(e,t){super(t),this.field=e,this.name=`RequiredError`}};function Kn(){return typeof process<`u`&&process.versions&&process.versions.node}async function qn(e,t){if(Kn()){let n=require(`crypto`).createHmac(`sha256`,t);return n.update(e),n.digest(`base64`)}else{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),s=Array.from(new Uint8Array(o));return btoa(String.fromCharCode.apply(null,s))}}let Jn=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 Yn(e){let{configuration:t,basePath:n,axiosArgs:r,url:i}=e;if(t?.consumerKey===void 0)throw Error(`Consumer key is required`);let a=encodeURI(t.consumerKey),o=r.options.data===void 0||r.options.data===`{}`?null:JSON.parse(r.options.data),s=r.url.indexOf(`?`)===-1?`${r.url}`:`${r.url.split(`?`)[0]}`,c=await qn(Jn({content:o,path:`/api/v1${s}`,query:i.replace(n,``).replace(s,``).replace(`?`,``)}),a);r.options.headers&&(r.options.headers.Signature=c)}var Xn=class extends Error{constructor(e,t,n){let r=e.message+`
10
10
  RESPONSE HEADERS:
11
- `+JSON.stringify(n,null,2);super(r),this.name=`SnaptradeError`,this.code=e.code,this.method=e.config?.method?.toUpperCase(),this.url=e.config?.url,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 Zn(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 Qn(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 Gn(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 $n(e,t,n=``){typeof t==`object`?Array.isArray(t)?t.forEach(t=>$n(e,t,n)):Object.keys(t).forEach(r=>$n(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);$n(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 er(e.pathname)+e.search+e.hash},er=function(e){return e.replace(/\/$/,``)};async function tr(e){let t=0,n=5e3;for(;t<3;)try{return await e()}catch(e){if(e instanceof kn&&e.isAxiosError){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}try{throw new Xn(e,Qn(e.response?.data instanceof ReadableStream?await Zn(e.response.data):e.response?.data),e.response?.headers)}catch(t){throw t instanceof ReferenceError?new Xn(e,e.response?.data,e.response?.headers):t instanceof Xn?t:e}}throw e}throw Error(`Request failed after 3 retries due to 429 (rate limit) errors.`)}let G=function(e,t,n,r){return async(i=t,a=n)=>{let o=(r?.basePath||a)+e.url;return await Yn({axiosArgs:e,basePath:a,url:o,configuration:r}),tr(async()=>await i.request({...e.options,url:o}))}};function K(){return typeof window<`u`}function q(e){let{queryParameters:t}=e;t.timestamp=Math.round(new Date().getTime()/1e3).toString()}let nr=function(e){return{getAccountActivities:async(t,n,r,i,a,o,s,c,l={})=>{B(`getAccountActivities`,`accountId`,t),B(`getAccountActivities`,`userId`,n),B(`getAccountActivities`,`userSecret`,r);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={};await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:m,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:h,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),i!==void 0&&(h.startDate=i instanceof Date?i.toISOString().substr(0,10):i),a!==void 0&&(h.endDate=a instanceof Date?a.toISOString().substr(0,10):a),o!==void 0&&(h.offset=o),s!==void 0&&(h.limit=s),c!==void 0&&(h.type=c),n!==void 0&&(h.userId=n),r!==void 0&&(h.userSecret=r);let g=f&&f.headers?f.headers:{};return p.headers={...m,...g,...l.headers},q({queryParameters:h,requestConfig:p,path:u,configuration:e,pathTemplate:`/accounts/{accountId}/activities`,httpMethod:`GET`}),H(d,h),{url:W(d),options:p}},getAccountBalanceHistory:async(t,n,r,i={})=>{B(`getAccountBalanceHistory`,`userId`,t),B(`getAccountBalanceHistory`,`userSecret`,n),B(`getAccountBalanceHistory`,`accountId`,r);let a=`/accounts/{accountId}/balanceHistory`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balanceHistory`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},getAllAccountPositions:async(t,n,r,i={})=>{B(`getAllAccountPositions`,`userId`,t),B(`getAllAccountPositions`,`userSecret`,n),B(`getAllAccountPositions`,`accountId`,r);let a=`/accounts/{accountId}/positions/all`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/positions/all`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},getAllUserHoldings:async(t,n,r,i={})=>{B(`getAllUserHoldings`,`userId`,t),B(`getAllUserHoldings`,`userSecret`,n);let a=`/holdings`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n),r!==void 0&&(u.brokerage_authorizations=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/holdings`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},getUserAccountBalance:async(t,n,r,i={})=>{B(`getUserAccountBalance`,`userId`,t),B(`getUserAccountBalance`,`userSecret`,n),B(`getUserAccountBalance`,`accountId`,r);let a=`/accounts/{accountId}/balances`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balances`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},getUserAccountDetails:async(t,n,r,i={})=>{B(`getUserAccountDetails`,`userId`,t),B(`getUserAccountDetails`,`userSecret`,n),B(`getUserAccountDetails`,`accountId`,r);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},getUserAccountOrderDetail:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetail`,`accountId`,t),B(`getUserAccountOrderDetail`,`userId`,n),B(`getUserAccountOrderDetail`,`userSecret`,r),B(`getUserAccountOrderDetail`,`accountInformationGetUserAccountOrderDetailRequest`,i);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={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(d.userId=n),r!==void 0&&(d.userSecret=r),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},getUserAccountOrders:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrders`,`userId`,t),B(`getUserAccountOrders`,`userSecret`,n),B(`getUserAccountOrders`,`accountId`,r);let s=`/accounts/{accountId}/orders`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:d,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:f,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(f.userId=t),n!==void 0&&(f.userSecret=n),i!==void 0&&(f.state=i),a!==void 0&&(f.days=a);let p=l&&l.headers?l.headers:{};return u.headers={...d,...p,...o.headers},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders`,httpMethod:`GET`}),H(c,f),{url:W(c),options:u}},getUserAccountPositions:async(t,n,r,i={})=>{B(`getUserAccountPositions`,`userId`,t),B(`getUserAccountPositions`,`userSecret`,n),B(`getUserAccountPositions`,`accountId`,r);let a=`/accounts/{accountId}/positions`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/positions`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},getUserAccountRecentOrders:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrders`,`userId`,t),B(`getUserAccountRecentOrders`,`userSecret`,n),B(`getUserAccountRecentOrders`,`accountId`,r);let o=`/accounts/{accountId}/recentOrders`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),i!==void 0&&(d.only_executed=i);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},getUserAccountReturnRates:async(t,n,r,i,a={})=>{B(`getUserAccountReturnRates`,`userId`,t),B(`getUserAccountReturnRates`,`userSecret`,n),B(`getUserAccountReturnRates`,`accountId`,r);let o=`/accounts/{accountId}/returnRates`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),i!==void 0&&(d.timeframes=i);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/returnRates`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},getUserHoldings:async(t,n,r,i={})=>{B(`getUserHoldings`,`accountId`,t),B(`getUserHoldings`,`userId`,n),B(`getUserHoldings`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/holdings`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},listUserAccounts:async(t,n,r={})=>{B(`listUserAccounts`,`userId`,t),B(`listUserAccounts`,`userSecret`,n);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={};await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:c,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:l,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n);let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...r.headers},q({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/accounts`,httpMethod:`GET`}),H(a,l),{url:W(a),options:s}},updateUserAccount:async(t,n,r,i={})=>{B(`updateUserAccount`,`userId`,t),B(`updateUserAccount`,`userSecret`,n),B(`updateUserAccount`,`accountId`,r);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`PUT`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`PUT`}),H(o,u),{url:W(o),options:c}}}},J=function(e){let t=nr(e);return{async getAccountActivities(n,r){return G(await t.getAccountActivities(n.accountId,n.userId,n.userSecret,n.startDate,n.endDate,n.offset,n.limit,n.type,r),I,L,e)},async getAccountBalanceHistory(n,r){return G(await t.getAccountBalanceHistory(n.userId,n.userSecret,n.accountId,r),I,L,e)},async getAllAccountPositions(n,r){return G(await t.getAllAccountPositions(n.userId,n.userSecret,n.accountId,r),I,L,e)},async getAllUserHoldings(n,r){return G(await t.getAllUserHoldings(n.userId,n.userSecret,n.brokerageAuthorizations,r),I,L,e)},async getUserAccountBalance(n,r){return G(await t.getUserAccountBalance(n.userId,n.userSecret,n.accountId,r),I,L,e)},async getUserAccountDetails(n,r){return G(await t.getUserAccountDetails(n.userId,n.userSecret,n.accountId,r),I,L,e)},async getUserAccountOrderDetail(n,r){let i={brokerage_order_id:n.brokerage_order_id};return G(await t.getUserAccountOrderDetail(n.accountId,n.userId,n.userSecret,i,r),I,L,e)},async getUserAccountOrders(n,r){return G(await t.getUserAccountOrders(n.userId,n.userSecret,n.accountId,n.state,n.days,r),I,L,e)},async getUserAccountPositions(n,r){return G(await t.getUserAccountPositions(n.userId,n.userSecret,n.accountId,r),I,L,e)},async getUserAccountRecentOrders(n,r){return G(await t.getUserAccountRecentOrders(n.userId,n.userSecret,n.accountId,n.onlyExecuted,r),I,L,e)},async getUserAccountReturnRates(n,r){return G(await t.getUserAccountReturnRates(n.userId,n.userSecret,n.accountId,n.timeframes,r),I,L,e)},async getUserHoldings(n,r){return G(await t.getUserHoldings(n.accountId,n.userId,n.userSecret,r),I,L,e)},async listUserAccounts(n,r){return G(await t.listUserAccounts(n.userId,n.userSecret,r),I,L,e)},async updateUserAccount(n,r){return G(await t.updateUserAccount(n.userId,n.userSecret,n.accountId,r),I,L,e)}}},rr=function(e,t,n){let r=J(e);return{getAccountActivities(e,i){return r.getAccountActivities(e,i).then(e=>e(n,t))},getAccountBalanceHistory(e,i){return r.getAccountBalanceHistory(e,i).then(e=>e(n,t))},getAllAccountPositions(e,i){return r.getAllAccountPositions(e,i).then(e=>e(n,t))},getAllUserHoldings(e,i){return r.getAllUserHoldings(e,i).then(e=>e(n,t))},getUserAccountBalance(e,i){return r.getUserAccountBalance(e,i).then(e=>e(n,t))},getUserAccountDetails(e,i){return r.getUserAccountDetails(e,i).then(e=>e(n,t))},getUserAccountOrderDetail(e,i){return r.getUserAccountOrderDetail(e,i).then(e=>e(n,t))},getUserAccountOrders(e,i){return r.getUserAccountOrders(e,i).then(e=>e(n,t))},getUserAccountPositions(e,i){return r.getUserAccountPositions(e,i).then(e=>e(n,t))},getUserAccountRecentOrders(e,i){return r.getUserAccountRecentOrders(e,i).then(e=>e(n,t))},getUserAccountReturnRates(e,i){return r.getUserAccountReturnRates(e,i).then(e=>e(n,t))},getUserHoldings(e,i){return r.getUserHoldings(e,i).then(e=>e(n,t))},listUserAccounts(e,i){return r.listUserAccounts(e,i).then(e=>e(n,t))},updateUserAccount(e,i){return r.updateUserAccount(e,i).then(e=>e(n,t))}}};var ir=class extends R{getAccountActivities(e,t){return J(this.configuration).getAccountActivities(e,t).then(e=>e(this.axios,this.basePath))}getAccountBalanceHistory(e,t){return J(this.configuration).getAccountBalanceHistory(e,t).then(e=>e(this.axios,this.basePath))}getAllAccountPositions(e,t){return J(this.configuration).getAllAccountPositions(e,t).then(e=>e(this.axios,this.basePath))}getAllUserHoldings(e,t){return J(this.configuration).getAllUserHoldings(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountBalance(e,t){return J(this.configuration).getUserAccountBalance(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountDetails(e,t){return J(this.configuration).getUserAccountDetails(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetail(e,t){return J(this.configuration).getUserAccountOrderDetail(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountOrders(e,t){return J(this.configuration).getUserAccountOrders(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountPositions(e,t){return J(this.configuration).getUserAccountPositions(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrders(e,t){return J(this.configuration).getUserAccountRecentOrders(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountReturnRates(e,t){return J(this.configuration).getUserAccountReturnRates(e,t).then(e=>e(this.axios,this.basePath))}getUserHoldings(e,t){return J(this.configuration).getUserHoldings(e,t).then(e=>e(this.axios,this.basePath))}listUserAccounts(e,t){return J(this.configuration).listUserAccounts(e,t).then(e=>e(this.axios,this.basePath))}updateUserAccount(e,t){return J(this.configuration).updateUserAccount(e,t).then(e=>e(this.axios,this.basePath))}},ar=class extends ir{};let or=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=r&&r.headers?r.headers:{};return i.headers={...a,...s,...t.headers},q({queryParameters:o,requestConfig:i,path:`/`,configuration:e,pathTemplate:`/`,httpMethod:`GET`}),H(n,o),{url:W(n),options:i}}}},sr=function(e){let t=or(e);return{async check(n){return G(await t.check(n),I,L,e)}}},cr=function(e,t,n){let r=sr(e);return{check(e){return r.check(e).then(e=>e(n,t))}}};var lr=class extends R{check(e){return sr(this.configuration).check(e).then(e=>e(this.axios,this.basePath))}},ur=class extends lr{};let dr=function(e){return{deleteSnapTradeUser:async(t,n={})=>{B(`deleteSnapTradeUser`,`userId`,t);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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(c.userId=t);let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/deleteUser`,httpMethod:`DELETE`}),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={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/listUsers`,httpMethod:`GET`}),H(r,s),{url:W(r),options:a}},loginSnapTradeUser:async(t,n,r,i={})=>{B(`loginSnapTradeUser`,`userId`,t),B(`loginSnapTradeUser`,`userSecret`,n);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n),l[`Content-Type`]=`application/json`;let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({requestBody:r,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/login`,httpMethod:`POST`}),c.data=U(r,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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),s[`Content-Type`]=`application/json`;let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/registerUser`,httpMethod:`POST`}),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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),s[`Content-Type`]=`application/json`;let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/resetUserSecret`,httpMethod:`POST`}),o.data=U(t,o,e),H(i,c),{url:W(i),options:o}}}},Y=function(e){let t=dr(e);return{async deleteSnapTradeUser(n,r){return G(await t.deleteSnapTradeUser(n.userId,r),I,L,e)},async listSnapTradeUsers(n){return G(await t.listSnapTradeUsers(n),I,L,e)},async loginSnapTradeUser(n,r){let i={broker:n.broker,immediateRedirect:n.immediateRedirect,customRedirect:n.customRedirect,reconnect:n.reconnect,connectionType:n.connectionType,showCloseButton:n.showCloseButton,darkMode:n.darkMode,connectionPortalVersion:n.connectionPortalVersion};return G(await t.loginSnapTradeUser(n.userId,n.userSecret,i,r),I,L,e)},async registerSnapTradeUser(n,r){let i={userId:n.userId};return G(await t.registerSnapTradeUser(i,r),I,L,e)},async resetSnapTradeUserSecret(n,r){let i={userId:n.userId,userSecret:n.userSecret};return G(await t.resetSnapTradeUserSecret(i,r),I,L,e)}}},fr=function(e,t,n){let r=Y(e);return{deleteSnapTradeUser(e,i){return r.deleteSnapTradeUser(e,i).then(e=>e(n,t))},listSnapTradeUsers(e){return r.listSnapTradeUsers(e).then(e=>e(n,t))},loginSnapTradeUser(e,i){return r.loginSnapTradeUser(e,i).then(e=>e(n,t))},registerSnapTradeUser(e,i){return r.registerSnapTradeUser(e,i).then(e=>e(n,t))},resetSnapTradeUserSecret(e,i){return r.resetSnapTradeUserSecret(e,i).then(e=>e(n,t))}}};var pr=class extends R{deleteSnapTradeUser(e,t){return Y(this.configuration).deleteSnapTradeUser(e,t).then(e=>e(this.axios,this.basePath))}listSnapTradeUsers(e){return Y(this.configuration).listSnapTradeUsers(e).then(e=>e(this.axios,this.basePath))}loginSnapTradeUser(e,t){return Y(this.configuration).loginSnapTradeUser(e,t).then(e=>e(this.axios,this.basePath))}registerSnapTradeUser(e,t){return Y(this.configuration).registerSnapTradeUser(e,t).then(e=>e(this.axios,this.basePath))}resetSnapTradeUserSecret(e,t){return Y(this.configuration).resetSnapTradeUserSecret(e,t).then(e=>e(this.axios,this.basePath))}},mr=class extends pr{};let hr=function(e){return{deleteConnection:async(t,n,r,i={})=>{B(`deleteConnection`,`connectionId`,t),B(`deleteConnection`,`userId`,n),B(`deleteConnection`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connection/{connectionId}`,httpMethod:`DELETE`}),H(o,u),{url:W(o),options:c}},detailBrokerageAuthorization:async(t,n,r,i={})=>{B(`detailBrokerageAuthorization`,`authorizationId`,t),B(`detailBrokerageAuthorization`,`userId`,n),B(`detailBrokerageAuthorization`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},disableBrokerageAuthorization:async(t,n,r,i={})=>{B(`disableBrokerageAuthorization`,`authorizationId`,t),B(`disableBrokerageAuthorization`,`userId`,n),B(`disableBrokerageAuthorization`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/disable`,httpMethod:`POST`}),H(o,u),{url:W(o),options:c}},listBrokerageAuthorizationAccounts:async(t,n,r,i={})=>{B(`listBrokerageAuthorizationAccounts`,`authorizationId`,t),B(`listBrokerageAuthorizationAccounts`,`userId`,n),B(`listBrokerageAuthorizationAccounts`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/accounts`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},listBrokerageAuthorizations:async(t,n,r={})=>{B(`listBrokerageAuthorizations`,`userId`,t),B(`listBrokerageAuthorizations`,`userSecret`,n);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={};await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:c,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:l,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n);let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...r.headers},q({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/authorizations`,httpMethod:`GET`}),H(a,l),{url:W(a),options:s}},refreshBrokerageAuthorization:async(t,n,r,i={})=>{B(`refreshBrokerageAuthorization`,`authorizationId`,t),B(`refreshBrokerageAuthorization`,`userId`,n),B(`refreshBrokerageAuthorization`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/refresh`,httpMethod:`POST`}),H(o,u),{url:W(o),options:c}},removeBrokerageAuthorization:async(t,n,r,i={})=>{B(`removeBrokerageAuthorization`,`authorizationId`,t),B(`removeBrokerageAuthorization`,`userId`,n),B(`removeBrokerageAuthorization`,`userSecret`,r);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:`DELETE`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}`,httpMethod:`DELETE`}),H(o,u),{url:W(o),options:c}},returnRates:async(t,n,r,i,a={})=>{B(`returnRates`,`userId`,t),B(`returnRates`,`userSecret`,n),B(`returnRates`,`authorizationId`,r);let o=`/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`,encodeURIComponent(String(r===void 0?`-authorizationId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),i!==void 0&&(d.timeframes=i);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/authorizations/{authorizationId}/returnRates`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},sessionEvents:async(t,n,r,i={})=>{B(`sessionEvents`,`partnerClientId`,t);let a=`/sessionEvents`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.PartnerClientId=t),n!==void 0&&(u.userId=n),r!==void 0&&(u.sessionId=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/sessionEvents`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},syncBrokerageAuthorizationTransactions:async(t,n,r,i={})=>{B(`syncBrokerageAuthorizationTransactions`,`authorizationId`,t),B(`syncBrokerageAuthorizationTransactions`,`userId`,n),B(`syncBrokerageAuthorizationTransactions`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/transactions/sync`,httpMethod:`POST`}),H(o,u),{url:W(o),options:c}}}},X=function(e){let t=hr(e);return{async deleteConnection(n,r){return G(await t.deleteConnection(n.connectionId,n.userId,n.userSecret,r),I,L,e)},async detailBrokerageAuthorization(n,r){return G(await t.detailBrokerageAuthorization(n.authorizationId,n.userId,n.userSecret,r),I,L,e)},async disableBrokerageAuthorization(n,r){return G(await t.disableBrokerageAuthorization(n.authorizationId,n.userId,n.userSecret,r),I,L,e)},async listBrokerageAuthorizationAccounts(n,r){return G(await t.listBrokerageAuthorizationAccounts(n.authorizationId,n.userId,n.userSecret,r),I,L,e)},async listBrokerageAuthorizations(n,r){return G(await t.listBrokerageAuthorizations(n.userId,n.userSecret,r),I,L,e)},async refreshBrokerageAuthorization(n,r){return G(await t.refreshBrokerageAuthorization(n.authorizationId,n.userId,n.userSecret,r),I,L,e)},async removeBrokerageAuthorization(n,r){return G(await t.removeBrokerageAuthorization(n.authorizationId,n.userId,n.userSecret,r),I,L,e)},async returnRates(n,r){return G(await t.returnRates(n.userId,n.userSecret,n.authorizationId,n.timeframes,r),I,L,e)},async sessionEvents(n,r){return G(await t.sessionEvents(n.partnerClientId,n.userId,n.sessionId,r),I,L,e)},async syncBrokerageAuthorizationTransactions(n,r){return G(await t.syncBrokerageAuthorizationTransactions(n.authorizationId,n.userId,n.userSecret,r),I,L,e)}}},gr=function(e,t,n){let r=X(e);return{deleteConnection(e,i){return r.deleteConnection(e,i).then(e=>e(n,t))},detailBrokerageAuthorization(e,i){return r.detailBrokerageAuthorization(e,i).then(e=>e(n,t))},disableBrokerageAuthorization(e,i){return r.disableBrokerageAuthorization(e,i).then(e=>e(n,t))},listBrokerageAuthorizationAccounts(e,i){return r.listBrokerageAuthorizationAccounts(e,i).then(e=>e(n,t))},listBrokerageAuthorizations(e,i){return r.listBrokerageAuthorizations(e,i).then(e=>e(n,t))},refreshBrokerageAuthorization(e,i){return r.refreshBrokerageAuthorization(e,i).then(e=>e(n,t))},removeBrokerageAuthorization(e,i){return r.removeBrokerageAuthorization(e,i).then(e=>e(n,t))},returnRates(e,i){return r.returnRates(e,i).then(e=>e(n,t))},sessionEvents(e,i){return r.sessionEvents(e,i).then(e=>e(n,t))},syncBrokerageAuthorizationTransactions(e,i){return r.syncBrokerageAuthorizationTransactions(e,i).then(e=>e(n,t))}}};var _r=class extends R{deleteConnection(e,t){return X(this.configuration).deleteConnection(e,t).then(e=>e(this.axios,this.basePath))}detailBrokerageAuthorization(e,t){return X(this.configuration).detailBrokerageAuthorization(e,t).then(e=>e(this.axios,this.basePath))}disableBrokerageAuthorization(e,t){return X(this.configuration).disableBrokerageAuthorization(e,t).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizationAccounts(e,t){return X(this.configuration).listBrokerageAuthorizationAccounts(e,t).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizations(e,t){return X(this.configuration).listBrokerageAuthorizations(e,t).then(e=>e(this.axios,this.basePath))}refreshBrokerageAuthorization(e,t){return X(this.configuration).refreshBrokerageAuthorization(e,t).then(e=>e(this.axios,this.basePath))}removeBrokerageAuthorization(e,t){return X(this.configuration).removeBrokerageAuthorization(e,t).then(e=>e(this.axios,this.basePath))}returnRates(e,t){return X(this.configuration).returnRates(e,t).then(e=>e(this.axios,this.basePath))}sessionEvents(e,t){return X(this.configuration).sessionEvents(e,t).then(e=>e(this.axios,this.basePath))}syncBrokerageAuthorizationTransactions(e,t){return X(this.configuration).syncBrokerageAuthorizationTransactions(e,t).then(e=>e(this.axios,this.basePath))}},vr=class extends _r{};let yr=function(e){return{addSubscription:async(t,n,r,i={})=>{B(`addSubscription`,`userId`,t),B(`addSubscription`,`userSecret`,n),B(`addSubscription`,`tradeDetectionAddSubscriptionRequest`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n),l[`Content-Type`]=`application/json`;let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({requestBody:r,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`POST`}),c.data=U(r,c,e),H(o,u),{url:W(o),options:c}},cancelSubscription:async(t,n={})=>{B(`cancelSubscription`,`tradeDetectionAddSubscriptionRequest`,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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),s[`Content-Type`]=`application/json`;let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions/cancel`,httpMethod:`POST`}),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),B(`getUserAccountOrderDetailV2`,`userId`,r),B(`getUserAccountOrderDetailV2`,`userSecret`,i);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={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},getUserAccountOrdersV2:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrdersV2`,`userId`,t),B(`getUserAccountOrdersV2`,`userSecret`,n),B(`getUserAccountOrdersV2`,`accountId`,r);let s=`/accounts/{accountId}/orders/v2`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:d,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:f,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(f.userId=t),n!==void 0&&(f.userSecret=n),i!==void 0&&(f.state=i),a!==void 0&&(f.days=a);let p=l&&l.headers?l.headers:{};return u.headers={...d,...p,...o.headers},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders/v2`,httpMethod:`GET`}),H(c,f),{url:W(c),options:u}},getUserAccountRecentOrdersV2:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrdersV2`,`userId`,t),B(`getUserAccountRecentOrdersV2`,`userSecret`,n),B(`getUserAccountRecentOrdersV2`,`accountId`,r);let o=`/accounts/{accountId}/recentOrders/v2`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),i!==void 0&&(d.only_executed=i);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders/v2`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},listSubscriptions:async(t={})=>{let n=`/snapTrade/tradeDetection/subscriptions`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`GET`}),H(r,s),{url:W(r),options:a}}}},Z=function(e){let t=yr(e);return{async addSubscription(n,r){let i={account_id:n.account_id};return G(await t.addSubscription(n.userId,n.userSecret,i,r),I,L,e)},async cancelSubscription(n,r){let i={account_id:n.account_id};return G(await t.cancelSubscription(i,r),I,L,e)},async getUserAccountOrderDetailV2(n,r){return G(await t.getUserAccountOrderDetailV2(n.accountId,n.brokerageOrderId,n.userId,n.userSecret,r),I,L,e)},async getUserAccountOrdersV2(n,r){return G(await t.getUserAccountOrdersV2(n.userId,n.userSecret,n.accountId,n.state,n.days,r),I,L,e)},async getUserAccountRecentOrdersV2(n,r){return G(await t.getUserAccountRecentOrdersV2(n.userId,n.userSecret,n.accountId,n.onlyExecuted,r),I,L,e)},async listSubscriptions(n){return G(await t.listSubscriptions(n),I,L,e)}}},br=function(e,t,n){let r=Z(e);return{addSubscription(e,i){return r.addSubscription(e,i).then(e=>e(n,t))},cancelSubscription(e,i){return r.cancelSubscription(e,i).then(e=>e(n,t))},getUserAccountOrderDetailV2(e,i){return r.getUserAccountOrderDetailV2(e,i).then(e=>e(n,t))},getUserAccountOrdersV2(e,i){return r.getUserAccountOrdersV2(e,i).then(e=>e(n,t))},getUserAccountRecentOrdersV2(e,i){return r.getUserAccountRecentOrdersV2(e,i).then(e=>e(n,t))},listSubscriptions(e){return r.listSubscriptions(e).then(e=>e(n,t))}}};var xr=class extends R{addSubscription(e,t){return Z(this.configuration).addSubscription(e,t).then(e=>e(this.axios,this.basePath))}cancelSubscription(e,t){return Z(this.configuration).cancelSubscription(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetailV2(e,t){return Z(this.configuration).getUserAccountOrderDetailV2(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountOrdersV2(e,t){return Z(this.configuration).getUserAccountOrdersV2(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrdersV2(e,t){return Z(this.configuration).getUserAccountRecentOrdersV2(e,t).then(e=>e(this.axios,this.basePath))}listSubscriptions(e){return Z(this.configuration).listSubscriptions(e).then(e=>e(this.axios,this.basePath))}},Sr=class extends xr{};let Cr=function(e){return{listOptionHoldings:async(t,n,r,i={})=>{B(`listOptionHoldings`,`userId`,t),B(`listOptionHoldings`,`userSecret`,n),B(`listOptionHoldings`,`accountId`,r);let a=`/accounts/{accountId}/options`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/options`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}}}},wr=function(e){let t=Cr(e);return{async listOptionHoldings(n,r){return G(await t.listOptionHoldings(n.userId,n.userSecret,n.accountId,r),I,L,e)}}},Tr=function(e,t,n){let r=wr(e);return{listOptionHoldings(e,i){return r.listOptionHoldings(e,i).then(e=>e(n,t))}}};var Er=class extends R{listOptionHoldings(e,t){return wr(this.configuration).listOptionHoldings(e,t).then(e=>e(this.axios,this.basePath))}},Dr=class extends Er{};let Or=function(e){return{getCurrencyExchangeRatePair:async(t,n={})=>{B(`getCurrencyExchangeRatePair`,`currencyPair`,t);let r=`/currencies/rates/{currencyPair}`.replace(`{currencyPair}`,encodeURIComponent(String(t===void 0?`-currencyPair-`: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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/currencies/rates/{currencyPair}`,httpMethod:`GET`}),H(i,c),{url:W(i),options:o}},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={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/partners`,httpMethod:`GET`}),H(r,s),{url:W(r),options:a}},getSecurityTypes:async(t={})=>{let n=`/securityTypes`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/securityTypes`,httpMethod:`GET`}),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={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/exchanges`,httpMethod:`GET`}),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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),s[`Content-Type`]=`application/json`;let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols`,httpMethod:`POST`}),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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols/{query}`,httpMethod:`GET`}),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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(c.brokerage=t);let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerageAuthorizationTypes`,httpMethod:`GET`}),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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerages/{slug}/instruments`,httpMethod:`GET`}),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={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/brokerages`,httpMethod:`GET`}),H(r,s),{url:W(r),options:a}},listAllCurrencies:async(t={})=>{let n=`/currencies`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/currencies`,httpMethod:`GET`}),H(r,s),{url:W(r),options:a}},listAllCurrenciesRates:async(t={})=>{let n=`/currencies/rates`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/currencies/rates`,httpMethod:`GET`}),H(r,s),{url:W(r),options:a}},symbolSearchUserAccount:async(t,n,r,i,a={})=>{B(`symbolSearchUserAccount`,`userId`,t),B(`symbolSearchUserAccount`,`userSecret`,n),B(`symbolSearchUserAccount`,`accountId`,r);let o=`/accounts/{accountId}/symbols`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/symbols`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}}}},Q=function(e){let t=Or(e);return{async getCurrencyExchangeRatePair(n,r){return G(await t.getCurrencyExchangeRatePair(n.currencyPair,r),I,L,e)},async getPartnerInfo(n){return G(await t.getPartnerInfo(n),I,L,e)},async getSecurityTypes(n){return G(await t.getSecurityTypes(n),I,L,e)},async getStockExchanges(n){return G(await t.getStockExchanges(n),I,L,e)},async getSymbols(n={},r){let i={substring:n.substring};return G(await t.getSymbols(i,r),I,L,e)},async getSymbolsByTicker(n,r){return G(await t.getSymbolsByTicker(n.query,r),I,L,e)},async listAllBrokerageAuthorizationType(n={},r){return G(await t.listAllBrokerageAuthorizationType(n.brokerage,r),I,L,e)},async listAllBrokerageInstruments(n,r){return G(await t.listAllBrokerageInstruments(n.slug,r),I,L,e)},async listAllBrokerages(n){return G(await t.listAllBrokerages(n),I,L,e)},async listAllCurrencies(n){return G(await t.listAllCurrencies(n),I,L,e)},async listAllCurrenciesRates(n){return G(await t.listAllCurrenciesRates(n),I,L,e)},async symbolSearchUserAccount(n,r){let i={substring:n.substring};return G(await t.symbolSearchUserAccount(n.userId,n.userSecret,n.accountId,i,r),I,L,e)}}},kr=function(e,t,n){let r=Q(e);return{getCurrencyExchangeRatePair(e,i){return r.getCurrencyExchangeRatePair(e,i).then(e=>e(n,t))},getPartnerInfo(e){return r.getPartnerInfo(e).then(e=>e(n,t))},getSecurityTypes(e){return r.getSecurityTypes(e).then(e=>e(n,t))},getStockExchanges(e){return r.getStockExchanges(e).then(e=>e(n,t))},getSymbols(e={},i){return r.getSymbols(e,i).then(e=>e(n,t))},getSymbolsByTicker(e,i){return r.getSymbolsByTicker(e,i).then(e=>e(n,t))},listAllBrokerageAuthorizationType(e={},i){return r.listAllBrokerageAuthorizationType(e,i).then(e=>e(n,t))},listAllBrokerageInstruments(e,i){return r.listAllBrokerageInstruments(e,i).then(e=>e(n,t))},listAllBrokerages(e){return r.listAllBrokerages(e).then(e=>e(n,t))},listAllCurrencies(e){return r.listAllCurrencies(e).then(e=>e(n,t))},listAllCurrenciesRates(e){return r.listAllCurrenciesRates(e).then(e=>e(n,t))},symbolSearchUserAccount(e,i){return r.symbolSearchUserAccount(e,i).then(e=>e(n,t))}}};var Ar=class extends R{getCurrencyExchangeRatePair(e,t){return Q(this.configuration).getCurrencyExchangeRatePair(e,t).then(e=>e(this.axios,this.basePath))}getPartnerInfo(e){return Q(this.configuration).getPartnerInfo(e).then(e=>e(this.axios,this.basePath))}getSecurityTypes(e){return Q(this.configuration).getSecurityTypes(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={},t){return Q(this.configuration).getSymbols(e,t).then(e=>e(this.axios,this.basePath))}getSymbolsByTicker(e,t){return Q(this.configuration).getSymbolsByTicker(e,t).then(e=>e(this.axios,this.basePath))}listAllBrokerageAuthorizationType(e={},t){return Q(this.configuration).listAllBrokerageAuthorizationType(e,t).then(e=>e(this.axios,this.basePath))}listAllBrokerageInstruments(e,t){return Q(this.configuration).listAllBrokerageInstruments(e,t).then(e=>e(this.axios,this.basePath))}listAllBrokerages(e){return Q(this.configuration).listAllBrokerages(e).then(e=>e(this.axios,this.basePath))}listAllCurrencies(e){return Q(this.configuration).listAllCurrencies(e).then(e=>e(this.axios,this.basePath))}listAllCurrenciesRates(e){return Q(this.configuration).listAllCurrenciesRates(e).then(e=>e(this.axios,this.basePath))}symbolSearchUserAccount(e,t){return Q(this.configuration).symbolSearchUserAccount(e,t).then(e=>e(this.axios,this.basePath))}},jr=class extends Ar{};let Mr=function(e){return{cancelOrder:async(t,n,r,i,a={})=>{B(`cancelOrder`,`userId`,t),B(`cancelOrder`,`userSecret`,n),B(`cancelOrder`,`accountId`,r),B(`cancelOrder`,`accountInformationGetUserAccountOrderDetailRequest`,i);let o=`/accounts/{accountId}/trading/cancel`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/cancel`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},cancelUserAccountOrder:async(t,n,r,i,a={})=>{B(`cancelUserAccountOrder`,`userId`,t),B(`cancelUserAccountOrder`,`userSecret`,n),B(`cancelUserAccountOrder`,`accountId`,r),B(`cancelUserAccountOrder`,`accountInformationGetUserAccountOrderDetailRequest`,i);let o=`/accounts/{accountId}/orders/cancel`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/cancel`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},getCryptocurrencyPairQuote:async(t,n,r,i,a={})=>{B(`getCryptocurrencyPairQuote`,`userId`,t),B(`getCryptocurrencyPairQuote`,`userSecret`,n),B(`getCryptocurrencyPairQuote`,`accountId`,r),B(`getCryptocurrencyPairQuote`,`instrumentSymbol`,i);let o=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))).replace(`{instrumentSymbol}`,encodeURIComponent(String(i===void 0?`-instrumentSymbol-`:i))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},getOptionImpact:async(t,n,r,i,a={})=>{B(`getOptionImpact`,`userId`,t),B(`getOptionImpact`,`userSecret`,n),B(`getOptionImpact`,`accountId`,r),B(`getOptionImpact`,`mlegTradeForm`,i);let o=`/accounts/{accountId}/trading/options/impact`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options/impact`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},getOrderImpact:async(t,n,r,i={})=>{B(`getOrderImpact`,`userId`,t),B(`getOrderImpact`,`userSecret`,n),B(`getOrderImpact`,`manualTradeForm`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n),l[`Content-Type`]=`application/json`;let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({requestBody:r,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/impact`,httpMethod:`POST`}),c.data=U(r,c,e),H(o,u),{url:W(o),options:c}},getUserAccountOptionQuotes:async(t,n,r,i,a={})=>{B(`getUserAccountOptionQuotes`,`userId`,t),B(`getUserAccountOptionQuotes`,`userSecret`,n),B(`getUserAccountOptionQuotes`,`accountId`,r),B(`getUserAccountOptionQuotes`,`symbol`,i);let o=`/accounts/{accountId}/quotes/options`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),i!==void 0&&(d.symbol=i);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/quotes/options`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},getUserAccountQuotes:async(t,n,r,i,a,o={})=>{B(`getUserAccountQuotes`,`userId`,t),B(`getUserAccountQuotes`,`userSecret`,n),B(`getUserAccountQuotes`,`symbols`,r),B(`getUserAccountQuotes`,`accountId`,i);let s=`/accounts/{accountId}/quotes`.replace(`{accountId}`,encodeURIComponent(String(i===void 0?`-accountId-`:i))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:d,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:f,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(f.userId=t),n!==void 0&&(f.userSecret=n),r!==void 0&&(f.symbols=r),a!==void 0&&(f.use_ticker=a);let p=l&&l.headers?l.headers:{};return u.headers={...d,...p,...o.headers},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/quotes`,httpMethod:`GET`}),H(c,f),{url:W(c),options:u}},placeBracketOrder:async(t,n,r,i,a={})=>{B(`placeBracketOrder`,`accountId`,t),B(`placeBracketOrder`,`userId`,n),B(`placeBracketOrder`,`userSecret`,r),B(`placeBracketOrder`,`manualTradeFormBracket`,i);let o=`/accounts/{accountId}/trading/bracket`.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={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(d.userId=n),r!==void 0&&(d.userSecret=r),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/bracket`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},placeComplexOrder:async(t,n,r,i,a={})=>{B(`placeComplexOrder`,`accountId`,t),B(`placeComplexOrder`,`userId`,n),B(`placeComplexOrder`,`userSecret`,r),B(`placeComplexOrder`,`manualTradeFormComplex`,i);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={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(d.userId=n),r!==void 0&&(d.userSecret=r),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/complex`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},placeCryptoOrder:async(t,n,r,i,a={})=>{B(`placeCryptoOrder`,`userId`,t),B(`placeCryptoOrder`,`userSecret`,n),B(`placeCryptoOrder`,`accountId`,r),B(`placeCryptoOrder`,`cryptoOrderForm`,i);let o=`/accounts/{accountId}/trading/crypto`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},placeForceOrder:async(t,n,r,i={})=>{B(`placeForceOrder`,`userId`,t),B(`placeForceOrder`,`userSecret`,n),B(`placeForceOrder`,`manualTradeFormWithOptions`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n),l[`Content-Type`]=`application/json`;let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({requestBody:r,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/place`,httpMethod:`POST`}),c.data=U(r,c,e),H(o,u),{url:W(o),options:c}},placeMlegOrder:async(t,n,r,i,a={})=>{B(`placeMlegOrder`,`userId`,t),B(`placeMlegOrder`,`userSecret`,n),B(`placeMlegOrder`,`accountId`,r),B(`placeMlegOrder`,`mlegTradeForm`,i);let o=`/accounts/{accountId}/trading/options`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},placeOrder:async(t,n,r,i,a={})=>{B(`placeOrder`,`tradeId`,t),B(`placeOrder`,`userId`,n),B(`placeOrder`,`userSecret`,r);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={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(d.userId=n),r!==void 0&&(d.userSecret=r),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/trade/{tradeId}`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},previewCryptoOrder:async(t,n,r,i,a={})=>{B(`previewCryptoOrder`,`userId`,t),B(`previewCryptoOrder`,`userSecret`,n),B(`previewCryptoOrder`,`accountId`,r),B(`previewCryptoOrder`,`cryptoOrderForm`,i);let o=`/accounts/{accountId}/trading/crypto/preview`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto/preview`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},replaceOrder:async(t,n,r,i,a={})=>{B(`replaceOrder`,`accountId`,t),B(`replaceOrder`,`userId`,n),B(`replaceOrder`,`userSecret`,r),B(`replaceOrder`,`manualTradeReplaceForm`,i);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={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(d.userId=n),r!==void 0&&(d.userSecret=r),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/replace`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},searchCryptocurrencyPairInstruments:async(t,n,r,i,a,o={})=>{B(`searchCryptocurrencyPairInstruments`,`userId`,t),B(`searchCryptocurrencyPairInstruments`,`userSecret`,n),B(`searchCryptocurrencyPairInstruments`,`accountId`,r);let s=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:d,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:f,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(f.userId=t),n!==void 0&&(f.userSecret=n),i!==void 0&&(f.base=i),a!==void 0&&(f.quote=a);let p=l&&l.headers?l.headers:{};return u.headers={...d,...p,...o.headers},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`,httpMethod:`GET`}),H(c,f),{url:W(c),options:u}}}},$=function(e){let t=Mr(e);return{async cancelOrder(n,r){let i={brokerage_order_id:n.brokerage_order_id};return G(await t.cancelOrder(n.userId,n.userSecret,n.accountId,i,r),I,L,e)},async cancelUserAccountOrder(n,r){let i={brokerage_order_id:n.brokerage_order_id};return G(await t.cancelUserAccountOrder(n.userId,n.userSecret,n.accountId,i,r),I,L,e)},async getCryptocurrencyPairQuote(n,r){return G(await t.getCryptocurrencyPairQuote(n.userId,n.userSecret,n.accountId,n.instrumentSymbol,r),I,L,e)},async getOptionImpact(n,r){let i={order_type:n.order_type,time_in_force:n.time_in_force,limit_price:n.limit_price,stop_price:n.stop_price,price_effect:n.price_effect,legs:n.legs};return G(await t.getOptionImpact(n.userId,n.userSecret,n.accountId,i,r),I,L,e)},async getOrderImpact(n,r){let i={account_id:n.account_id,action:n.action,universal_symbol_id:n.universal_symbol_id,order_type:n.order_type,time_in_force:n.time_in_force,price:n.price,stop:n.stop,units:n.units,notional_value:n.notional_value};return G(await t.getOrderImpact(n.userId,n.userSecret,i,r),I,L,e)},async getUserAccountOptionQuotes(n,r){return G(await t.getUserAccountOptionQuotes(n.userId,n.userSecret,n.accountId,n.symbol,r),I,L,e)},async getUserAccountQuotes(n,r){return G(await t.getUserAccountQuotes(n.userId,n.userSecret,n.symbols,n.accountId,n.useTicker,r),I,L,e)},async placeBracketOrder(n,r){let i={action:n.action,instrument:n.instrument,order_type:n.order_type,time_in_force:n.time_in_force,price:n.price,stop:n.stop,units:n.units,stop_loss:n.stop_loss,take_profit:n.take_profit};return G(await t.placeBracketOrder(n.accountId,n.userId,n.userSecret,i,r),I,L,e)},async placeComplexOrder(n,r){let i={type:n.type,orders:n.orders,client_order_id:n.client_order_id};return G(await t.placeComplexOrder(n.accountId,n.userId,n.userSecret,i,r),I,L,e)},async placeCryptoOrder(n,r){let i={instrument:n.instrument,side:n.side,type:n.type,time_in_force:n.time_in_force,amount:n.amount,limit_price:n.limit_price,stop_price:n.stop_price,post_only:n.post_only,expiration_date:n.expiration_date};return G(await t.placeCryptoOrder(n.userId,n.userSecret,n.accountId,i,r),I,L,e)},async placeForceOrder(n,r){let i={account_id:n.account_id,action:n.action,universal_symbol_id:n.universal_symbol_id,symbol:n.symbol,order_type:n.order_type,time_in_force:n.time_in_force,trading_session:n.trading_session,price:n.price,stop:n.stop,units:n.units,notional_value:n.notional_value};return G(await t.placeForceOrder(n.userId,n.userSecret,i,r),I,L,e)},async placeMlegOrder(n,r){let i={order_type:n.order_type,time_in_force:n.time_in_force,limit_price:n.limit_price,stop_price:n.stop_price,price_effect:n.price_effect,legs:n.legs};return G(await t.placeMlegOrder(n.userId,n.userSecret,n.accountId,i,r),I,L,e)},async placeOrder(n,r){let i={wait_to_confirm:n.wait_to_confirm};return G(await t.placeOrder(n.tradeId,n.userId,n.userSecret,i,r),I,L,e)},async previewCryptoOrder(n,r){let i={instrument:n.instrument,side:n.side,type:n.type,time_in_force:n.time_in_force,amount:n.amount,limit_price:n.limit_price,stop_price:n.stop_price,post_only:n.post_only,expiration_date:n.expiration_date};return G(await t.previewCryptoOrder(n.userId,n.userSecret,n.accountId,i,r),I,L,e)},async replaceOrder(n,r){let i={brokerage_order_id:n.brokerage_order_id,action:n.action,order_type:n.order_type,time_in_force:n.time_in_force,price:n.price,symbol:n.symbol,stop:n.stop,units:n.units};return G(await t.replaceOrder(n.accountId,n.userId,n.userSecret,i,r),I,L,e)},async searchCryptocurrencyPairInstruments(n,r){return G(await t.searchCryptocurrencyPairInstruments(n.userId,n.userSecret,n.accountId,n.base,n.quote,r),I,L,e)}}},Nr=function(e,t,n){let r=$(e);return{cancelOrder(e,i){return r.cancelOrder(e,i).then(e=>e(n,t))},cancelUserAccountOrder(e,i){return r.cancelUserAccountOrder(e,i).then(e=>e(n,t))},getCryptocurrencyPairQuote(e,i){return r.getCryptocurrencyPairQuote(e,i).then(e=>e(n,t))},getOptionImpact(e,i){return r.getOptionImpact(e,i).then(e=>e(n,t))},getOrderImpact(e,i){return r.getOrderImpact(e,i).then(e=>e(n,t))},getUserAccountOptionQuotes(e,i){return r.getUserAccountOptionQuotes(e,i).then(e=>e(n,t))},getUserAccountQuotes(e,i){return r.getUserAccountQuotes(e,i).then(e=>e(n,t))},placeBracketOrder(e,i){return r.placeBracketOrder(e,i).then(e=>e(n,t))},placeComplexOrder(e,i){return r.placeComplexOrder(e,i).then(e=>e(n,t))},placeCryptoOrder(e,i){return r.placeCryptoOrder(e,i).then(e=>e(n,t))},placeForceOrder(e,i){return r.placeForceOrder(e,i).then(e=>e(n,t))},placeMlegOrder(e,i){return r.placeMlegOrder(e,i).then(e=>e(n,t))},placeOrder(e,i){return r.placeOrder(e,i).then(e=>e(n,t))},previewCryptoOrder(e,i){return r.previewCryptoOrder(e,i).then(e=>e(n,t))},replaceOrder(e,i){return r.replaceOrder(e,i).then(e=>e(n,t))},searchCryptocurrencyPairInstruments(e,i){return r.searchCryptocurrencyPairInstruments(e,i).then(e=>e(n,t))}}};var Pr=class extends R{cancelOrder(e,t){return $(this.configuration).cancelOrder(e,t).then(e=>e(this.axios,this.basePath))}cancelUserAccountOrder(e,t){return $(this.configuration).cancelUserAccountOrder(e,t).then(e=>e(this.axios,this.basePath))}getCryptocurrencyPairQuote(e,t){return $(this.configuration).getCryptocurrencyPairQuote(e,t).then(e=>e(this.axios,this.basePath))}getOptionImpact(e,t){return $(this.configuration).getOptionImpact(e,t).then(e=>e(this.axios,this.basePath))}getOrderImpact(e,t){return $(this.configuration).getOrderImpact(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountOptionQuotes(e,t){return $(this.configuration).getUserAccountOptionQuotes(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountQuotes(e,t){return $(this.configuration).getUserAccountQuotes(e,t).then(e=>e(this.axios,this.basePath))}placeBracketOrder(e,t){return $(this.configuration).placeBracketOrder(e,t).then(e=>e(this.axios,this.basePath))}placeComplexOrder(e,t){return $(this.configuration).placeComplexOrder(e,t).then(e=>e(this.axios,this.basePath))}placeCryptoOrder(e,t){return $(this.configuration).placeCryptoOrder(e,t).then(e=>e(this.axios,this.basePath))}placeForceOrder(e,t){return $(this.configuration).placeForceOrder(e,t).then(e=>e(this.axios,this.basePath))}placeMlegOrder(e,t){return $(this.configuration).placeMlegOrder(e,t).then(e=>e(this.axios,this.basePath))}placeOrder(e,t){return $(this.configuration).placeOrder(e,t).then(e=>e(this.axios,this.basePath))}previewCryptoOrder(e,t){return $(this.configuration).previewCryptoOrder(e,t).then(e=>e(this.axios,this.basePath))}replaceOrder(e,t){return $(this.configuration).replaceOrder(e,t).then(e=>e(this.axios,this.basePath))}searchCryptocurrencyPairInstruments(e,t){return $(this.configuration).searchCryptocurrencyPairInstruments(e,t).then(e=>e(this.axios,this.basePath))}},Fr=class extends Pr{};let Ir=function(e){return{getActivities:async(t,n,r,i,a,o,s,c={})=>{B(`getActivities`,`userId`,t),B(`getActivities`,`userSecret`,n);let l=`/activities`,u=new URL(l,z),d;e&&(d=e.baseOptions);let f={method:`GET`,...d,...c},p=e&&!K()?{"User-Agent":e.userAgent}:{},m={};await V({object:m,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:p,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:m,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),r!==void 0&&(m.startDate=r instanceof Date?r.toISOString().substr(0,10):r),i!==void 0&&(m.endDate=i instanceof Date?i.toISOString().substr(0,10):i),a!==void 0&&(m.accounts=a),o!==void 0&&(m.brokerageAuthorizations=o),s!==void 0&&(m.type=s),t!==void 0&&(m.userId=t),n!==void 0&&(m.userSecret=n);let h=d&&d.headers?d.headers:{};return f.headers={...p,...h,...c.headers},q({queryParameters:m,requestConfig:f,path:l,configuration:e,pathTemplate:`/activities`,httpMethod:`GET`}),H(u,m),{url:W(u),options:f}},getReportingCustomRange:async(t,n,r,i,a,o,s,c={})=>{B(`getReportingCustomRange`,`startDate`,t),B(`getReportingCustomRange`,`endDate`,n),B(`getReportingCustomRange`,`userId`,r),B(`getReportingCustomRange`,`userSecret`,i);let l=`/performance/custom`,u=new URL(l,z),d;e&&(d=e.baseOptions);let f={method:`GET`,...d,...c},p=e&&!K()?{"User-Agent":e.userAgent}:{},m={};await V({object:m,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:p,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:m,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(m.startDate=t instanceof Date?t.toISOString().substr(0,10):t),n!==void 0&&(m.endDate=n instanceof Date?n.toISOString().substr(0,10):n),a!==void 0&&(m.accounts=a),o!==void 0&&(m.detailed=o),s!==void 0&&(m.frequency=s),r!==void 0&&(m.userId=r),i!==void 0&&(m.userSecret=i);let h=d&&d.headers?d.headers:{};return f.headers={...p,...h,...c.headers},q({queryParameters:m,requestConfig:f,path:l,configuration:e,pathTemplate:`/performance/custom`,httpMethod:`GET`}),H(u,m),{url:W(u),options:f}}}},Lr=function(e){let t=Ir(e);return{async getActivities(n,r){return G(await t.getActivities(n.userId,n.userSecret,n.startDate,n.endDate,n.accounts,n.brokerageAuthorizations,n.type,r),I,L,e)},async getReportingCustomRange(n,r){return G(await t.getReportingCustomRange(n.startDate,n.endDate,n.userId,n.userSecret,n.accounts,n.detailed,n.frequency,r),I,L,e)}}},Rr=function(e,t,n){let r=Lr(e);return{getActivities(e,i){return r.getActivities(e,i).then(e=>e(n,t))},getReportingCustomRange(e,i){return r.getReportingCustomRange(e,i).then(e=>e(n,t))}}};var zr=class extends R{getActivities(e,t){return Lr(this.configuration).getActivities(e,t).then(e=>e(this.axios,this.basePath))}getReportingCustomRange(e,t){return Lr(this.configuration).getReportingCustomRange(e,t).then(e=>e(this.axios,this.basePath))}},Br=class extends zr{},Vr=class{constructor(e={}){this.consumerKey=e.consumerKey,this.apiKey=e.apiKey,this.apiKey===void 0&&(this.apiKey={},e.clientId!==void 0&&(this.apiKey.clientId=e.clientId),e.signature!==void 0&&(this.apiKey.signature=e.signature),e.timestamp!==void 0&&(this.apiKey.timestamp=e.timestamp)),this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions??{},this.userAgent=e.userAgent===void 0?`Konfig/10.0.7/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`)}},Hr=class{constructor(e){}},Ur=class extends Hr{constructor(e={}){super(e);let t=new Vr(e);this.accountInformation=new ar(t),this.apiStatus=new ur(t),this.authentication=new mr(t),this.connections=new vr(t),this.experimentalEndpoints=new Sr(t),this.options=new Dr(t),this.referenceData=new jr(t),this.trading=new Fr(t),this.transactionsAndReporting=new Br(t)}};e.AccountInformationApi=ar,e.AccountInformationApiAxiosParamCreator=nr,e.AccountInformationApiFactory=rr,e.AccountInformationApiFp=J,e.AccountInformationApiGenerated=ir,e.ApiStatusApi=ur,e.ApiStatusApiAxiosParamCreator=or,e.ApiStatusApiFactory=cr,e.ApiStatusApiFp=sr,e.ApiStatusApiGenerated=lr,e.AuthenticationApi=mr,e.AuthenticationApiAxiosParamCreator=dr,e.AuthenticationApiFactory=fr,e.AuthenticationApiFp=Y,e.AuthenticationApiGenerated=pr,e.Configuration=Vr,e.ConnectionsApi=vr,e.ConnectionsApiAxiosParamCreator=hr,e.ConnectionsApiFactory=gr,e.ConnectionsApiFp=X,e.ConnectionsApiGenerated=_r,e.ExperimentalEndpointsApi=Sr,e.ExperimentalEndpointsApiAxiosParamCreator=yr,e.ExperimentalEndpointsApiFactory=br,e.ExperimentalEndpointsApiFp=Z,e.ExperimentalEndpointsApiGenerated=xr,e.OptionsApi=Dr,e.OptionsApiAxiosParamCreator=Cr,e.OptionsApiFactory=Tr,e.OptionsApiFp=wr,e.OptionsApiGenerated=Er,e.ReferenceDataApi=jr,e.ReferenceDataApiAxiosParamCreator=Or,e.ReferenceDataApiFactory=kr,e.ReferenceDataApiFp=Q,e.ReferenceDataApiGenerated=Ar,e.Snaptrade=Ur,e.SnaptradeError=Xn,e.TradingApi=Fr,e.TradingApiAxiosParamCreator=Mr,e.TradingApiFactory=Nr,e.TradingApiFp=$,e.TradingApiGenerated=Pr,e.TransactionsAndReportingApi=Br,e.TransactionsAndReportingApiAxiosParamCreator=Ir,e.TransactionsAndReportingApiFactory=Rr,e.TransactionsAndReportingApiFp=Lr,e.TransactionsAndReportingApiGenerated=zr,e.parseIfJson=Qn,e.readableStreamToString=Zn});
11
+ `+JSON.stringify(n,null,2);super(r),this.name=`SnaptradeError`,this.code=e.code,this.method=e.config?.method?.toUpperCase(),this.url=e.config?.url,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 Zn(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 Qn(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 Gn(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 $n(e,t,n=``){typeof t==`object`?Array.isArray(t)?t.forEach(t=>$n(e,t,n)):Object.keys(t).forEach(r=>$n(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);$n(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 er(e.pathname)+e.search+e.hash},er=function(e){return e.replace(/\/$/,``)};async function tr(e){let t=0,n=5e3;for(;t<3;)try{return await e()}catch(e){if(e instanceof kn&&e.isAxiosError){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}try{throw new Xn(e,Qn(e.response?.data instanceof ReadableStream?await Zn(e.response.data):e.response?.data),e.response?.headers)}catch(t){throw t instanceof ReferenceError?new Xn(e,e.response?.data,e.response?.headers):t instanceof Xn?t:e}}throw e}throw Error(`Request failed after 3 retries due to 429 (rate limit) errors.`)}let G=function(e,t,n,r){return async(i=t,a=n)=>{let o=(r?.basePath||a)+e.url;return await Yn({axiosArgs:e,basePath:a,url:o,configuration:r}),tr(async()=>await i.request({...e.options,url:o}))}};function K(){return typeof window<`u`}function q(e){let{queryParameters:t}=e;t.timestamp=Math.round(new Date().getTime()/1e3).toString()}let nr=function(e){return{getAccountActivities:async(t,n,r,i,a,o,s,c,l={})=>{B(`getAccountActivities`,`accountId`,t),B(`getAccountActivities`,`userId`,n),B(`getAccountActivities`,`userSecret`,r);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={};await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:m,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:h,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),i!==void 0&&(h.startDate=i instanceof Date?i.toISOString().substr(0,10):i),a!==void 0&&(h.endDate=a instanceof Date?a.toISOString().substr(0,10):a),o!==void 0&&(h.offset=o),s!==void 0&&(h.limit=s),c!==void 0&&(h.type=c),n!==void 0&&(h.userId=n),r!==void 0&&(h.userSecret=r);let g=f&&f.headers?f.headers:{};return p.headers={...m,...g,...l.headers},q({queryParameters:h,requestConfig:p,path:u,configuration:e,pathTemplate:`/accounts/{accountId}/activities`,httpMethod:`GET`}),H(d,h),{url:W(d),options:p}},getAccountBalanceHistory:async(t,n,r,i={})=>{B(`getAccountBalanceHistory`,`userId`,t),B(`getAccountBalanceHistory`,`userSecret`,n),B(`getAccountBalanceHistory`,`accountId`,r);let a=`/accounts/{accountId}/balanceHistory`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balanceHistory`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},getAllAccountPositions:async(t,n,r,i={})=>{B(`getAllAccountPositions`,`userId`,t),B(`getAllAccountPositions`,`userSecret`,n),B(`getAllAccountPositions`,`accountId`,r);let a=`/accounts/{accountId}/positions/all`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/positions/all`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},getAllUserHoldings:async(t,n,r,i={})=>{B(`getAllUserHoldings`,`userId`,t),B(`getAllUserHoldings`,`userSecret`,n);let a=`/holdings`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n),r!==void 0&&(u.brokerage_authorizations=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/holdings`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},getUserAccountBalance:async(t,n,r,i={})=>{B(`getUserAccountBalance`,`userId`,t),B(`getUserAccountBalance`,`userSecret`,n),B(`getUserAccountBalance`,`accountId`,r);let a=`/accounts/{accountId}/balances`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balances`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},getUserAccountDetails:async(t,n,r,i={})=>{B(`getUserAccountDetails`,`userId`,t),B(`getUserAccountDetails`,`userSecret`,n),B(`getUserAccountDetails`,`accountId`,r);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},getUserAccountOrderDetail:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetail`,`accountId`,t),B(`getUserAccountOrderDetail`,`userId`,n),B(`getUserAccountOrderDetail`,`userSecret`,r),B(`getUserAccountOrderDetail`,`accountInformationGetUserAccountOrderDetailRequest`,i);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={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(d.userId=n),r!==void 0&&(d.userSecret=r),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},getUserAccountOrders:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrders`,`userId`,t),B(`getUserAccountOrders`,`userSecret`,n),B(`getUserAccountOrders`,`accountId`,r);let s=`/accounts/{accountId}/orders`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:d,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:f,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(f.userId=t),n!==void 0&&(f.userSecret=n),i!==void 0&&(f.state=i),a!==void 0&&(f.days=a);let p=l&&l.headers?l.headers:{};return u.headers={...d,...p,...o.headers},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders`,httpMethod:`GET`}),H(c,f),{url:W(c),options:u}},getUserAccountPositions:async(t,n,r,i={})=>{B(`getUserAccountPositions`,`userId`,t),B(`getUserAccountPositions`,`userSecret`,n),B(`getUserAccountPositions`,`accountId`,r);let a=`/accounts/{accountId}/positions`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/positions`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},getUserAccountRecentOrders:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrders`,`userId`,t),B(`getUserAccountRecentOrders`,`userSecret`,n),B(`getUserAccountRecentOrders`,`accountId`,r);let o=`/accounts/{accountId}/recentOrders`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),i!==void 0&&(d.only_executed=i);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},getUserAccountReturnRates:async(t,n,r,i,a={})=>{B(`getUserAccountReturnRates`,`userId`,t),B(`getUserAccountReturnRates`,`userSecret`,n),B(`getUserAccountReturnRates`,`accountId`,r);let o=`/accounts/{accountId}/returnRates`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),i!==void 0&&(d.timeframes=i);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/returnRates`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},getUserHoldings:async(t,n,r,i={})=>{B(`getUserHoldings`,`accountId`,t),B(`getUserHoldings`,`userId`,n),B(`getUserHoldings`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/holdings`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},listUserAccounts:async(t,n,r={})=>{B(`listUserAccounts`,`userId`,t),B(`listUserAccounts`,`userSecret`,n);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={};await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:c,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:l,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n);let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...r.headers},q({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/accounts`,httpMethod:`GET`}),H(a,l),{url:W(a),options:s}},updateUserAccount:async(t,n,r,i={})=>{B(`updateUserAccount`,`userId`,t),B(`updateUserAccount`,`userSecret`,n),B(`updateUserAccount`,`accountId`,r);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`PUT`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`PUT`}),H(o,u),{url:W(o),options:c}}}},J=function(e){let t=nr(e);return{async getAccountActivities(n,r){return G(await t.getAccountActivities(n.accountId,n.userId,n.userSecret,n.startDate,n.endDate,n.offset,n.limit,n.type,r),I,L,e)},async getAccountBalanceHistory(n,r){return G(await t.getAccountBalanceHistory(n.userId,n.userSecret,n.accountId,r),I,L,e)},async getAllAccountPositions(n,r){return G(await t.getAllAccountPositions(n.userId,n.userSecret,n.accountId,r),I,L,e)},async getAllUserHoldings(n,r){return G(await t.getAllUserHoldings(n.userId,n.userSecret,n.brokerageAuthorizations,r),I,L,e)},async getUserAccountBalance(n,r){return G(await t.getUserAccountBalance(n.userId,n.userSecret,n.accountId,r),I,L,e)},async getUserAccountDetails(n,r){return G(await t.getUserAccountDetails(n.userId,n.userSecret,n.accountId,r),I,L,e)},async getUserAccountOrderDetail(n,r){let i={brokerage_order_id:n.brokerage_order_id};return G(await t.getUserAccountOrderDetail(n.accountId,n.userId,n.userSecret,i,r),I,L,e)},async getUserAccountOrders(n,r){return G(await t.getUserAccountOrders(n.userId,n.userSecret,n.accountId,n.state,n.days,r),I,L,e)},async getUserAccountPositions(n,r){return G(await t.getUserAccountPositions(n.userId,n.userSecret,n.accountId,r),I,L,e)},async getUserAccountRecentOrders(n,r){return G(await t.getUserAccountRecentOrders(n.userId,n.userSecret,n.accountId,n.onlyExecuted,r),I,L,e)},async getUserAccountReturnRates(n,r){return G(await t.getUserAccountReturnRates(n.userId,n.userSecret,n.accountId,n.timeframes,r),I,L,e)},async getUserHoldings(n,r){return G(await t.getUserHoldings(n.accountId,n.userId,n.userSecret,r),I,L,e)},async listUserAccounts(n,r){return G(await t.listUserAccounts(n.userId,n.userSecret,r),I,L,e)},async updateUserAccount(n,r){return G(await t.updateUserAccount(n.userId,n.userSecret,n.accountId,r),I,L,e)}}},rr=function(e,t,n){let r=J(e);return{getAccountActivities(e,i){return r.getAccountActivities(e,i).then(e=>e(n,t))},getAccountBalanceHistory(e,i){return r.getAccountBalanceHistory(e,i).then(e=>e(n,t))},getAllAccountPositions(e,i){return r.getAllAccountPositions(e,i).then(e=>e(n,t))},getAllUserHoldings(e,i){return r.getAllUserHoldings(e,i).then(e=>e(n,t))},getUserAccountBalance(e,i){return r.getUserAccountBalance(e,i).then(e=>e(n,t))},getUserAccountDetails(e,i){return r.getUserAccountDetails(e,i).then(e=>e(n,t))},getUserAccountOrderDetail(e,i){return r.getUserAccountOrderDetail(e,i).then(e=>e(n,t))},getUserAccountOrders(e,i){return r.getUserAccountOrders(e,i).then(e=>e(n,t))},getUserAccountPositions(e,i){return r.getUserAccountPositions(e,i).then(e=>e(n,t))},getUserAccountRecentOrders(e,i){return r.getUserAccountRecentOrders(e,i).then(e=>e(n,t))},getUserAccountReturnRates(e,i){return r.getUserAccountReturnRates(e,i).then(e=>e(n,t))},getUserHoldings(e,i){return r.getUserHoldings(e,i).then(e=>e(n,t))},listUserAccounts(e,i){return r.listUserAccounts(e,i).then(e=>e(n,t))},updateUserAccount(e,i){return r.updateUserAccount(e,i).then(e=>e(n,t))}}};var ir=class extends R{getAccountActivities(e,t){return J(this.configuration).getAccountActivities(e,t).then(e=>e(this.axios,this.basePath))}getAccountBalanceHistory(e,t){return J(this.configuration).getAccountBalanceHistory(e,t).then(e=>e(this.axios,this.basePath))}getAllAccountPositions(e,t){return J(this.configuration).getAllAccountPositions(e,t).then(e=>e(this.axios,this.basePath))}getAllUserHoldings(e,t){return J(this.configuration).getAllUserHoldings(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountBalance(e,t){return J(this.configuration).getUserAccountBalance(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountDetails(e,t){return J(this.configuration).getUserAccountDetails(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetail(e,t){return J(this.configuration).getUserAccountOrderDetail(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountOrders(e,t){return J(this.configuration).getUserAccountOrders(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountPositions(e,t){return J(this.configuration).getUserAccountPositions(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrders(e,t){return J(this.configuration).getUserAccountRecentOrders(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountReturnRates(e,t){return J(this.configuration).getUserAccountReturnRates(e,t).then(e=>e(this.axios,this.basePath))}getUserHoldings(e,t){return J(this.configuration).getUserHoldings(e,t).then(e=>e(this.axios,this.basePath))}listUserAccounts(e,t){return J(this.configuration).listUserAccounts(e,t).then(e=>e(this.axios,this.basePath))}updateUserAccount(e,t){return J(this.configuration).updateUserAccount(e,t).then(e=>e(this.axios,this.basePath))}},ar=class extends ir{};let or=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=r&&r.headers?r.headers:{};return i.headers={...a,...s,...t.headers},q({queryParameters:o,requestConfig:i,path:`/`,configuration:e,pathTemplate:`/`,httpMethod:`GET`}),H(n,o),{url:W(n),options:i}}}},sr=function(e){let t=or(e);return{async check(n){return G(await t.check(n),I,L,e)}}},cr=function(e,t,n){let r=sr(e);return{check(e){return r.check(e).then(e=>e(n,t))}}};var lr=class extends R{check(e){return sr(this.configuration).check(e).then(e=>e(this.axios,this.basePath))}},ur=class extends lr{};let dr=function(e){return{deleteSnapTradeUser:async(t,n={})=>{B(`deleteSnapTradeUser`,`userId`,t);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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(c.userId=t);let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/deleteUser`,httpMethod:`DELETE`}),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={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/listUsers`,httpMethod:`GET`}),H(r,s),{url:W(r),options:a}},loginSnapTradeUser:async(t,n,r,i={})=>{B(`loginSnapTradeUser`,`userId`,t),B(`loginSnapTradeUser`,`userSecret`,n);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n),l[`Content-Type`]=`application/json`;let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({requestBody:r,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/login`,httpMethod:`POST`}),c.data=U(r,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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),s[`Content-Type`]=`application/json`;let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/registerUser`,httpMethod:`POST`}),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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),s[`Content-Type`]=`application/json`;let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/resetUserSecret`,httpMethod:`POST`}),o.data=U(t,o,e),H(i,c),{url:W(i),options:o}}}},Y=function(e){let t=dr(e);return{async deleteSnapTradeUser(n,r){return G(await t.deleteSnapTradeUser(n.userId,r),I,L,e)},async listSnapTradeUsers(n){return G(await t.listSnapTradeUsers(n),I,L,e)},async loginSnapTradeUser(n,r){let i={broker:n.broker,immediateRedirect:n.immediateRedirect,customRedirect:n.customRedirect,reconnect:n.reconnect,connectionType:n.connectionType,showCloseButton:n.showCloseButton,darkMode:n.darkMode,connectionPortalVersion:n.connectionPortalVersion};return G(await t.loginSnapTradeUser(n.userId,n.userSecret,i,r),I,L,e)},async registerSnapTradeUser(n,r){let i={userId:n.userId};return G(await t.registerSnapTradeUser(i,r),I,L,e)},async resetSnapTradeUserSecret(n,r){let i={userId:n.userId,userSecret:n.userSecret};return G(await t.resetSnapTradeUserSecret(i,r),I,L,e)}}},fr=function(e,t,n){let r=Y(e);return{deleteSnapTradeUser(e,i){return r.deleteSnapTradeUser(e,i).then(e=>e(n,t))},listSnapTradeUsers(e){return r.listSnapTradeUsers(e).then(e=>e(n,t))},loginSnapTradeUser(e,i){return r.loginSnapTradeUser(e,i).then(e=>e(n,t))},registerSnapTradeUser(e,i){return r.registerSnapTradeUser(e,i).then(e=>e(n,t))},resetSnapTradeUserSecret(e,i){return r.resetSnapTradeUserSecret(e,i).then(e=>e(n,t))}}};var pr=class extends R{deleteSnapTradeUser(e,t){return Y(this.configuration).deleteSnapTradeUser(e,t).then(e=>e(this.axios,this.basePath))}listSnapTradeUsers(e){return Y(this.configuration).listSnapTradeUsers(e).then(e=>e(this.axios,this.basePath))}loginSnapTradeUser(e,t){return Y(this.configuration).loginSnapTradeUser(e,t).then(e=>e(this.axios,this.basePath))}registerSnapTradeUser(e,t){return Y(this.configuration).registerSnapTradeUser(e,t).then(e=>e(this.axios,this.basePath))}resetSnapTradeUserSecret(e,t){return Y(this.configuration).resetSnapTradeUserSecret(e,t).then(e=>e(this.axios,this.basePath))}},mr=class extends pr{};let hr=function(e){return{deleteConnection:async(t,n,r,i={})=>{B(`deleteConnection`,`connectionId`,t),B(`deleteConnection`,`userId`,n),B(`deleteConnection`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connection/{connectionId}`,httpMethod:`DELETE`}),H(o,u),{url:W(o),options:c}},detailBrokerageAuthorization:async(t,n,r,i={})=>{B(`detailBrokerageAuthorization`,`authorizationId`,t),B(`detailBrokerageAuthorization`,`userId`,n),B(`detailBrokerageAuthorization`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},disableBrokerageAuthorization:async(t,n,r,i={})=>{B(`disableBrokerageAuthorization`,`authorizationId`,t),B(`disableBrokerageAuthorization`,`userId`,n),B(`disableBrokerageAuthorization`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/disable`,httpMethod:`POST`}),H(o,u),{url:W(o),options:c}},listBrokerageAuthorizationAccounts:async(t,n,r,i={})=>{B(`listBrokerageAuthorizationAccounts`,`authorizationId`,t),B(`listBrokerageAuthorizationAccounts`,`userId`,n),B(`listBrokerageAuthorizationAccounts`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/accounts`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},listBrokerageAuthorizations:async(t,n,r={})=>{B(`listBrokerageAuthorizations`,`userId`,t),B(`listBrokerageAuthorizations`,`userSecret`,n);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={};await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:c,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:l,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n);let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...r.headers},q({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/authorizations`,httpMethod:`GET`}),H(a,l),{url:W(a),options:s}},refreshBrokerageAuthorization:async(t,n,r,i={})=>{B(`refreshBrokerageAuthorization`,`authorizationId`,t),B(`refreshBrokerageAuthorization`,`userId`,n),B(`refreshBrokerageAuthorization`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/refresh`,httpMethod:`POST`}),H(o,u),{url:W(o),options:c}},removeBrokerageAuthorization:async(t,n,r,i={})=>{B(`removeBrokerageAuthorization`,`authorizationId`,t),B(`removeBrokerageAuthorization`,`userId`,n),B(`removeBrokerageAuthorization`,`userSecret`,r);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:`DELETE`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}`,httpMethod:`DELETE`}),H(o,u),{url:W(o),options:c}},returnRates:async(t,n,r,i,a={})=>{B(`returnRates`,`userId`,t),B(`returnRates`,`userSecret`,n),B(`returnRates`,`authorizationId`,r);let o=`/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`,encodeURIComponent(String(r===void 0?`-authorizationId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),i!==void 0&&(d.timeframes=i);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/authorizations/{authorizationId}/returnRates`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},sessionEvents:async(t,n,r,i={})=>{B(`sessionEvents`,`partnerClientId`,t);let a=`/sessionEvents`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.PartnerClientId=t),n!==void 0&&(u.userId=n),r!==void 0&&(u.sessionId=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/sessionEvents`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}},syncBrokerageAuthorizationTransactions:async(t,n,r,i={})=>{B(`syncBrokerageAuthorizationTransactions`,`authorizationId`,t),B(`syncBrokerageAuthorizationTransactions`,`userId`,n),B(`syncBrokerageAuthorizationTransactions`,`userSecret`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/transactions/sync`,httpMethod:`POST`}),H(o,u),{url:W(o),options:c}}}},X=function(e){let t=hr(e);return{async deleteConnection(n,r){return G(await t.deleteConnection(n.connectionId,n.userId,n.userSecret,r),I,L,e)},async detailBrokerageAuthorization(n,r){return G(await t.detailBrokerageAuthorization(n.authorizationId,n.userId,n.userSecret,r),I,L,e)},async disableBrokerageAuthorization(n,r){return G(await t.disableBrokerageAuthorization(n.authorizationId,n.userId,n.userSecret,r),I,L,e)},async listBrokerageAuthorizationAccounts(n,r){return G(await t.listBrokerageAuthorizationAccounts(n.authorizationId,n.userId,n.userSecret,r),I,L,e)},async listBrokerageAuthorizations(n,r){return G(await t.listBrokerageAuthorizations(n.userId,n.userSecret,r),I,L,e)},async refreshBrokerageAuthorization(n,r){return G(await t.refreshBrokerageAuthorization(n.authorizationId,n.userId,n.userSecret,r),I,L,e)},async removeBrokerageAuthorization(n,r){return G(await t.removeBrokerageAuthorization(n.authorizationId,n.userId,n.userSecret,r),I,L,e)},async returnRates(n,r){return G(await t.returnRates(n.userId,n.userSecret,n.authorizationId,n.timeframes,r),I,L,e)},async sessionEvents(n,r){return G(await t.sessionEvents(n.partnerClientId,n.userId,n.sessionId,r),I,L,e)},async syncBrokerageAuthorizationTransactions(n,r){return G(await t.syncBrokerageAuthorizationTransactions(n.authorizationId,n.userId,n.userSecret,r),I,L,e)}}},gr=function(e,t,n){let r=X(e);return{deleteConnection(e,i){return r.deleteConnection(e,i).then(e=>e(n,t))},detailBrokerageAuthorization(e,i){return r.detailBrokerageAuthorization(e,i).then(e=>e(n,t))},disableBrokerageAuthorization(e,i){return r.disableBrokerageAuthorization(e,i).then(e=>e(n,t))},listBrokerageAuthorizationAccounts(e,i){return r.listBrokerageAuthorizationAccounts(e,i).then(e=>e(n,t))},listBrokerageAuthorizations(e,i){return r.listBrokerageAuthorizations(e,i).then(e=>e(n,t))},refreshBrokerageAuthorization(e,i){return r.refreshBrokerageAuthorization(e,i).then(e=>e(n,t))},removeBrokerageAuthorization(e,i){return r.removeBrokerageAuthorization(e,i).then(e=>e(n,t))},returnRates(e,i){return r.returnRates(e,i).then(e=>e(n,t))},sessionEvents(e,i){return r.sessionEvents(e,i).then(e=>e(n,t))},syncBrokerageAuthorizationTransactions(e,i){return r.syncBrokerageAuthorizationTransactions(e,i).then(e=>e(n,t))}}};var _r=class extends R{deleteConnection(e,t){return X(this.configuration).deleteConnection(e,t).then(e=>e(this.axios,this.basePath))}detailBrokerageAuthorization(e,t){return X(this.configuration).detailBrokerageAuthorization(e,t).then(e=>e(this.axios,this.basePath))}disableBrokerageAuthorization(e,t){return X(this.configuration).disableBrokerageAuthorization(e,t).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizationAccounts(e,t){return X(this.configuration).listBrokerageAuthorizationAccounts(e,t).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizations(e,t){return X(this.configuration).listBrokerageAuthorizations(e,t).then(e=>e(this.axios,this.basePath))}refreshBrokerageAuthorization(e,t){return X(this.configuration).refreshBrokerageAuthorization(e,t).then(e=>e(this.axios,this.basePath))}removeBrokerageAuthorization(e,t){return X(this.configuration).removeBrokerageAuthorization(e,t).then(e=>e(this.axios,this.basePath))}returnRates(e,t){return X(this.configuration).returnRates(e,t).then(e=>e(this.axios,this.basePath))}sessionEvents(e,t){return X(this.configuration).sessionEvents(e,t).then(e=>e(this.axios,this.basePath))}syncBrokerageAuthorizationTransactions(e,t){return X(this.configuration).syncBrokerageAuthorizationTransactions(e,t).then(e=>e(this.axios,this.basePath))}},vr=class extends _r{};let yr=function(e){return{addSubscription:async(t,n,r,i={})=>{B(`addSubscription`,`userId`,t),B(`addSubscription`,`userSecret`,n),B(`addSubscription`,`tradeDetectionAddSubscriptionRequest`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n),l[`Content-Type`]=`application/json`;let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({requestBody:r,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`POST`}),c.data=U(r,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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),s[`Content-Type`]=`application/json`;let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions/cancel`,httpMethod:`POST`}),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),B(`getUserAccountOrderDetailV2`,`userId`,r),B(`getUserAccountOrderDetailV2`,`userSecret`,i);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={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},getUserAccountOrdersV2:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrdersV2`,`userId`,t),B(`getUserAccountOrdersV2`,`userSecret`,n),B(`getUserAccountOrdersV2`,`accountId`,r);let s=`/accounts/{accountId}/orders/v2`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:d,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:f,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(f.userId=t),n!==void 0&&(f.userSecret=n),i!==void 0&&(f.state=i),a!==void 0&&(f.days=a);let p=l&&l.headers?l.headers:{};return u.headers={...d,...p,...o.headers},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders/v2`,httpMethod:`GET`}),H(c,f),{url:W(c),options:u}},getUserAccountRecentOrdersV2:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrdersV2`,`userId`,t),B(`getUserAccountRecentOrdersV2`,`userSecret`,n),B(`getUserAccountRecentOrdersV2`,`accountId`,r);let o=`/accounts/{accountId}/recentOrders/v2`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),i!==void 0&&(d.only_executed=i);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders/v2`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},listSubscriptions:async(t={})=>{let n=`/snapTrade/tradeDetection/subscriptions`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`GET`}),H(r,s),{url:W(r),options:a}}}},Z=function(e){let t=yr(e);return{async addSubscription(n,r){let i={account_id:n.account_id,check_interval_seconds:n.check_interval_seconds};return G(await t.addSubscription(n.userId,n.userSecret,i,r),I,L,e)},async cancelSubscription(n,r){let i={account_id:n.account_id};return G(await t.cancelSubscription(i,r),I,L,e)},async getUserAccountOrderDetailV2(n,r){return G(await t.getUserAccountOrderDetailV2(n.accountId,n.brokerageOrderId,n.userId,n.userSecret,r),I,L,e)},async getUserAccountOrdersV2(n,r){return G(await t.getUserAccountOrdersV2(n.userId,n.userSecret,n.accountId,n.state,n.days,r),I,L,e)},async getUserAccountRecentOrdersV2(n,r){return G(await t.getUserAccountRecentOrdersV2(n.userId,n.userSecret,n.accountId,n.onlyExecuted,r),I,L,e)},async listSubscriptions(n){return G(await t.listSubscriptions(n),I,L,e)}}},br=function(e,t,n){let r=Z(e);return{addSubscription(e,i){return r.addSubscription(e,i).then(e=>e(n,t))},cancelSubscription(e,i){return r.cancelSubscription(e,i).then(e=>e(n,t))},getUserAccountOrderDetailV2(e,i){return r.getUserAccountOrderDetailV2(e,i).then(e=>e(n,t))},getUserAccountOrdersV2(e,i){return r.getUserAccountOrdersV2(e,i).then(e=>e(n,t))},getUserAccountRecentOrdersV2(e,i){return r.getUserAccountRecentOrdersV2(e,i).then(e=>e(n,t))},listSubscriptions(e){return r.listSubscriptions(e).then(e=>e(n,t))}}};var xr=class extends R{addSubscription(e,t){return Z(this.configuration).addSubscription(e,t).then(e=>e(this.axios,this.basePath))}cancelSubscription(e,t){return Z(this.configuration).cancelSubscription(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetailV2(e,t){return Z(this.configuration).getUserAccountOrderDetailV2(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountOrdersV2(e,t){return Z(this.configuration).getUserAccountOrdersV2(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrdersV2(e,t){return Z(this.configuration).getUserAccountRecentOrdersV2(e,t).then(e=>e(this.axios,this.basePath))}listSubscriptions(e){return Z(this.configuration).listSubscriptions(e).then(e=>e(this.axios,this.basePath))}},Sr=class extends xr{};let Cr=function(e){return{listOptionHoldings:async(t,n,r,i={})=>{B(`listOptionHoldings`,`userId`,t),B(`listOptionHoldings`,`userSecret`,n),B(`listOptionHoldings`,`accountId`,r);let a=`/accounts/{accountId}/options`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!K()?{"User-Agent":e.userAgent}:{},u={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/options`,httpMethod:`GET`}),H(o,u),{url:W(o),options:c}}}},wr=function(e){let t=Cr(e);return{async listOptionHoldings(n,r){return G(await t.listOptionHoldings(n.userId,n.userSecret,n.accountId,r),I,L,e)}}},Tr=function(e,t,n){let r=wr(e);return{listOptionHoldings(e,i){return r.listOptionHoldings(e,i).then(e=>e(n,t))}}};var Er=class extends R{listOptionHoldings(e,t){return wr(this.configuration).listOptionHoldings(e,t).then(e=>e(this.axios,this.basePath))}},Dr=class extends Er{};let Or=function(e){return{getCurrencyExchangeRatePair:async(t,n={})=>{B(`getCurrencyExchangeRatePair`,`currencyPair`,t);let r=`/currencies/rates/{currencyPair}`.replace(`{currencyPair}`,encodeURIComponent(String(t===void 0?`-currencyPair-`: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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/currencies/rates/{currencyPair}`,httpMethod:`GET`}),H(i,c),{url:W(i),options:o}},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={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/partners`,httpMethod:`GET`}),H(r,s),{url:W(r),options:a}},getSecurityTypes:async(t={})=>{let n=`/securityTypes`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/securityTypes`,httpMethod:`GET`}),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={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/exchanges`,httpMethod:`GET`}),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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),s[`Content-Type`]=`application/json`;let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols`,httpMethod:`POST`}),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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols/{query}`,httpMethod:`GET`}),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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(c.brokerage=t);let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerageAuthorizationTypes`,httpMethod:`GET`}),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={};await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:s,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:c,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...n.headers},q({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerages/{slug}/instruments`,httpMethod:`GET`}),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={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/brokerages`,httpMethod:`GET`}),H(r,s),{url:W(r),options:a}},listAllCurrencies:async(t={})=>{let n=`/currencies`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/currencies`,httpMethod:`GET`}),H(r,s),{url:W(r),options:a}},listAllCurrenciesRates:async(t={})=>{let n=`/currencies/rates`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!K()?{"User-Agent":e.userAgent}:{},s={};await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:o,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:s,key:`timestamp`,keyParamName:`timestamp`,configuration:e});let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...t.headers},q({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/currencies/rates`,httpMethod:`GET`}),H(r,s),{url:W(r),options:a}},symbolSearchUserAccount:async(t,n,r,i,a={})=>{B(`symbolSearchUserAccount`,`userId`,t),B(`symbolSearchUserAccount`,`userSecret`,n),B(`symbolSearchUserAccount`,`accountId`,r);let o=`/accounts/{accountId}/symbols`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/symbols`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}}}},Q=function(e){let t=Or(e);return{async getCurrencyExchangeRatePair(n,r){return G(await t.getCurrencyExchangeRatePair(n.currencyPair,r),I,L,e)},async getPartnerInfo(n){return G(await t.getPartnerInfo(n),I,L,e)},async getSecurityTypes(n){return G(await t.getSecurityTypes(n),I,L,e)},async getStockExchanges(n){return G(await t.getStockExchanges(n),I,L,e)},async getSymbols(n={},r){let i={substring:n.substring};return G(await t.getSymbols(i,r),I,L,e)},async getSymbolsByTicker(n,r){return G(await t.getSymbolsByTicker(n.query,r),I,L,e)},async listAllBrokerageAuthorizationType(n={},r){return G(await t.listAllBrokerageAuthorizationType(n.brokerage,r),I,L,e)},async listAllBrokerageInstruments(n,r){return G(await t.listAllBrokerageInstruments(n.slug,r),I,L,e)},async listAllBrokerages(n){return G(await t.listAllBrokerages(n),I,L,e)},async listAllCurrencies(n){return G(await t.listAllCurrencies(n),I,L,e)},async listAllCurrenciesRates(n){return G(await t.listAllCurrenciesRates(n),I,L,e)},async symbolSearchUserAccount(n,r){let i={substring:n.substring};return G(await t.symbolSearchUserAccount(n.userId,n.userSecret,n.accountId,i,r),I,L,e)}}},kr=function(e,t,n){let r=Q(e);return{getCurrencyExchangeRatePair(e,i){return r.getCurrencyExchangeRatePair(e,i).then(e=>e(n,t))},getPartnerInfo(e){return r.getPartnerInfo(e).then(e=>e(n,t))},getSecurityTypes(e){return r.getSecurityTypes(e).then(e=>e(n,t))},getStockExchanges(e){return r.getStockExchanges(e).then(e=>e(n,t))},getSymbols(e={},i){return r.getSymbols(e,i).then(e=>e(n,t))},getSymbolsByTicker(e,i){return r.getSymbolsByTicker(e,i).then(e=>e(n,t))},listAllBrokerageAuthorizationType(e={},i){return r.listAllBrokerageAuthorizationType(e,i).then(e=>e(n,t))},listAllBrokerageInstruments(e,i){return r.listAllBrokerageInstruments(e,i).then(e=>e(n,t))},listAllBrokerages(e){return r.listAllBrokerages(e).then(e=>e(n,t))},listAllCurrencies(e){return r.listAllCurrencies(e).then(e=>e(n,t))},listAllCurrenciesRates(e){return r.listAllCurrenciesRates(e).then(e=>e(n,t))},symbolSearchUserAccount(e,i){return r.symbolSearchUserAccount(e,i).then(e=>e(n,t))}}};var Ar=class extends R{getCurrencyExchangeRatePair(e,t){return Q(this.configuration).getCurrencyExchangeRatePair(e,t).then(e=>e(this.axios,this.basePath))}getPartnerInfo(e){return Q(this.configuration).getPartnerInfo(e).then(e=>e(this.axios,this.basePath))}getSecurityTypes(e){return Q(this.configuration).getSecurityTypes(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={},t){return Q(this.configuration).getSymbols(e,t).then(e=>e(this.axios,this.basePath))}getSymbolsByTicker(e,t){return Q(this.configuration).getSymbolsByTicker(e,t).then(e=>e(this.axios,this.basePath))}listAllBrokerageAuthorizationType(e={},t){return Q(this.configuration).listAllBrokerageAuthorizationType(e,t).then(e=>e(this.axios,this.basePath))}listAllBrokerageInstruments(e,t){return Q(this.configuration).listAllBrokerageInstruments(e,t).then(e=>e(this.axios,this.basePath))}listAllBrokerages(e){return Q(this.configuration).listAllBrokerages(e).then(e=>e(this.axios,this.basePath))}listAllCurrencies(e){return Q(this.configuration).listAllCurrencies(e).then(e=>e(this.axios,this.basePath))}listAllCurrenciesRates(e){return Q(this.configuration).listAllCurrenciesRates(e).then(e=>e(this.axios,this.basePath))}symbolSearchUserAccount(e,t){return Q(this.configuration).symbolSearchUserAccount(e,t).then(e=>e(this.axios,this.basePath))}},jr=class extends Ar{};let Mr=function(e){return{cancelOrder:async(t,n,r,i,a={})=>{B(`cancelOrder`,`userId`,t),B(`cancelOrder`,`userSecret`,n),B(`cancelOrder`,`accountId`,r),B(`cancelOrder`,`accountInformationGetUserAccountOrderDetailRequest`,i);let o=`/accounts/{accountId}/trading/cancel`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/cancel`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},cancelUserAccountOrder:async(t,n,r,i,a={})=>{B(`cancelUserAccountOrder`,`userId`,t),B(`cancelUserAccountOrder`,`userSecret`,n),B(`cancelUserAccountOrder`,`accountId`,r),B(`cancelUserAccountOrder`,`accountInformationGetUserAccountOrderDetailRequest`,i);let o=`/accounts/{accountId}/orders/cancel`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/cancel`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},getCryptocurrencyPairQuote:async(t,n,r,i,a={})=>{B(`getCryptocurrencyPairQuote`,`userId`,t),B(`getCryptocurrencyPairQuote`,`userSecret`,n),B(`getCryptocurrencyPairQuote`,`accountId`,r),B(`getCryptocurrencyPairQuote`,`instrumentSymbol`,i);let o=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))).replace(`{instrumentSymbol}`,encodeURIComponent(String(i===void 0?`-instrumentSymbol-`:i))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},getOptionImpact:async(t,n,r,i,a={})=>{B(`getOptionImpact`,`userId`,t),B(`getOptionImpact`,`userSecret`,n),B(`getOptionImpact`,`accountId`,r),B(`getOptionImpact`,`mlegTradeForm`,i);let o=`/accounts/{accountId}/trading/options/impact`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options/impact`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},getOrderImpact:async(t,n,r,i={})=>{B(`getOrderImpact`,`userId`,t),B(`getOrderImpact`,`userSecret`,n),B(`getOrderImpact`,`manualTradeForm`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n),l[`Content-Type`]=`application/json`;let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({requestBody:r,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/impact`,httpMethod:`POST`}),c.data=U(r,c,e),H(o,u),{url:W(o),options:c}},getUserAccountOptionQuotes:async(t,n,r,i,a={})=>{B(`getUserAccountOptionQuotes`,`userId`,t),B(`getUserAccountOptionQuotes`,`userSecret`,n),B(`getUserAccountOptionQuotes`,`accountId`,r),B(`getUserAccountOptionQuotes`,`symbol`,i);let o=`/accounts/{accountId}/quotes/options`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),i!==void 0&&(d.symbol=i);let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/quotes/options`,httpMethod:`GET`}),H(s,d),{url:W(s),options:l}},getUserAccountQuotes:async(t,n,r,i,a,o={})=>{B(`getUserAccountQuotes`,`userId`,t),B(`getUserAccountQuotes`,`userSecret`,n),B(`getUserAccountQuotes`,`symbols`,r),B(`getUserAccountQuotes`,`accountId`,i);let s=`/accounts/{accountId}/quotes`.replace(`{accountId}`,encodeURIComponent(String(i===void 0?`-accountId-`:i))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:d,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:f,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(f.userId=t),n!==void 0&&(f.userSecret=n),r!==void 0&&(f.symbols=r),a!==void 0&&(f.use_ticker=a);let p=l&&l.headers?l.headers:{};return u.headers={...d,...p,...o.headers},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/quotes`,httpMethod:`GET`}),H(c,f),{url:W(c),options:u}},placeBracketOrder:async(t,n,r,i,a={})=>{B(`placeBracketOrder`,`accountId`,t),B(`placeBracketOrder`,`userId`,n),B(`placeBracketOrder`,`userSecret`,r),B(`placeBracketOrder`,`manualTradeFormBracket`,i);let o=`/accounts/{accountId}/trading/bracket`.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={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(d.userId=n),r!==void 0&&(d.userSecret=r),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/bracket`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},placeComplexOrder:async(t,n,r,i,a={})=>{B(`placeComplexOrder`,`accountId`,t),B(`placeComplexOrder`,`userId`,n),B(`placeComplexOrder`,`userSecret`,r),B(`placeComplexOrder`,`manualTradeFormComplex`,i);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={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(d.userId=n),r!==void 0&&(d.userSecret=r),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/complex`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},placeCryptoOrder:async(t,n,r,i,a={})=>{B(`placeCryptoOrder`,`userId`,t),B(`placeCryptoOrder`,`userSecret`,n),B(`placeCryptoOrder`,`accountId`,r),B(`placeCryptoOrder`,`cryptoOrderForm`,i);let o=`/accounts/{accountId}/trading/crypto`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},placeForceOrder:async(t,n,r,i={})=>{B(`placeForceOrder`,`userId`,t),B(`placeForceOrder`,`userSecret`,n),B(`placeForceOrder`,`manualTradeFormWithOptions`,r);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={};await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:l,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:u,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(u.userId=t),n!==void 0&&(u.userSecret=n),l[`Content-Type`]=`application/json`;let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},q({requestBody:r,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/place`,httpMethod:`POST`}),c.data=U(r,c,e),H(o,u),{url:W(o),options:c}},placeMlegOrder:async(t,n,r,i,a={})=>{B(`placeMlegOrder`,`userId`,t),B(`placeMlegOrder`,`userSecret`,n),B(`placeMlegOrder`,`accountId`,r),B(`placeMlegOrder`,`mlegTradeForm`,i);let o=`/accounts/{accountId}/trading/options`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},placeOrder:async(t,n,r,i,a={})=>{B(`placeOrder`,`tradeId`,t),B(`placeOrder`,`userId`,n),B(`placeOrder`,`userSecret`,r);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={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(d.userId=n),r!==void 0&&(d.userSecret=r),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/trade/{tradeId}`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},previewCryptoOrder:async(t,n,r,i,a={})=>{B(`previewCryptoOrder`,`userId`,t),B(`previewCryptoOrder`,`userSecret`,n),B(`previewCryptoOrder`,`accountId`,r),B(`previewCryptoOrder`,`cryptoOrderForm`,i);let o=`/accounts/{accountId}/trading/crypto/preview`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!K()?{"User-Agent":e.userAgent}:{},d={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(d.userId=t),n!==void 0&&(d.userSecret=n),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto/preview`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},replaceOrder:async(t,n,r,i,a={})=>{B(`replaceOrder`,`accountId`,t),B(`replaceOrder`,`userId`,n),B(`replaceOrder`,`userSecret`,r),B(`replaceOrder`,`manualTradeReplaceForm`,i);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={};await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:u,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:d,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),n!==void 0&&(d.userId=n),r!==void 0&&(d.userSecret=r),u[`Content-Type`]=`application/json`;let f=c&&c.headers?c.headers:{};return l.headers={...u,...f,...a.headers},q({requestBody:i,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/replace`,httpMethod:`POST`}),l.data=U(i,l,e),H(s,d),{url:W(s),options:l}},searchCryptocurrencyPairInstruments:async(t,n,r,i,a,o={})=>{B(`searchCryptocurrencyPairInstruments`,`userId`,t),B(`searchCryptocurrencyPairInstruments`,`userSecret`,n),B(`searchCryptocurrencyPairInstruments`,`accountId`,r);let s=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`.replace(`{accountId}`,encodeURIComponent(String(r===void 0?`-accountId-`:r))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!K()?{"User-Agent":e.userAgent}:{},f={};await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:d,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:f,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(f.userId=t),n!==void 0&&(f.userSecret=n),i!==void 0&&(f.base=i),a!==void 0&&(f.quote=a);let p=l&&l.headers?l.headers:{};return u.headers={...d,...p,...o.headers},q({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`,httpMethod:`GET`}),H(c,f),{url:W(c),options:u}}}},$=function(e){let t=Mr(e);return{async cancelOrder(n,r){let i={brokerage_order_id:n.brokerage_order_id};return G(await t.cancelOrder(n.userId,n.userSecret,n.accountId,i,r),I,L,e)},async cancelUserAccountOrder(n,r){let i={brokerage_order_id:n.brokerage_order_id};return G(await t.cancelUserAccountOrder(n.userId,n.userSecret,n.accountId,i,r),I,L,e)},async getCryptocurrencyPairQuote(n,r){return G(await t.getCryptocurrencyPairQuote(n.userId,n.userSecret,n.accountId,n.instrumentSymbol,r),I,L,e)},async getOptionImpact(n,r){let i={order_type:n.order_type,time_in_force:n.time_in_force,limit_price:n.limit_price,stop_price:n.stop_price,price_effect:n.price_effect,legs:n.legs};return G(await t.getOptionImpact(n.userId,n.userSecret,n.accountId,i,r),I,L,e)},async getOrderImpact(n,r){let i={account_id:n.account_id,action:n.action,universal_symbol_id:n.universal_symbol_id,order_type:n.order_type,time_in_force:n.time_in_force,price:n.price,stop:n.stop,units:n.units,notional_value:n.notional_value};return G(await t.getOrderImpact(n.userId,n.userSecret,i,r),I,L,e)},async getUserAccountOptionQuotes(n,r){return G(await t.getUserAccountOptionQuotes(n.userId,n.userSecret,n.accountId,n.symbol,r),I,L,e)},async getUserAccountQuotes(n,r){return G(await t.getUserAccountQuotes(n.userId,n.userSecret,n.symbols,n.accountId,n.useTicker,r),I,L,e)},async placeBracketOrder(n,r){let i={action:n.action,instrument:n.instrument,order_type:n.order_type,time_in_force:n.time_in_force,price:n.price,stop:n.stop,units:n.units,stop_loss:n.stop_loss,take_profit:n.take_profit};return G(await t.placeBracketOrder(n.accountId,n.userId,n.userSecret,i,r),I,L,e)},async placeComplexOrder(n,r){let i={type:n.type,orders:n.orders,client_order_id:n.client_order_id};return G(await t.placeComplexOrder(n.accountId,n.userId,n.userSecret,i,r),I,L,e)},async placeCryptoOrder(n,r){let i={instrument:n.instrument,side:n.side,type:n.type,time_in_force:n.time_in_force,amount:n.amount,limit_price:n.limit_price,stop_price:n.stop_price,post_only:n.post_only,expiration_date:n.expiration_date};return G(await t.placeCryptoOrder(n.userId,n.userSecret,n.accountId,i,r),I,L,e)},async placeForceOrder(n,r){let i={account_id:n.account_id,action:n.action,universal_symbol_id:n.universal_symbol_id,symbol:n.symbol,order_type:n.order_type,time_in_force:n.time_in_force,trading_session:n.trading_session,price:n.price,stop:n.stop,units:n.units,notional_value:n.notional_value};return G(await t.placeForceOrder(n.userId,n.userSecret,i,r),I,L,e)},async placeMlegOrder(n,r){let i={order_type:n.order_type,time_in_force:n.time_in_force,limit_price:n.limit_price,stop_price:n.stop_price,price_effect:n.price_effect,legs:n.legs};return G(await t.placeMlegOrder(n.userId,n.userSecret,n.accountId,i,r),I,L,e)},async placeOrder(n,r){let i={wait_to_confirm:n.wait_to_confirm};return G(await t.placeOrder(n.tradeId,n.userId,n.userSecret,i,r),I,L,e)},async previewCryptoOrder(n,r){let i={instrument:n.instrument,side:n.side,type:n.type,time_in_force:n.time_in_force,amount:n.amount,limit_price:n.limit_price,stop_price:n.stop_price,post_only:n.post_only,expiration_date:n.expiration_date};return G(await t.previewCryptoOrder(n.userId,n.userSecret,n.accountId,i,r),I,L,e)},async replaceOrder(n,r){let i={brokerage_order_id:n.brokerage_order_id,action:n.action,order_type:n.order_type,time_in_force:n.time_in_force,price:n.price,symbol:n.symbol,stop:n.stop,units:n.units};return G(await t.replaceOrder(n.accountId,n.userId,n.userSecret,i,r),I,L,e)},async searchCryptocurrencyPairInstruments(n,r){return G(await t.searchCryptocurrencyPairInstruments(n.userId,n.userSecret,n.accountId,n.base,n.quote,r),I,L,e)}}},Nr=function(e,t,n){let r=$(e);return{cancelOrder(e,i){return r.cancelOrder(e,i).then(e=>e(n,t))},cancelUserAccountOrder(e,i){return r.cancelUserAccountOrder(e,i).then(e=>e(n,t))},getCryptocurrencyPairQuote(e,i){return r.getCryptocurrencyPairQuote(e,i).then(e=>e(n,t))},getOptionImpact(e,i){return r.getOptionImpact(e,i).then(e=>e(n,t))},getOrderImpact(e,i){return r.getOrderImpact(e,i).then(e=>e(n,t))},getUserAccountOptionQuotes(e,i){return r.getUserAccountOptionQuotes(e,i).then(e=>e(n,t))},getUserAccountQuotes(e,i){return r.getUserAccountQuotes(e,i).then(e=>e(n,t))},placeBracketOrder(e,i){return r.placeBracketOrder(e,i).then(e=>e(n,t))},placeComplexOrder(e,i){return r.placeComplexOrder(e,i).then(e=>e(n,t))},placeCryptoOrder(e,i){return r.placeCryptoOrder(e,i).then(e=>e(n,t))},placeForceOrder(e,i){return r.placeForceOrder(e,i).then(e=>e(n,t))},placeMlegOrder(e,i){return r.placeMlegOrder(e,i).then(e=>e(n,t))},placeOrder(e,i){return r.placeOrder(e,i).then(e=>e(n,t))},previewCryptoOrder(e,i){return r.previewCryptoOrder(e,i).then(e=>e(n,t))},replaceOrder(e,i){return r.replaceOrder(e,i).then(e=>e(n,t))},searchCryptocurrencyPairInstruments(e,i){return r.searchCryptocurrencyPairInstruments(e,i).then(e=>e(n,t))}}};var Pr=class extends R{cancelOrder(e,t){return $(this.configuration).cancelOrder(e,t).then(e=>e(this.axios,this.basePath))}cancelUserAccountOrder(e,t){return $(this.configuration).cancelUserAccountOrder(e,t).then(e=>e(this.axios,this.basePath))}getCryptocurrencyPairQuote(e,t){return $(this.configuration).getCryptocurrencyPairQuote(e,t).then(e=>e(this.axios,this.basePath))}getOptionImpact(e,t){return $(this.configuration).getOptionImpact(e,t).then(e=>e(this.axios,this.basePath))}getOrderImpact(e,t){return $(this.configuration).getOrderImpact(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountOptionQuotes(e,t){return $(this.configuration).getUserAccountOptionQuotes(e,t).then(e=>e(this.axios,this.basePath))}getUserAccountQuotes(e,t){return $(this.configuration).getUserAccountQuotes(e,t).then(e=>e(this.axios,this.basePath))}placeBracketOrder(e,t){return $(this.configuration).placeBracketOrder(e,t).then(e=>e(this.axios,this.basePath))}placeComplexOrder(e,t){return $(this.configuration).placeComplexOrder(e,t).then(e=>e(this.axios,this.basePath))}placeCryptoOrder(e,t){return $(this.configuration).placeCryptoOrder(e,t).then(e=>e(this.axios,this.basePath))}placeForceOrder(e,t){return $(this.configuration).placeForceOrder(e,t).then(e=>e(this.axios,this.basePath))}placeMlegOrder(e,t){return $(this.configuration).placeMlegOrder(e,t).then(e=>e(this.axios,this.basePath))}placeOrder(e,t){return $(this.configuration).placeOrder(e,t).then(e=>e(this.axios,this.basePath))}previewCryptoOrder(e,t){return $(this.configuration).previewCryptoOrder(e,t).then(e=>e(this.axios,this.basePath))}replaceOrder(e,t){return $(this.configuration).replaceOrder(e,t).then(e=>e(this.axios,this.basePath))}searchCryptocurrencyPairInstruments(e,t){return $(this.configuration).searchCryptocurrencyPairInstruments(e,t).then(e=>e(this.axios,this.basePath))}},Fr=class extends Pr{};let Ir=function(e){return{getActivities:async(t,n,r,i,a,o,s,c={})=>{B(`getActivities`,`userId`,t),B(`getActivities`,`userSecret`,n);let l=`/activities`,u=new URL(l,z),d;e&&(d=e.baseOptions);let f={method:`GET`,...d,...c},p=e&&!K()?{"User-Agent":e.userAgent}:{},m={};await V({object:m,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:p,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:m,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),r!==void 0&&(m.startDate=r instanceof Date?r.toISOString().substr(0,10):r),i!==void 0&&(m.endDate=i instanceof Date?i.toISOString().substr(0,10):i),a!==void 0&&(m.accounts=a),o!==void 0&&(m.brokerageAuthorizations=o),s!==void 0&&(m.type=s),t!==void 0&&(m.userId=t),n!==void 0&&(m.userSecret=n);let h=d&&d.headers?d.headers:{};return f.headers={...p,...h,...c.headers},q({queryParameters:m,requestConfig:f,path:l,configuration:e,pathTemplate:`/activities`,httpMethod:`GET`}),H(u,m),{url:W(u),options:f}},getReportingCustomRange:async(t,n,r,i,a,o,s,c={})=>{B(`getReportingCustomRange`,`startDate`,t),B(`getReportingCustomRange`,`endDate`,n),B(`getReportingCustomRange`,`userId`,r),B(`getReportingCustomRange`,`userSecret`,i);let l=`/performance/custom`,u=new URL(l,z),d;e&&(d=e.baseOptions);let f={method:`GET`,...d,...c},p=e&&!K()?{"User-Agent":e.userAgent}:{},m={};await V({object:m,key:`clientId`,keyParamName:`clientId`,configuration:e}),await V({object:p,key:`Signature`,keyParamName:`signature`,configuration:e}),await V({object:m,key:`timestamp`,keyParamName:`timestamp`,configuration:e}),t!==void 0&&(m.startDate=t instanceof Date?t.toISOString().substr(0,10):t),n!==void 0&&(m.endDate=n instanceof Date?n.toISOString().substr(0,10):n),a!==void 0&&(m.accounts=a),o!==void 0&&(m.detailed=o),s!==void 0&&(m.frequency=s),r!==void 0&&(m.userId=r),i!==void 0&&(m.userSecret=i);let h=d&&d.headers?d.headers:{};return f.headers={...p,...h,...c.headers},q({queryParameters:m,requestConfig:f,path:l,configuration:e,pathTemplate:`/performance/custom`,httpMethod:`GET`}),H(u,m),{url:W(u),options:f}}}},Lr=function(e){let t=Ir(e);return{async getActivities(n,r){return G(await t.getActivities(n.userId,n.userSecret,n.startDate,n.endDate,n.accounts,n.brokerageAuthorizations,n.type,r),I,L,e)},async getReportingCustomRange(n,r){return G(await t.getReportingCustomRange(n.startDate,n.endDate,n.userId,n.userSecret,n.accounts,n.detailed,n.frequency,r),I,L,e)}}},Rr=function(e,t,n){let r=Lr(e);return{getActivities(e,i){return r.getActivities(e,i).then(e=>e(n,t))},getReportingCustomRange(e,i){return r.getReportingCustomRange(e,i).then(e=>e(n,t))}}};var zr=class extends R{getActivities(e,t){return Lr(this.configuration).getActivities(e,t).then(e=>e(this.axios,this.basePath))}getReportingCustomRange(e,t){return Lr(this.configuration).getReportingCustomRange(e,t).then(e=>e(this.axios,this.basePath))}},Br=class extends zr{},Vr=class{constructor(e={}){this.consumerKey=e.consumerKey,this.apiKey=e.apiKey,this.apiKey===void 0&&(this.apiKey={},e.clientId!==void 0&&(this.apiKey.clientId=e.clientId),e.signature!==void 0&&(this.apiKey.signature=e.signature),e.timestamp!==void 0&&(this.apiKey.timestamp=e.timestamp)),this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions??{},this.userAgent=e.userAgent===void 0?`Konfig/10.0.8/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`)}},Hr=class{constructor(e){}},Ur=class extends Hr{constructor(e={}){super(e);let t=new Vr(e);this.accountInformation=new ar(t),this.apiStatus=new ur(t),this.authentication=new mr(t),this.connections=new vr(t),this.experimentalEndpoints=new Sr(t),this.options=new Dr(t),this.referenceData=new jr(t),this.trading=new Fr(t),this.transactionsAndReporting=new Br(t)}};e.AccountInformationApi=ar,e.AccountInformationApiAxiosParamCreator=nr,e.AccountInformationApiFactory=rr,e.AccountInformationApiFp=J,e.AccountInformationApiGenerated=ir,e.ApiStatusApi=ur,e.ApiStatusApiAxiosParamCreator=or,e.ApiStatusApiFactory=cr,e.ApiStatusApiFp=sr,e.ApiStatusApiGenerated=lr,e.AuthenticationApi=mr,e.AuthenticationApiAxiosParamCreator=dr,e.AuthenticationApiFactory=fr,e.AuthenticationApiFp=Y,e.AuthenticationApiGenerated=pr,e.Configuration=Vr,e.ConnectionsApi=vr,e.ConnectionsApiAxiosParamCreator=hr,e.ConnectionsApiFactory=gr,e.ConnectionsApiFp=X,e.ConnectionsApiGenerated=_r,e.ExperimentalEndpointsApi=Sr,e.ExperimentalEndpointsApiAxiosParamCreator=yr,e.ExperimentalEndpointsApiFactory=br,e.ExperimentalEndpointsApiFp=Z,e.ExperimentalEndpointsApiGenerated=xr,e.OptionsApi=Dr,e.OptionsApiAxiosParamCreator=Cr,e.OptionsApiFactory=Tr,e.OptionsApiFp=wr,e.OptionsApiGenerated=Er,e.ReferenceDataApi=jr,e.ReferenceDataApiAxiosParamCreator=Or,e.ReferenceDataApiFactory=kr,e.ReferenceDataApiFp=Q,e.ReferenceDataApiGenerated=Ar,e.Snaptrade=Ur,e.SnaptradeError=Xn,e.TradingApi=Fr,e.TradingApiAxiosParamCreator=Mr,e.TradingApiFactory=Nr,e.TradingApiFp=$,e.TradingApiGenerated=Pr,e.TransactionsAndReportingApi=Br,e.TransactionsAndReportingApiAxiosParamCreator=Ir,e.TransactionsAndReportingApiFactory=Rr,e.TransactionsAndReportingApiFp=Lr,e.TransactionsAndReportingApiGenerated=zr,e.parseIfJson=Qn,e.readableStreamToString=Zn});
package/dist/index.cjs CHANGED
@@ -3363,12 +3363,12 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
3363
3363
  /**
3364
3364
  * Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
3365
3365
  * @summary Cancel a Trade Detection subscription
3366
- * @param {TradeDetectionAddSubscriptionRequest} tradeDetectionAddSubscriptionRequest
3366
+ * @param {TradeDetectionCancelSubscriptionRequest} tradeDetectionCancelSubscriptionRequest
3367
3367
  * @param {*} [options] Override http request option.
3368
3368
  * @throws {RequiredError}
3369
3369
  */
3370
- cancelSubscription: async (tradeDetectionAddSubscriptionRequest, options = {}) => {
3371
- assertParamExists("cancelSubscription", "tradeDetectionAddSubscriptionRequest", tradeDetectionAddSubscriptionRequest);
3370
+ cancelSubscription: async (tradeDetectionCancelSubscriptionRequest, options = {}) => {
3371
+ assertParamExists("cancelSubscription", "tradeDetectionCancelSubscriptionRequest", tradeDetectionCancelSubscriptionRequest);
3372
3372
  const localVarPath = `/snapTrade/tradeDetection/subscriptions/cancel`;
3373
3373
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3374
3374
  let baseOptions;
@@ -3406,7 +3406,7 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
3406
3406
  ...options.headers
3407
3407
  };
3408
3408
  requestBeforeHook({
3409
- requestBody: tradeDetectionAddSubscriptionRequest,
3409
+ requestBody: tradeDetectionCancelSubscriptionRequest,
3410
3410
  queryParameters: localVarQueryParameter,
3411
3411
  requestConfig: localVarRequestOptions,
3412
3412
  path: localVarPath,
@@ -3414,7 +3414,7 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
3414
3414
  pathTemplate: "/snapTrade/tradeDetection/subscriptions/cancel",
3415
3415
  httpMethod: "POST"
3416
3416
  });
3417
- localVarRequestOptions.data = serializeDataIfNeeded(tradeDetectionAddSubscriptionRequest, localVarRequestOptions, configuration);
3417
+ localVarRequestOptions.data = serializeDataIfNeeded(tradeDetectionCancelSubscriptionRequest, localVarRequestOptions, configuration);
3418
3418
  setSearchParams(localVarUrlObj, localVarQueryParameter);
3419
3419
  return {
3420
3420
  url: toPathString(localVarUrlObj),
@@ -3694,7 +3694,10 @@ const ExperimentalEndpointsApiFp = function(configuration) {
3694
3694
  * @throws {RequiredError}
3695
3695
  */
3696
3696
  async addSubscription(requestParameters, options) {
3697
- const tradeDetectionAddSubscriptionRequest = { account_id: requestParameters.account_id };
3697
+ const tradeDetectionAddSubscriptionRequest = {
3698
+ account_id: requestParameters.account_id,
3699
+ check_interval_seconds: requestParameters.check_interval_seconds
3700
+ };
3698
3701
  return createRequestFunction(await localVarAxiosParamCreator.addSubscription(requestParameters.userId, requestParameters.userSecret, tradeDetectionAddSubscriptionRequest, options), axios.default, BASE_PATH, configuration);
3699
3702
  },
3700
3703
  /**
@@ -3705,8 +3708,8 @@ const ExperimentalEndpointsApiFp = function(configuration) {
3705
3708
  * @throws {RequiredError}
3706
3709
  */
3707
3710
  async cancelSubscription(requestParameters, options) {
3708
- const tradeDetectionAddSubscriptionRequest = { account_id: requestParameters.account_id };
3709
- return createRequestFunction(await localVarAxiosParamCreator.cancelSubscription(tradeDetectionAddSubscriptionRequest, options), axios.default, BASE_PATH, configuration);
3711
+ const tradeDetectionCancelSubscriptionRequest = { account_id: requestParameters.account_id };
3712
+ return createRequestFunction(await localVarAxiosParamCreator.cancelSubscription(tradeDetectionCancelSubscriptionRequest, options), axios.default, BASE_PATH, configuration);
3710
3713
  },
3711
3714
  /**
3712
3715
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
@@ -7118,7 +7121,7 @@ var Configuration = class {
7118
7121
  this.accessToken = param.accessToken;
7119
7122
  this.basePath = param.basePath;
7120
7123
  this.baseOptions = param.baseOptions ?? {};
7121
- this.userAgent = param.userAgent === void 0 ? "Konfig/10.0.7/typescript" : param.userAgent;
7124
+ this.userAgent = param.userAgent === void 0 ? "Konfig/10.0.8/typescript" : param.userAgent;
7122
7125
  this.formDataCtor = param.formDataCtor;
7123
7126
  }
7124
7127
  /**
package/dist/index.d.cts CHANGED
@@ -3194,6 +3194,22 @@ type ActionStrict = 'BUY' | 'SELL';
3194
3194
  */
3195
3195
  type ActionStrictWithOptions = 'BUY' | 'SELL' | 'BUY_TO_OPEN' | 'BUY_TO_CLOSE' | 'SELL_TO_OPEN' | 'SELL_TO_CLOSE';
3196
3196
  //#endregion
3197
+ //#region models/all-account-positions-response-data-freshness.d.ts
3198
+ /**
3199
+ * Metadata describing freshness of the returned positions data.
3200
+ * @export
3201
+ * @interface AllAccountPositionsResponseDataFreshness
3202
+ */
3203
+ interface AllAccountPositionsResponseDataFreshness {
3204
+ [key: string]: any;
3205
+ /**
3206
+ * The time the returned positions data was fetched from the brokerage.
3207
+ * @type {string}
3208
+ * @memberof AllAccountPositionsResponseDataFreshness
3209
+ */
3210
+ 'as_of': string;
3211
+ }
3212
+ //#endregion
3197
3213
  //#region models/all-account-positions-response.d.ts
3198
3214
  /**
3199
3215
  * Information about all account positions.
@@ -3208,6 +3224,12 @@ interface AllAccountPositionsResponse {
3208
3224
  * @memberof AllAccountPositionsResponse
3209
3225
  */
3210
3226
  'results': Array<AccountPosition>;
3227
+ /**
3228
+ *
3229
+ * @type {AllAccountPositionsResponseDataFreshness}
3230
+ * @memberof AllAccountPositionsResponse
3231
+ */
3232
+ 'data_freshness': AllAccountPositionsResponseDataFreshness;
3211
3233
  }
3212
3234
  //#endregion
3213
3235
  //#region models/encrypted-response-encrypted-message-data.d.ts
@@ -6370,6 +6392,27 @@ interface TradeDetectionAddSubscriptionRequest {
6370
6392
  * @memberof TradeDetectionAddSubscriptionRequest
6371
6393
  */
6372
6394
  'account_id': string;
6395
+ /**
6396
+ * How often the subscribed account should be checked for new trades. Must match an active Trade Detection plan.
6397
+ * @type {number}
6398
+ * @memberof TradeDetectionAddSubscriptionRequest
6399
+ */
6400
+ 'check_interval_seconds': number;
6401
+ }
6402
+ //#endregion
6403
+ //#region models/trade-detection-cancel-subscription-request.d.ts
6404
+ /**
6405
+ *
6406
+ * @export
6407
+ * @interface TradeDetectionCancelSubscriptionRequest
6408
+ */
6409
+ interface TradeDetectionCancelSubscriptionRequest {
6410
+ /**
6411
+ * Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
6412
+ * @type {string}
6413
+ * @memberof TradeDetectionCancelSubscriptionRequest
6414
+ */
6415
+ 'account_id': string;
6373
6416
  }
6374
6417
  //#endregion
6375
6418
  //#region models/trade-detection-cancel-subscription-response.d.ts
@@ -8553,11 +8596,11 @@ declare const ExperimentalEndpointsApiAxiosParamCreator: (configuration?: Config
8553
8596
  /**
8554
8597
  * Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
8555
8598
  * @summary Cancel a Trade Detection subscription
8556
- * @param {TradeDetectionAddSubscriptionRequest} tradeDetectionAddSubscriptionRequest
8599
+ * @param {TradeDetectionCancelSubscriptionRequest} tradeDetectionCancelSubscriptionRequest
8557
8600
  * @param {*} [options] Override http request option.
8558
8601
  * @throws {RequiredError}
8559
8602
  */
8560
- cancelSubscription: (tradeDetectionAddSubscriptionRequest: TradeDetectionAddSubscriptionRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
8603
+ cancelSubscription: (tradeDetectionCancelSubscriptionRequest: TradeDetectionCancelSubscriptionRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
8561
8604
  /**
8562
8605
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
8563
8606
  * @summary Get account order detail (V2)
@@ -8730,7 +8773,7 @@ type ExperimentalEndpointsApiAddSubscriptionRequest = {
8730
8773
  * @export
8731
8774
  * @interface ExperimentalEndpointsApiCancelSubscriptionRequest
8732
8775
  */
8733
- type ExperimentalEndpointsApiCancelSubscriptionRequest = {} & TradeDetectionAddSubscriptionRequest;
8776
+ type ExperimentalEndpointsApiCancelSubscriptionRequest = {} & TradeDetectionCancelSubscriptionRequest;
8734
8777
  /**
8735
8778
  * Request parameters for getUserAccountOrderDetailV2 operation in ExperimentalEndpointsApi.
8736
8779
  * @export
@@ -10799,4 +10842,4 @@ declare class SnaptradeError extends Error {
10799
10842
  declare function readableStreamToString(stream: ReadableStream): Promise<string>;
10800
10843
  declare function parseIfJson(input: unknown): object | unknown;
10801
10844
  //#endregion
10802
- export { Account, AccountBalance, AccountBalanceTotal, AccountHoldings, AccountHoldingsAccount, AccountInformationApi, AccountInformationApiAxiosParamCreator, AccountInformationApiFactory, AccountInformationApiFp, AccountInformationApiGenerated, AccountInformationApiGetAccountActivitiesRequest, AccountInformationApiGetAccountBalanceHistoryRequest, AccountInformationApiGetAllAccountPositionsRequest, AccountInformationApiGetAllUserHoldingsRequest, AccountInformationApiGetUserAccountBalanceRequest, AccountInformationApiGetUserAccountDetailsRequest, AccountInformationApiGetUserAccountOrderDetailRequest, AccountInformationApiGetUserAccountOrdersRequest, AccountInformationApiGetUserAccountPositionsRequest, AccountInformationApiGetUserAccountRecentOrdersRequest, AccountInformationApiGetUserAccountReturnRatesRequest, AccountInformationApiGetUserHoldingsRequest, AccountInformationApiListUserAccountsRequest, AccountInformationApiUpdateUserAccountRequest, AccountInformationGetUserAccountOrderDetailRequest, AccountOrderRecord, AccountOrderRecordChildBrokerageOrderIds, AccountOrderRecordLeg, AccountOrderRecordLegInstrument, AccountOrderRecordOptionSymbol, AccountOrderRecordQuoteCurrency, AccountOrderRecordQuoteUniversalSymbol, AccountOrderRecordStatus, AccountOrderRecordStatusV2, AccountOrderRecordTrailingStop, AccountOrderRecordUniversalSymbol, AccountOrderRecordV2, AccountOrdersV2Response, AccountPosition, AccountSimple, AccountSyncStatus, AccountUniversalActivity, AccountUniversalActivityCurrency, AccountUniversalActivityOptionSymbol, AccountUniversalActivitySymbol, AccountValueHistoryItem, AccountValueHistoryResponse, ActionStrict, ActionStrictWithOptions, AdrInstrument, AllAccountPositionsResponse, ApiStatusApi, ApiStatusApiAxiosParamCreator, ApiStatusApiFactory, ApiStatusApiFp, ApiStatusApiGenerated, AuthenticationApi, AuthenticationApiAxiosParamCreator, AuthenticationApiDeleteSnapTradeUserRequest, AuthenticationApiFactory, AuthenticationApiFp, AuthenticationApiGenerated, AuthenticationApiLoginSnapTradeUserRequest, AuthenticationApiRegisterSnapTradeUserRequest, AuthenticationApiResetSnapTradeUserSecretRequest, AuthenticationLoginSnapTradeUser200Response, Balance, BalanceCurrency, Brokerage, BrokerageAuthorization, BrokerageAuthorizationDisabledConfirmation, BrokerageAuthorizationRefreshConfirmation, BrokerageAuthorizationTransactionsSyncConfirmation, BrokerageAuthorizationTypeReadOnly, BrokerageAuthorizationTypeReadOnlyBrokerage, BrokerageInstrument, BrokerageInstrumentsResponse, BrokerageType, CancelOrderResponse, CefInstrument, ChildBrokerageOrderIDs, ComplexOrderLeg, ComplexOrderResponse, Configuration, ConfigurationParameters, ConnectionsApi, ConnectionsApiAxiosParamCreator, ConnectionsApiDeleteConnectionRequest, ConnectionsApiDetailBrokerageAuthorizationRequest, ConnectionsApiDisableBrokerageAuthorizationRequest, ConnectionsApiFactory, ConnectionsApiFp, ConnectionsApiGenerated, ConnectionsApiListBrokerageAuthorizationAccountsRequest, ConnectionsApiListBrokerageAuthorizationsRequest, ConnectionsApiRefreshBrokerageAuthorizationRequest, ConnectionsApiRemoveBrokerageAuthorizationRequest, ConnectionsApiReturnRatesRequest, ConnectionsApiSessionEventsRequest, ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest, ConnectionsSessionEvents200ResponseInner, CryptoInstrument, CryptoOrderForm, CryptoOrderPreview, CryptoOrderPreviewEstimatedFee, CryptoTradingInstrument, CryptocurrencyPair, CryptocurrencyPairQuote, Currency, DeleteConnectionConfirmation, DeleteUserResponse, DividendAtDate, EncryptedResponse, EncryptedResponseEncryptedMessageData, EtfInstrument, Exchange, ExchangeRatePairs, ExperimentalEndpointsApi, ExperimentalEndpointsApiAddSubscriptionRequest, ExperimentalEndpointsApiAxiosParamCreator, ExperimentalEndpointsApiCancelSubscriptionRequest, ExperimentalEndpointsApiFactory, ExperimentalEndpointsApiFp, ExperimentalEndpointsApiGenerated, ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request, ExperimentalEndpointsApiGetUserAccountOrdersV2Request, ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request, FigiInstrument, FutureInstrument, HoldingsStatus, Instrument, LoginRedirectURI, ManualTrade, ManualTradeAndImpact, ManualTradeBalance, ManualTradeForm, ManualTradeFormBracket, ManualTradeFormComplex, ManualTradeFormNotionalValue, ManualTradeFormWithOptions, ManualTradeImpact, ManualTradeReplaceForm, ManualTradeSymbol, MlegActionStrict, MlegInstrumentType, MlegLeg, MlegOrderResponse, MlegOrderTypeStrict, MlegPriceEffectStrict, MlegTradeForm, MlegTradingInstrument, Model400FailedRequestResponse, Model401FailedRequestResponse, Model402BrokerageAuthAlreadyDisabledException, Model402BrokerageAuthDisabledResponse, Model403FailedRequestResponse, Model403FeatureNotEnabledResponse, Model404FailedRequestResponse, Model425FailedRequestResponse, Model500UnexpectedExceptionResponse, MonthlyDividends, MutualFundInstrument, NetContributions, NetDividend, NotionalValue, OptionBrokerageSymbol, OptionChainInner, OptionChainInnerChainPerRootInner, OptionChainInnerChainPerRootInnerChainPerStrikePriceInner, OptionImpact, OptionInstrument, OptionLeg, OptionQuote, OptionQuoteGreeks, OptionStrategy, OptionStrategyLegsInner, OptionsApi, OptionsApiAxiosParamCreator, OptionsApiFactory, OptionsApiFp, OptionsApiGenerated, OptionsApiListOptionHoldingsRequest, OptionsPosition, OptionsPositionCurrency, OptionsSymbol, OrderTypeStrict, OrderUpdatedResponse, OrderUpdatedResponseOrder, OtherInstrument, PaginatedUniversalActivity, PaginationDetails, PartnerData, PastValue, PerformanceCustom, Position, PositionCurrency, PositionSymbol, RateOfReturnObject, RateOfReturnResponse, RecentOrdersResponse, ReferenceDataApi, ReferenceDataApiAxiosParamCreator, ReferenceDataApiFactory, ReferenceDataApiFp, ReferenceDataApiGenerated, ReferenceDataApiGetCurrencyExchangeRatePairRequest, ReferenceDataApiGetSymbolsByTickerRequest, ReferenceDataApiGetSymbolsRequest, ReferenceDataApiListAllBrokerageAuthorizationTypeRequest, ReferenceDataApiListAllBrokerageInstrumentsRequest, ReferenceDataApiSymbolSearchUserAccountRequest, SecurityType, SessionEvent, SimpleOrderForm, SnapTradeHoldingsAccount, SnapTradeHoldingsTotalValue, SnapTradeLoginUserRequestBody, SnapTradeRegisterUserRequestBody, Snaptrade, SnaptradeError, Status, StockInstrument, StockInstrumentFigiInstrument, StopLoss, StrategyOrderRecord, StrategyQuotes, StrategyQuotesGreek, SubPeriodReturnRate, Symbol$1 as Symbol, SymbolCurrency, SymbolExchange, SymbolQuery, SymbolsQuotesInner, TakeProfit, TaxLot, TimeInForceStrict, TradeDetectionAddSubscriptionRequest, TradeDetectionCancelSubscriptionResponse, TradeDetectionSubscription, TradingApi, TradingApiAxiosParamCreator, TradingApiCancelOrderRequest, TradingApiCancelUserAccountOrderRequest, TradingApiFactory, TradingApiFp, TradingApiGenerated, TradingApiGetCryptocurrencyPairQuoteRequest, TradingApiGetOptionImpactRequest, TradingApiGetOrderImpactRequest, TradingApiGetUserAccountOptionQuotesRequest, TradingApiGetUserAccountQuotesRequest, TradingApiPlaceBracketOrderRequest, TradingApiPlaceComplexOrderRequest, TradingApiPlaceCryptoOrderRequest, TradingApiPlaceForceOrderRequest, TradingApiPlaceMlegOrderRequest, TradingApiPlaceOrderRequest, TradingApiPreviewCryptoOrderRequest, TradingApiReplaceOrderRequest, TradingApiSearchCryptocurrencyPairInstrumentsRequest, TradingInstrument, TradingSearchCryptocurrencyPairInstruments200Response, TradingSession, TrailingStop, TransactionsAndReportingApi, TransactionsAndReportingApiAxiosParamCreator, TransactionsAndReportingApiFactory, TransactionsAndReportingApiFp, TransactionsAndReportingApiGenerated, TransactionsAndReportingApiGetActivitiesRequest, TransactionsAndReportingApiGetReportingCustomRangeRequest, TransactionsStatus, USExchange, UnderlyingOptionInstrument, UnderlyingSymbol, UnderlyingSymbolExchange, UnderlyingSymbolType, UniversalActivity, UniversalSymbol, UserIDandSecret, ValidatedTradeBody, parseIfJson, readableStreamToString };
10845
+ export { Account, AccountBalance, AccountBalanceTotal, AccountHoldings, AccountHoldingsAccount, AccountInformationApi, AccountInformationApiAxiosParamCreator, AccountInformationApiFactory, AccountInformationApiFp, AccountInformationApiGenerated, AccountInformationApiGetAccountActivitiesRequest, AccountInformationApiGetAccountBalanceHistoryRequest, AccountInformationApiGetAllAccountPositionsRequest, AccountInformationApiGetAllUserHoldingsRequest, AccountInformationApiGetUserAccountBalanceRequest, AccountInformationApiGetUserAccountDetailsRequest, AccountInformationApiGetUserAccountOrderDetailRequest, AccountInformationApiGetUserAccountOrdersRequest, AccountInformationApiGetUserAccountPositionsRequest, AccountInformationApiGetUserAccountRecentOrdersRequest, AccountInformationApiGetUserAccountReturnRatesRequest, AccountInformationApiGetUserHoldingsRequest, AccountInformationApiListUserAccountsRequest, AccountInformationApiUpdateUserAccountRequest, AccountInformationGetUserAccountOrderDetailRequest, AccountOrderRecord, AccountOrderRecordChildBrokerageOrderIds, AccountOrderRecordLeg, AccountOrderRecordLegInstrument, AccountOrderRecordOptionSymbol, AccountOrderRecordQuoteCurrency, AccountOrderRecordQuoteUniversalSymbol, AccountOrderRecordStatus, AccountOrderRecordStatusV2, AccountOrderRecordTrailingStop, AccountOrderRecordUniversalSymbol, AccountOrderRecordV2, AccountOrdersV2Response, AccountPosition, AccountSimple, AccountSyncStatus, AccountUniversalActivity, AccountUniversalActivityCurrency, AccountUniversalActivityOptionSymbol, AccountUniversalActivitySymbol, AccountValueHistoryItem, AccountValueHistoryResponse, ActionStrict, ActionStrictWithOptions, AdrInstrument, AllAccountPositionsResponse, AllAccountPositionsResponseDataFreshness, ApiStatusApi, ApiStatusApiAxiosParamCreator, ApiStatusApiFactory, ApiStatusApiFp, ApiStatusApiGenerated, AuthenticationApi, AuthenticationApiAxiosParamCreator, AuthenticationApiDeleteSnapTradeUserRequest, AuthenticationApiFactory, AuthenticationApiFp, AuthenticationApiGenerated, AuthenticationApiLoginSnapTradeUserRequest, AuthenticationApiRegisterSnapTradeUserRequest, AuthenticationApiResetSnapTradeUserSecretRequest, AuthenticationLoginSnapTradeUser200Response, Balance, BalanceCurrency, Brokerage, BrokerageAuthorization, BrokerageAuthorizationDisabledConfirmation, BrokerageAuthorizationRefreshConfirmation, BrokerageAuthorizationTransactionsSyncConfirmation, BrokerageAuthorizationTypeReadOnly, BrokerageAuthorizationTypeReadOnlyBrokerage, BrokerageInstrument, BrokerageInstrumentsResponse, BrokerageType, CancelOrderResponse, CefInstrument, ChildBrokerageOrderIDs, ComplexOrderLeg, ComplexOrderResponse, Configuration, ConfigurationParameters, ConnectionsApi, ConnectionsApiAxiosParamCreator, ConnectionsApiDeleteConnectionRequest, ConnectionsApiDetailBrokerageAuthorizationRequest, ConnectionsApiDisableBrokerageAuthorizationRequest, ConnectionsApiFactory, ConnectionsApiFp, ConnectionsApiGenerated, ConnectionsApiListBrokerageAuthorizationAccountsRequest, ConnectionsApiListBrokerageAuthorizationsRequest, ConnectionsApiRefreshBrokerageAuthorizationRequest, ConnectionsApiRemoveBrokerageAuthorizationRequest, ConnectionsApiReturnRatesRequest, ConnectionsApiSessionEventsRequest, ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest, ConnectionsSessionEvents200ResponseInner, CryptoInstrument, CryptoOrderForm, CryptoOrderPreview, CryptoOrderPreviewEstimatedFee, CryptoTradingInstrument, CryptocurrencyPair, CryptocurrencyPairQuote, Currency, DeleteConnectionConfirmation, DeleteUserResponse, DividendAtDate, EncryptedResponse, EncryptedResponseEncryptedMessageData, EtfInstrument, Exchange, ExchangeRatePairs, ExperimentalEndpointsApi, ExperimentalEndpointsApiAddSubscriptionRequest, ExperimentalEndpointsApiAxiosParamCreator, ExperimentalEndpointsApiCancelSubscriptionRequest, ExperimentalEndpointsApiFactory, ExperimentalEndpointsApiFp, ExperimentalEndpointsApiGenerated, ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request, ExperimentalEndpointsApiGetUserAccountOrdersV2Request, ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request, FigiInstrument, FutureInstrument, HoldingsStatus, Instrument, LoginRedirectURI, ManualTrade, ManualTradeAndImpact, ManualTradeBalance, ManualTradeForm, ManualTradeFormBracket, ManualTradeFormComplex, ManualTradeFormNotionalValue, ManualTradeFormWithOptions, ManualTradeImpact, ManualTradeReplaceForm, ManualTradeSymbol, MlegActionStrict, MlegInstrumentType, MlegLeg, MlegOrderResponse, MlegOrderTypeStrict, MlegPriceEffectStrict, MlegTradeForm, MlegTradingInstrument, Model400FailedRequestResponse, Model401FailedRequestResponse, Model402BrokerageAuthAlreadyDisabledException, Model402BrokerageAuthDisabledResponse, Model403FailedRequestResponse, Model403FeatureNotEnabledResponse, Model404FailedRequestResponse, Model425FailedRequestResponse, Model500UnexpectedExceptionResponse, MonthlyDividends, MutualFundInstrument, NetContributions, NetDividend, NotionalValue, OptionBrokerageSymbol, OptionChainInner, OptionChainInnerChainPerRootInner, OptionChainInnerChainPerRootInnerChainPerStrikePriceInner, OptionImpact, OptionInstrument, OptionLeg, OptionQuote, OptionQuoteGreeks, OptionStrategy, OptionStrategyLegsInner, OptionsApi, OptionsApiAxiosParamCreator, OptionsApiFactory, OptionsApiFp, OptionsApiGenerated, OptionsApiListOptionHoldingsRequest, OptionsPosition, OptionsPositionCurrency, OptionsSymbol, OrderTypeStrict, OrderUpdatedResponse, OrderUpdatedResponseOrder, OtherInstrument, PaginatedUniversalActivity, PaginationDetails, PartnerData, PastValue, PerformanceCustom, Position, PositionCurrency, PositionSymbol, RateOfReturnObject, RateOfReturnResponse, RecentOrdersResponse, ReferenceDataApi, ReferenceDataApiAxiosParamCreator, ReferenceDataApiFactory, ReferenceDataApiFp, ReferenceDataApiGenerated, ReferenceDataApiGetCurrencyExchangeRatePairRequest, ReferenceDataApiGetSymbolsByTickerRequest, ReferenceDataApiGetSymbolsRequest, ReferenceDataApiListAllBrokerageAuthorizationTypeRequest, ReferenceDataApiListAllBrokerageInstrumentsRequest, ReferenceDataApiSymbolSearchUserAccountRequest, SecurityType, SessionEvent, SimpleOrderForm, SnapTradeHoldingsAccount, SnapTradeHoldingsTotalValue, SnapTradeLoginUserRequestBody, SnapTradeRegisterUserRequestBody, Snaptrade, SnaptradeError, Status, StockInstrument, StockInstrumentFigiInstrument, StopLoss, StrategyOrderRecord, StrategyQuotes, StrategyQuotesGreek, SubPeriodReturnRate, Symbol$1 as Symbol, SymbolCurrency, SymbolExchange, SymbolQuery, SymbolsQuotesInner, TakeProfit, TaxLot, TimeInForceStrict, TradeDetectionAddSubscriptionRequest, TradeDetectionCancelSubscriptionRequest, TradeDetectionCancelSubscriptionResponse, TradeDetectionSubscription, TradingApi, TradingApiAxiosParamCreator, TradingApiCancelOrderRequest, TradingApiCancelUserAccountOrderRequest, TradingApiFactory, TradingApiFp, TradingApiGenerated, TradingApiGetCryptocurrencyPairQuoteRequest, TradingApiGetOptionImpactRequest, TradingApiGetOrderImpactRequest, TradingApiGetUserAccountOptionQuotesRequest, TradingApiGetUserAccountQuotesRequest, TradingApiPlaceBracketOrderRequest, TradingApiPlaceComplexOrderRequest, TradingApiPlaceCryptoOrderRequest, TradingApiPlaceForceOrderRequest, TradingApiPlaceMlegOrderRequest, TradingApiPlaceOrderRequest, TradingApiPreviewCryptoOrderRequest, TradingApiReplaceOrderRequest, TradingApiSearchCryptocurrencyPairInstrumentsRequest, TradingInstrument, TradingSearchCryptocurrencyPairInstruments200Response, TradingSession, TrailingStop, TransactionsAndReportingApi, TransactionsAndReportingApiAxiosParamCreator, TransactionsAndReportingApiFactory, TransactionsAndReportingApiFp, TransactionsAndReportingApiGenerated, TransactionsAndReportingApiGetActivitiesRequest, TransactionsAndReportingApiGetReportingCustomRangeRequest, TransactionsStatus, USExchange, UnderlyingOptionInstrument, UnderlyingSymbol, UnderlyingSymbolExchange, UnderlyingSymbolType, UniversalActivity, UniversalSymbol, UserIDandSecret, ValidatedTradeBody, parseIfJson, readableStreamToString };
package/dist/index.d.mts CHANGED
@@ -3194,6 +3194,22 @@ type ActionStrict = 'BUY' | 'SELL';
3194
3194
  */
3195
3195
  type ActionStrictWithOptions = 'BUY' | 'SELL' | 'BUY_TO_OPEN' | 'BUY_TO_CLOSE' | 'SELL_TO_OPEN' | 'SELL_TO_CLOSE';
3196
3196
  //#endregion
3197
+ //#region models/all-account-positions-response-data-freshness.d.ts
3198
+ /**
3199
+ * Metadata describing freshness of the returned positions data.
3200
+ * @export
3201
+ * @interface AllAccountPositionsResponseDataFreshness
3202
+ */
3203
+ interface AllAccountPositionsResponseDataFreshness {
3204
+ [key: string]: any;
3205
+ /**
3206
+ * The time the returned positions data was fetched from the brokerage.
3207
+ * @type {string}
3208
+ * @memberof AllAccountPositionsResponseDataFreshness
3209
+ */
3210
+ 'as_of': string;
3211
+ }
3212
+ //#endregion
3197
3213
  //#region models/all-account-positions-response.d.ts
3198
3214
  /**
3199
3215
  * Information about all account positions.
@@ -3208,6 +3224,12 @@ interface AllAccountPositionsResponse {
3208
3224
  * @memberof AllAccountPositionsResponse
3209
3225
  */
3210
3226
  'results': Array<AccountPosition>;
3227
+ /**
3228
+ *
3229
+ * @type {AllAccountPositionsResponseDataFreshness}
3230
+ * @memberof AllAccountPositionsResponse
3231
+ */
3232
+ 'data_freshness': AllAccountPositionsResponseDataFreshness;
3211
3233
  }
3212
3234
  //#endregion
3213
3235
  //#region models/encrypted-response-encrypted-message-data.d.ts
@@ -6370,6 +6392,27 @@ interface TradeDetectionAddSubscriptionRequest {
6370
6392
  * @memberof TradeDetectionAddSubscriptionRequest
6371
6393
  */
6372
6394
  'account_id': string;
6395
+ /**
6396
+ * How often the subscribed account should be checked for new trades. Must match an active Trade Detection plan.
6397
+ * @type {number}
6398
+ * @memberof TradeDetectionAddSubscriptionRequest
6399
+ */
6400
+ 'check_interval_seconds': number;
6401
+ }
6402
+ //#endregion
6403
+ //#region models/trade-detection-cancel-subscription-request.d.ts
6404
+ /**
6405
+ *
6406
+ * @export
6407
+ * @interface TradeDetectionCancelSubscriptionRequest
6408
+ */
6409
+ interface TradeDetectionCancelSubscriptionRequest {
6410
+ /**
6411
+ * Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
6412
+ * @type {string}
6413
+ * @memberof TradeDetectionCancelSubscriptionRequest
6414
+ */
6415
+ 'account_id': string;
6373
6416
  }
6374
6417
  //#endregion
6375
6418
  //#region models/trade-detection-cancel-subscription-response.d.ts
@@ -8553,11 +8596,11 @@ declare const ExperimentalEndpointsApiAxiosParamCreator: (configuration?: Config
8553
8596
  /**
8554
8597
  * Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
8555
8598
  * @summary Cancel a Trade Detection subscription
8556
- * @param {TradeDetectionAddSubscriptionRequest} tradeDetectionAddSubscriptionRequest
8599
+ * @param {TradeDetectionCancelSubscriptionRequest} tradeDetectionCancelSubscriptionRequest
8557
8600
  * @param {*} [options] Override http request option.
8558
8601
  * @throws {RequiredError}
8559
8602
  */
8560
- cancelSubscription: (tradeDetectionAddSubscriptionRequest: TradeDetectionAddSubscriptionRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
8603
+ cancelSubscription: (tradeDetectionCancelSubscriptionRequest: TradeDetectionCancelSubscriptionRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
8561
8604
  /**
8562
8605
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
8563
8606
  * @summary Get account order detail (V2)
@@ -8730,7 +8773,7 @@ type ExperimentalEndpointsApiAddSubscriptionRequest = {
8730
8773
  * @export
8731
8774
  * @interface ExperimentalEndpointsApiCancelSubscriptionRequest
8732
8775
  */
8733
- type ExperimentalEndpointsApiCancelSubscriptionRequest = {} & TradeDetectionAddSubscriptionRequest;
8776
+ type ExperimentalEndpointsApiCancelSubscriptionRequest = {} & TradeDetectionCancelSubscriptionRequest;
8734
8777
  /**
8735
8778
  * Request parameters for getUserAccountOrderDetailV2 operation in ExperimentalEndpointsApi.
8736
8779
  * @export
@@ -10799,4 +10842,4 @@ declare class SnaptradeError extends Error {
10799
10842
  declare function readableStreamToString(stream: ReadableStream): Promise<string>;
10800
10843
  declare function parseIfJson(input: unknown): object | unknown;
10801
10844
  //#endregion
10802
- export { Account, AccountBalance, AccountBalanceTotal, AccountHoldings, AccountHoldingsAccount, AccountInformationApi, AccountInformationApiAxiosParamCreator, AccountInformationApiFactory, AccountInformationApiFp, AccountInformationApiGenerated, AccountInformationApiGetAccountActivitiesRequest, AccountInformationApiGetAccountBalanceHistoryRequest, AccountInformationApiGetAllAccountPositionsRequest, AccountInformationApiGetAllUserHoldingsRequest, AccountInformationApiGetUserAccountBalanceRequest, AccountInformationApiGetUserAccountDetailsRequest, AccountInformationApiGetUserAccountOrderDetailRequest, AccountInformationApiGetUserAccountOrdersRequest, AccountInformationApiGetUserAccountPositionsRequest, AccountInformationApiGetUserAccountRecentOrdersRequest, AccountInformationApiGetUserAccountReturnRatesRequest, AccountInformationApiGetUserHoldingsRequest, AccountInformationApiListUserAccountsRequest, AccountInformationApiUpdateUserAccountRequest, AccountInformationGetUserAccountOrderDetailRequest, AccountOrderRecord, AccountOrderRecordChildBrokerageOrderIds, AccountOrderRecordLeg, AccountOrderRecordLegInstrument, AccountOrderRecordOptionSymbol, AccountOrderRecordQuoteCurrency, AccountOrderRecordQuoteUniversalSymbol, AccountOrderRecordStatus, AccountOrderRecordStatusV2, AccountOrderRecordTrailingStop, AccountOrderRecordUniversalSymbol, AccountOrderRecordV2, AccountOrdersV2Response, AccountPosition, AccountSimple, AccountSyncStatus, AccountUniversalActivity, AccountUniversalActivityCurrency, AccountUniversalActivityOptionSymbol, AccountUniversalActivitySymbol, AccountValueHistoryItem, AccountValueHistoryResponse, ActionStrict, ActionStrictWithOptions, AdrInstrument, AllAccountPositionsResponse, ApiStatusApi, ApiStatusApiAxiosParamCreator, ApiStatusApiFactory, ApiStatusApiFp, ApiStatusApiGenerated, AuthenticationApi, AuthenticationApiAxiosParamCreator, AuthenticationApiDeleteSnapTradeUserRequest, AuthenticationApiFactory, AuthenticationApiFp, AuthenticationApiGenerated, AuthenticationApiLoginSnapTradeUserRequest, AuthenticationApiRegisterSnapTradeUserRequest, AuthenticationApiResetSnapTradeUserSecretRequest, AuthenticationLoginSnapTradeUser200Response, Balance, BalanceCurrency, Brokerage, BrokerageAuthorization, BrokerageAuthorizationDisabledConfirmation, BrokerageAuthorizationRefreshConfirmation, BrokerageAuthorizationTransactionsSyncConfirmation, BrokerageAuthorizationTypeReadOnly, BrokerageAuthorizationTypeReadOnlyBrokerage, BrokerageInstrument, BrokerageInstrumentsResponse, BrokerageType, CancelOrderResponse, CefInstrument, ChildBrokerageOrderIDs, ComplexOrderLeg, ComplexOrderResponse, Configuration, ConfigurationParameters, ConnectionsApi, ConnectionsApiAxiosParamCreator, ConnectionsApiDeleteConnectionRequest, ConnectionsApiDetailBrokerageAuthorizationRequest, ConnectionsApiDisableBrokerageAuthorizationRequest, ConnectionsApiFactory, ConnectionsApiFp, ConnectionsApiGenerated, ConnectionsApiListBrokerageAuthorizationAccountsRequest, ConnectionsApiListBrokerageAuthorizationsRequest, ConnectionsApiRefreshBrokerageAuthorizationRequest, ConnectionsApiRemoveBrokerageAuthorizationRequest, ConnectionsApiReturnRatesRequest, ConnectionsApiSessionEventsRequest, ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest, ConnectionsSessionEvents200ResponseInner, CryptoInstrument, CryptoOrderForm, CryptoOrderPreview, CryptoOrderPreviewEstimatedFee, CryptoTradingInstrument, CryptocurrencyPair, CryptocurrencyPairQuote, Currency, DeleteConnectionConfirmation, DeleteUserResponse, DividendAtDate, EncryptedResponse, EncryptedResponseEncryptedMessageData, EtfInstrument, Exchange, ExchangeRatePairs, ExperimentalEndpointsApi, ExperimentalEndpointsApiAddSubscriptionRequest, ExperimentalEndpointsApiAxiosParamCreator, ExperimentalEndpointsApiCancelSubscriptionRequest, ExperimentalEndpointsApiFactory, ExperimentalEndpointsApiFp, ExperimentalEndpointsApiGenerated, ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request, ExperimentalEndpointsApiGetUserAccountOrdersV2Request, ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request, FigiInstrument, FutureInstrument, HoldingsStatus, Instrument, LoginRedirectURI, ManualTrade, ManualTradeAndImpact, ManualTradeBalance, ManualTradeForm, ManualTradeFormBracket, ManualTradeFormComplex, ManualTradeFormNotionalValue, ManualTradeFormWithOptions, ManualTradeImpact, ManualTradeReplaceForm, ManualTradeSymbol, MlegActionStrict, MlegInstrumentType, MlegLeg, MlegOrderResponse, MlegOrderTypeStrict, MlegPriceEffectStrict, MlegTradeForm, MlegTradingInstrument, Model400FailedRequestResponse, Model401FailedRequestResponse, Model402BrokerageAuthAlreadyDisabledException, Model402BrokerageAuthDisabledResponse, Model403FailedRequestResponse, Model403FeatureNotEnabledResponse, Model404FailedRequestResponse, Model425FailedRequestResponse, Model500UnexpectedExceptionResponse, MonthlyDividends, MutualFundInstrument, NetContributions, NetDividend, NotionalValue, OptionBrokerageSymbol, OptionChainInner, OptionChainInnerChainPerRootInner, OptionChainInnerChainPerRootInnerChainPerStrikePriceInner, OptionImpact, OptionInstrument, OptionLeg, OptionQuote, OptionQuoteGreeks, OptionStrategy, OptionStrategyLegsInner, OptionsApi, OptionsApiAxiosParamCreator, OptionsApiFactory, OptionsApiFp, OptionsApiGenerated, OptionsApiListOptionHoldingsRequest, OptionsPosition, OptionsPositionCurrency, OptionsSymbol, OrderTypeStrict, OrderUpdatedResponse, OrderUpdatedResponseOrder, OtherInstrument, PaginatedUniversalActivity, PaginationDetails, PartnerData, PastValue, PerformanceCustom, Position, PositionCurrency, PositionSymbol, RateOfReturnObject, RateOfReturnResponse, RecentOrdersResponse, ReferenceDataApi, ReferenceDataApiAxiosParamCreator, ReferenceDataApiFactory, ReferenceDataApiFp, ReferenceDataApiGenerated, ReferenceDataApiGetCurrencyExchangeRatePairRequest, ReferenceDataApiGetSymbolsByTickerRequest, ReferenceDataApiGetSymbolsRequest, ReferenceDataApiListAllBrokerageAuthorizationTypeRequest, ReferenceDataApiListAllBrokerageInstrumentsRequest, ReferenceDataApiSymbolSearchUserAccountRequest, SecurityType, SessionEvent, SimpleOrderForm, SnapTradeHoldingsAccount, SnapTradeHoldingsTotalValue, SnapTradeLoginUserRequestBody, SnapTradeRegisterUserRequestBody, Snaptrade, SnaptradeError, Status, StockInstrument, StockInstrumentFigiInstrument, StopLoss, StrategyOrderRecord, StrategyQuotes, StrategyQuotesGreek, SubPeriodReturnRate, Symbol$1 as Symbol, SymbolCurrency, SymbolExchange, SymbolQuery, SymbolsQuotesInner, TakeProfit, TaxLot, TimeInForceStrict, TradeDetectionAddSubscriptionRequest, TradeDetectionCancelSubscriptionResponse, TradeDetectionSubscription, TradingApi, TradingApiAxiosParamCreator, TradingApiCancelOrderRequest, TradingApiCancelUserAccountOrderRequest, TradingApiFactory, TradingApiFp, TradingApiGenerated, TradingApiGetCryptocurrencyPairQuoteRequest, TradingApiGetOptionImpactRequest, TradingApiGetOrderImpactRequest, TradingApiGetUserAccountOptionQuotesRequest, TradingApiGetUserAccountQuotesRequest, TradingApiPlaceBracketOrderRequest, TradingApiPlaceComplexOrderRequest, TradingApiPlaceCryptoOrderRequest, TradingApiPlaceForceOrderRequest, TradingApiPlaceMlegOrderRequest, TradingApiPlaceOrderRequest, TradingApiPreviewCryptoOrderRequest, TradingApiReplaceOrderRequest, TradingApiSearchCryptocurrencyPairInstrumentsRequest, TradingInstrument, TradingSearchCryptocurrencyPairInstruments200Response, TradingSession, TrailingStop, TransactionsAndReportingApi, TransactionsAndReportingApiAxiosParamCreator, TransactionsAndReportingApiFactory, TransactionsAndReportingApiFp, TransactionsAndReportingApiGenerated, TransactionsAndReportingApiGetActivitiesRequest, TransactionsAndReportingApiGetReportingCustomRangeRequest, TransactionsStatus, USExchange, UnderlyingOptionInstrument, UnderlyingSymbol, UnderlyingSymbolExchange, UnderlyingSymbolType, UniversalActivity, UniversalSymbol, UserIDandSecret, ValidatedTradeBody, parseIfJson, readableStreamToString };
10845
+ export { Account, AccountBalance, AccountBalanceTotal, AccountHoldings, AccountHoldingsAccount, AccountInformationApi, AccountInformationApiAxiosParamCreator, AccountInformationApiFactory, AccountInformationApiFp, AccountInformationApiGenerated, AccountInformationApiGetAccountActivitiesRequest, AccountInformationApiGetAccountBalanceHistoryRequest, AccountInformationApiGetAllAccountPositionsRequest, AccountInformationApiGetAllUserHoldingsRequest, AccountInformationApiGetUserAccountBalanceRequest, AccountInformationApiGetUserAccountDetailsRequest, AccountInformationApiGetUserAccountOrderDetailRequest, AccountInformationApiGetUserAccountOrdersRequest, AccountInformationApiGetUserAccountPositionsRequest, AccountInformationApiGetUserAccountRecentOrdersRequest, AccountInformationApiGetUserAccountReturnRatesRequest, AccountInformationApiGetUserHoldingsRequest, AccountInformationApiListUserAccountsRequest, AccountInformationApiUpdateUserAccountRequest, AccountInformationGetUserAccountOrderDetailRequest, AccountOrderRecord, AccountOrderRecordChildBrokerageOrderIds, AccountOrderRecordLeg, AccountOrderRecordLegInstrument, AccountOrderRecordOptionSymbol, AccountOrderRecordQuoteCurrency, AccountOrderRecordQuoteUniversalSymbol, AccountOrderRecordStatus, AccountOrderRecordStatusV2, AccountOrderRecordTrailingStop, AccountOrderRecordUniversalSymbol, AccountOrderRecordV2, AccountOrdersV2Response, AccountPosition, AccountSimple, AccountSyncStatus, AccountUniversalActivity, AccountUniversalActivityCurrency, AccountUniversalActivityOptionSymbol, AccountUniversalActivitySymbol, AccountValueHistoryItem, AccountValueHistoryResponse, ActionStrict, ActionStrictWithOptions, AdrInstrument, AllAccountPositionsResponse, AllAccountPositionsResponseDataFreshness, ApiStatusApi, ApiStatusApiAxiosParamCreator, ApiStatusApiFactory, ApiStatusApiFp, ApiStatusApiGenerated, AuthenticationApi, AuthenticationApiAxiosParamCreator, AuthenticationApiDeleteSnapTradeUserRequest, AuthenticationApiFactory, AuthenticationApiFp, AuthenticationApiGenerated, AuthenticationApiLoginSnapTradeUserRequest, AuthenticationApiRegisterSnapTradeUserRequest, AuthenticationApiResetSnapTradeUserSecretRequest, AuthenticationLoginSnapTradeUser200Response, Balance, BalanceCurrency, Brokerage, BrokerageAuthorization, BrokerageAuthorizationDisabledConfirmation, BrokerageAuthorizationRefreshConfirmation, BrokerageAuthorizationTransactionsSyncConfirmation, BrokerageAuthorizationTypeReadOnly, BrokerageAuthorizationTypeReadOnlyBrokerage, BrokerageInstrument, BrokerageInstrumentsResponse, BrokerageType, CancelOrderResponse, CefInstrument, ChildBrokerageOrderIDs, ComplexOrderLeg, ComplexOrderResponse, Configuration, ConfigurationParameters, ConnectionsApi, ConnectionsApiAxiosParamCreator, ConnectionsApiDeleteConnectionRequest, ConnectionsApiDetailBrokerageAuthorizationRequest, ConnectionsApiDisableBrokerageAuthorizationRequest, ConnectionsApiFactory, ConnectionsApiFp, ConnectionsApiGenerated, ConnectionsApiListBrokerageAuthorizationAccountsRequest, ConnectionsApiListBrokerageAuthorizationsRequest, ConnectionsApiRefreshBrokerageAuthorizationRequest, ConnectionsApiRemoveBrokerageAuthorizationRequest, ConnectionsApiReturnRatesRequest, ConnectionsApiSessionEventsRequest, ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest, ConnectionsSessionEvents200ResponseInner, CryptoInstrument, CryptoOrderForm, CryptoOrderPreview, CryptoOrderPreviewEstimatedFee, CryptoTradingInstrument, CryptocurrencyPair, CryptocurrencyPairQuote, Currency, DeleteConnectionConfirmation, DeleteUserResponse, DividendAtDate, EncryptedResponse, EncryptedResponseEncryptedMessageData, EtfInstrument, Exchange, ExchangeRatePairs, ExperimentalEndpointsApi, ExperimentalEndpointsApiAddSubscriptionRequest, ExperimentalEndpointsApiAxiosParamCreator, ExperimentalEndpointsApiCancelSubscriptionRequest, ExperimentalEndpointsApiFactory, ExperimentalEndpointsApiFp, ExperimentalEndpointsApiGenerated, ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request, ExperimentalEndpointsApiGetUserAccountOrdersV2Request, ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request, FigiInstrument, FutureInstrument, HoldingsStatus, Instrument, LoginRedirectURI, ManualTrade, ManualTradeAndImpact, ManualTradeBalance, ManualTradeForm, ManualTradeFormBracket, ManualTradeFormComplex, ManualTradeFormNotionalValue, ManualTradeFormWithOptions, ManualTradeImpact, ManualTradeReplaceForm, ManualTradeSymbol, MlegActionStrict, MlegInstrumentType, MlegLeg, MlegOrderResponse, MlegOrderTypeStrict, MlegPriceEffectStrict, MlegTradeForm, MlegTradingInstrument, Model400FailedRequestResponse, Model401FailedRequestResponse, Model402BrokerageAuthAlreadyDisabledException, Model402BrokerageAuthDisabledResponse, Model403FailedRequestResponse, Model403FeatureNotEnabledResponse, Model404FailedRequestResponse, Model425FailedRequestResponse, Model500UnexpectedExceptionResponse, MonthlyDividends, MutualFundInstrument, NetContributions, NetDividend, NotionalValue, OptionBrokerageSymbol, OptionChainInner, OptionChainInnerChainPerRootInner, OptionChainInnerChainPerRootInnerChainPerStrikePriceInner, OptionImpact, OptionInstrument, OptionLeg, OptionQuote, OptionQuoteGreeks, OptionStrategy, OptionStrategyLegsInner, OptionsApi, OptionsApiAxiosParamCreator, OptionsApiFactory, OptionsApiFp, OptionsApiGenerated, OptionsApiListOptionHoldingsRequest, OptionsPosition, OptionsPositionCurrency, OptionsSymbol, OrderTypeStrict, OrderUpdatedResponse, OrderUpdatedResponseOrder, OtherInstrument, PaginatedUniversalActivity, PaginationDetails, PartnerData, PastValue, PerformanceCustom, Position, PositionCurrency, PositionSymbol, RateOfReturnObject, RateOfReturnResponse, RecentOrdersResponse, ReferenceDataApi, ReferenceDataApiAxiosParamCreator, ReferenceDataApiFactory, ReferenceDataApiFp, ReferenceDataApiGenerated, ReferenceDataApiGetCurrencyExchangeRatePairRequest, ReferenceDataApiGetSymbolsByTickerRequest, ReferenceDataApiGetSymbolsRequest, ReferenceDataApiListAllBrokerageAuthorizationTypeRequest, ReferenceDataApiListAllBrokerageInstrumentsRequest, ReferenceDataApiSymbolSearchUserAccountRequest, SecurityType, SessionEvent, SimpleOrderForm, SnapTradeHoldingsAccount, SnapTradeHoldingsTotalValue, SnapTradeLoginUserRequestBody, SnapTradeRegisterUserRequestBody, Snaptrade, SnaptradeError, Status, StockInstrument, StockInstrumentFigiInstrument, StopLoss, StrategyOrderRecord, StrategyQuotes, StrategyQuotesGreek, SubPeriodReturnRate, Symbol$1 as Symbol, SymbolCurrency, SymbolExchange, SymbolQuery, SymbolsQuotesInner, TakeProfit, TaxLot, TimeInForceStrict, TradeDetectionAddSubscriptionRequest, TradeDetectionCancelSubscriptionRequest, TradeDetectionCancelSubscriptionResponse, TradeDetectionSubscription, TradingApi, TradingApiAxiosParamCreator, TradingApiCancelOrderRequest, TradingApiCancelUserAccountOrderRequest, TradingApiFactory, TradingApiFp, TradingApiGenerated, TradingApiGetCryptocurrencyPairQuoteRequest, TradingApiGetOptionImpactRequest, TradingApiGetOrderImpactRequest, TradingApiGetUserAccountOptionQuotesRequest, TradingApiGetUserAccountQuotesRequest, TradingApiPlaceBracketOrderRequest, TradingApiPlaceComplexOrderRequest, TradingApiPlaceCryptoOrderRequest, TradingApiPlaceForceOrderRequest, TradingApiPlaceMlegOrderRequest, TradingApiPlaceOrderRequest, TradingApiPreviewCryptoOrderRequest, TradingApiReplaceOrderRequest, TradingApiSearchCryptocurrencyPairInstrumentsRequest, TradingInstrument, TradingSearchCryptocurrencyPairInstruments200Response, TradingSession, TrailingStop, TransactionsAndReportingApi, TransactionsAndReportingApiAxiosParamCreator, TransactionsAndReportingApiFactory, TransactionsAndReportingApiFp, TransactionsAndReportingApiGenerated, TransactionsAndReportingApiGetActivitiesRequest, TransactionsAndReportingApiGetReportingCustomRangeRequest, TransactionsStatus, USExchange, UnderlyingOptionInstrument, UnderlyingSymbol, UnderlyingSymbolExchange, UnderlyingSymbolType, UniversalActivity, UniversalSymbol, UserIDandSecret, ValidatedTradeBody, parseIfJson, readableStreamToString };
package/dist/index.d.ts CHANGED
@@ -3194,6 +3194,22 @@ type ActionStrict = 'BUY' | 'SELL';
3194
3194
  */
3195
3195
  type ActionStrictWithOptions = 'BUY' | 'SELL' | 'BUY_TO_OPEN' | 'BUY_TO_CLOSE' | 'SELL_TO_OPEN' | 'SELL_TO_CLOSE';
3196
3196
  //#endregion
3197
+ //#region models/all-account-positions-response-data-freshness.d.ts
3198
+ /**
3199
+ * Metadata describing freshness of the returned positions data.
3200
+ * @export
3201
+ * @interface AllAccountPositionsResponseDataFreshness
3202
+ */
3203
+ interface AllAccountPositionsResponseDataFreshness {
3204
+ [key: string]: any;
3205
+ /**
3206
+ * The time the returned positions data was fetched from the brokerage.
3207
+ * @type {string}
3208
+ * @memberof AllAccountPositionsResponseDataFreshness
3209
+ */
3210
+ 'as_of': string;
3211
+ }
3212
+ //#endregion
3197
3213
  //#region models/all-account-positions-response.d.ts
3198
3214
  /**
3199
3215
  * Information about all account positions.
@@ -3208,6 +3224,12 @@ interface AllAccountPositionsResponse {
3208
3224
  * @memberof AllAccountPositionsResponse
3209
3225
  */
3210
3226
  'results': Array<AccountPosition>;
3227
+ /**
3228
+ *
3229
+ * @type {AllAccountPositionsResponseDataFreshness}
3230
+ * @memberof AllAccountPositionsResponse
3231
+ */
3232
+ 'data_freshness': AllAccountPositionsResponseDataFreshness;
3211
3233
  }
3212
3234
  //#endregion
3213
3235
  //#region models/encrypted-response-encrypted-message-data.d.ts
@@ -6370,6 +6392,27 @@ interface TradeDetectionAddSubscriptionRequest {
6370
6392
  * @memberof TradeDetectionAddSubscriptionRequest
6371
6393
  */
6372
6394
  'account_id': string;
6395
+ /**
6396
+ * How often the subscribed account should be checked for new trades. Must match an active Trade Detection plan.
6397
+ * @type {number}
6398
+ * @memberof TradeDetectionAddSubscriptionRequest
6399
+ */
6400
+ 'check_interval_seconds': number;
6401
+ }
6402
+ //#endregion
6403
+ //#region models/trade-detection-cancel-subscription-request.d.ts
6404
+ /**
6405
+ *
6406
+ * @export
6407
+ * @interface TradeDetectionCancelSubscriptionRequest
6408
+ */
6409
+ interface TradeDetectionCancelSubscriptionRequest {
6410
+ /**
6411
+ * Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
6412
+ * @type {string}
6413
+ * @memberof TradeDetectionCancelSubscriptionRequest
6414
+ */
6415
+ 'account_id': string;
6373
6416
  }
6374
6417
  //#endregion
6375
6418
  //#region models/trade-detection-cancel-subscription-response.d.ts
@@ -8553,11 +8596,11 @@ declare const ExperimentalEndpointsApiAxiosParamCreator: (configuration?: Config
8553
8596
  /**
8554
8597
  * Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
8555
8598
  * @summary Cancel a Trade Detection subscription
8556
- * @param {TradeDetectionAddSubscriptionRequest} tradeDetectionAddSubscriptionRequest
8599
+ * @param {TradeDetectionCancelSubscriptionRequest} tradeDetectionCancelSubscriptionRequest
8557
8600
  * @param {*} [options] Override http request option.
8558
8601
  * @throws {RequiredError}
8559
8602
  */
8560
- cancelSubscription: (tradeDetectionAddSubscriptionRequest: TradeDetectionAddSubscriptionRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
8603
+ cancelSubscription: (tradeDetectionCancelSubscriptionRequest: TradeDetectionCancelSubscriptionRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
8561
8604
  /**
8562
8605
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
8563
8606
  * @summary Get account order detail (V2)
@@ -8730,7 +8773,7 @@ type ExperimentalEndpointsApiAddSubscriptionRequest = {
8730
8773
  * @export
8731
8774
  * @interface ExperimentalEndpointsApiCancelSubscriptionRequest
8732
8775
  */
8733
- type ExperimentalEndpointsApiCancelSubscriptionRequest = {} & TradeDetectionAddSubscriptionRequest;
8776
+ type ExperimentalEndpointsApiCancelSubscriptionRequest = {} & TradeDetectionCancelSubscriptionRequest;
8734
8777
  /**
8735
8778
  * Request parameters for getUserAccountOrderDetailV2 operation in ExperimentalEndpointsApi.
8736
8779
  * @export
@@ -10799,4 +10842,4 @@ declare class SnaptradeError extends Error {
10799
10842
  declare function readableStreamToString(stream: ReadableStream): Promise<string>;
10800
10843
  declare function parseIfJson(input: unknown): object | unknown;
10801
10844
  //#endregion
10802
- export { Account, AccountBalance, AccountBalanceTotal, AccountHoldings, AccountHoldingsAccount, AccountInformationApi, AccountInformationApiAxiosParamCreator, AccountInformationApiFactory, AccountInformationApiFp, AccountInformationApiGenerated, AccountInformationApiGetAccountActivitiesRequest, AccountInformationApiGetAccountBalanceHistoryRequest, AccountInformationApiGetAllAccountPositionsRequest, AccountInformationApiGetAllUserHoldingsRequest, AccountInformationApiGetUserAccountBalanceRequest, AccountInformationApiGetUserAccountDetailsRequest, AccountInformationApiGetUserAccountOrderDetailRequest, AccountInformationApiGetUserAccountOrdersRequest, AccountInformationApiGetUserAccountPositionsRequest, AccountInformationApiGetUserAccountRecentOrdersRequest, AccountInformationApiGetUserAccountReturnRatesRequest, AccountInformationApiGetUserHoldingsRequest, AccountInformationApiListUserAccountsRequest, AccountInformationApiUpdateUserAccountRequest, AccountInformationGetUserAccountOrderDetailRequest, AccountOrderRecord, AccountOrderRecordChildBrokerageOrderIds, AccountOrderRecordLeg, AccountOrderRecordLegInstrument, AccountOrderRecordOptionSymbol, AccountOrderRecordQuoteCurrency, AccountOrderRecordQuoteUniversalSymbol, AccountOrderRecordStatus, AccountOrderRecordStatusV2, AccountOrderRecordTrailingStop, AccountOrderRecordUniversalSymbol, AccountOrderRecordV2, AccountOrdersV2Response, AccountPosition, AccountSimple, AccountSyncStatus, AccountUniversalActivity, AccountUniversalActivityCurrency, AccountUniversalActivityOptionSymbol, AccountUniversalActivitySymbol, AccountValueHistoryItem, AccountValueHistoryResponse, ActionStrict, ActionStrictWithOptions, AdrInstrument, AllAccountPositionsResponse, ApiStatusApi, ApiStatusApiAxiosParamCreator, ApiStatusApiFactory, ApiStatusApiFp, ApiStatusApiGenerated, AuthenticationApi, AuthenticationApiAxiosParamCreator, AuthenticationApiDeleteSnapTradeUserRequest, AuthenticationApiFactory, AuthenticationApiFp, AuthenticationApiGenerated, AuthenticationApiLoginSnapTradeUserRequest, AuthenticationApiRegisterSnapTradeUserRequest, AuthenticationApiResetSnapTradeUserSecretRequest, AuthenticationLoginSnapTradeUser200Response, Balance, BalanceCurrency, Brokerage, BrokerageAuthorization, BrokerageAuthorizationDisabledConfirmation, BrokerageAuthorizationRefreshConfirmation, BrokerageAuthorizationTransactionsSyncConfirmation, BrokerageAuthorizationTypeReadOnly, BrokerageAuthorizationTypeReadOnlyBrokerage, BrokerageInstrument, BrokerageInstrumentsResponse, BrokerageType, CancelOrderResponse, CefInstrument, ChildBrokerageOrderIDs, ComplexOrderLeg, ComplexOrderResponse, Configuration, ConfigurationParameters, ConnectionsApi, ConnectionsApiAxiosParamCreator, ConnectionsApiDeleteConnectionRequest, ConnectionsApiDetailBrokerageAuthorizationRequest, ConnectionsApiDisableBrokerageAuthorizationRequest, ConnectionsApiFactory, ConnectionsApiFp, ConnectionsApiGenerated, ConnectionsApiListBrokerageAuthorizationAccountsRequest, ConnectionsApiListBrokerageAuthorizationsRequest, ConnectionsApiRefreshBrokerageAuthorizationRequest, ConnectionsApiRemoveBrokerageAuthorizationRequest, ConnectionsApiReturnRatesRequest, ConnectionsApiSessionEventsRequest, ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest, ConnectionsSessionEvents200ResponseInner, CryptoInstrument, CryptoOrderForm, CryptoOrderPreview, CryptoOrderPreviewEstimatedFee, CryptoTradingInstrument, CryptocurrencyPair, CryptocurrencyPairQuote, Currency, DeleteConnectionConfirmation, DeleteUserResponse, DividendAtDate, EncryptedResponse, EncryptedResponseEncryptedMessageData, EtfInstrument, Exchange, ExchangeRatePairs, ExperimentalEndpointsApi, ExperimentalEndpointsApiAddSubscriptionRequest, ExperimentalEndpointsApiAxiosParamCreator, ExperimentalEndpointsApiCancelSubscriptionRequest, ExperimentalEndpointsApiFactory, ExperimentalEndpointsApiFp, ExperimentalEndpointsApiGenerated, ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request, ExperimentalEndpointsApiGetUserAccountOrdersV2Request, ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request, FigiInstrument, FutureInstrument, HoldingsStatus, Instrument, LoginRedirectURI, ManualTrade, ManualTradeAndImpact, ManualTradeBalance, ManualTradeForm, ManualTradeFormBracket, ManualTradeFormComplex, ManualTradeFormNotionalValue, ManualTradeFormWithOptions, ManualTradeImpact, ManualTradeReplaceForm, ManualTradeSymbol, MlegActionStrict, MlegInstrumentType, MlegLeg, MlegOrderResponse, MlegOrderTypeStrict, MlegPriceEffectStrict, MlegTradeForm, MlegTradingInstrument, Model400FailedRequestResponse, Model401FailedRequestResponse, Model402BrokerageAuthAlreadyDisabledException, Model402BrokerageAuthDisabledResponse, Model403FailedRequestResponse, Model403FeatureNotEnabledResponse, Model404FailedRequestResponse, Model425FailedRequestResponse, Model500UnexpectedExceptionResponse, MonthlyDividends, MutualFundInstrument, NetContributions, NetDividend, NotionalValue, OptionBrokerageSymbol, OptionChainInner, OptionChainInnerChainPerRootInner, OptionChainInnerChainPerRootInnerChainPerStrikePriceInner, OptionImpact, OptionInstrument, OptionLeg, OptionQuote, OptionQuoteGreeks, OptionStrategy, OptionStrategyLegsInner, OptionsApi, OptionsApiAxiosParamCreator, OptionsApiFactory, OptionsApiFp, OptionsApiGenerated, OptionsApiListOptionHoldingsRequest, OptionsPosition, OptionsPositionCurrency, OptionsSymbol, OrderTypeStrict, OrderUpdatedResponse, OrderUpdatedResponseOrder, OtherInstrument, PaginatedUniversalActivity, PaginationDetails, PartnerData, PastValue, PerformanceCustom, Position, PositionCurrency, PositionSymbol, RateOfReturnObject, RateOfReturnResponse, RecentOrdersResponse, ReferenceDataApi, ReferenceDataApiAxiosParamCreator, ReferenceDataApiFactory, ReferenceDataApiFp, ReferenceDataApiGenerated, ReferenceDataApiGetCurrencyExchangeRatePairRequest, ReferenceDataApiGetSymbolsByTickerRequest, ReferenceDataApiGetSymbolsRequest, ReferenceDataApiListAllBrokerageAuthorizationTypeRequest, ReferenceDataApiListAllBrokerageInstrumentsRequest, ReferenceDataApiSymbolSearchUserAccountRequest, SecurityType, SessionEvent, SimpleOrderForm, SnapTradeHoldingsAccount, SnapTradeHoldingsTotalValue, SnapTradeLoginUserRequestBody, SnapTradeRegisterUserRequestBody, Snaptrade, SnaptradeError, Status, StockInstrument, StockInstrumentFigiInstrument, StopLoss, StrategyOrderRecord, StrategyQuotes, StrategyQuotesGreek, SubPeriodReturnRate, Symbol$1 as Symbol, SymbolCurrency, SymbolExchange, SymbolQuery, SymbolsQuotesInner, TakeProfit, TaxLot, TimeInForceStrict, TradeDetectionAddSubscriptionRequest, TradeDetectionCancelSubscriptionResponse, TradeDetectionSubscription, TradingApi, TradingApiAxiosParamCreator, TradingApiCancelOrderRequest, TradingApiCancelUserAccountOrderRequest, TradingApiFactory, TradingApiFp, TradingApiGenerated, TradingApiGetCryptocurrencyPairQuoteRequest, TradingApiGetOptionImpactRequest, TradingApiGetOrderImpactRequest, TradingApiGetUserAccountOptionQuotesRequest, TradingApiGetUserAccountQuotesRequest, TradingApiPlaceBracketOrderRequest, TradingApiPlaceComplexOrderRequest, TradingApiPlaceCryptoOrderRequest, TradingApiPlaceForceOrderRequest, TradingApiPlaceMlegOrderRequest, TradingApiPlaceOrderRequest, TradingApiPreviewCryptoOrderRequest, TradingApiReplaceOrderRequest, TradingApiSearchCryptocurrencyPairInstrumentsRequest, TradingInstrument, TradingSearchCryptocurrencyPairInstruments200Response, TradingSession, TrailingStop, TransactionsAndReportingApi, TransactionsAndReportingApiAxiosParamCreator, TransactionsAndReportingApiFactory, TransactionsAndReportingApiFp, TransactionsAndReportingApiGenerated, TransactionsAndReportingApiGetActivitiesRequest, TransactionsAndReportingApiGetReportingCustomRangeRequest, TransactionsStatus, USExchange, UnderlyingOptionInstrument, UnderlyingSymbol, UnderlyingSymbolExchange, UnderlyingSymbolType, UniversalActivity, UniversalSymbol, UserIDandSecret, ValidatedTradeBody, parseIfJson, readableStreamToString };
10845
+ export { Account, AccountBalance, AccountBalanceTotal, AccountHoldings, AccountHoldingsAccount, AccountInformationApi, AccountInformationApiAxiosParamCreator, AccountInformationApiFactory, AccountInformationApiFp, AccountInformationApiGenerated, AccountInformationApiGetAccountActivitiesRequest, AccountInformationApiGetAccountBalanceHistoryRequest, AccountInformationApiGetAllAccountPositionsRequest, AccountInformationApiGetAllUserHoldingsRequest, AccountInformationApiGetUserAccountBalanceRequest, AccountInformationApiGetUserAccountDetailsRequest, AccountInformationApiGetUserAccountOrderDetailRequest, AccountInformationApiGetUserAccountOrdersRequest, AccountInformationApiGetUserAccountPositionsRequest, AccountInformationApiGetUserAccountRecentOrdersRequest, AccountInformationApiGetUserAccountReturnRatesRequest, AccountInformationApiGetUserHoldingsRequest, AccountInformationApiListUserAccountsRequest, AccountInformationApiUpdateUserAccountRequest, AccountInformationGetUserAccountOrderDetailRequest, AccountOrderRecord, AccountOrderRecordChildBrokerageOrderIds, AccountOrderRecordLeg, AccountOrderRecordLegInstrument, AccountOrderRecordOptionSymbol, AccountOrderRecordQuoteCurrency, AccountOrderRecordQuoteUniversalSymbol, AccountOrderRecordStatus, AccountOrderRecordStatusV2, AccountOrderRecordTrailingStop, AccountOrderRecordUniversalSymbol, AccountOrderRecordV2, AccountOrdersV2Response, AccountPosition, AccountSimple, AccountSyncStatus, AccountUniversalActivity, AccountUniversalActivityCurrency, AccountUniversalActivityOptionSymbol, AccountUniversalActivitySymbol, AccountValueHistoryItem, AccountValueHistoryResponse, ActionStrict, ActionStrictWithOptions, AdrInstrument, AllAccountPositionsResponse, AllAccountPositionsResponseDataFreshness, ApiStatusApi, ApiStatusApiAxiosParamCreator, ApiStatusApiFactory, ApiStatusApiFp, ApiStatusApiGenerated, AuthenticationApi, AuthenticationApiAxiosParamCreator, AuthenticationApiDeleteSnapTradeUserRequest, AuthenticationApiFactory, AuthenticationApiFp, AuthenticationApiGenerated, AuthenticationApiLoginSnapTradeUserRequest, AuthenticationApiRegisterSnapTradeUserRequest, AuthenticationApiResetSnapTradeUserSecretRequest, AuthenticationLoginSnapTradeUser200Response, Balance, BalanceCurrency, Brokerage, BrokerageAuthorization, BrokerageAuthorizationDisabledConfirmation, BrokerageAuthorizationRefreshConfirmation, BrokerageAuthorizationTransactionsSyncConfirmation, BrokerageAuthorizationTypeReadOnly, BrokerageAuthorizationTypeReadOnlyBrokerage, BrokerageInstrument, BrokerageInstrumentsResponse, BrokerageType, CancelOrderResponse, CefInstrument, ChildBrokerageOrderIDs, ComplexOrderLeg, ComplexOrderResponse, Configuration, ConfigurationParameters, ConnectionsApi, ConnectionsApiAxiosParamCreator, ConnectionsApiDeleteConnectionRequest, ConnectionsApiDetailBrokerageAuthorizationRequest, ConnectionsApiDisableBrokerageAuthorizationRequest, ConnectionsApiFactory, ConnectionsApiFp, ConnectionsApiGenerated, ConnectionsApiListBrokerageAuthorizationAccountsRequest, ConnectionsApiListBrokerageAuthorizationsRequest, ConnectionsApiRefreshBrokerageAuthorizationRequest, ConnectionsApiRemoveBrokerageAuthorizationRequest, ConnectionsApiReturnRatesRequest, ConnectionsApiSessionEventsRequest, ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest, ConnectionsSessionEvents200ResponseInner, CryptoInstrument, CryptoOrderForm, CryptoOrderPreview, CryptoOrderPreviewEstimatedFee, CryptoTradingInstrument, CryptocurrencyPair, CryptocurrencyPairQuote, Currency, DeleteConnectionConfirmation, DeleteUserResponse, DividendAtDate, EncryptedResponse, EncryptedResponseEncryptedMessageData, EtfInstrument, Exchange, ExchangeRatePairs, ExperimentalEndpointsApi, ExperimentalEndpointsApiAddSubscriptionRequest, ExperimentalEndpointsApiAxiosParamCreator, ExperimentalEndpointsApiCancelSubscriptionRequest, ExperimentalEndpointsApiFactory, ExperimentalEndpointsApiFp, ExperimentalEndpointsApiGenerated, ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request, ExperimentalEndpointsApiGetUserAccountOrdersV2Request, ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request, FigiInstrument, FutureInstrument, HoldingsStatus, Instrument, LoginRedirectURI, ManualTrade, ManualTradeAndImpact, ManualTradeBalance, ManualTradeForm, ManualTradeFormBracket, ManualTradeFormComplex, ManualTradeFormNotionalValue, ManualTradeFormWithOptions, ManualTradeImpact, ManualTradeReplaceForm, ManualTradeSymbol, MlegActionStrict, MlegInstrumentType, MlegLeg, MlegOrderResponse, MlegOrderTypeStrict, MlegPriceEffectStrict, MlegTradeForm, MlegTradingInstrument, Model400FailedRequestResponse, Model401FailedRequestResponse, Model402BrokerageAuthAlreadyDisabledException, Model402BrokerageAuthDisabledResponse, Model403FailedRequestResponse, Model403FeatureNotEnabledResponse, Model404FailedRequestResponse, Model425FailedRequestResponse, Model500UnexpectedExceptionResponse, MonthlyDividends, MutualFundInstrument, NetContributions, NetDividend, NotionalValue, OptionBrokerageSymbol, OptionChainInner, OptionChainInnerChainPerRootInner, OptionChainInnerChainPerRootInnerChainPerStrikePriceInner, OptionImpact, OptionInstrument, OptionLeg, OptionQuote, OptionQuoteGreeks, OptionStrategy, OptionStrategyLegsInner, OptionsApi, OptionsApiAxiosParamCreator, OptionsApiFactory, OptionsApiFp, OptionsApiGenerated, OptionsApiListOptionHoldingsRequest, OptionsPosition, OptionsPositionCurrency, OptionsSymbol, OrderTypeStrict, OrderUpdatedResponse, OrderUpdatedResponseOrder, OtherInstrument, PaginatedUniversalActivity, PaginationDetails, PartnerData, PastValue, PerformanceCustom, Position, PositionCurrency, PositionSymbol, RateOfReturnObject, RateOfReturnResponse, RecentOrdersResponse, ReferenceDataApi, ReferenceDataApiAxiosParamCreator, ReferenceDataApiFactory, ReferenceDataApiFp, ReferenceDataApiGenerated, ReferenceDataApiGetCurrencyExchangeRatePairRequest, ReferenceDataApiGetSymbolsByTickerRequest, ReferenceDataApiGetSymbolsRequest, ReferenceDataApiListAllBrokerageAuthorizationTypeRequest, ReferenceDataApiListAllBrokerageInstrumentsRequest, ReferenceDataApiSymbolSearchUserAccountRequest, SecurityType, SessionEvent, SimpleOrderForm, SnapTradeHoldingsAccount, SnapTradeHoldingsTotalValue, SnapTradeLoginUserRequestBody, SnapTradeRegisterUserRequestBody, Snaptrade, SnaptradeError, Status, StockInstrument, StockInstrumentFigiInstrument, StopLoss, StrategyOrderRecord, StrategyQuotes, StrategyQuotesGreek, SubPeriodReturnRate, Symbol$1 as Symbol, SymbolCurrency, SymbolExchange, SymbolQuery, SymbolsQuotesInner, TakeProfit, TaxLot, TimeInForceStrict, TradeDetectionAddSubscriptionRequest, TradeDetectionCancelSubscriptionRequest, TradeDetectionCancelSubscriptionResponse, TradeDetectionSubscription, TradingApi, TradingApiAxiosParamCreator, TradingApiCancelOrderRequest, TradingApiCancelUserAccountOrderRequest, TradingApiFactory, TradingApiFp, TradingApiGenerated, TradingApiGetCryptocurrencyPairQuoteRequest, TradingApiGetOptionImpactRequest, TradingApiGetOrderImpactRequest, TradingApiGetUserAccountOptionQuotesRequest, TradingApiGetUserAccountQuotesRequest, TradingApiPlaceBracketOrderRequest, TradingApiPlaceComplexOrderRequest, TradingApiPlaceCryptoOrderRequest, TradingApiPlaceForceOrderRequest, TradingApiPlaceMlegOrderRequest, TradingApiPlaceOrderRequest, TradingApiPreviewCryptoOrderRequest, TradingApiReplaceOrderRequest, TradingApiSearchCryptocurrencyPairInstrumentsRequest, TradingInstrument, TradingSearchCryptocurrencyPairInstruments200Response, TradingSession, TrailingStop, TransactionsAndReportingApi, TransactionsAndReportingApiAxiosParamCreator, TransactionsAndReportingApiFactory, TransactionsAndReportingApiFp, TransactionsAndReportingApiGenerated, TransactionsAndReportingApiGetActivitiesRequest, TransactionsAndReportingApiGetReportingCustomRangeRequest, TransactionsStatus, USExchange, UnderlyingOptionInstrument, UnderlyingSymbol, UnderlyingSymbolExchange, UnderlyingSymbolType, UniversalActivity, UniversalSymbol, UserIDandSecret, ValidatedTradeBody, parseIfJson, readableStreamToString };
package/dist/index.mjs CHANGED
@@ -3340,12 +3340,12 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
3340
3340
  /**
3341
3341
  * Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
3342
3342
  * @summary Cancel a Trade Detection subscription
3343
- * @param {TradeDetectionAddSubscriptionRequest} tradeDetectionAddSubscriptionRequest
3343
+ * @param {TradeDetectionCancelSubscriptionRequest} tradeDetectionCancelSubscriptionRequest
3344
3344
  * @param {*} [options] Override http request option.
3345
3345
  * @throws {RequiredError}
3346
3346
  */
3347
- cancelSubscription: async (tradeDetectionAddSubscriptionRequest, options = {}) => {
3348
- assertParamExists("cancelSubscription", "tradeDetectionAddSubscriptionRequest", tradeDetectionAddSubscriptionRequest);
3347
+ cancelSubscription: async (tradeDetectionCancelSubscriptionRequest, options = {}) => {
3348
+ assertParamExists("cancelSubscription", "tradeDetectionCancelSubscriptionRequest", tradeDetectionCancelSubscriptionRequest);
3349
3349
  const localVarPath = `/snapTrade/tradeDetection/subscriptions/cancel`;
3350
3350
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3351
3351
  let baseOptions;
@@ -3383,7 +3383,7 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
3383
3383
  ...options.headers
3384
3384
  };
3385
3385
  requestBeforeHook({
3386
- requestBody: tradeDetectionAddSubscriptionRequest,
3386
+ requestBody: tradeDetectionCancelSubscriptionRequest,
3387
3387
  queryParameters: localVarQueryParameter,
3388
3388
  requestConfig: localVarRequestOptions,
3389
3389
  path: localVarPath,
@@ -3391,7 +3391,7 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
3391
3391
  pathTemplate: "/snapTrade/tradeDetection/subscriptions/cancel",
3392
3392
  httpMethod: "POST"
3393
3393
  });
3394
- localVarRequestOptions.data = serializeDataIfNeeded(tradeDetectionAddSubscriptionRequest, localVarRequestOptions, configuration);
3394
+ localVarRequestOptions.data = serializeDataIfNeeded(tradeDetectionCancelSubscriptionRequest, localVarRequestOptions, configuration);
3395
3395
  setSearchParams(localVarUrlObj, localVarQueryParameter);
3396
3396
  return {
3397
3397
  url: toPathString(localVarUrlObj),
@@ -3671,7 +3671,10 @@ const ExperimentalEndpointsApiFp = function(configuration) {
3671
3671
  * @throws {RequiredError}
3672
3672
  */
3673
3673
  async addSubscription(requestParameters, options) {
3674
- const tradeDetectionAddSubscriptionRequest = { account_id: requestParameters.account_id };
3674
+ const tradeDetectionAddSubscriptionRequest = {
3675
+ account_id: requestParameters.account_id,
3676
+ check_interval_seconds: requestParameters.check_interval_seconds
3677
+ };
3675
3678
  return createRequestFunction(await localVarAxiosParamCreator.addSubscription(requestParameters.userId, requestParameters.userSecret, tradeDetectionAddSubscriptionRequest, options), globalAxios, BASE_PATH, configuration);
3676
3679
  },
3677
3680
  /**
@@ -3682,8 +3685,8 @@ const ExperimentalEndpointsApiFp = function(configuration) {
3682
3685
  * @throws {RequiredError}
3683
3686
  */
3684
3687
  async cancelSubscription(requestParameters, options) {
3685
- const tradeDetectionAddSubscriptionRequest = { account_id: requestParameters.account_id };
3686
- return createRequestFunction(await localVarAxiosParamCreator.cancelSubscription(tradeDetectionAddSubscriptionRequest, options), globalAxios, BASE_PATH, configuration);
3688
+ const tradeDetectionCancelSubscriptionRequest = { account_id: requestParameters.account_id };
3689
+ return createRequestFunction(await localVarAxiosParamCreator.cancelSubscription(tradeDetectionCancelSubscriptionRequest, options), globalAxios, BASE_PATH, configuration);
3687
3690
  },
3688
3691
  /**
3689
3692
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
@@ -7095,7 +7098,7 @@ var Configuration = class {
7095
7098
  this.accessToken = param.accessToken;
7096
7099
  this.basePath = param.basePath;
7097
7100
  this.baseOptions = param.baseOptions ?? {};
7098
- this.userAgent = param.userAgent === void 0 ? "Konfig/10.0.7/typescript" : param.userAgent;
7101
+ this.userAgent = param.userAgent === void 0 ? "Konfig/10.0.8/typescript" : param.userAgent;
7099
7102
  this.formDataCtor = param.formDataCtor;
7100
7103
  }
7101
7104
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snaptrade-typescript-sdk",
3
- "version": "10.0.7",
3
+ "version": "10.0.8",
4
4
  "description": "Client for SnapTrade",
5
5
  "author": "Konfig",
6
6
  "engines": {