simple-fxtrade
Version:
A node js wrapper for the Oanda Rest v20 api to make things really simple
7 lines • 52.6 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fx=e():t.fx=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=29)}([function(t,e,n){"use strict";function r(t){return"[object Array]"===O.call(t)}function o(t){return"[object ArrayBuffer]"===O.call(t)}function i(t){return"undefined"!=typeof FormData&&t instanceof FormData}function s(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer}function u(t){return"string"==typeof t}function c(t){return"number"==typeof t}function a(t){return void 0===t}function f(t){return null!==t&&"object"===(void 0===t?"undefined":S(t))}function l(t){return"[object Date]"===O.call(t)}function p(t){return"[object File]"===O.call(t)}function d(t){return"[object Blob]"===O.call(t)}function h(t){return"[object Function]"===O.call(t)}function y(t){return f(t)&&h(t.pipe)}function v(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams}function m(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function b(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function g(t,e){if(null!==t&&void 0!==t)if("object"===(void 0===t?"undefined":S(t))||r(t)||(t=[t]),r(t))for(var n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}function w(){function t(t,n){"object"===S(e[n])&&"object"===(void 0===t?"undefined":S(t))?e[n]=w(e[n],t):e[n]=t}for(var e={},n=0,r=arguments.length;n<r;n++)g(arguments[n],t);return e}function x(t,e,n){return g(e,function(e,r){t[r]=n&&"function"==typeof e?j(e,n):e}),t}var S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j=n(10),E=n(32),O=Object.prototype.toString;t.exports={isArray:r,isArrayBuffer:o,isBuffer:E,isFormData:i,isArrayBufferView:s,isString:u,isNumber:c,isObject:f,isUndefined:a,isDate:l,isFile:p,isBlob:d,isFunction:h,isStream:y,isURLSearchParams:v,isStandardBrowserEnv:b,forEach:g,merge:w,extend:x,trim:m}},function(t,e,n){"use strict";(function(){var t=[].indexOf;e.validate=function(e,n){var r,o,i;if(o=Object.keys(e),r=function(){var e,r,s;for(s=[],e=0,r=n.length;e<r;e++)i=n[e],t.call(o,i)<0&&s.push(i);return s}(),r.length>0)throw new Error("Required parameters missing: "+r.join(", "))},e.assign=n(51),e.omit=function(t,n){var r;return r=e.assign({},t),delete r[n],r}}).call(void 0)},function(t,e,n){"use strict";var r,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":o(window))&&(r=window)}t.exports=r},function(t,e,n){"use strict";function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function s(t){if(p===clearTimeout)return clearTimeout(t);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function u(){v&&h&&(v=!1,h.length?y=h.concat(y):m=-1,y.length&&c())}function c(){if(!v){var t=i(u);v=!0;for(var e=y.length;e;){for(h=y,y=[];++m<e;)h&&h[m].run();m=-1,e=y.length}h=null,v=!1,s(t)}}function a(t,e){this.fun=t,this.array=e}function f(){}var l,p,d=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(t){l=r}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(t){p=o}}();var h,y=[],v=!1,m=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];y.push(new a(t,e)),1!==y.length||v||i(c)},a.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.prependListener=f,d.prependOnceListener=f,d.listeners=function(t){return[]},d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(t,e,n){"use strict";(function(e){function r(t,e){!o.isUndefined(t)&&o.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var o=n(0),i=n(34),s={"Content-Type":"application/x-www-form-urlencoded"},u={adapter:function(){var t;return"undefined"!=typeof XMLHttpRequest?t=n(11):void 0!==e&&(t=n(11)),t}(),transformRequest:[function(t,e){return i(e,"Content-Type"),o.isFormData(t)||o.isArrayBuffer(t)||o.isBuffer(t)||o.isStream(t)||o.isFile(t)||o.isBlob(t)?t:o.isArrayBufferView(t)?t.buffer:o.isURLSearchParams(t)?(r(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):o.isObject(t)?(r(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],function(t){u.headers[t]={}}),o.forEach(["post","put","patch"],function(t){u.headers[t]=o.merge(s)}),t.exports=u}).call(e,n(3))},function(t,e,n){"use strict";function r(t){return null==t?void 0===t?c:u:a&&a in Object(t)?i(t):s(t)}var o=n(19),i=n(54),s=n(55),u="[object Null]",c="[object Undefined]",a=o?o.toStringTag:void 0;t.exports=r},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=n(20),i="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,s=o||i||Function("return this")();t.exports=s},function(t,e,n){"use strict";function r(t){var e=void 0===t?"undefined":o(t);return null!=t&&("object"==e||"function"==e)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=r},function(t,e,n){"use strict";function r(t){return null!=t&&i(t.length)&&!o(t)}var o=n(18),i=n(23);t.exports=r},function(t,e,n){"use strict";function r(t){return null!=t&&"object"==(void 0===t?"undefined":o(t))}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=r},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(0),o=n(35),i=n(37),s=n(38),u=n(39),c=n(12),a="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(40);t.exports=function(t){return new Promise(function(e,f){var l=t.data,p=t.headers;r.isFormData(l)&&delete p["Content-Type"];var d=new XMLHttpRequest,h="onreadystatechange",y=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in d||u(t.url)||(d=new window.XDomainRequest,h="onload",y=!0,d.onprogress=function(){},d.ontimeout=function(){}),t.auth){var v=t.auth.username||"",m=t.auth.password||"";p.Authorization="Basic "+a(v+":"+m)}if(d.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),d.timeout=t.timeout,d[h]=function(){if(d&&(4===d.readyState||y)&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?s(d.getAllResponseHeaders()):null,r=t.responseType&&"text"!==t.responseType?d.response:d.responseText,i={data:r,status:1223===d.status?204:d.status,statusText:1223===d.status?"No Content":d.statusText,headers:n,config:t,request:d};o(e,f,i),d=null}},d.onerror=function(){f(c("Network Error",t,null,d)),d=null},d.ontimeout=function(){f(c("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var b=n(41),g=(t.withCredentials||u(t.url))&&t.xsrfCookieName?b.read(t.xsrfCookieName):void 0;g&&(p[t.xsrfHeaderName]=g)}if("setRequestHeader"in d&&r.forEach(p,function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete p[e]:d.setRequestHeader(e,t)}),t.withCredentials&&(d.withCredentials=!0),t.responseType)try{d.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&d.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){d&&(d.abort(),f(t),d=null)}),void 0===l&&(l=null),d.send(l)})}},function(t,e,n){"use strict";var r=n(36);t.exports=function(t,e,n,o,i){var s=new Error(t);return r(s,e,n,o,i)}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){"use strict";function r(t,e,n){var r=t[e];u.call(t,e)&&i(r,n)&&(void 0!==n||e in t)||o(t,e,n)}var o=n(16),i=n(21),s=Object.prototype,u=s.hasOwnProperty;t.exports=r},function(t,e,n){"use strict";function r(t,e,n){"__proto__"==e&&o?o(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var o=n(17);t.exports=r},function(t,e,n){"use strict";var r=n(52),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,n){"use strict";function r(t){if(!i(t))return!1;var e=o(t);return e==u||e==c||e==s||e==a}var o=n(5),i=n(7),s="[object AsyncFunction]",u="[object Function]",c="[object GeneratorFunction]",a="[object Proxy]";t.exports=r},function(t,e,n){"use strict";var r=n(6),o=r.Symbol;t.exports=o},function(t,e,n){"use strict";(function(e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r="object"==(void 0===e?"undefined":n(e))&&e&&e.Object===Object&&e;t.exports=r}).call(e,n(2))},function(t,e,n){"use strict";function r(t,e){return t===e||t!==t&&e!==e}t.exports=r},function(t,e,n){"use strict";function r(t){return t}t.exports=r},function(t,e,n){"use strict";function r(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}var o=9007199254740991;t.exports=r},function(t,e,n){"use strict";function r(t,e){var n=void 0===t?"undefined":o(t);return!!(e=null==e?i:e)&&("number"==n||"symbol"!=n&&s.test(t))&&t>-1&&t%1==0&&t<e}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=9007199254740991,s=/^(?:0|[1-9]\d*)$/;t.exports=r},function(t,e,n){"use strict";function r(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||o)}var o=Object.prototype;t.exports=r},function(t,e,n){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";(function(e){function r(){}function o(){p.log.apply(p,arguments)}function i(){p.log.apply(p,arguments)}function s(){p.warn.apply(p,arguments)}function u(t){m[t]=y()}function c(t){var e=m[t];if(!e)throw new Error("No such label: "+t);var n=y()-e;p.log(t+": "+n+"ms")}function a(){var t=new Error;t.name="Trace",t.message=d.format.apply(null,arguments),p.error(t.stack)}function f(t){p.log(d.inspect(t)+"\n")}function l(t){if(!t){var e=v.call(arguments,1);h.ok(!1,d.format.apply(null,e))}}var p,d=n(28),h=n(95),y=n(96),v=Array.prototype.slice,m={};p=void 0!==e&&e.console?e.console:"undefined"!=typeof window&&window.console?window.console:{};for(var b=[[r,"log"],[o,"info"],[i,"warn"],[s,"error"],[u,"time"],[c,"timeEnd"],[a,"trace"],[f,"dir"],[l,"assert"]],g=0;g<b.length;g++){var w=b[g],x=w[0],S=w[1];p[S]||(p[S]=x)}t.exports=p}).call(e,n(2))},function(t,e,n){"use strict";(function(t,r,o){function i(t,n){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),v(n)?r.showHidden=n:n&&e._extend(r,n),S(r.showHidden)&&(r.showHidden=!1),S(r.depth)&&(r.depth=2),S(r.colors)&&(r.colors=!1),S(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),a(r,t,r.depth)}function s(t,e){var n=i.styles[e];return n?"["+i.colors[n][0]+"m"+t+"["+i.colors[n][1]+"m":t}function u(t,e){return t}function c(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function a(t,n,r){if(t.customInspect&&n&&_(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,t);return w(o)||(o=a(t,o,r)),o}var i=f(t,n);if(i)return i;var s=Object.keys(n),u=c(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(n)),A(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(n);if(0===s.length){if(_(n)){var v=n.name?": "+n.name:"";return t.stylize("[Function"+v+"]","special")}if(j(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(O(n))return t.stylize(Date.prototype.toString.call(n),"date");if(A(n))return l(n)}var m="",b=!1,g=["{","}"];if(y(n)&&(b=!0,g=["[","]"]),_(n)){m=" [Function"+(n.name?": "+n.name:"")+"]"}if(j(n)&&(m=" "+RegExp.prototype.toString.call(n)),O(n)&&(m=" "+Date.prototype.toUTCString.call(n)),A(n)&&(m=" "+l(n)),0===s.length&&(!b||0==n.length))return g[0]+m+g[1];if(r<0)return j(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var x;return x=b?p(t,n,r,u,s):s.map(function(e){return d(t,n,r,u,e,b)}),t.seen.pop(),h(x,m,g)}function f(t,e){if(S(e))return t.stylize("undefined","undefined");if(w(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return g(e)?t.stylize(""+e,"number"):v(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,n,r,o){for(var i=[],s=0,u=e.length;s<u;++s)C(e,String(s))?i.push(d(t,e,n,r,String(s),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(d(t,e,n,r,o,!0))}),i}function d(t,e,n,r,o,i){var s,u,c;if(c=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]},c.get?u=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(u=t.stylize("[Setter]","special")),C(r,o)||(s="["+o+"]"),u||(t.seen.indexOf(c.value)<0?(u=m(n)?a(t,c.value,null):a(t,c.value,n-1),u.indexOf("\n")>-1&&(u=i?u.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+u.split("\n").map(function(t){return" "+t}).join("\n"))):u=t.stylize("[Circular]","special")),S(s)){if(i&&o.match(/^\d+$/))return u;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+u}function h(t,e,n){var r=0;return t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function y(t){return Array.isArray(t)}function v(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return null==t}function g(t){return"number"==typeof t}function w(t){return"string"==typeof t}function x(t){return"symbol"===(void 0===t?"undefined":R(t))}function S(t){return void 0===t}function j(t){return E(t)&&"[object RegExp]"===q(t)}function E(t){return"object"===(void 0===t?"undefined":R(t))&&null!==t}function O(t){return E(t)&&"[object Date]"===q(t)}function A(t){return E(t)&&("[object Error]"===q(t)||t instanceof Error)}function _(t){return"function"==typeof t}function T(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"===(void 0===t?"undefined":R(t))||void 0===t}function q(t){return Object.prototype.toString.call(t)}function L(t){return t<10?"0"+t.toString(10):t.toString(10)}function P(){var t=new Date,e=[L(t.getHours()),L(t.getMinutes()),L(t.getSeconds())].join(":");return[t.getDate(),B[t.getMonth()],e].join(" ")}function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D=/%[sdj%]/g;e.format=function(t){if(!w(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(i(arguments[n]));return e.join(" ")}for(var n=1,r=arguments,o=r.length,s=String(t).replace(D,function(t){if("%%"===t)return"%";if(n>=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}}),u=r[n];n<o;u=r[++n])m(u)||!E(u)?s+=" "+u:s+=" "+i(u);return s},e.deprecate=function(n,i){function s(){if(!u){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?o.trace(i):o.error(i),u=!0}return n.apply(this,arguments)}if(S(t.process))return function(){return e.deprecate(n,i).apply(this,arguments)};if(!0===r.noDeprecation)return n;var u=!1;return s};var k,I={};e.debuglog=function(t){if(S(k)&&(k=r.env.NODE_DEBUG||""),t=t.toUpperCase(),!I[t])if(new RegExp("\\b"+t+"\\b","i").test(k)){var n=r.pid;I[t]=function(){var r=e.format.apply(e,arguments);o.error("%s %d: %s",t,n,r)}}else I[t]=function(){};return I[t]},e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=y,e.isBoolean=v,e.isNull=m,e.isNullOrUndefined=b,e.isNumber=g,e.isString=w,e.isSymbol=x,e.isUndefined=S,e.isRegExp=j,e.isObject=E,e.isDate=O,e.isError=A,e.isFunction=_,e.isPrimitive=T,e.isBuffer=n(93);var B=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];e.log=function(){o.log("%s - %s",P(),e.format.apply(e,arguments))},e.inherits=n(94),e._extend=function(t,e){if(!e||!E(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}}).call(e,n(2),n(3),n(27))},function(t,e,n){"use strict";(function(e){(function(){var r,o,i,s,u,c,a,f,l;u=n(30),l=n(49),r=n(91);var p=n(1);f=p.omit,s=p.assign,a=function(t){return a.method=t.toUpperCase(),a},a.configure=function(t){return this.options=s({},this.options,t)},a.setAccount=function(t){return this.options.accountId=t},a.setDateTimeFormat=function(t){if("UNIX"!==t&&"RFC3339"!==t)throw new Error("invalid date time format");return this.options.dateTimeFormat=t},a.request=function(t,e){var n,r,o,c,a,l,p,d=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return i(this.options,d),r=null!=(c=this.method)?c:"GET",this.method=null,p="json",null==t.json||t.json||(p="text"),o={method:r,url:null!=(a=t.url)?a:this.endpoint(e),headers:{Authorization:"Bearer "+this.options.apiKey,"Accept-Datetime-Format":this.options.dateTimeFormat},data:t.body,params:f(t,"body"),responseType:p},n=u(o),this.options.fullResponse?n:null!=n&&null!=(l=n.then(function(t){var e=t.status,n=t.headers,r=t.data;return s({},{status:e,headers:n},r)}))?l.catch(function(t){var e,n,r,o,i;if(!(null!=t&&null!=(r=t.response)?r.status:void 0))return Promise.reject(t);o=t.response;var u=o;return i=u.status,n=u.headers,e=u.data,Promise.reject(s({},{status:i,headers:n},e))}):void 0},a.subscribe=function(t,e){var n,o,s,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return i(this.options,c),n={method:"GET",url:null!=(o=t.url)?o:this.endpoint(e,"stream"),headers:{Authorization:"Bearer "+this.options.apiKey,"Accept-Datetime-Format":this.options.dateTimeFormat},params:f(t,"body"),responseType:"stream"},this.method=null,null!=(s=u(n))?s.then(function(e){var n,o=e.data;return new r(o,{json:null==(n=t.json)||n})}):void 0},a.endpoint=function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"api",o=this.options;if(t=o.live,e=o.version,"api"!==r&&"stream"!==r)throw new Error("invalid mode");switch(!1){case!t:return"https://"+r+"-fxtrade.oanda.com/"+e+"/"+n;default:return"https://"+r+"-fxpractice.oanda.com/"+e+"/"+n}},i=function(t,e){if(!t.apiKey)throw new Error("Api key is not set. Use configure or env OANDA_API_KEY");if(e&&!t.accountId)throw new Error("Account id must be set for this request")},o=function(t,e){var n,r;for(r in t){e[r]=t[r].bind(e);for(n in t[r])e[r][n]=t[r][n].bind(e)}return e},c=function(){return a.configure({apiKey:e.env.OANDA_API_KEY,live:!1,version:"v3",dateTimeFormat:"RFC3339",throwHttpErrors:!0}),s(a,l),o(l,a)},t.exports=c()}).call(void 0)}).call(e,n(3))},function(t,e,n){"use strict";t.exports=n(31)},function(t,e,n){"use strict";function r(t){var e=new s(t),n=i(s.prototype.request,e);return o.extend(n,s.prototype,e),o.extend(n,e),n}var o=n(0),i=n(10),s=n(33),u=n(4),c=r(u);c.Axios=s,c.create=function(t){return r(o.merge(u,t))},c.Cancel=n(14),c.CancelToken=n(47),c.isCancel=n(13),c.all=function(t){return Promise.all(t)},c.spread=n(48),t.exports=c,t.exports.default=c},function(t,e,n){"use strict";function r(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function o(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
t.exports=function(t){return null!=t&&(r(t)||o(t)||!!t._isBuffer)}},function(t,e,n){"use strict";function r(t){this.defaults=t,this.interceptors={request:new s,response:new s}}var o=n(4),i=n(0),s=n(42),u=n(43),c=n(45),a=n(46);r.prototype.request=function(t){"string"==typeof t&&(t=i.merge({url:arguments[0]},arguments[1])),t=i.merge(o,this.defaults,{method:"get"},t),t.method=t.method.toLowerCase(),t.baseURL&&!c(t.url)&&(t.url=a(t.baseURL,t.url));var e=[u,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},i.forEach(["delete","get","head","options"],function(t){r.prototype[t]=function(e,n){return this.request(i.merge(n||{},{method:t,url:e}))}}),i.forEach(["post","put","patch"],function(t){r.prototype[t]=function(e,n,r){return this.request(i.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=r},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(12);t.exports=function(t,e,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t}},function(t,e,n){"use strict";function r(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=n(0);t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(o.isURLSearchParams(e))i=e.toString();else{var s=[];o.forEach(e,function(t,e){null!==t&&void 0!==t&&(o.isArray(t)&&(e+="[]"),o.isArray(t)||(t=[t]),o.forEach(t,function(t){o.isDate(t)?t=t.toISOString():o.isObject(t)&&(t=JSON.stringify(t)),s.push(r(e)+"="+r(t))}))}),i=s.join("&")}return i&&(t+=(-1===t.indexOf("?")?"?":"&")+i),t}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t){var e,n,o,i={};return t?(r.forEach(t.split("\n"),function(t){o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e&&(i[e]=i[e]?i[e]+", "+n:n)}),i):i}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){function t(t){var e=t;return n&&(o.setAttribute("href",e),e=o.href),o.setAttribute("href",e),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var e,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return e=t(window.location.href),function(n){var o=r.isString(n)?t(n):n;return o.protocol===e.protocol&&o.host===e.host}}():function(){return function(){return!0}}()},function(t,e,n){"use strict";function r(){this.message="String contains an invalid character"}function o(t){for(var e,n,o=String(t),s="",u=0,c=i;o.charAt(0|u)||(c="=",u%1);s+=c.charAt(63&e>>8-u%1*8)){if((n=o.charCodeAt(u+=.75))>255)throw new r;e=e<<8|n}return s}var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.prototype=new Error,r.prototype.code=5,r.prototype.name="InvalidCharacterError",t.exports=o},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){return{write:function(t,e,n,o,i,s){var u=[];u.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),!0===s&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(t,e,n){"use strict";function r(){this.handlers=[]}var o=n(0);r.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},r.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},r.prototype.forEach=function(t){o.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=r},function(t,e,n){"use strict";function r(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var o=n(0),i=n(44),s=n(13),u=n(4);t.exports=function(t){return r(t),t.headers=t.headers||{},t.data=i(t.data,t.headers,t.transformRequest),t.headers=o.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||u.adapter)(t).then(function(e){return r(t),e.data=i(e.data,e.headers,t.transformResponse),e},function(e){return s(e)||(r(t),e&&e.response&&(e.response.data=i(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";function r(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new o(t),e(n.reason))})}var o=n(14);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var t;return{token:new r(function(e){t=e}),cancel:t}},t.exports=r},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";(function(){t.exports=Object.assign({},n(50),n(85),n(86),n(87),n(88),n(89),n(90))}).call(void 0)},function(t,e,n){"use strict";(function(){var t,r,o=n(1);r=o.validate,t=o.omit,e.accounts=function(){var e,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=o.id,"PATCH"===this.method?(r(o,["id"]),this.request({body:t(o,"id")},"accounts/"+e+"/configuration",!1)):(n=function(){switch(!1){case null==e:return"accounts/"+e;default:return"accounts"}}(),this.request(o,n,!1))},e.summary=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.request(t,"accounts/"+this.options.accountId+"/summary")},e.instruments=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.request(t,"accounts/"+this.options.accountId+"/instruments")},e.changes=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(t,["sinceTransactionID"]),this.request(t,"accounts/"+this.options.accountId+"/changes")}}).call(void 0)},function(t,e,n){"use strict";var r=n(15),o=n(60),i=n(61),s=n(8),u=n(25),c=n(70),a=Object.prototype,f=a.hasOwnProperty,l=i(function(t,e){if(u(e)||s(e))return void o(e,c(e),t);for(var n in e)f.call(e,n)&&r(t,n,e[n])});t.exports=l},function(t,e,n){"use strict";function r(t,e){var n=i(t,e);return o(n)?n:void 0}var o=n(53),i=n(59);t.exports=r},function(t,e,n){"use strict";function r(t){return!(!s(t)||i(t))&&(o(t)?h:a).test(u(t))}var o=n(18),i=n(56),s=n(7),u=n(58),c=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,f=Function.prototype,l=Object.prototype,p=f.toString,d=l.hasOwnProperty,h=RegExp("^"+p.call(d).replace(c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},function(t,e,n){"use strict";function r(t){var e=s.call(t,c),n=t[c];try{t[c]=void 0;var r=!0}catch(t){}var o=u.call(t);return r&&(e?t[c]=n:delete t[c]),o}var o=n(19),i=Object.prototype,s=i.hasOwnProperty,u=i.toString,c=o?o.toStringTag:void 0;t.exports=r},function(t,e,n){"use strict";function r(t){return i.call(t)}var o=Object.prototype,i=o.toString;t.exports=r},function(t,e,n){"use strict";function r(t){return!!i&&i in t}var o=n(57),i=function(){var t=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=r},function(t,e,n){"use strict";var r=n(6),o=r["__core-js_shared__"];t.exports=o},function(t,e,n){"use strict";function r(t){if(null!=t){try{return i.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var o=Function.prototype,i=o.toString;t.exports=r},function(t,e,n){"use strict";function r(t,e){return null==t?void 0:t[e]}t.exports=r},function(t,e,n){"use strict";function r(t,e,n,r){var s=!n;n||(n={});for(var u=-1,c=e.length;++u<c;){var a=e[u],f=r?r(n[a],t[a],a,n,t):void 0;void 0===f&&(f=t[a]),s?i(n,a,f):o(n,a,f)}return n}var o=n(15),i=n(16);t.exports=r},function(t,e,n){"use strict";function r(t){return o(function(e,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,u=o>2?n[2]:void 0;for(s=t.length>3&&"function"==typeof s?(o--,s):void 0,u&&i(n[0],n[1],u)&&(s=o<3?void 0:s,o=1),e=Object(e);++r<o;){var c=n[r];c&&t(e,c,r,s)}return e})}var o=n(62),i=n(69);t.exports=r},function(t,e,n){"use strict";function r(t,e){return s(i(t,e,o),t+"")}var o=n(22),i=n(63),s=n(65);t.exports=r},function(t,e,n){"use strict";function r(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var r=arguments,s=-1,u=i(r.length-e,0),c=Array(u);++s<u;)c[s]=r[e+s];s=-1;for(var a=Array(e+1);++s<e;)a[s]=r[s];return a[e]=n(c),o(t,this,a)}}var o=n(64),i=Math.max;t.exports=r},function(t,e,n){"use strict";function r(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}t.exports=r},function(t,e,n){"use strict";var r=n(66),o=n(68),i=o(r);t.exports=i},function(t,e,n){"use strict";var r=n(67),o=n(17),i=n(22),s=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i;t.exports=s},function(t,e,n){"use strict";function r(t){return function(){return t}}t.exports=r},function(t,e,n){"use strict";function r(t){var e=0,n=0;return function(){var r=s(),u=i-(r-n);if(n=r,u>0){if(++e>=o)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var o=800,i=16,s=Date.now;t.exports=r},function(t,e,n){"use strict";function r(t,e,n){if(!c(n))return!1;var r=void 0===e?"undefined":o(e);return!!("number"==r?s(n)&&u(e,n.length):"string"==r&&e in n)&&i(n[e],t)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(21),s=n(8),u=n(24),c=n(7);t.exports=r},function(t,e,n){"use strict";function r(t){return s(t)?o(t):i(t)}var o=n(71),i=n(82),s=n(8);t.exports=r},function(t,e,n){"use strict";function r(t,e){var n=s(t),r=!n&&i(t),f=!n&&!r&&u(t),p=!n&&!r&&!f&&a(t),d=n||r||f||p,h=d?o(t.length,String):[],y=h.length;for(var v in t)!e&&!l.call(t,v)||d&&("length"==v||f&&("offset"==v||"parent"==v)||p&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||c(v,y))||h.push(v);return h}var o=n(72),i=n(73),s=n(75),u=n(76),c=n(24),a=n(78),f=Object.prototype,l=f.hasOwnProperty;t.exports=r},function(t,e,n){"use strict";function r(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}t.exports=r},function(t,e,n){"use strict";var r=n(74),o=n(9),i=Object.prototype,s=i.hasOwnProperty,u=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(t){return o(t)&&s.call(t,"callee")&&!u.call(t,"callee")};t.exports=c},function(t,e,n){"use strict";function r(t){return i(t)&&o(t)==s}var o=n(5),i=n(9),s="[object Arguments]";t.exports=r},function(t,e,n){"use strict";var r=Array.isArray;t.exports=r},function(t,e,n){"use strict";(function(t){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=n(6),i=n(77),s="object"==r(e)&&e&&!e.nodeType&&e,u=s&&"object"==r(t)&&t&&!t.nodeType&&t,c=u&&u.exports===s,a=c?o.Buffer:void 0,f=a?a.isBuffer:void 0,l=f||i;t.exports=l}).call(e,n(26)(t))},function(t,e,n){"use strict";function r(){return!1}t.exports=r},function(t,e,n){"use strict";var r=n(79),o=n(80),i=n(81),s=i&&i.isTypedArray,u=s?o(s):r;t.exports=u},function(t,e,n){"use strict";function r(t){return s(t)&&i(t.length)&&!!u[o(t)]}var o=n(5),i=n(23),s=n(9),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.exports=r},function(t,e,n){"use strict";function r(t){return function(e){return t(e)}}t.exports=r},function(t,e,n){"use strict";(function(t){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=n(20),i="object"==r(e)&&e&&!e.nodeType&&e,s=i&&"object"==r(t)&&t&&!t.nodeType&&t,u=s&&s.exports===i,c=u&&o.process,a=function(){try{var t=s&&s.require&&s.require("util").types;return t||c&&c.binding&&c.binding("util")}catch(t){}}();t.exports=a}).call(e,n(26)(t))},function(t,e,n){"use strict";function r(t){if(!o(t))return i(t);var e=[];for(var n in Object(t))u.call(t,n)&&"constructor"!=n&&e.push(n);return e}var o=n(25),i=n(83),s=Object.prototype,u=s.hasOwnProperty;t.exports=r},function(t,e,n){"use strict";var r=n(84),o=r(Object.keys,Object);t.exports=o},function(t,e,n){"use strict";function r(t,e){return function(n){return t(e(n))}}t.exports=r},function(t,e,n){"use strict";(function(){var t,r=n(1);t=r.validate,e.candles=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t(e,["id"]),this.request(e,"instruments/"+e.id+"/candles",!1)}}).call(void 0)},function(t,e,n){"use strict";(function(){var t,r,o=n(1);r=o.validate,t=o.omit,e.orders=function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=n.id,e=function(){switch(!1){case null==t:return"accounts/"+this.options.accountId+"/orders/"+t;default:return"accounts/"+this.options.accountId+"/orders"}}.call(this),this.request(n,e)},e.orders.create=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(t,["order"]),this("post").request({body:t},"accounts/"+this.options.accountId+"/orders")},e.orders.replace=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(e,["id","order"]),this("put").request({body:t(e,"id")},"accounts/"+this.options.accountId+"/orders/"+e.id)},e.orders.cancel=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(e,["id"]),this("put").request({body:t(e,"id")},"accounts/"+this.options.accountId+"/orders/"+e.id+"/cancel")},e.orders.clientExtensions=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(e,["id"]),this("put").request({body:t(e,"id")},"accounts/"+this.options.accountId+"/orders/"+e.id+"/clientExtensions")}}).call(void 0)},function(t,e,n){"use strict";(function(){var t,r,o=n(1);t=o.omit,r=o.validate,e.trades=function(){var t,e,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=r.id,e=r.open,e&&(r.state="OPEN"),n=function(){switch(!1){case null==t:return"accounts/"+this.options.accountId+"/trades/"+t;default:return"accounts/"+this.options.accountId+"/trades"}}.call(this),this.request(r,n)},e.trades.close=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(e,["id"]),this("put").request({body:t(e,"id")},"accounts/"+this.options.accountId+"/trades/"+e.id+"/close")},e.trades.clientExtensions=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(e,["id"]),this("put").request({body:t(e,"id")},"accounts/"+this.options.accountId+"/trades/"+e.id+"/clientExtensions")},e.trades.orders=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(e,["id"]),this("put").request({body:t(e,"id")},"accounts/"+this.options.accountId+"/trades/"+e.id+"/orders")}}).call(void 0)},function(t,e,n){"use strict";(function(){var t,r,o=n(1);t=o.omit,r=o.validate,e.positions=function(){var t,e,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=r.id,e=r.open,n=function(){switch(!1){case null==t:return"accounts/"+this.options.accountId+"/positions/"+t;case!e:return"accounts/"+this.options.accountId+"/openPositions";default:return"accounts/"+this.options.accountId+"/positions"}}.call(this),this.request(r,n)},e.positions.close=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(e,["id"]),this("put").request({body:t(e,"id")},"accounts/"+this.options.accountId+"/positions/"+e.id+"/close")}}).call(void 0)},function(t,e,n){"use strict";(function(){n(1).validate,e.transactions=function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=n.id,e=function(){switch(!1){case null==t:return"accounts/"+this.options.accountId+"/transactions/"+t;default:return"accounts/"+this.options.accountId+"/transactions"}}.call(this),this.request(n,e)},e.transactions.stream=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.subscribe(t,"accounts/"+this.options.accountId+"/transactions/stream")}}).call(void 0)},function(t,e,n){"use strict";(function(){var t,r=n(1);t=r.validate,e.pricing=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t(e,["instruments"]),this.request(e,"accounts/"+this.options.accountId+"/pricing")},e.pricing.stream=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t(e,["instruments"]),this.subscribe(e,"accounts/"+this.options.accountId+"/pricing/stream")}}).call(void 0)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();(function(){var e,u,c;e=n(92).EventEmitter;var a=n(1);c=a.assign,u=function(t){function e(t,n){r(this,e);var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return null==t?o(i):(i.connected=!1,i.stream=t,i.options=c({},n),i.stream.on("data",function(t){var e,n;i.connected=!0;try{return n=function(){switch(!1){case!this.options.json:return t.toString().split(/\r?\n/).filter(Boolean).map(JSON.parse);default:return[t]}}.call(i),n.forEach(function(t){return i.emit("data",t)})}catch(n){return e=n.message,i.emit("error",new Error("Subscription error parsing Oanda response:\nMessage: "+e+"\nData string: "+t.toString()))}}),i.stream.on("error",function(t){return i.connected=!1,i.emit("error",t)}),i.stream.on("end",function(t){return i.connected=!1,i.emit("end",t)}),i)}return i(e,t),s(e,[{key:"connect",value:function(){return this.stream(),this.connected=!0}},{key:"disconnect",value:function(){return this.connected=!1,this.stream.req.abort()}}]),e}(e),t.exports=u}).call(void 0)},function(t,e,n){"use strict";(function(e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function o(t){return"number"==typeof t}function i(t){return"object"===(void 0===t?"undefined":u(t))&&null!==t}function s(t){return void 0===t}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!o(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,o,u,c,a;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var f=new Error('Uncaught, unspecified "error" event. ('+e+")");throw f.context=e,f}if(n=this._events[t],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:u=Array.prototype.slice.call(arguments,1),n.apply(this,u)}else if(i(n))for(u=Array.prototype.slice.call(arguments,1),a=n.slice(),o=a.length,c=0;c<o;c++)a[c].apply(this,u);return!0},n.prototype.addListener=function(t,o){var u;if(!r(o))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(o.listener)?o.listener:o),this._events[t]?i(this._events[t])?this._events[t].push(o):this._events[t]=[this._events[t],o]:this._events[t]=o,i(this._events[t])&&!this._events[t].warned&&(u=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&u>0&&this._events[t].length>u&&(this._events[t].warned=!0,e.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof e.trace&&e.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),o||(o=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var o=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,o,s,u;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,o=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(n)){for(u=s;u-- >0;)if(n[u]===e||n[u].listener&&n[u].listener===e){o=u;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}}).call(e,n(27))},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t){return t&&"object"===(void 0===t?"undefined":r(t))&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e,n){"use strict";"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){"use strict";(function(e){function r(t,e){if(t===e)return 0;for(var n=t.length,r=e.length,o=0,i=Math.min(n,r);o<i;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0}function o(t){return e.Buffer&&"function"==typeof e.Buffer.isBuffer?e.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}function i(t){return Object.prototype.toString.call(t)}function s(t){return!o(t)&&("function"==typeof e.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}function u(t){if(x.isFunction(t)){if(E)return t.name;var e=t.toString(),n=e.match(A);return n&&n[1]}}function c(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function a(t){if(E||!x.isFunction(t))return x.inspect(t);var e=u(t);return"[Function"+(e?": "+e:"")+"]"}function f(t){return c(a(t.actual),128)+" "+t.operator+" "+c(a(t.expected),128)}function l(t,e,n,r,o){throw new O.AssertionError({message:n,actual:t,expected:e,operator:r,stackStartFunction:o})}function p(t,e){t||l(t,!0,e,"==",O.ok)}function d(t,e,n,u){if(t===e)return!0;if(o(t)&&o(e))return 0===r(t,e);if(x.isDate(t)&&x.isDate(e))return t.getTime()===e.getTime();if(x.isRegExp(t)&&x.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"===(void 0===t?"undefined":w(t))||null!==e&&"object"===(void 0===e?"undefined":w(e))){if(s(t)&&s(e)&&i(t)===i(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===r(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(o(t)!==o(e))return!1;u=u||{actual:[],expected:[]};var c=u.actual.indexOf(t);return-1!==c&&c===u.expected.indexOf(e)||(u.actual.push(t),u.expected.push(e),y(t,e,n,u))}return n?t===e:t==e}function h(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function y(t,e,n,r){if(null===t||void 0===t||null===e||void 0===e)return!1;if(x.isPrimitive(t)||x.isPrimitive(e))return t===e;if(n&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var o=h(t),i=h(e);if(o&&!i||!o&&i)return!1;if(o)return t=j.call(t),e=j.call(e),d(t,e,n);var s,u,c=_(t),a=_(e);if(c.length!==a.length)return!1;for(c.sort(),a.sort(),u=c.length-1;u>=0;u--)if(c[u]!==a[u])return!1;for(u=c.le