diff --git a/README.md b/README.md index f4c900c..581e367 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ You just need node.js — and npm, obviously. ### Dependencies -The dependency list is tiny — **node-fetch**, **http-status**, and **source-map-support**. They will be automatically installed when you install `wstrade-api` through `npm`. +The dependency list is tiny — **node-fetch** and **source-map-support**. They will be automatically installed when you install `wstrade-api` through `npm`. ### Installing diff --git a/dist.js b/dist.js index c8593f4..e3d773f 100644 --- a/dist.js +++ b/dist.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("source-map-support"),require("node-fetch"),require("http-status")):"function"==typeof define&&define.amd?define(["source-map-support","node-fetch","http-status"],e):"object"==typeof exports?exports["wstrade-api"]=e(require("source-map-support"),require("node-fetch"),require("http-status")):t["wstrade-api"]=e(t._,t._,t._)}(global,(function(t,e,r){return(()=>{var n={228:t=>{t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r{t.exports=function(t){if(Array.isArray(t))return t}},646:(t,e,r)=>{var n=r(228);t.exports=function(t){if(Array.isArray(t))return n(t)}},926:t=>{function e(t,e,r,n,o,a,s){try{var i=t[a](s),c=i.value}catch(t){return void r(t)}i.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise((function(o,a){var s=t.apply(r,n);function i(t){e(s,o,a,i,c,"next",t)}function c(t){e(s,o,a,i,c,"throw",t)}i(void 0)}))}}},575:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},913:t=>{function e(t,e){for(var r=0;r{t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},860:t=>{t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},884:t=>{t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,a=void 0;try{for(var s,i=t[Symbol.iterator]();!(n=(s=i.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return r}}},521:t=>{t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},206:t=>{t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},38:(t,e,r)=>{var n=r(858),o=r(884),a=r(379),s=r(521);t.exports=function(t,e){return n(t)||o(t,e)||a(t,e)||s()}},319:(t,e,r)=>{var n=r(646),o=r(860),a=r(379),s=r(206);t.exports=function(t){return n(t)||o(t)||a(t)||s()}},379:(t,e,r)=>{var n=r(228);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},757:(t,e,r)=>{t.exports=r(666)},391:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var n=r(757),o=r.n(n),a=r(926),s=r.n(a),i=r(726),c=r(811);const u={all:(w=s()(o().mark((function t(){var e;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,c.Z)(i.Z.ACCOUNT_IDS,{});case 2:return e=t.sent,t.abrupt("return",{tfsa:e.find((function(t){return t.startsWith("tfsa")})),rrsp:e.find((function(t){return t.startsWith("rrsp")})),crypto:e.find((function(t){return t.startsWith("non-registered-crypto")})),personal:e.find((function(t){return t.startsWith("non-registered")&&!t.startsWith("non-registered-crypto")}))});case 4:case"end":return t.stop()}}),t)}))),function(){return w.apply(this,arguments)}),data:(m=s()(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.LIST_ACCOUNT,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return m.apply(this,arguments)}),me:(v=s()(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.ME,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return v.apply(this,arguments)}),person:(y=s()(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.PERSON,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return y.apply(this,arguments)}),history:(d=s()(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.HISTORY_ACCOUNT,{interval:e,accountId:r}));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return d.apply(this,arguments)}),activities:(h=s()(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.ACTIVITIES,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return h.apply(this,arguments)}),getBankAccounts:(l=s()(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.BANK_ACCOUNTS,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return l.apply(this,arguments)}),deposits:(f=s()(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.DEPOSITS,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return f.apply(this,arguments)}),positions:(p=s()(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.POSITIONS,{accountId:e}));case 1:case"end":return t.stop()}}),t)}))),function(t){return p.apply(this,arguments)})};var p,f,l,h,d,y,v,m,w},726:(t,e,r)=>{"use strict";r.d(e,{p:()=>x,Z:()=>g});var n,o,a,s,i,c,u,p,f,l,h,d,y=r(757),v=r.n(y),m=r(926),w=r.n(m),x=20,b={onFailure:(o=w()(v().mark((function t(e){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=e.status,t.t1=e.statusText,t.next=4,e.json();case 4:return t.t2=t.sent,t.abrupt("return",{status:t.t0,reason:t.t1,body:t.t2});case 6:case"end":return t.stop()}}),t)}))),function(t){return o.apply(this,arguments)}),onSuccess:(n=w()(v().mark((function t(e){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.json());case 1:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)})};const g={LOGIN:{method:"POST",url:"https://trade-service.wealthsimple.com/auth/login",onSuccess:(d=w()(v().mark((function t(e){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0={access:e.headers.get("x-access-token"),refresh:e.headers.get("x-refresh-token"),expires:parseInt(e.headers.get("x-access-token-expires"),10)},t.next=3,e.json();case 3:return t.t1=t.sent,t.abrupt("return",{tokens:t.t0,accountInfo:t.t1});case 5:case"end":return t.stop()}}),t)}))),function(t){return d.apply(this,arguments)}),onFailure:b.onFailure},REFRESH:{method:"POST",url:"https://trade-service.wealthsimple.com/auth/refresh",onSuccess:(h=w()(v().mark((function t(e){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{tokens:{access:e.headers.get("x-access-token"),refresh:e.headers.get("x-refresh-token"),expires:parseInt(e.headers.get("x-access-token-expires"),10)}});case 1:case"end":return t.stop()}}),t)}))),function(t){return h.apply(this,arguments)}),onFailure:b.onFailure},ACCOUNT_IDS:{method:"GET",url:"https://trade-service.wealthsimple.com/account/list",onSuccess:(l=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",r.results.map((function(t){return t.id})));case 4:case"end":return t.stop()}}),t)}))),function(t){return l.apply(this,arguments)}),onFailure:b.onFailure},LIST_ACCOUNT:{method:"GET",url:"https://trade-service.wealthsimple.com/account/list",onSuccess:(f=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",r.results);case 4:case"end":return t.stop()}}),t)}))),function(t){return f.apply(this,arguments)}),onFailure:b.onFailure},ME:{method:"GET",url:"https://trade-service.wealthsimple.com/me",onSuccess:b.onSuccess,onFailure:b.onFailure},PERSON:{method:"GET",url:"https://trade-service.wealthsimple.com/person",onSuccess:b.onSuccess,onFailure:b.onFailure},HISTORY_ACCOUNT:{method:"GET",url:"https://trade-service.wealthsimple.com/account/history/{0}?account_id={1}",parameters:{0:"interval",1:"accountId"},onSuccess:b.onSuccess,onFailure:b.onFailure},ACTIVITIES:{method:"GET",url:"https://trade-service.wealthsimple.com/account/activities",onSuccess:(p=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",r.results);case 4:case"end":return t.stop()}}),t)}))),function(t){return p.apply(this,arguments)}),onFailure:b.onFailure},DEPOSITS:{method:"GET",url:"https://trade-service.wealthsimple.com/deposits",onSuccess:(u=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",r.results);case 4:case"end":return t.stop()}}),t)}))),function(t){return u.apply(this,arguments)}),onFailure:b.onFailure},BANK_ACCOUNTS:{method:"GET",url:"https://trade-service.wealthsimple.com/bank-accounts",onSuccess:(c=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",r.results);case 4:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),onFailure:b.onFailure},EXCHANGE_RATES:{method:"GET",url:"https://trade-service.wealthsimple.com/forex",onSuccess:b.onSuccess,onFailure:b.onFailure},SECURITY:{method:"GET",url:"https://trade-service.wealthsimple.com/securities?query={0}",parameters:{0:"ticker"},onSuccess:(i=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:if(0!==(r=t.sent).results.length){t.next=5;break}throw new Error("Security does not exist");case 5:return t.abrupt("return",r.results);case 6:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)}),onFailure:b.onFailure},EXTENSIVE_SECURITY_DETAILS:{method:"GET",url:"https://trade-service.wealthsimple.com/securities/{0}",parameters:{0:"id"},onSuccess:b.onSuccess,onFailure:b.onFailure},POSITIONS:{method:"GET",url:"https://trade-service.wealthsimple.com/account/positions?account_id={0}",parameters:{0:"accountId"},onSuccess:(s=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",r.results);case 4:case"end":return t.stop()}}),t)}))),function(t){return s.apply(this,arguments)}),onFailure:b.onFailure},ORDERS_BY_PAGE:{method:"GET",url:"https://trade-service.wealthsimple.com/orders?offset={0}&account_id={1}",parameters:{0:"offset",1:"accountId"},onSuccess:(a=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",{total:r.total,orders:r.results});case 4:case"end":return t.stop()}}),t)}))),function(t){return a.apply(this,arguments)}),onFailure:b.onFailure},CANCEL_ORDER:{method:"DELETE",url:"https://trade-service.wealthsimple.com/orders/{0}",parameters:{0:"orderId"},onSuccess:b.onSuccess,onFailure:b.onFailure},PLACE_ORDER:{method:"POST",url:"https://trade-service.wealthsimple.com/orders",onSuccess:b.onSuccess,onFailure:b.onFailure}}},464:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var n=r(757),o=r.n(n),a=r(926),s=r.n(a),i=r(811),c=r(726);const u={tokens:null,otp:null,on:function(t,e){this[t]=e},login:function(t,e){var r=this;return s()(o().mark((function n(){var a;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=null,"function"!=typeof r.otp){n.next=4;break}return n.next=4,(0,i.Z)(c.Z.LOGIN,{email:t,password:e}).catch((function(){}));case 4:if(n.prev=4,n.t0=i.Z,n.t1=c.Z.LOGIN,n.t2=t,n.t3=e,"function"!=typeof r.otp){n.next=15;break}return n.next=12,r.otp();case 12:n.t4=n.sent,n.next=16;break;case 15:n.t4=r.otp;case 16:return n.t5=n.t4,n.t6={email:n.t2,password:n.t3,otp:n.t5},n.next=20,(0,n.t0)(n.t1,n.t6);case 20:a=n.sent,n.next=28;break;case 23:if(n.prev=23,n.t7=n.catch(4),r.otp){n.next=27;break}throw new Error("OTP not provided!");case 27:throw n.t7;case 28:r.tokens=a.tokens;case 29:case"end":return n.stop()}}),n,null,[[4,23]])})))()},refresh:function(){var t=this;return s()(o().mark((function e(){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.tokens.access=null,e.next=3,(0,i.Z)(c.Z.REFRESH,{refresh_token:t.tokens.refresh});case 3:r=e.sent,t.tokens=r.tokens;case 5:case"end":return e.stop()}}),e)})))()}}},500:(t,e,r)=>{"use strict";r.d(e,{e:()=>o,Z:()=>a});var n=["securities_cache"],o=function(t){return!n.includes(t)};function a(t){if(null!=t&&t.startsWith("no_")){var e=t.substring(t.indexOf("_")+1);o(e)&&n.push(e)}else o(t)||n.splice(n.indexOf(t),1)}},657:(t,e,r)=>{"use strict";r.d(e,{Z:()=>p});var n=r(38),o=r.n(n),a=r(575),s=r.n(a),i=r(913),c=r.n(i),u=["NASDAQ","NYSE","TSX","TSX-V","NEO","CC"];const p=function(){function t(e){var r;if(s()(this,t),this.symbol=null,this.exchange=null,this.id=null,this.crypto=!1,"string"==typeof e){if(""===e)throw new Error("Empty ticker");var n=e.split(":"),a=o()(n,2);this.symbol=a[0],this.exchange=a[1]}else{if(!e.symbol&&!e.id)throw new Error("Invalid ticker '".concat(e,"'"));this.symbol=e.symbol||null,this.exchange=e.exchange||null,this.id=e.id||null}if(this.exchange&&!u.includes(this.exchange))throw new Error("Invalid exchange '".concat(this.exchange,"'!"));("CC"===this.exchange||null!==(r=this.id)&&void 0!==r&&r.startsWith("sec-z"))&&(this.crypto=!0),"NEO"===this.exchange&&(this.exchange="AEQUITAS NEO EXCHANGE")}return c()(t,[{key:"format",value:function(){return this.id?this.id:"AEQUITAS NEO EXCHANGE"===this.exchange?"".concat(this.symbol,":NEO"):"".concat(this.symbol).concat(this.exchange?":".concat(this.exchange):"")}},{key:"weakEquals",value:function(t){return!(!this.id||this.id!==t.id)||!(!this.symbol||this.symbol!==t.symbol||this.crypto!==t.crypto)}}]),t}()},752:(t,e,r)=>{"use strict";r.d(e,{Z:()=>x});var n=r(38),o=r.n(n),a=r(757),s=r.n(a),i=r(926),c=r.n(i),u=r(726),p=r(811),f=r(657),l=r(500),h=r(575),d=r.n(h),y=r(913),v=r.n(y),m=new(function(){function t(e){d()(this,t),this.cache=new Map,this.size=e}return v()(t,[{key:"insert",value:function(t,e){this.cache.size>=this.size&&this.cache.delete(this.cache.keys().next().value),this.cache.set(t,e)}},{key:"get",value:function(t){return this.cache.get(t)}}]),t}())(10);const w=function(t){var e=m.get(new f.Z(t).format());return void 0===e?null:e},x={exchangeRates:(g=c()(s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,p.Z)(u.Z.EXCHANGE_RATES,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return g.apply(this,arguments)}),getSecurity:(b=c()(s().mark((function t(e,r){var n,a,i,c;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=null,a=new f.Z(e),r||!(0,l.e)("securities_cache")){t.next=6;break}if(!(n=w(a))){t.next=6;break}return t.abrupt("return",n);case 6:if(!a.id){t.next=12;break}return t.next=9,(0,p.Z)(u.Z.EXTENSIVE_SECURITY_DETAILS,{id:a.id});case 9:n=t.sent,t.next=28;break;case 12:return t.next=14,(0,p.Z)(u.Z.SECURITY,{ticker:a.symbol});case 14:if(n=(n=t.sent).filter((function(t){return t.stock.symbol===a.symbol})),a.crypto?n=n.filter((function(t){return"cryptocurrency"===t.security_type})):a.exchange&&(n=n.filter((function(t){return t.stock.primary_exchange===a.exchange}))),!(n.length>1)){t.next=19;break}throw new Error("Multiple securities matched query.");case 19:if(0!==n.length){t.next=21;break}throw new Error("No securities matched query.");case 21:if(i=n,c=o()(i,1),n=c[0],!r){t.next=28;break}return t.next=27,(0,p.Z)(u.Z.EXTENSIVE_SECURITY_DETAILS,{id:n.id});case 27:n=t.sent;case 28:return(0,l.e)("securities_cache")&&null===w(a)&&(s=a,h=n,m.insert(new f.Z(s).format(),h)),t.abrupt("return",n);case 30:case"end":return t.stop()}var s,h}),t)}))),function(t,e){return b.apply(this,arguments)})};var b,g},568:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(319),o=r.n(n),a=new(r(545).Headers);const s={add:function(t,e){return a.append(t,e)},remove:function(t){return a.delete(t)},clear:function(){return o()(a).forEach((function(t){return a.delete(t[0])}))},values:function(){return o()(a)}}},352:(t,e,r)=>{r(949).install();var n=r(464).Z,o=r(568).Z,a=r(391).Z,s=r(826).Z,i=r(752).Z,c=r(889).Z,u=r(500).Z;t.exports={auth:n,headers:o,accounts:a,orders:s,quotes:c,data:i,config:u}},811:(t,e,r)=>{"use strict";r.d(e,{Z:()=>S});var n=r(757),o=r.n(n),a=r(319),s=r.n(a),i=r(926),c=r.n(i),u=r(713),p=r.n(u),f=r(545),l=r.n(f),h=r(457),d=r.n(h),y=r(568),v=r(464),m=r(500);const w=function(){return parseInt(Date.now()/1e3,10)};function x(){return b.apply(this,arguments)}function b(){return(b=c()(o().mark((function t(){var e,r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(w()>=(null===(e=v.Z.tokens)||void 0===e?void 0:e.expires))){t.next=13;break}if(null===(r=v.Z.tokens)||void 0===r||!r.refresh){t.next=12;break}return t.prev=2,t.next=5,v.Z.refresh();case 5:t.next=10;break;case 7:throw t.prev=7,t.t0=t.catch(2),new Error("Unable to refresh expired token: ".concat(t.t0));case 10:t.next=13;break;case 12:throw new Error("Access token expired");case 13:case"end":return t.stop()}}),t,null,[[2,7]])})))).apply(this,arguments)}function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function k(t,e){var r=function(t){for(var e=1;e{"use strict";r.d(e,{Z:()=>R});var n=r(713),o=r.n(n),a=r(319),s=r.n(a),i=r(757),c=r.n(i),u=r(926),p=r.n(u),f=r(726),l=r(811),h=r(657);function d(t,e){return y.apply(this,arguments)}function y(){return(y=p()(c().mark((function t(e,r){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,l.Z)(f.Z.ORDERS_BY_PAGE,{offset:(r-1)*f.p,accountId:e}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(t){return m.apply(this,arguments)}function m(){return(m=p()(c().mark((function t(e){var r,n,o,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d(e,1);case 2:if(r=t.sent,!((n=Math.ceil(r.total/f.p))>1)){t.next=12;break}for(o=[],a=2;a<=n;a++)o.push(d(e,a).then((function(t){return t.orders})));return t.next=9,Promise.all(o);case 9:t.sent.forEach((function(t){var e;return(e=r.orders).push.apply(e,s()(t))})),r.total=r.orders.length;case 12:return t.abrupt("return",r);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function w(t,e,r){return x.apply(this,arguments)}function x(){return(x=p()(c().mark((function t(e,r,n){var o,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v(e);case 2:return o=t.sent,a=function(t){if(r){var e=new h.Z({symbol:t.symbol,id:t.security_id});if(!new h.Z(r).weakEquals(e))return!1}return t.status===n},o.orders=o.orders.filter(a),o.total=o.orders.length,t.abrupt("return",o);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}const b={page:d,all:v,pending:(E=p()(c().mark((function t(e,r){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",w(e,r,"submitted"));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return E.apply(this,arguments)}),filled:(k=p()(c().mark((function t(e,r){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",w(e,r,"posted"));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return k.apply(this,arguments)}),cancelled:(g=p()(c().mark((function t(e,r){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",w(e,r,"cancelled"));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return g.apply(this,arguments)})};var g,k,E,_=r(752),S=r(889),O=function(t){return["TSX","TSX-V"].includes(t)};const Z={cancel:(C=p()(c().mark((function t(e){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=e,t.next=3,(0,l.Z)(f.Z.CANCEL_ORDER,{orderId:e});case 3:return t.t1=t.sent,t.abrupt("return",{order:t.t0,response:t.t1});case 5:case"end":return t.stop()}}),t)}))),function(t){return C.apply(this,arguments)}),cancelPending:function(t){var e=this;return p()(c().mark((function r(){var n;return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,b.pending(t);case 2:return n=r.sent,r.abrupt("return",Promise.all(n.orders.map(function(){var t=p()(c().mark((function t(r){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.cancel(r.order_id));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())));case 4:case"end":return r.stop()}}),r)})))()},marketBuy:(L=p()(c().mark((function t(e,r,n){var o;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,_.Z.getSecurity(r);case 2:if(o=t.sent,t.t0=l.Z,t.t1=f.Z.PLACE_ORDER,t.t2=o.id,new h.Z(r).crypto){t.next=12;break}return t.next=9,S.Z.get(r);case 9:t.t3=t.sent,t.next=13;break;case 12:t.t3=void 0;case 13:return t.t4=t.t3,t.t5=n,t.t6=e,t.t7={security_id:t.t2,limit_price:t.t4,quantity:t.t5,order_type:"buy_quantity",order_sub_type:"market",time_in_force:"day",account_id:t.t6},t.abrupt("return",(0,t.t0)(t.t1,t.t7));case 18:case"end":return t.stop()}}),t)}))),function(t,e,r){return L.apply(this,arguments)}),limitBuy:(P=p()(c().mark((function t(e,r,n,o){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=l.Z,t.t1=f.Z.PLACE_ORDER,t.next=4,_.Z.getSecurity(r);case 4:return t.t2=t.sent.id,t.t3=n,t.t4=o,t.t5=e,t.t6={security_id:t.t2,limit_price:t.t3,quantity:t.t4,order_type:"buy_quantity",order_sub_type:"limit",time_in_force:"day",account_id:t.t5},t.abrupt("return",(0,t.t0)(t.t1,t.t6));case 10:case"end":return t.stop()}}),t)}))),function(t,e,r,n){return P.apply(this,arguments)}),stopLimitBuy:(A=p()(c().mark((function t(e,r,n,o,a){var s;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,_.Z.getSecurity(r);case 2:if(s=t.sent,!O(s.stock.primary_exchange)||n===o){t.next=5;break}throw new Error("TSX/TSX-V securities must have an equivalent stop and limit price.");case 5:return t.abrupt("return",(0,l.Z)(f.Z.PLACE_ORDER,{security_id:s.id,stop_price:n,limit_price:o,quantity:a,order_type:"buy_quantity",order_sub_type:"stop_limit",time_in_force:"day",account_id:e}));case 6:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o){return A.apply(this,arguments)}),marketSell:(I=p()(c().mark((function t(e,r,n){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=l.Z,t.t1=f.Z.PLACE_ORDER,t.next=4,_.Z.getSecurity(r);case 4:if(t.t2=t.sent.id,new h.Z(r).crypto){t.next=11;break}return t.next=8,S.Z.get(r);case 8:t.t3=t.sent,t.next=12;break;case 11:t.t3=void 0;case 12:return t.t4=t.t3,t.t5=n,t.t6=e,t.t7={security_id:t.t2,market_value:t.t4,quantity:t.t5,order_type:"sell_quantity",order_sub_type:"market",time_in_force:"day",account_id:t.t6},t.abrupt("return",(0,t.t0)(t.t1,t.t7));case 17:case"end":return t.stop()}}),t)}))),function(t,e,r){return I.apply(this,arguments)}),limitSell:(j=p()(c().mark((function t(e,r,n,o){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=l.Z,t.t1=f.Z.PLACE_ORDER,t.next=4,_.Z.getSecurity(r);case 4:return t.t2=t.sent.id,t.t3=n,t.t4=o,t.t5=e,t.t6={security_id:t.t2,limit_price:t.t3,quantity:t.t4,order_type:"sell_quantity",order_sub_type:"limit",time_in_force:"day",account_id:t.t5},t.abrupt("return",(0,t.t0)(t.t1,t.t6));case 10:case"end":return t.stop()}}),t)}))),function(t,e,r,n){return j.apply(this,arguments)}),stopLimitSell:(T=p()(c().mark((function t(e,r,n,o,a){var s;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,_.Z.getSecurity(r);case 2:if(s=t.sent,!O(s.stock.primary_exchange)||n===o){t.next=5;break}throw new Error("TSX/TSX-V securities must have an equivalent stop and limit price.");case 5:return t.abrupt("return",(0,l.Z)(f.Z.PLACE_ORDER,{security_id:s.id,stop_price:n,limit_price:o,quantity:a,order_type:"sell_quantity",order_sub_type:"stop_limit",time_in_force:"day",account_id:e}));case 6:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o){return T.apply(this,arguments)})};var T,j,I,A,P,L,C;function F(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function N(t){for(var e=1;e{"use strict";r.d(e,{Z:()=>f});var n=r(757),o=r.n(n),a=r(926),s=r.n(a),i=r(752);const c={quote:(u=s()(o().mark((function t(e){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.Z.getSecurity(e,!0);case 2:return r=t.sent,t.abrupt("return",r.quote.amount);case 4:case"end":return t.stop()}}),t)}))),function(t){return u.apply(this,arguments)})};var u,p=r(657);const f={defaultProvider:c,providers:{},use:function(t,e){if("function"!=typeof e.quote)throw new Error("Invalid quote provider for ".concat(t,"!"));this.providers[t]=e},get:function(t){var e=this;return s()(o().mark((function r(){var n,a,s;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=null,!(a=new p.Z(t)).exchange){r.next=6;break}n=a.exchange,r.next=15;break;case 6:if(!a.crypto||!a.id){r.next=10;break}n="CC",r.next=15;break;case 10:if(!(Object.keys(e.providers).length>0)){r.next=15;break}return r.next=13,i.Z.getSecurity(a,!1);case 13:s=r.sent,n=s.stock.primary_exchange;case 15:if(!(n in e.providers)){r.next=17;break}return r.abrupt("return",e.providers[n].quote(a));case 17:return r.abrupt("return",e.defaultProvider.quote(a));case 18:case"end":return r.stop()}}),r)})))()}}},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",i=o.toStringTag||"@@toStringTag";function c(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),s=new Z(n||[]);return a._invoke=function(t,e,r){var n=p;return function(o,a){if(n===l)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw a;return j()}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var i=_(s,r);if(i){if(i===d)continue;return i}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=l;var c=u(t,e,r);if("normal"===c.type){if(n=r.done?h:f,c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=h,r.method="throw",r.arg=c.arg)}}}(t,r,s),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var p="suspendedStart",f="suspendedYield",l="executing",h="completed",d={};function y(){}function v(){}function m(){}var w={};w[a]=function(){return this};var x=Object.getPrototypeOf,b=x&&x(x(T([])));b&&b!==r&&n.call(b,a)&&(w=b);var g=m.prototype=y.prototype=Object.create(w);function k(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function E(t,e){function r(o,a,s,i){var c=u(t[o],t,a);if("throw"!==c.type){var p=c.arg,f=p.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,i)}),(function(t){r("throw",t,s,i)})):e.resolve(f).then((function(t){p.value=t,s(p)}),(function(t){return r("throw",t,s,i)}))}i(c.arg)}var o;this._invoke=function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}}function _(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=u(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Z(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function r(){for(;++o=0;--a){var s=this.tryEntries[a],i=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),u=n.call(s,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},457:t=>{"use strict";t.exports=r},545:t=>{"use strict";t.exports=e},949:e=>{"use strict";e.exports=t}},o={};function a(t){if(o[t])return o[t].exports;var e=o[t]={exports:{}};return n[t](e,e.exports,a),e.exports}return a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a(352)})()})); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93c3RyYWRlLWFwaS93ZWJwYWNrL3VuaXZlcnNhbE1vZHVsZURlZmluaXRpb24iLCJ3ZWJwYWNrOi8vd3N0cmFkZS1hcGkvLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUvaGVscGVycy9hcnJheUxpa2VUb0FycmF5LmpzIiwid2VicGFjazovL3dzdHJhZGUtYXBpLy4vbm9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3duIGZyb20gaW5uZXJGbiwgd2UgbGVhdmUgc3RhdGUgPT09XG4gICAgICAgICAgLy8gR2VuU3RhdGVFeGVjdXRpbmcgYW5kIGxvb3AgYmFjayBmb3IgYW5vdGhlciBpbnZvY2F0aW9uLlxuICAgICAgICAgIHN0YXRlID0gY29udGV4dC5kb25lXG4gICAgICAgICAgICA/IEdlblN0YXRlQ29tcGxldGVkXG4gICAgICAgICAgICA6IEdlblN0YXRlU3VzcGVuZGVkWWllbGQ7XG5cbiAgICAgICAgICBpZiAocmVjb3JkLmFyZyA9PT0gQ29udGludWVTZW50aW5lbCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHZhbHVlOiByZWNvcmQuYXJnLFxuICAgICAgICAgICAgZG9uZTogY29udGV4dC5kb25lXG4gICAgICAgICAgfTtcblxuICAgICAgICB9IGVsc2UgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgICBzdGF0ZSA9IEdlblN0YXRlQ29tcGxldGVkO1xuICAgICAgICAgIC8vIERpc3BhdGNoIHRoZSBleGNlcHRpb24gYnkgbG9vcGluZyBiYWNrIGFyb3VuZCB0byB0aGVcbiAgICAgICAgICAvLyBjb250ZXh0LmRpc3BhdGNoRXhjZXB0aW9uKGNvbnRleHQuYXJnKSBjYWxsIGFib3ZlLlxuICAgICAgICAgIGNvbnRleHQubWV0aG9kID0gXCJ0aHJvd1wiO1xuICAgICAgICAgIGNvbnRleHQuYXJnID0gcmVjb3JkLmFyZztcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH07XG4gIH1cblxuICAvLyBDYWxsIGRlbGVnYXRlLml0ZXJhdG9yW2NvbnRleHQubWV0aG9kXShjb250ZXh0LmFyZykgYW5kIGhhbmRsZSB0aGVcbiAgLy8gcmVzdWx0LCBlaXRoZXIgYnkgcmV0dXJuaW5nIGEgeyB2YWx1ZSwgZG9uZSB9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luZWQ7XG5cbiAgICAgIHRoaXMudHJ5RW50cmllcy5mb3JFYWNoKHJlc2V0VHJ5RW50cnkpO1xuXG4gICAgICBpZiAoIXNraXBUZW1wUmVzZXQpIHtcbiAgICAgICAgZm9yICh2YXIgbmFtZSBpbiB0aGlzKSB7XG4gICAgICAgICAgLy8gTm90IHN1cmUgYWJvdXQgdGhlIG9wdGltYWwgb3JkZXIgb2YgdGhlc2UgY29uZGl0aW9uczpcbiAgICAgICAgICBpZiAobmFtZS5jaGFyQXQoMCkgPT09IFwidFwiICYmXG4gICAgICAgICAgICAgIGhhc093bi5jYWxsKHRoaXMsIG5hbWUpICYmXG4gICAgICAgICAgICAgICFpc05hTigrbmFtZS5zbGljZSgxKSkpIHtcbiAgICAgICAgICAgIHRoaXNbbmFtZV0gPSB1bmRlZmluZWQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIHN0b3A6IGZ1bmN0aW9uKCkge1xuICAgICAgdGhpcy5kb25lID0gdHJ1ZTtcblxuICAgICAgdmFyIHJvb3RFbnRyeSA9IHRoaXMudHJ5RW50cmllc1swXTtcbiAgICAgIHZhciByb290UmVjb3JkID0gcm9vdEVudHJ5LmNvbXBsZXRpb247XG4gICAgICBpZiAocm9vdFJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgdGhyb3cgcm9vdFJlY29yZC5hcmc7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB0aGlzLnJ2YWw7XG4gICAgfSxcblxuICAgIGRpc3BhdGNoRXhjZXB0aW9uOiBmdW5jdGlvbihleGNlcHRpb24pIHtcbiAgICAgIGlmICh0aGlzLmRvbmUpIHtcbiAgICAgICAgdGhyb3cgZXhjZXB0aW9uO1xuICAgICAgfVxuXG4gICAgICB2YXIgY29udGV4dCA9IHRoaXM7XG4gICAgICBmdW5jdGlvbiBoYW5kbGUobG9jLCBjYXVnaHQpIHtcbiAgICAgICAgcmVjb3JkLnR5cGUg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c0NhdGNoID0gaGFzT3duLmNhbGwoZW50cnksIFwiY2F0Y2hMb2NcIik7XG4gICAgICAgICAgdmFyIGhhc0ZpbmFsbHkgPSBoYXNPd24uY2FsbChlbnRyeSwgXCJmaW5hbGx5TG9jXCIpO1xuXG4gICAgICAgICAgaWYgKGhhc0NhdGNoICYmIGhhc0ZpbmFsbHkpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5jYXRjaExvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmNhdGNoTG9jLCB0cnVlKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmZpbmFsbHlMb2MpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIGlmIChoYXNDYXRjaCkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJldiA8IGVudHJ5LmNhdGNoTG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuY2F0Y2hMb2MsIHRydWUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIGlmIChoYXNGaW5hbGx5KSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmZpbmFsbHlMb2MpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcInRyeSBzdGF0ZW1lbnQgd2l0aG91dCBjYXRjaCBvciBmaW5hbGx5XCIpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG5cbiAgICBhYnJ1cHQ6IGZ1bmN0aW9uKHR5cGUsIGFyZykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPD0gdGhpcy5wcmV2ICYmXG4gICAgICAgICAgICBoYXNPd24uY2FsbChlbnRyeSwgXCJmaW5hbGx5TG9jXCIpICYmXG4gICAgICAgICAgICB0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgdmFyIGZpbmFsbHlFbnRyeSA9IGVudHJ5O1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChmaW5hbGx5RW50cnkgJiZcbiAgICAgICAgICAodHlwZSA9PT0gXCJicmVha1wiIHx8XG4gICAgICAgICAgIHR5cGUgPT09IFwiY29udGludWVcIikgJiZcbiAgICAgICAgICBmaW5hbGx5RW50cnkudHJ5TG9jIDw9IGFyZyAmJlxuICAgICAgICAgIGFyZyA8PSBmaW5hbGx5RW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAvLyBJZ25vcmUgdGhlIGZpbmFsbHkgZW50cnkgaWYgY29udHJvbCBpcyBub3QganVtcGluZyB0byBhXG4gICAgICAgIC8vIGxvY2F0aW9uIG91dHNpZGUgdGhlIHRyeS9jYXRjaCBibG9jay5cbiAgICAgICAgZmluYWxseUVudHJ5ID0gbnVsbDtcbiAgICAgIH1cblxuICAgICAgdmFyIHJlY29yZCA9IGZpbmFsbHlFbnRyeSA/IGZpbmFsbHlFbnRyeS5jb21wbGV0aW9uIDoge307XG4gICAgICByZWNvcmQudHlwZSA9IHR5cGU7XG4gICAgICByZWNvcmQuYXJnID0gYXJnO1xuXG4gICAgICBpZiAoZmluYWxseUVudHJ5KSB7XG4gICAgICAgIHRoaXMubWV0aG9kID0gXCJuZXh0XCI7XG4gICAgICAgIHRoaXMubmV4dCA9IGZpbmF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W5pdGlvbikge1xuXHRcdGlmKF9fd2VicGFja19yZXF1aXJlX18ubyhkZWZpbml0aW9uLCBrZXkpICYmICFfX3dlYnBhY2tfcmVxdWlyZV9fLm8oZXhwb3J0cywga2V5KSkge1xuXHRcdFx0T2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIGtleSwgeyBlbnVtZXJhYmxlOiB0cnVlLCBnZXQ6IGRlZmluaXRpb25ba2V5XSB9KTtcblx0XHR9XG5cdH1cbn07IiwiX193ZWJwYWNrX3JlcXVpcmVfXy5vID0gKG9iaiwgcHJvcCkgPT4gT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iaiwgcHJvcCkiXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("source-map-support"),require("node-fetch")):"function"==typeof define&&define.amd?define(["source-map-support","node-fetch"],e):"object"==typeof exports?exports["wstrade-api"]=e(require("source-map-support"),require("node-fetch")):t["wstrade-api"]=e(t._,t._)}(global,(function(t,e){return(()=>{var r={228:t=>{t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r{t.exports=function(t){if(Array.isArray(t))return t}},646:(t,e,r)=>{var n=r(228);t.exports=function(t){if(Array.isArray(t))return n(t)}},926:t=>{function e(t,e,r,n,o,a,s){try{var i=t[a](s),c=i.value}catch(t){return void r(t)}i.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise((function(o,a){var s=t.apply(r,n);function i(t){e(s,o,a,i,c,"next",t)}function c(t){e(s,o,a,i,c,"throw",t)}i(void 0)}))}}},575:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},913:t=>{function e(t,e){for(var r=0;r{t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},860:t=>{t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},884:t=>{t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,a=void 0;try{for(var s,i=t[Symbol.iterator]();!(n=(s=i.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return r}}},521:t=>{t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},206:t=>{t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},38:(t,e,r)=>{var n=r(858),o=r(884),a=r(379),s=r(521);t.exports=function(t,e){return n(t)||o(t,e)||a(t,e)||s()}},319:(t,e,r)=>{var n=r(646),o=r(860),a=r(379),s=r(206);t.exports=function(t){return n(t)||o(t)||a(t)||s()}},379:(t,e,r)=>{var n=r(228);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},757:(t,e,r)=>{t.exports=r(666)},391:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var n=r(757),o=r.n(n),a=r(926),s=r.n(a),i=r(726),c=r(811);const u={all:(w=s()(o().mark((function t(){var e;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,c.Z)(i.Z.ACCOUNT_IDS,{});case 2:return e=t.sent,t.abrupt("return",{tfsa:e.find((function(t){return t.startsWith("tfsa")})),rrsp:e.find((function(t){return t.startsWith("rrsp")})),crypto:e.find((function(t){return t.startsWith("non-registered-crypto")})),personal:e.find((function(t){return t.startsWith("non-registered")&&!t.startsWith("non-registered-crypto")}))});case 4:case"end":return t.stop()}}),t)}))),function(){return w.apply(this,arguments)}),data:(m=s()(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.LIST_ACCOUNT,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return m.apply(this,arguments)}),me:(v=s()(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.ME,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return v.apply(this,arguments)}),person:(y=s()(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.PERSON,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return y.apply(this,arguments)}),history:(d=s()(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.HISTORY_ACCOUNT,{interval:e,accountId:r}));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return d.apply(this,arguments)}),activities:(h=s()(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.ACTIVITIES,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return h.apply(this,arguments)}),getBankAccounts:(l=s()(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.BANK_ACCOUNTS,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return l.apply(this,arguments)}),deposits:(f=s()(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.DEPOSITS,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return f.apply(this,arguments)}),positions:(p=s()(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.Z)(i.Z.POSITIONS,{accountId:e}));case 1:case"end":return t.stop()}}),t)}))),function(t){return p.apply(this,arguments)})};var p,f,l,h,d,y,v,m,w},726:(t,e,r)=>{"use strict";r.d(e,{p:()=>x,Z:()=>g});var n,o,a,s,i,c,u,p,f,l,h,d,y=r(757),v=r.n(y),m=r(926),w=r.n(m),x=20,b={onFailure:(o=w()(v().mark((function t(e){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=e.status,t.t1=e.statusText,t.next=4,e.json();case 4:return t.t2=t.sent,t.abrupt("return",{status:t.t0,reason:t.t1,body:t.t2});case 6:case"end":return t.stop()}}),t)}))),function(t){return o.apply(this,arguments)}),onSuccess:(n=w()(v().mark((function t(e){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.json());case 1:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)})};const g={LOGIN:{method:"POST",url:"https://trade-service.wealthsimple.com/auth/login",onSuccess:(d=w()(v().mark((function t(e){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0={access:e.headers.get("x-access-token"),refresh:e.headers.get("x-refresh-token"),expires:parseInt(e.headers.get("x-access-token-expires"),10)},t.next=3,e.json();case 3:return t.t1=t.sent,t.abrupt("return",{tokens:t.t0,accountInfo:t.t1});case 5:case"end":return t.stop()}}),t)}))),function(t){return d.apply(this,arguments)}),onFailure:b.onFailure},REFRESH:{method:"POST",url:"https://trade-service.wealthsimple.com/auth/refresh",onSuccess:(h=w()(v().mark((function t(e){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{tokens:{access:e.headers.get("x-access-token"),refresh:e.headers.get("x-refresh-token"),expires:parseInt(e.headers.get("x-access-token-expires"),10)}});case 1:case"end":return t.stop()}}),t)}))),function(t){return h.apply(this,arguments)}),onFailure:b.onFailure},ACCOUNT_IDS:{method:"GET",url:"https://trade-service.wealthsimple.com/account/list",onSuccess:(l=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",r.results.map((function(t){return t.id})));case 4:case"end":return t.stop()}}),t)}))),function(t){return l.apply(this,arguments)}),onFailure:b.onFailure},LIST_ACCOUNT:{method:"GET",url:"https://trade-service.wealthsimple.com/account/list",onSuccess:(f=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",r.results);case 4:case"end":return t.stop()}}),t)}))),function(t){return f.apply(this,arguments)}),onFailure:b.onFailure},ME:{method:"GET",url:"https://trade-service.wealthsimple.com/me",onSuccess:b.onSuccess,onFailure:b.onFailure},PERSON:{method:"GET",url:"https://trade-service.wealthsimple.com/person",onSuccess:b.onSuccess,onFailure:b.onFailure},HISTORY_ACCOUNT:{method:"GET",url:"https://trade-service.wealthsimple.com/account/history/{0}?account_id={1}",parameters:{0:"interval",1:"accountId"},onSuccess:b.onSuccess,onFailure:b.onFailure},ACTIVITIES:{method:"GET",url:"https://trade-service.wealthsimple.com/account/activities",onSuccess:(p=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",r.results);case 4:case"end":return t.stop()}}),t)}))),function(t){return p.apply(this,arguments)}),onFailure:b.onFailure},DEPOSITS:{method:"GET",url:"https://trade-service.wealthsimple.com/deposits",onSuccess:(u=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",r.results);case 4:case"end":return t.stop()}}),t)}))),function(t){return u.apply(this,arguments)}),onFailure:b.onFailure},BANK_ACCOUNTS:{method:"GET",url:"https://trade-service.wealthsimple.com/bank-accounts",onSuccess:(c=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",r.results);case 4:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),onFailure:b.onFailure},EXCHANGE_RATES:{method:"GET",url:"https://trade-service.wealthsimple.com/forex",onSuccess:b.onSuccess,onFailure:b.onFailure},SECURITY:{method:"GET",url:"https://trade-service.wealthsimple.com/securities?query={0}",parameters:{0:"ticker"},onSuccess:(i=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:if(0!==(r=t.sent).results.length){t.next=5;break}throw new Error("Security does not exist");case 5:return t.abrupt("return",r.results);case 6:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)}),onFailure:b.onFailure},EXTENSIVE_SECURITY_DETAILS:{method:"GET",url:"https://trade-service.wealthsimple.com/securities/{0}",parameters:{0:"id"},onSuccess:b.onSuccess,onFailure:b.onFailure},POSITIONS:{method:"GET",url:"https://trade-service.wealthsimple.com/account/positions?account_id={0}",parameters:{0:"accountId"},onSuccess:(s=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",r.results);case 4:case"end":return t.stop()}}),t)}))),function(t){return s.apply(this,arguments)}),onFailure:b.onFailure},ORDERS_BY_PAGE:{method:"GET",url:"https://trade-service.wealthsimple.com/orders?offset={0}&account_id={1}",parameters:{0:"offset",1:"accountId"},onSuccess:(a=w()(v().mark((function t(e){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.json();case 2:return r=t.sent,t.abrupt("return",{total:r.total,orders:r.results});case 4:case"end":return t.stop()}}),t)}))),function(t){return a.apply(this,arguments)}),onFailure:b.onFailure},CANCEL_ORDER:{method:"DELETE",url:"https://trade-service.wealthsimple.com/orders/{0}",parameters:{0:"orderId"},onSuccess:b.onSuccess,onFailure:b.onFailure},PLACE_ORDER:{method:"POST",url:"https://trade-service.wealthsimple.com/orders",onSuccess:b.onSuccess,onFailure:b.onFailure}}},464:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var n=r(757),o=r.n(n),a=r(926),s=r.n(a),i=r(811),c=r(726);const u={tokens:null,otp:null,on:function(t,e){this[t]=e},login:function(t,e){var r=this;return s()(o().mark((function n(){var a;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=null,"function"!=typeof r.otp){n.next=4;break}return n.next=4,(0,i.Z)(c.Z.LOGIN,{email:t,password:e}).catch((function(){}));case 4:if(n.prev=4,n.t0=i.Z,n.t1=c.Z.LOGIN,n.t2=t,n.t3=e,"function"!=typeof r.otp){n.next=15;break}return n.next=12,r.otp();case 12:n.t4=n.sent,n.next=16;break;case 15:n.t4=r.otp;case 16:return n.t5=n.t4,n.t6={email:n.t2,password:n.t3,otp:n.t5},n.next=20,(0,n.t0)(n.t1,n.t6);case 20:a=n.sent,n.next=28;break;case 23:if(n.prev=23,n.t7=n.catch(4),r.otp){n.next=27;break}throw new Error("OTP not provided!");case 27:throw n.t7;case 28:r.tokens=a.tokens;case 29:case"end":return n.stop()}}),n,null,[[4,23]])})))()},refresh:function(){var t=this;return s()(o().mark((function e(){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.tokens.access=null,e.next=3,(0,i.Z)(c.Z.REFRESH,{refresh_token:t.tokens.refresh});case 3:r=e.sent,t.tokens=r.tokens;case 5:case"end":return e.stop()}}),e)})))()}}},500:(t,e,r)=>{"use strict";r.d(e,{e:()=>o,Z:()=>a});var n=["securities_cache"],o=function(t){return!n.includes(t)};function a(t){if(null!=t&&t.startsWith("no_")){var e=t.substring(t.indexOf("_")+1);o(e)&&n.push(e)}else o(t)||n.splice(n.indexOf(t),1)}},657:(t,e,r)=>{"use strict";r.d(e,{Z:()=>p});var n=r(38),o=r.n(n),a=r(575),s=r.n(a),i=r(913),c=r.n(i),u=["NASDAQ","NYSE","TSX","TSX-V","NEO","CC"];const p=function(){function t(e){var r;if(s()(this,t),this.symbol=null,this.exchange=null,this.id=null,this.crypto=!1,"string"==typeof e){if(""===e)throw new Error("Empty ticker");var n=e.split(":"),a=o()(n,2);this.symbol=a[0],this.exchange=a[1]}else{if(!e.symbol&&!e.id)throw new Error("Invalid ticker '".concat(e,"'"));this.symbol=e.symbol||null,this.exchange=e.exchange||null,this.id=e.id||null}if(this.exchange&&!u.includes(this.exchange))throw new Error("Invalid exchange '".concat(this.exchange,"'!"));("CC"===this.exchange||null!==(r=this.id)&&void 0!==r&&r.startsWith("sec-z"))&&(this.crypto=!0),"NEO"===this.exchange&&(this.exchange="AEQUITAS NEO EXCHANGE")}return c()(t,[{key:"format",value:function(){return this.id?this.id:"AEQUITAS NEO EXCHANGE"===this.exchange?"".concat(this.symbol,":NEO"):"".concat(this.symbol).concat(this.exchange?":".concat(this.exchange):"")}},{key:"weakEquals",value:function(t){return!(!this.id||this.id!==t.id)||!(!this.symbol||this.symbol!==t.symbol||this.crypto!==t.crypto)}}]),t}()},752:(t,e,r)=>{"use strict";r.d(e,{Z:()=>x});var n=r(38),o=r.n(n),a=r(757),s=r.n(a),i=r(926),c=r.n(i),u=r(726),p=r(811),f=r(657),l=r(500),h=r(575),d=r.n(h),y=r(913),v=r.n(y),m=new(function(){function t(e){d()(this,t),this.cache=new Map,this.size=e}return v()(t,[{key:"insert",value:function(t,e){this.cache.size>=this.size&&this.cache.delete(this.cache.keys().next().value),this.cache.set(t,e)}},{key:"get",value:function(t){return this.cache.get(t)}}]),t}())(10);const w=function(t){var e=m.get(new f.Z(t).format());return void 0===e?null:e},x={exchangeRates:(g=c()(s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,p.Z)(u.Z.EXCHANGE_RATES,{}));case 1:case"end":return t.stop()}}),t)}))),function(){return g.apply(this,arguments)}),getSecurity:(b=c()(s().mark((function t(e,r){var n,a,i,c;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=null,a=new f.Z(e),r||!(0,l.e)("securities_cache")){t.next=6;break}if(!(n=w(a))){t.next=6;break}return t.abrupt("return",n);case 6:if(!a.id){t.next=12;break}return t.next=9,(0,p.Z)(u.Z.EXTENSIVE_SECURITY_DETAILS,{id:a.id});case 9:n=t.sent,t.next=28;break;case 12:return t.next=14,(0,p.Z)(u.Z.SECURITY,{ticker:a.symbol});case 14:if(n=(n=t.sent).filter((function(t){return t.stock.symbol===a.symbol})),a.crypto?n=n.filter((function(t){return"cryptocurrency"===t.security_type})):a.exchange&&(n=n.filter((function(t){return t.stock.primary_exchange===a.exchange}))),!(n.length>1)){t.next=19;break}throw new Error("Multiple securities matched query.");case 19:if(0!==n.length){t.next=21;break}throw new Error("No securities matched query.");case 21:if(i=n,c=o()(i,1),n=c[0],!r){t.next=28;break}return t.next=27,(0,p.Z)(u.Z.EXTENSIVE_SECURITY_DETAILS,{id:n.id});case 27:n=t.sent;case 28:return(0,l.e)("securities_cache")&&null===w(a)&&(s=a,h=n,m.insert(new f.Z(s).format(),h)),t.abrupt("return",n);case 30:case"end":return t.stop()}var s,h}),t)}))),function(t,e){return b.apply(this,arguments)})};var b,g},568:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(319),o=r.n(n),a=new(r(545).Headers);const s={add:function(t,e){return a.append(t,e)},remove:function(t){return a.delete(t)},clear:function(){return o()(a).forEach((function(t){return a.delete(t[0])}))},values:function(){return o()(a)}}},352:(t,e,r)=>{r(949).install();var n=r(464).Z,o=r(568).Z,a=r(391).Z,s=r(826).Z,i=r(752).Z,c=r(889).Z,u=r(500).Z;t.exports={auth:n,headers:o,accounts:a,orders:s,quotes:c,data:i,config:u}},811:(t,e,r)=>{"use strict";r.d(e,{Z:()=>S});var n=r(757),o=r.n(n),a=r(319),s=r.n(a),i=r(926),c=r.n(i),u=r(713),p=r.n(u),f=r(545),l=r.n(f),h=r(568),d=r(464),y=r(500);const v=function(){return parseInt(Date.now()/1e3,10)};function m(){return w.apply(this,arguments)}function w(){return(w=c()(o().mark((function t(){var e,r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(v()>=(null===(e=d.Z.tokens)||void 0===e?void 0:e.expires))){t.next=13;break}if(null===(r=d.Z.tokens)||void 0===r||!r.refresh){t.next=12;break}return t.prev=2,t.next=5,d.Z.refresh();case 5:t.next=10;break;case 7:throw t.prev=7,t.t0=t.catch(2),new Error("Unable to refresh expired token: ".concat(t.t0));case 10:t.next=13;break;case 12:throw new Error("Access token expired");case 13:case"end":return t.stop()}}),t,null,[[2,7]])})))).apply(this,arguments)}function x(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var b=200,g=201;function k(t,e){var r=function(t){for(var e=1;e{"use strict";r.d(e,{Z:()=>R});var n=r(713),o=r.n(n),a=r(319),s=r.n(a),i=r(757),c=r.n(i),u=r(926),p=r.n(u),f=r(726),l=r(811),h=r(657);function d(t,e){return y.apply(this,arguments)}function y(){return(y=p()(c().mark((function t(e,r){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,l.Z)(f.Z.ORDERS_BY_PAGE,{offset:(r-1)*f.p,accountId:e}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(t){return m.apply(this,arguments)}function m(){return(m=p()(c().mark((function t(e){var r,n,o,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d(e,1);case 2:if(r=t.sent,!((n=Math.ceil(r.total/f.p))>1)){t.next=12;break}for(o=[],a=2;a<=n;a++)o.push(d(e,a).then((function(t){return t.orders})));return t.next=9,Promise.all(o);case 9:t.sent.forEach((function(t){var e;return(e=r.orders).push.apply(e,s()(t))})),r.total=r.orders.length;case 12:return t.abrupt("return",r);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function w(t,e,r){return x.apply(this,arguments)}function x(){return(x=p()(c().mark((function t(e,r,n){var o,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v(e);case 2:return o=t.sent,a=function(t){if(r){var e=new h.Z({symbol:t.symbol,id:t.security_id});if(!new h.Z(r).weakEquals(e))return!1}return t.status===n},o.orders=o.orders.filter(a),o.total=o.orders.length,t.abrupt("return",o);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}const b={page:d,all:v,pending:(E=p()(c().mark((function t(e,r){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",w(e,r,"submitted"));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return E.apply(this,arguments)}),filled:(k=p()(c().mark((function t(e,r){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",w(e,r,"posted"));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return k.apply(this,arguments)}),cancelled:(g=p()(c().mark((function t(e,r){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",w(e,r,"cancelled"));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return g.apply(this,arguments)})};var g,k,E,_=r(752),S=r(889),O=function(t){return["TSX","TSX-V"].includes(t)};const Z={cancel:(C=p()(c().mark((function t(e){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=e,t.next=3,(0,l.Z)(f.Z.CANCEL_ORDER,{orderId:e});case 3:return t.t1=t.sent,t.abrupt("return",{order:t.t0,response:t.t1});case 5:case"end":return t.stop()}}),t)}))),function(t){return C.apply(this,arguments)}),cancelPending:function(t){var e=this;return p()(c().mark((function r(){var n;return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,b.pending(t);case 2:return n=r.sent,r.abrupt("return",Promise.all(n.orders.map(function(){var t=p()(c().mark((function t(r){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.cancel(r.order_id));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())));case 4:case"end":return r.stop()}}),r)})))()},marketBuy:(L=p()(c().mark((function t(e,r,n){var o;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,_.Z.getSecurity(r);case 2:if(o=t.sent,t.t0=l.Z,t.t1=f.Z.PLACE_ORDER,t.t2=o.id,new h.Z(r).crypto){t.next=12;break}return t.next=9,S.Z.get(r);case 9:t.t3=t.sent,t.next=13;break;case 12:t.t3=void 0;case 13:return t.t4=t.t3,t.t5=n,t.t6=e,t.t7={security_id:t.t2,limit_price:t.t4,quantity:t.t5,order_type:"buy_quantity",order_sub_type:"market",time_in_force:"day",account_id:t.t6},t.abrupt("return",(0,t.t0)(t.t1,t.t7));case 18:case"end":return t.stop()}}),t)}))),function(t,e,r){return L.apply(this,arguments)}),limitBuy:(P=p()(c().mark((function t(e,r,n,o){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=l.Z,t.t1=f.Z.PLACE_ORDER,t.next=4,_.Z.getSecurity(r);case 4:return t.t2=t.sent.id,t.t3=n,t.t4=o,t.t5=e,t.t6={security_id:t.t2,limit_price:t.t3,quantity:t.t4,order_type:"buy_quantity",order_sub_type:"limit",time_in_force:"day",account_id:t.t5},t.abrupt("return",(0,t.t0)(t.t1,t.t6));case 10:case"end":return t.stop()}}),t)}))),function(t,e,r,n){return P.apply(this,arguments)}),stopLimitBuy:(A=p()(c().mark((function t(e,r,n,o,a){var s;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,_.Z.getSecurity(r);case 2:if(s=t.sent,!O(s.stock.primary_exchange)||n===o){t.next=5;break}throw new Error("TSX/TSX-V securities must have an equivalent stop and limit price.");case 5:return t.abrupt("return",(0,l.Z)(f.Z.PLACE_ORDER,{security_id:s.id,stop_price:n,limit_price:o,quantity:a,order_type:"buy_quantity",order_sub_type:"stop_limit",time_in_force:"day",account_id:e}));case 6:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o){return A.apply(this,arguments)}),marketSell:(I=p()(c().mark((function t(e,r,n){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=l.Z,t.t1=f.Z.PLACE_ORDER,t.next=4,_.Z.getSecurity(r);case 4:if(t.t2=t.sent.id,new h.Z(r).crypto){t.next=11;break}return t.next=8,S.Z.get(r);case 8:t.t3=t.sent,t.next=12;break;case 11:t.t3=void 0;case 12:return t.t4=t.t3,t.t5=n,t.t6=e,t.t7={security_id:t.t2,market_value:t.t4,quantity:t.t5,order_type:"sell_quantity",order_sub_type:"market",time_in_force:"day",account_id:t.t6},t.abrupt("return",(0,t.t0)(t.t1,t.t7));case 17:case"end":return t.stop()}}),t)}))),function(t,e,r){return I.apply(this,arguments)}),limitSell:(j=p()(c().mark((function t(e,r,n,o){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=l.Z,t.t1=f.Z.PLACE_ORDER,t.next=4,_.Z.getSecurity(r);case 4:return t.t2=t.sent.id,t.t3=n,t.t4=o,t.t5=e,t.t6={security_id:t.t2,limit_price:t.t3,quantity:t.t4,order_type:"sell_quantity",order_sub_type:"limit",time_in_force:"day",account_id:t.t5},t.abrupt("return",(0,t.t0)(t.t1,t.t6));case 10:case"end":return t.stop()}}),t)}))),function(t,e,r,n){return j.apply(this,arguments)}),stopLimitSell:(T=p()(c().mark((function t(e,r,n,o,a){var s;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,_.Z.getSecurity(r);case 2:if(s=t.sent,!O(s.stock.primary_exchange)||n===o){t.next=5;break}throw new Error("TSX/TSX-V securities must have an equivalent stop and limit price.");case 5:return t.abrupt("return",(0,l.Z)(f.Z.PLACE_ORDER,{security_id:s.id,stop_price:n,limit_price:o,quantity:a,order_type:"sell_quantity",order_sub_type:"stop_limit",time_in_force:"day",account_id:e}));case 6:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o){return T.apply(this,arguments)})};var T,j,I,A,P,L,C;function F(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function N(t){for(var e=1;e{"use strict";r.d(e,{Z:()=>f});var n=r(757),o=r.n(n),a=r(926),s=r.n(a),i=r(752);const c={quote:(u=s()(o().mark((function t(e){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.Z.getSecurity(e,!0);case 2:return r=t.sent,t.abrupt("return",r.quote.amount);case 4:case"end":return t.stop()}}),t)}))),function(t){return u.apply(this,arguments)})};var u,p=r(657);const f={defaultProvider:c,providers:{},use:function(t,e){if("function"!=typeof e.quote)throw new Error("Invalid quote provider for ".concat(t,"!"));this.providers[t]=e},get:function(t){var e=this;return s()(o().mark((function r(){var n,a,s;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=null,!(a=new p.Z(t)).exchange){r.next=6;break}n=a.exchange,r.next=15;break;case 6:if(!a.crypto||!a.id){r.next=10;break}n="CC",r.next=15;break;case 10:if(!(Object.keys(e.providers).length>0)){r.next=15;break}return r.next=13,i.Z.getSecurity(a,!1);case 13:s=r.sent,n=s.stock.primary_exchange;case 15:if(!(n in e.providers)){r.next=17;break}return r.abrupt("return",e.providers[n].quote(a));case 17:return r.abrupt("return",e.defaultProvider.quote(a));case 18:case"end":return r.stop()}}),r)})))()}}},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",i=o.toStringTag||"@@toStringTag";function c(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),s=new Z(n||[]);return a._invoke=function(t,e,r){var n=p;return function(o,a){if(n===l)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw a;return j()}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var i=_(s,r);if(i){if(i===d)continue;return i}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=l;var c=u(t,e,r);if("normal"===c.type){if(n=r.done?h:f,c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=h,r.method="throw",r.arg=c.arg)}}}(t,r,s),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var p="suspendedStart",f="suspendedYield",l="executing",h="completed",d={};function y(){}function v(){}function m(){}var w={};w[a]=function(){return this};var x=Object.getPrototypeOf,b=x&&x(x(T([])));b&&b!==r&&n.call(b,a)&&(w=b);var g=m.prototype=y.prototype=Object.create(w);function k(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function E(t,e){function r(o,a,s,i){var c=u(t[o],t,a);if("throw"!==c.type){var p=c.arg,f=p.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,i)}),(function(t){r("throw",t,s,i)})):e.resolve(f).then((function(t){p.value=t,s(p)}),(function(t){return r("throw",t,s,i)}))}i(c.arg)}var o;this._invoke=function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}}function _(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=u(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Z(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function r(){for(;++o=0;--a){var s=this.tryEntries[a],i=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),u=n.call(s,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},545:t=>{"use strict";t.exports=e},949:e=>{"use strict";e.exports=t}},n={};function o(t){if(n[t])return n[t].exports;var e=n[t]={exports:{}};return r[t](e,e.exports,o),e.exports}return o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o(352)})()})); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93c3RyYWRlLWFwaS93ZWJwYWNrL3VuaXZlcnNhbE1vZHVsZURlZmluaXRpb24iLCJ3ZWJwYWNrOi8vd3N0cmFkZS1hcGkvLi9ub2RlX21v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9IGNvbnRleHQuX3NlbnQgPSBjb250ZXh0LmFyZztcblxuICAgICAgICB9IGVsc2UgaWYgKGNvbnRleHQubWV0aG9kID09PSBcInRocm93XCIpIHtcbiAgICAgICAgICBpZiAoc3RhdGUgPT09IEdlblN0YXRlU3VzcGVuZGVkU3RhcnQpIHtcbiAgICAgICAgICAgIHN0YXRlID0gR2VuU3RhdGVDb21wbGV0ZWQ7XG4gICAgICAgICAgICB0aHJvdyBjb250ZXh0LmFyZztcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb250ZXh0LmRpc3BhdGNoRXhjZXB0aW9uKGNvbnRleHQuYXJnKTtcblxuICAgICAgICB9IGVsc2UgaWYgKGNvbnRleHQubWV0aG9kID09PSBcInJldHVyblwiKSB7XG4gICAgICAgICAgY29udGV4dC5hYnJ1cHQoXCJyZXR1cm5cIiwgY29udGV4dC5hcmcpO1xuICAgICAgICB9XG5cbiAgICAgICAgc3RhdGUgPSBHZW5TdGF0ZUV4ZWN1dGluZztcblxuICAgICAgICB2YXIgcmVjb3JkID0gdHJ5Q2F0Y2goaW5uZXJGbiwgc2VsZiwgY29udGV4dCk7XG4gICAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIikge1xuICAgICAgICAgIC8vIElmIGFuIGV4Y2VwdGlvbiBpcyB0aHJvd24gZnJvbSBpbm5lckZuLCB3ZSBsZWF2ZSBzdGF0ZSA9PT1cbiAgICAgICAgICAvLyBHZW5TdGF0ZUV4ZWN1dGluZyBhbmQgbG9vcCBiYWNrIGZvciBhbm90aGVyIGludm9jYXRpb24uXG4gICAgICAgICAgc3RhdGUgPSBjb250ZXh0LmRvbmVcbiAgICAgICAgICAgID8gR2VuU3RhdGVDb21wbGV0ZWRcbiAgICAgICAgICAgIDogR2VuU3RhdGVTdXNwZW5kZWRZaWVsZDtcblxuICAgICAgICAgIGlmIChyZWNvcmQuYXJnID09PSBDb250aW51ZVNlbnRpbmVsKSB7XG4gICAgICAgICAgICBjb250a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luZWw7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29udGV4dC5tZXRob2QgPSBcInRocm93XCI7XG4gICAgICAgIGNvbnRleHQuYXJnID0gbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICBcIlRoZSBpdGVyYXRvciBkb2VzIG5vdCBwcm92aWRlIGEgJ3Rocm93JyBtZXRob2RcIik7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgIH1cblxuICAgIHZhciByZWNvcmQgPSB0cnlDYXRjaChtZXRob2QsIGRlbGVnYXRlLml0ZXJhdG9yLCBjb250ZXh0LmFyZyk7XG5cbiAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgY29udGV4dC5tZXRob2QgPSBcInRocm93XCI7XG4gICAgICBjb250ZXh0LmFyZyA9IHJlY29yZC5hcmc7XG4gICAgICBjb250ZXh0LmRlbGVnYXRlID0gbnVsbDtcbiAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgIH1cblxuICAgIHZhciBpbmZvID0gcmVjb3JkLmFyZztcblxuICAgIGlmICghIGluZm8pIHtcbiAgICAgIGNvbnRleHQubWV0aG9kID0gXCJ0aHJvd1wiO1xuICAgICAgY29udGV4dC5hcmcgPSBuZXcgVHlwZUVycm9yKFwiaXRlcmF0b3IgcmVzdWx0IGlzIG5vdCBhbiBvYmplY3RcIik7XG4gICAgICBjb250ZXh0LmRlbGVnYXRlID0gbnVsbDtcbiAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgIH1cblxuICAgIGlmIChpbmZvLmRvbmUpIHtcbiAgICAgIC8vIEFzc2lnbiB0aGUgcmVzdWx0IG9mIHRoZSBmaW5pc2hlZCBkZWxlZ2F0ZSB0byB0aGUgdGVtcG9yYXJ5XG4gICAgICAvLyB2YXJpYWJsZSBzcGVjaWZpZWQgYnkgZGVsZWdhdGUucmVzdWx0TmFtZSA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h0O1xuICAgIH07XG4gIH07XG5cbiAgZnVuY3Rpb24gdmFsdWVzKGl0ZXJhYmxlKSB7XG4gICAgaWYgKGl0ZXJhYmxlKSB7XG4gICAgICB2YXIgaXRlcmF0b3JNZXRob2QgPSBpdGVyYWJsZVtpdGVyYXRvclN5bWJvbF07XG4gICAgICBpZiAoaXRlcmF0b3JNZXRob2QpIHtcbiAgICAgICAgcmV0dXJuIGl0ZXJhdG9yTWV0aG9kLmNhbGwoaXRlcmFibGUpO1xuICAgICAgfVxuXG4gICAgICBpZiAodHlwZW9mIGl0ZXJhYmxlLm5leHQgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICByZXR1cm4gaXRlcmFibGU7XG4gICAgICB9XG5cbiAgICAgIGlmICghaXNOYU4oaXRlcmFibGUubGVuZ3RoKSkge1xuICAgICAgICB2YXIgaSA9IC0xLCBuZXh0ID0gZnVuY3Rpb24gbmV4dCgpIHtcbiAgICAgICAgICB3aGlsZSAoKytpIDwgaXRlcmFibGUubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoaGFzT3duLmNhbGwoaXRlcmFibGUsIGkpKSB7XG4gICAgICAgICAgICAgIG5leHQudmFsdWUgPSBpdGVyYWJsZVtpXTtcbiAgICAgICAgICAgICAgbmV4dC5kb25lID0gZmFsc2U7XG4gICAgICAgICAgICAgIHJldHVybiBuZXh0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIG5leHQudmFsdWUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgbmV4dC5kb25lID0gdHJ1ZTtcblxuICAgICAgICAgIHJldHVybiBuZXh0O1xuICAgICAgICB9O1xuXG4gICAgICAgIHJldHVybiBuZXh0Lm5leHQgPSBuZXh0O1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIFJldHVybiBhbiBpdGVyYXRvciB3aXRoIG5vIHZhbHVlcy5cbiAgICByZXR1cm4geyBuZXh0OiBkb25lUmVzdWx0IH07XG4gIH1cbiAg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gICAgIHJldHVybiBoYW5kbGUoZW50cnkuZmluYWxseUxvYyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2UgaWYgKGhhc0NhdGNoKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuY2F0Y2hMb2MpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShlbnRyeS5jYXRjaExvYywgdHJ1ZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2UgaWYgKGhhc0ZpbmFsbHkpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuZmluYWxseUxvYyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwidHJ5IHN0YXRlbWVudCB3aXRob3V0IGNhdGNoIG9yIGZpbmFsbHlcIik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIGFicnVwdDogZnVuY3Rpb24odHlwZSwgYXJnKSB7XG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBlbnRyeSA9IHRoaXMudHJ5RW50cmllc1tpXTtcbiAgICAgICAgaWYgKGVudHJ5LnRyeUxvYyA8PSB0aGlzLnByZXYgJiZcbiAgICAgICAgICAgIGhhc093bi5jYWxsKGVudHJ5LCBcImZpbmFsbHlMb2NcIikgJiZcbiAgICAgICAgICAgIHRoaXMucHJldiA8IGVudHJ5LmZpbmFsbHlMb2MpIHtcbiAgICAgICAgICB2YXIgZmluYWxseUVudHJ5ID0gZW50cnk7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKGZpbmFsbHlFbnRyeSAmJlxuICAgICAgICAgICh0eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICAgdHlwZSA9PT0gXCJjb250aW51ZVwiKSAmJlxuICAgICAgICAgIGZpbmFsbHlFbnRyeS50cnlMb2MgPD0gYXJnICYmXG4gICAgICAgICAgYXJnIDw9IGZpbmFsbHlFbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgIC8vIElnbm9yZSB0aGUgZmluYWxseSBlbnRyeSBpZiBjb250cm9sIGlzIG5vdCBqdW1waW5nIHRvIGFcbiAgICAgICAgLy8gbG9jYXRpb24gb3V0c2lkZSB0aGUgdHJ5L2NhdGNoIGJsb2NrLlxuICAgICAgICBmaW5hbGx5RW50cnkgPSBudWxsO1xuICAgICAgfVxuXG4gICAgICB2YXIgcmVjb3JkID0gZmluYWxseUVudHJ5ID8gZmluYWxseUVudHJ5LmNvbXBsZXRpb24gOiB7fTtcbiAgICAgIHJlY29yZC50eXBlID0gdHlwZTtcbiAgICAgIHJlY29yZC5hcmcgPSBhcmc7XG5cbiAgICAgIGlmIChmaW5hbGx5RW50cnkpIHtcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcIm5leHRcIjtcbiAgICAgICAgdGhpcy5uZXh0ID0gZmluYWxseUVudHJ5LmZpbmFsbHlMb2M7XG4gICAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gdGhpcy5jb21wbGV0ZShyZWNvcmQpO1xuICAgIH0sXG5cbiAgICBjb21wbGV0ZTogZnVuY3Rpb24ocmVjb3JkLCBhZnRlckxvYykge1xuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgdGhyb3cgcmVjb3JkLmFyZztcbiAgICAgIH1cblxuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICByZWNvcmQudHlwZSA9PT0gXCJjb250aW51ZVwiKSB7XG4gICAgICAgIHRoaXMubmV4dCA9IHJlY29yZC5hcmc7XG4gICAgICB9IGVsc2UgaWYgKHJlY29yZC50eXBlID09PSBcInJldHVyblwiKSB7XG4gICAgICAgIHRoaXMucnZhbCA9IHRoaXMuYXJnID0gcmVjb3JkLmFyZztcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcInJldHVyblwiO1xuICAgICAgICB0aGlzLm5leHQgPSBcImVuZFwiO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIiAmJiBhZnRlckxvYykge1xuICAgICAgICB0aGlzLm5leHQgPSBhZnRlckxvYztcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgfSxcblxuICAgIGZpbmlzaDogZnVuY3Rpb24oZmluYWxseUxvYykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS5maW5hbGx5TG9jID09PSBmaW5hbGx5TG9jKSB7XG4gICAgICAgICAgdGhpcy5jb21wbGV0ZShlbnRyeS5jb21wbGV0aW9uLCBlbnRyeS5hZnRlckxvYyk7XG4gICAgICAgICAgcmVzZXRUcnlFbnRyeShlbnRyeSk7XG4gICAgICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuXG4gICAgXCJjYXRjaFwiOiBmdW5jdGlvbih0cnlMb2MpIHtcbiAgICAgIGZvciAodmFyIGkgPSB0aGlzLnRyeUVudHJpZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIHtcbiAgICAgICAgdmFyIGVudHJ5ID0gdGhpcy50cnlFbnRyaWVzW2ldO1xuICAgICAgICBpZiAoZW50cnkudHJ5TG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iBfX3dlYnBhY2tfcmVxdWlyZV9fKDM1Mik7XG4iLCIvLyBnZXREZWZhdWx0RXhwb3J0IGZ1bmN0aW9uIGZvciBjb21wYXRpYmlsaXR5IHdpdGggbm9uLWhhcm1vbnkgbW9kdWxlc1xuX193ZWJwYWNrX3JlcXVpcmVfXy5uID0gKG1vZHVsZSkgPT4ge1xuXHR2YXIgZ2V0dGVyID0gbW9kdWxlICYmIG1vZHVsZS5fX2VzTW9kdWxlID9cblx0XHQoKSA9PiBtb2R1bGVbJ2RlZmF1bHQnXSA6XG5cdFx0KCkgPT4gbW9kdWxlO1xuXHRfX3dlYnBhY2tfcmVxdWlyZV9fLmQoZ2V0dGVyLCB7IGE6IGdldHRlciB9KTtcblx0cmV0dXJuIGdldHRlcjtcbn07IiwiLy8gZGVmaW5lIGdldHRlciBmdW5jdGlvbnMgZm9yIGhhcm1vbnkgZXhwb3J0c1xuX193ZWJwYWNrX3JlcXVpcmVfXy5kID0gKGV4cG9ydHMsIGRlZmluaXRpb24pID0+IHtcblx0Zm9yKHZhciBrZXkgaW4gZGVmaW5pdGlvbikge1xuXHRcdGlmKF9fd2VicGFja19yZXF1aXJlX18ubyhkZWZpbml0aW9uLCBrZXkpICYmICFfX3dlYnBhY2tfcmVxdWlyZV9fLm8oZXhwb3J0cywga2V5KSkge1xuXHRcdFx0T2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIGtleSwgeyBlbnVtZXJhYmxlOiB0cnVlLCBnZXQ6IGRlZmluaXRpb25ba2V5XSB9KTtcblx0XHR9XG5cdH1cbn07IiwiX193ZWJwYWNrX3JlcXVpcmVfXy5vID0gKG9iaiwgcHJvcCkgPT4gT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iaiwgcHJvcCkiXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file diff --git a/docs/auth/README.md b/docs/auth/README.md index 7f9cabc..2477674 100644 --- a/docs/auth/README.md +++ b/docs/auth/README.md @@ -78,7 +78,7 @@ auth.login(email, password) -> Promise Attempts to login to the Wealthsimple Trade platform using the email and password combination. If the login was successful, `auth.tokens` will be populated with the retrieved OAuth2.0 tokens and access token expiry time. Otherwise, the return promise is rejected with the appropriate error. -An OTP provider must be configured beforehand with the auth.`on` API for the `otp` event. If the `otp` event was registered with a string literal, it is assumed that you have already obtained the OTP manually and it will be passed along as-is. Otherwise, if you specified a function handler, it is assumed that your handler will automatically retrieve the OTP after we attempt a login without an OTP. See examples for practical explanation. +An OTP provider must be configured beforehand with the auth.`on` API for the `otp` event. If the `otp` event was registered with a string literal, it is assumed that you have already obtained the OTP somehow and it will be passed along as-is. Otherwise, if you specified a function handler, it is assumed that your handler will automatically retrieve the OTP after we attempt a login without an OTP. Your OTP function should return the OTP code as a string literal. See examples for practical explanation. **Failure reasons** * Incorrect email/password combination diff --git a/index.d.ts b/index.d.ts index 962a2e1..1bd6303 100644 --- a/index.d.ts +++ b/index.d.ts @@ -8,7 +8,7 @@ declare namespace Trade { }; // Supported exchanges - type Exchange = 'NYSE' | 'NASDAQ' | 'TSX' | 'TSX-V' | 'NEO'; + type Exchange = 'NYSE' | 'NASDAQ' | 'TSX' | 'TSX-V' | 'NEO' | 'CC'; /** * A ticker may be provided to the API as a string or an object with diff --git a/package-lock.json b/package-lock.json index 5ed94c3..e39b073 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "wstrade-api", - "version": "1.3.0", + "version": "1.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -4596,11 +4596,6 @@ "sshpk": "^1.7.0" } }, - "http-status": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/http-status/-/http-status-1.4.2.tgz", - "integrity": "sha512-mBnIohUwRw9NyXMEMMv8/GANnzEYUj0Y8d3uL01zDWFkxUjYyZ6rgCaAI2zZ1Wb34Oqtbx/nFZolPRDc8Xlm5A==" - }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", diff --git a/package.json b/package.json index 981a7ad..ab45beb 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "wstrade-api", - "version": "1.3.0", + "version": "1.3.1", "description": "Wealthsimple Trade API Wrapper", "main": "dist.js", + "types": "index.d.ts", "scripts": { "bundle": "webpack", "lint": "npx eslint --fix src/ --ignore-pattern __test__", @@ -42,7 +43,6 @@ "webpack-cli": "^4.2.0" }, "dependencies": { - "http-status": "^1.4.2", "node-fetch": "^2.6.1", "source-map-support": "^0.5.19" } diff --git a/src/network/https.js b/src/network/https.js index d6af0de..5e87550 100644 --- a/src/network/https.js +++ b/src/network/https.js @@ -1,10 +1,11 @@ import fetch, { Headers } from 'node-fetch'; -import status from 'http-status'; import customHeaders from '../headers'; import auth from '../auth'; import { configEnabled } from '../config'; import implicitTokenRefresh from '../optional/implicit-token-refresh'; +const [HTTP_OK, HTTP_CREATED] = [200, 201]; + /* * Complete the URL by filling the parameter placeholders with the * data arguments. @@ -80,7 +81,7 @@ export default async function handleRequest(endpoint, data) { // Submit the HTTP request to the Wealthsimple Trade Servers const response = await talk(endpoint, data); - if ([status.OK, status.CREATED].includes(response.status)) { + if ([HTTP_OK, HTTP_CREATED].includes(response.status)) { return endpoint.onSuccess(response); } diff --git a/webpack.config.js b/webpack.config.js index bf0deea..266c667 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -19,12 +19,6 @@ module.exports = { amd: 'node-fetch', root: '_', }, - "http-status": { - commonjs: 'http-status', - commonjs2: 'http-status', - amd: 'http-status', - root: '_', - }, "source-map-support": { commonjs: 'source-map-support', commonjs2: 'source-map-support',