rehive 1.34.2 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(n){var t=setTimeout;function i(){}function o(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(n,this)}function s(e,i){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn(function(){var n=1===e._state?i.onFulfilled:i.onRejected;if(null!==n){var t;try{t=n(e._value)}catch(n){return void r(i.promise,n)}u(i.promise,t)}else(1===e._state?u:r)(i.promise,e._value)})):e._deferreds.push(i)}function u(t,n){try{if(n===t)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if(n instanceof o)return t._state=3,t._value=n,void a(t);if("function"==typeof e)return void f((i=e,s=n,function(){i.apply(s,arguments)}),t)}t._state=1,t._value=n,a(t)}catch(n){r(t,n)}var i,s}function r(n,t){n._state=2,n._value=t,a(n)}function a(n){2===n._state&&0===n._deferreds.length&&o._immediateFn(function(){n._handled||o._unhandledRejectionFn(n._value)});for(var t=0,e=n._deferreds.length;t<e;t++)s(n,n._deferreds[t]);n._deferreds=null}function c(n,t,e){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.promise=e}function f(n,t){var e=!1;try{n(function(n){e||(e=!0,u(t,n))},function(n){e||(e=!0,r(t,n))})}catch(n){if(e)return;e=!0,r(t,n)}}o.prototype.catch=function(n){return this.then(null,n)},o.prototype.then=function(n,t){var e=new this.constructor(i);return s(this,new c(n,t,e)),e},o.all=function(n){var r=Array.prototype.slice.call(n);return new o(function(i,s){if(0===r.length)return i([]);var o=r.length;function u(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void e.call(n,function(n){u(t,n)},s)}r[t]=n,0==--o&&i(r)}catch(n){s(n)}}for(var n=0;n<r.length;n++)u(n,r[n])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(n){n(t)})},o.reject=function(e){return new o(function(n,t){t(e)})},o.race=function(s){return new o(function(n,t){for(var e=0,i=s.length;e<i;e++)s[e].then(n,t)})},o._immediateFn="function"==typeof setImmediate&&function(n){setImmediate(n)}||function(n){t(n,0)},o._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},o._setImmediateFn=function(n){o._immediateFn=n},o._setUnhandledRejectionFn=function(n){o._unhandledRejectionFn=n},"undefined"!=typeof module&&module.exports?module.exports=o:n.Promise||(n.Promise=o)}(this),function(n){"use strict";if(!n.fetch){var t="URLSearchParams"in n,e="Symbol"in n&&"iterator"in Symbol,u="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(n){return!1}}(),i="FormData"in n,s="ArrayBuffer"in n;if(s)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=function(n){return n&&DataView.prototype.isPrototypeOf(n)},a=ArrayBuffer.isView||function(n){return n&&-1<o.indexOf(Object.prototype.toString.call(n))};l.prototype.append=function(n,t){n=m(n),t=d(t);var e=this.map[n];this.map[n]=e?e+","+t:t},l.prototype.delete=function(n){delete this.map[m(n)]},l.prototype.get=function(n){return n=m(n),this.has(n)?this.map[n]:null},l.prototype.has=function(n){return this.map.hasOwnProperty(m(n))},l.prototype.set=function(n,t){this.map[m(n)]=d(t)},l.prototype.forEach=function(n,t){for(var e in this.map)this.map.hasOwnProperty(e)&&n.call(t,this.map[e],e,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(n,t){e.push(t)}),h(e)},l.prototype.values=function(){var t=[];return this.forEach(function(n){t.push(n)}),h(t)},l.prototype.entries=function(){var e=[];return this.forEach(function(n,t){e.push([t,n])}),h(e)},e&&(l.prototype[Symbol.iterator]=l.prototype.entries);var c=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},P.call(b.prototype),P.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},y.error=function(){var n=new y(null,{status:0,statusText:""});return n.type="error",n};var f=[301,302,303,307,308];y.redirect=function(n,t){if(-1===f.indexOf(t))throw new RangeError("Invalid status code");return new y(null,{status:t,headers:{location:n}})},n.Headers=l,n.Request=b,n.Response=y,n.fetch=function(e,s){return new Promise(function(i,n){var t=new b(e,s),o=new XMLHttpRequest;o.onload=function(){var n,s,t={status:o.status,statusText:o.statusText,headers:(n=o.getAllResponseHeaders()||"",s=new l,n.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(n){var t=n.split(":"),e=t.shift().trim();if(e){var i=t.join(":").trim();s.append(e,i)}}),s)};t.url="responseURL"in o?o.responseURL:t.headers.get("X-Request-URL");var e="response"in o?o.response:o.responseText;i(new y(e,t))},o.onerror=function(){n(new TypeError("Network request failed"))},o.ontimeout=function(){n(new TypeError("Network request failed"))},o.open(t.method,t.url,!0),"include"===t.credentials?o.withCredentials=!0:"omit"===t.credentials&&(o.withCredentials=!1),"responseType"in o&&u&&(o.responseType="blob"),t.headers.forEach(function(n,t){o.setRequestHeader(t,n)}),o.send(void 0===t._bodyInit?null:t._bodyInit)})},n.fetch.polyfill=!0}function m(n){if("string"!=typeof n&&(n=String(n)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(n))throw new TypeError("Invalid character in header field name");return n.toLowerCase()}function d(n){return"string"!=typeof n&&(n=String(n)),n}function h(t){var n={next:function(){var n=t.shift();return{done:void 0===n,value:n}}};return e&&(n[Symbol.iterator]=function(){return n}),n}function l(t){this.map={},t instanceof l?t.forEach(function(n,t){this.append(t,n)},this):Array.isArray(t)?t.forEach(function(n){this.append(n[0],n[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(n){this.append(n,t[n])},this)}function g(n){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}function p(e){return new Promise(function(n,t){e.onload=function(){n(e.result)},e.onerror=function(){t(e.error)}})}function w(n){var t=new FileReader,e=p(t);return t.readAsArrayBuffer(n),e}function v(n){if(n.slice)return n.slice(0);var t=new Uint8Array(n.byteLength);return t.set(new Uint8Array(n)),t.buffer}function P(){return this.bodyUsed=!1,this._initBody=function(n){if(this._bodyInit=n)if("string"==typeof n)this._bodyText=n;else if(u&&Blob.prototype.isPrototypeOf(n))this._bodyBlob=n;else if(i&&FormData.prototype.isPrototypeOf(n))this._bodyFormData=n;else if(t&&URLSearchParams.prototype.isPrototypeOf(n))this._bodyText=n.toString();else if(s&&u&&r(n))this._bodyArrayBuffer=v(n.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!s||!ArrayBuffer.prototype.isPrototypeOf(n)&&!a(n))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=v(n)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof n?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(n)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u&&(this.blob=function(){var n=g(this);if(n)return n;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(w)}),this.text=function(){var n,t,e,i=g(this);if(i)return i;if(this._bodyBlob)return n=this._bodyBlob,t=new FileReader,e=p(t),t.readAsText(n),e;if(this._bodyArrayBuffer)return Promise.resolve(function(n){for(var t=new Uint8Array(n),e=new Array(t.length),i=0;i<t.length;i++)e[i]=String.fromCharCode(t[i]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(N)}),this.json=function(){return this.text().then(JSON.parse)},this}function b(n,t){var e,i,s=(t=t||{}).body;if(n instanceof b){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,t.headers||(this.headers=new l(n.headers)),this.method=n.method,this.mode=n.mode,s||null==n._bodyInit||(s=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(e=t.method||this.method||"GET",i=e.toUpperCase(),-1<c.indexOf(i)?i:e),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(s)}function N(n){var s=new FormData;return n.trim().split("&").forEach(function(n){if(n){var t=n.split("="),e=t.shift().replace(/\+/g," "),i=t.join("=").replace(/\+/g," ");s.append(decodeURIComponent(e),decodeURIComponent(i))}}),s}function y(n,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(n)}}("undefined"!=typeof self?self:this);var fetch,isNode=!1;function Rehive(t){this.public={companies:[]},this.auth={password:{},email:{},mobile:{},tokens:{},mfa:{sms:{},token:{},status:{}}},this.user={addresses:[],bankAccounts:{},cryptoAccounts:{},documents:{},emails:{},mobiles:{},legalTerms:{versions:{}}},this.transactions={totals:{}},this.transaction_collections={},this.accounts={currencies:{}},this.company={currencies:{},bankAccounts:{}},this.groups={},this.permissions={},this.admin={auth:{login:{},register:{}},accessControlRules:{},users:{overview:{},tiers:{},addresses:{},bankAccounts:{currencies:{}},settings:{},cryptoAccounts:{},documents:{},emails:{},mobiles:{},permissions:{},messages:{},groups:{},kyc:{},mfa:{token:{},sms:{}}},requests:{},transactions:{messages:{},totals:{}},transaction_collections:{},accounts:{currencies:{limits:{},fees:{},settings:{}}},account:{currencies:{},definitions:{groups:{currencies:{}}}},currencies:{overview:{},bankAccounts:{}},company:{settings:{},address:{},links:{}},bankAccounts:{currencies:{}},webhooks:{},subtypes:{},notifications:{},services:{},groups:{tiers:{requirements:{},limits:{},fees:{},settings:{}},fees:{},permissions:{},accountConfigurations:{currencies:{}},settings:{}},webhookTasks:{requests:{}},exports:{sets:{}},metrics:{points:{}}};var u,n="3",i="public/companies/",s="auth/mfa/sms/",o="auth/mfa/token/",r="auth/tokens/",a="user/addresses/",c="user/bank-accounts/",f="user/crypto-accounts/",m="user/documents/",d="user/emails/",h="user/mobiles/",l="user/legal-terms/",g="transactions/",p="transaction-collections/",w="accounts/",v="/currencies/",P="company/currencies/",b="permissions/",N="groups/",y={"Content-Type":"application/json",Accept:"application/json"},k="admin/users/",A="admin/access-control-rules/",_="/settings/",T="admin/users/overview/",x="/permissions/",C="/groups/",S="admin/users/addresses/",E="admin/users/bank-accounts/",I="admin/users/crypto-accounts/",R="admin/users/documents/",j="admin/users/emails/",q="admin/users/mobiles/",O="admin/transactions/",B="admin/exports/",D="admin/transaction-collections/",U="admin/accounts/",F="/currencies/",z="/limits/",L="/fees/",M="/settings/",G="admin/account-currencies/",H="admin/account-definitions/",J="admin/currencies/",V="/bank-accounts/",X="admin/company/",K="admin/company/links/",W="settings/",$="address/",Q="admin/webhooks/",Y="admin/webhook-tasks/",Z="/requests/",nn="admin/subtypes/",tn="admin/notifications/",en="/requirements/",sn="/limits/",on="/fees/",un="admin/bank-accounts/",rn="admin/services/",an="admin/groups/",cn="admin/requests/",fn="/permissions/",mn="/settings/",dn="/tiers/",hn="/account-configurations/",ln="/currencies/",gn="/settings/",pn="admin/metrics/";t||(t={}),u=0<Object.keys(t).length?(t.apiToken&&yn(t.apiToken),t.customAPIURL?t.customAPIURL:(n=t.apiVersion?t.apiVersion:"3",t.network&&"staging"==t.network?t.network="api.staging.rehive.com":t.network="api.rehive.com","https://"+t.network+"/"+n+"/")):(n="3",t.network="api.rehive.com","https://"+t.network+"/"+n+"/");var e,wn,vn,Pn={},bn={};function Nn(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(encodeURIComponent(e)+"="+encodeURIComponent(n[e]));return t.join("&")}function yn(n){if(t&&t.storageMethod){if(void 0===sessionStorage||void 0===localStorage)return void console.log("sessionStorage and localStorage not supported.");"local"===t.storageMethod?localStorage.setItem("token",n):"session"===t.storageMethod&&sessionStorage.setItem("token",n)}e=n}function kn(){return t&&"local"===t.storageMethod?e=localStorage.getItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.getItem("token")),e||""}function An(){t&&"local"===t.storageMethod?e=localStorage.removeItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.removeItem("token")),delete y.Authorization,e=""}function _n(e){return e.json().then(function(t){return new Promise(function(n){e.ok||(t.status_code=e.status,t.ok=e.ok),n(t)})})}function Tn(n){wn=n.next?n.next:null,vn=n.previous?n.previous:null}function xn(n,t){n.next?Pn[t]=n.next:delete Pn[t],n.previous?bn[t]=n.previous:delete bn[t]}var Cn=function(i,s,o){return new Promise(function(t,e){var n=kn();n&&!o?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"POST",headers:y,body:JSON.stringify(s)}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},Sn=function(i,s){return new Promise(function(t,e){var n=s||kn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"GET",headers:y}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},En=function(i,s){return new Promise(function(t,e){var n=kn();n?y.Authorization="Token "+n:delete y.Authorization,!isNode&&s instanceof FormData?delete y["Content-Type"]:(y["Content-Type"]="application/json",s=JSON.stringify(s)),fetch(u+i,{method:"PATCH",headers:y,body:s}).then(_n).then(function(n){y["Content-Type"]="application/json","success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},In=function(i,s){return new Promise(function(t,e){var n=kn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"DELETE",headers:y,body:JSON.stringify(s)}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})};this.removeToken=function(){return t&&"local"===t.storageMethod?e=localStorage.removeItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.removeItem("token")),delete y.Authorization,e="","Token removed"},this.public.companies.get=function(n){return new Promise(function(t,e){Sn(n?i+n+"/":i).then(function(n){t(n)},function(n){e(n)})})},this.auth.register=function(n){return new Promise(function(t,e){fetch(u+"auth/register/",{method:"POST",headers:y,body:JSON.stringify(n)}).then(_n).then(function(n){"success"==n.status?(yn(n.data.token),t({user:n.data.user,token:n.data.token})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.registerCompany=function(n){return new Promise(function(t,e){fetch(u+"auth/company/register/",{method:"POST",headers:y,body:JSON.stringify(n)}).then(_n).then(function(n){"success"==n.status?(yn(n.data.token),t(n.data.user)):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.login=function(n){return new Promise(function(t,e){fetch(u+"auth/login/",{method:"POST",headers:y,body:JSON.stringify(n)}).then(_n).then(function(n){"success"==n.status?(yn(n.data.token),t({user:n.data.user,token:n.data.token,challenges:n.data.challenges,mfa:void 0!==n.data.mfa?n.data.mfa:null})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.logout=function(){return new Promise(function(t,e){var n=kn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+"auth/logout/",{method:"POST",headers:y}).then(_n).then(function(n){"success"==n.status?(An(),t({})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.logoutAll=function(){return new Promise(function(t,e){var n=kn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+"auth/logout/all/",{method:"POST",headers:y}).then(_n).then(function(n){"success"==n.status?(An(),t({})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.password.change=function(n){return new Promise(function(t,e){Cn("auth/password/change/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.password.reset=function(n){return new Promise(function(t,e){Cn("auth/password/reset/",n,!0).then(function(n){t(n)},function(n){e(n)})})},this.auth.password.resetConfirm=function(n){return new Promise(function(t,e){Cn("auth/password/reset/confirm/",n,!0).then(function(n){t(n)},function(n){e(n)})})},this.auth.email.resendEmailVerification=function(n){return new Promise(function(t,e){Cn("auth/email/verify/resend/",n,!0).then(function(n){t(n)},function(n){e(n)})})},this.auth.mobile.resendMobileVerification=function(n){return new Promise(function(t,e){Cn("auth/mobile/verify/resend/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mobile.verify=function(n){return new Promise(function(t,e){Cn("auth/mobile/verify/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.email.verify=function(n){return new Promise(function(t,e){Cn("auth/email/verify/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.get=function(n){var i;return i=n?r+n:r,new Promise(function(t,e){Sn(i).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.create=function(n){return new Promise(function(t,e){Cn(r,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.delete=function(i){return new Promise(function(t,e){var n;i?n=r+i:e({status:"error",message:"A token is required"}),In(n,{}).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.verify=function(n){return new Promise(function(t,e){Sn("auth/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.status.get=function(){return new Promise(function(t,e){Sn("auth/mfa/").then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.get=function(){return new Promise(function(t,e){Sn(s).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.enable=function(n){return new Promise(function(t,e){Cn(s,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.send=function(n){return new Promise(function(t,e){Cn("auth/mfa/sms/send/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.disable=function(n){return new Promise(function(t,e){In(s,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.get=function(){return new Promise(function(t,e){Sn(o).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.enable=function(n){return new Promise(function(t,e){Cn(o,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.disable=function(){return new Promise(function(t,e){In(o).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.verify=function(n){return new Promise(function(t,e){Cn("auth/mfa/verify/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?g+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),g+i):g,Sn(n).then(function(n){xn(n,"Transaction"),t(n)},function(n){e(n)})})},this.transactions.getNext=function(){return new Promise(function(t,e){var n,i=Pn.Transaction;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Transaction"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transactions.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.Transaction;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Transaction"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transactions.totals.get=function(n){return new Promise(function(t,e){n=n?"?"+Nn(n):"",Sn(g+"totals/"+n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createDebit=function(n){return new Promise(function(t,e){Cn("transactions/debit/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createCredit=function(n){return new Promise(function(t,e){Cn("transactions/credit/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createTransfer=function(n){return new Promise(function(t,e){Cn("transactions/transfer/",n).then(function(n){t(n)},function(n){e(n)})})},this.transaction_collections.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?p+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),p+i):p,Sn(n).then(function(n){xn(n,"Transaction Collection"),t(n)},function(n){e(n)})})},this.transaction_collections.getNext=function(){return new Promise(function(t,e){var n,i=Pn["Transaction Collection"];i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Transaction Collection"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transaction_collections.getPrevious=function(){return new Promise(function(t,e){var n,i=bn["Transaction Collection"];i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Transaction Collection"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transaction_collections.create=function(n){return new Promise(function(t,e){Cn(p,n).then(function(n){t(n)},function(n){e(n)})})},this.accounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.reference?w+s.reference+"/":s&&s.filters?(i="?"+Nn(s.filters),w+i):w,Sn(n).then(function(n){xn(n,"Account"),t(n)},function(n){e(n)})})},this.accounts.getNext=function(){return new Promise(function(t,e){var n,i=Pn.Account;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Account"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.Account;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Account"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.create=function(n){return new Promise(function(t,e){Cn(w,n).then(function(n){t(n)},function(n){e(n)})})},this.accounts.currencies.get=function(s,o){return new Promise(function(t,e){var n,i;s&&"string"==typeof s?(n=o&&o.code?w+s+v+o.code+"/":o&&o.filters?(i="?"+Nn(o.filters),w+s+v+i):w+s+v,Sn(n).then(function(n){xn(n,"AccountCurrencies"),t(n)},function(n){e(n)})):e({status:"error",message:"Reference is required"})})},this.accounts.currencies.getNext=function(){return new Promise(function(t,e){var n,i=Pn.AccountCurrencies;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"AccountCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.AccountCurrencies;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"AccountCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.currencies.update=function(n,i,s){return new Promise(function(t,e){n&&"string"==typeof n?i&&"string"==typeof i?En(w+n+v+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Currency Code is required"}):e({status:"error",message:"Reference is required"})})},this.company.get=function(){return new Promise(function(t,e){Sn("company/").then(function(n){t(n)},function(n){e(n)})})},this.company.currencies.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.code?P+s.code+"/":s&&s.filters?(i="?"+Nn(s.filters),P+i):P,Sn(n).then(function(n){xn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})})},this.company.currencies.getNext=function(){return new Promise(function(t,e){var n,i=Pn.CompanyCurrencies;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.company.currencies.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.CompanyCurrencies;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.company.bankAccounts.get=function(){return new Promise(function(t,e){Sn("company/bank-accounts/").then(function(n){t(n)},function(n){e(n)})})},this.permissions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?b+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),b+i):b,Sn(n).then(function(n){xn(n,"Permissions"),t(n)},function(n){e(n)})})},this.permissions.getNext=function(){return new Promise(function(t,e){var n,i=Pn.Permissions;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Permissions"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.permissions.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.Permissions;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Permissions"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.groups.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.name?N+s.name+"/":s&&s.filters?(i="?"+Nn(s.filters),N+i):N,Sn(n).then(function(n){xn(n,"Groups"),t(n)},function(n){e(n)})})},this.groups.getNext=function(){return new Promise(function(t,e){var n,i=Pn.Groups;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Groups"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.groups.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.Groups;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.get=function(){return new Promise(function(t,e){Sn("user/").then(function(n){t(n)},function(n){e(n)})})},this.user.update=function(n){return new Promise(function(t,e){En("user/",n).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.get=function(n){return new Promise(function(t,e){Sn(n?a+n:a).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.update=function(i){return new Promise(function(t,e){var n;i.id?n=a+i.id+"/":e({status:400,message:"No id has been given"}),En(n,i).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.create=function(n){return new Promise(function(t,e){Cn(a,n).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.delete=function(n){return new Promise(function(t,e){n?In(a+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.user.bankAccounts.get=function(n){return new Promise(function(t,e){Sn(n?c+n+"/":c).then(function(n){t(n)},function(n){e(n)})})},this.user.bankAccounts.create=function(n){return new Promise(function(t,e){Cn(c,n).then(function(n){t(n)},function(n){e(n)})})},this.user.bankAccounts.update=function(n,i){return new Promise(function(t,e){n?En(c+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Account id is required"})})},this.user.bankAccounts.delete=function(n){return new Promise(function(t,e){n?In(c+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Bank id is required"})})},this.user.cryptoAccounts.get=function(n){return new Promise(function(t,e){Sn(n?f+n+"/":f).then(function(n){t(n)},function(n){e(n)})})},this.user.cryptoAccounts.create=function(n){return new Promise(function(t,e){Cn(f,n).then(function(n){t(n)},function(n){e(n)})})},this.user.cryptoAccounts.update=function(n,i){return new Promise(function(t,e){n?En(f+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Crypto account id is required"})})},this.user.cryptoAccounts.delete=function(n){return new Promise(function(t,e){n?In(f+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Crypto account id is required"})})},this.user.documents.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?m+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),m+i):m,Sn(n).then(function(n){xn(n,"Documents"),t(n)},function(n){e(n)})})},this.user.documents.getNext=function(){return new Promise(function(t,e){var n,i=Pn.Documents;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Documents"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.documents.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.Documents;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Documents"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.documents.create=function(s){return new Promise(function(t,e){var n=kn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+m,{method:"POST",headers:i,body:s}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.user.emails.get=function(n){return new Promise(function(t,e){Sn(n?d+n+"/":d).then(function(n){t(n)},function(n){e(n)})})},this.user.emails.create=function(n){return new Promise(function(t,e){Cn(d,n).then(function(n){t(n)},function(n){e(n)})})},this.user.emails.update=function(n,i){return new Promise(function(t,e){n&&i?En(d+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Email address id is required"},null)})},this.user.emails.delete=function(n){return new Promise(function(t,e){n?In(d+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Email address id is required"})})},this.user.mobiles.get=function(n){return new Promise(function(t,e){Sn(n?h+n+"/":h).then(function(n){t(n)},function(n){e(n)})})},this.user.mobiles.create=function(n){return new Promise(function(t,e){Cn(h,n).then(function(n){t(n)},function(n){e(n)})})},this.user.mobiles.update=function(n,i){return new Promise(function(t,e){n&&i?En(h+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Mobile number id is required"})})},this.user.mobiles.delete=function(n){return new Promise(function(t,e){n?In(h+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Mobile number id is required"})})},this.user.legalTerms.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?l+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),l+i):l,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.user.legalTerms.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.legalTerms.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.legalTerms.versions.get=function(i,s){return new Promise(function(t,e){if(i){var n=l+i+"/versions/";s&&s.id?n+=s.id+"/":s&&s.filters&&(filters="?"+Nn(s.filters),n+=filters),Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})}else e({status:400,message:"No term ID has been given"})})},this.user.legalTerms.versions.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){n.next&&Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.legalTerms.versions.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.legalTerms.versions.update=function(n,i,s){return new Promise(function(t,e){n?i?En(l+n+"/versions/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No version ID has been given"}):e({status:400,message:"No term ID has been given"})})},this.admin.auth.login=function(n){return new Promise(function(t,e){Cn("admin/auth/login/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.auth.register=function(n){return new Promise(function(t,e){Cn("admin/auth/register/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.metrics.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?pn+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),pn+i):pn,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.metrics.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.metrics.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.metrics.create=function(n){return new Promise(function(t,e){Cn(pn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.metrics.delete=function(n){return new Promise(function(t,e){n?In(pn+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.metrics.points.get=function(i,s){return new Promise(function(t,e){var n;i?(n=pn+i+"/points/",s.filters&&(n+="?"+Nn(s.filters)),Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No id has been given"})})},this.admin.metrics.points.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.metrics.points.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.exports.sets.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?B+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),B+i):B,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.exports.sets.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.exports.sets.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.exports.sets.create=function(n){return new Promise(function(t,e){Cn(B,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.exports.sets.delete=function(n){return new Promise(function(t,e){n?In(B+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.accessControlRules.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?A+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),A+i):A,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.accessControlRules.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accessControlRules.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accessControlRules.create=function(n){return new Promise(function(t,e){n?Cn(A,n).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No data has been given"})})},this.admin.accessControlRules.update=function(n,i){return new Promise(function(t,e){n?En(A+n,i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.accessControlRules.delete=function(n){return new Promise(function(t,e){n?In(A+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.overview.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.filters?(i="?"+Nn(s.filters),T+i):T,Sn(n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.settings.get=function(n){return new Promise(function(t,e){n?Sn(k+n+_).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.settings.update=function(n,i){return new Promise(function(t,e){n?En(k+n+_,i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.kyc.get=function(n){return new Promise(function(t,e){n?Sn(k+n+"/kyc/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.kyc.update=function(n,i){return new Promise(function(t,e){n?En(k+n+"/kyc/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?k+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),k+i):k,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.create=function(i){return new Promise(function(t,e){var n=kn();n?y.Authorization="Token "+n:delete y.Authorization,!isNode&&i instanceof FormData?delete y["Content-Type"]:i=JSON.stringify(i),fetch(u+k,{method:"POST",headers:y,body:i}).then(_n).then(function(n){y["Content-Type"]="application/json","success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.admin.users.update=function(s,o){return new Promise(function(t,e){if(s){var n=kn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+k+s+"/",{method:"PATCH",headers:i,body:o}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})}else e({status:400,message:"No id has been given"})})},this.admin.users.delete=function(n){return new Promise(function(t,e){n?In(k+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.permissions.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.id?k+s+x+o.id+"/":o&&o.filters?(i="?"+Nn(o.filters),k+s+x+i):k+s+x,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No id has been given"})})},this.admin.users.permissions.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.permissions.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.permissions.create=function(n,i){return new Promise(function(t,e){Cn(k+n+x,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.permissions.delete=function(n,i){return new Promise(function(t,e){In(k+n+x+i+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.messages.get=function(i,s){return new Promise(function(t,e){i||e({status:400,message:"User ID not found."});var n=k+i+"/messages/";s&&s.id?n+=s.id+"/":s&&s.filters&&(n+="?"+Nn(s.filters)),Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.messages.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.messages.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.messages.create=function(n,i){return new Promise(function(t,e){n||e({status:400,message:"User ID not found."}),Cn(k+n+"/messages/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.groups.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.name?k+s+C+o.name+"/":o&&o.filters?(i="?"+Nn(o.filters),k+s+C+i):k+s+C,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No id has been given"})})},this.admin.users.groups.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.groups.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.groups.create=function(n,i){return new Promise(function(t,e){Cn(k+n+C,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.groups.delete=function(n,i){return new Promise(function(t,e){In(k+n+C+i+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.addresses.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?S+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),S+i):S,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.addresses.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.addresses.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.addresses.create=function(n){return new Promise(function(t,e){Cn(S,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.addresses.update=function(n,i){return new Promise(function(t,e){n?En(S+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.addresses.delete=function(n){return new Promise(function(t,e){n?In(S+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?E+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),E+i):E,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.create=function(n){return new Promise(function(t,e){Cn(E,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.update=function(n,i){return new Promise(function(t,e){n?En(E+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.delete=function(n){return new Promise(function(t,e){n?In(E+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.currencies.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.code?E+s+"/currencies/"+o.code+"/":o&&o.filters?(i="?"+Nn(o.filters),E+s+"/currencies/"+i):E+s+"/currencies/",Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.currencies.create=function(n,i){return new Promise(function(t,e){n?Cn(E+n+"/currencies/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.currencies.update=function(n,i,s){return new Promise(function(t,e){n?i?En(E+n+"/currencies/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.currencies.delete=function(n,i){return new Promise(function(t,e){n?i?In(E+n+"/currencies/"+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No id has been given"})})},this.admin.users.cryptoAccounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?I+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),I+i):I,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.cryptoAccounts.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.cryptoAccounts.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.cryptoAccounts.create=function(n){return new Promise(function(t,e){Cn(I,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.cryptoAccounts.update=function(n,i){return new Promise(function(t,e){n?En(I+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.cryptoAccounts.delete=function(n){return new Promise(function(t,e){n?In(I+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.documents.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?R+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),R+i):R,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.documents.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.documents.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.documents.create=function(s){return new Promise(function(t,e){var n=kn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+R,{method:"POST",headers:i,body:s}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.admin.users.documents.update=function(s,o){return new Promise(function(t,e){if(s){var n=kn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+R+s+"/",{method:"PATCH",headers:i,body:o}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})}else e({status:400,message:"No id has been given"})})},this.admin.users.documents.delete=function(n){return new Promise(function(t,e){n?In(R+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.emails.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?j+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),j+i):j,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.emails.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.emails.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.emails.create=function(n){return new Promise(function(t,e){Cn(j,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.emails.update=function(n,i){return new Promise(function(t,e){n?En(j+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.emails.delete=function(n){return new Promise(function(t,e){n?In(j+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mobiles.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?q+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),q+i):q,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.mobiles.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.mobiles.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.mobiles.create=function(n){return new Promise(function(t,e){Cn(q,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.mobiles.update=function(n,i){return new Promise(function(t,e){n?En(q+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mobiles.delete=function(n){return new Promise(function(t,e){n?In(q+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mfa.get=function(n){return new Promise(function(t,e){n?Sn(k+n+"/mfa/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mfa.sms.delete=function(n){return new Promise(function(t,e){n?In(k+n+"/mfa/sms/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mfa.token.delete=function(n){return new Promise(function(t,e){n?In(k+n+"/mfa/token/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.transactions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?O+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),O+i):O,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.transactions.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transactions.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transactions.totals.get=function(i){return new Promise(function(t,e){var n;n=i?"?"+Nn(i.filters):"",Sn("admin/transactions/totals/"+n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.transactions.update=function(n,i){return new Promise(function(t,e){n?En(O+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.transactions.createCredit=function(n){return new Promise(function(t,e){Cn("admin/transactions/credit/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transactions.createDebit=function(n){return new Promise(function(t,e){Cn("admin/transactions/debit/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transactions.createTransfer=function(n){return new Promise(function(t,e){Cn("admin/transactions/transfer/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transactions.messages.get=function(i,s){return new Promise(function(t,e){i||e({status:400,message:"Transaction ID not found."});var n=O+i+"/messages/";s&&s.id?n+=s.id+"/":s&&s.filters&&(n+="?"+Nn(s.filters)),Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.transactions.messages.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transactions.messages.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transactions.messages.create=function(n,i){return new Promise(function(t,e){n||e({status:400,message:"Transaction ID not found."}),Cn(O+n+"/messages/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.transaction_collections.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?D+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),D+i):D,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.transaction_collections.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transaction_collections.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transaction_collections.create=function(n){return new Promise(function(t,e){Cn(D,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transaction_collections.update=function(n,i){return new Promise(function(t,e){n?En(D+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference has been given"})})},this.admin.transaction_collections.delete=function(n){return new Promise(function(t,e){n?In(D+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.accounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.reference?U+s.reference+"/":s&&s.filters?(i="?"+Nn(s.filters),U+i):U,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.accounts.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.name?H+s.name+"/":s&&s.filters?(i="?"+Nn(s.filters),H+i):H,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.account.definitions.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.create=function(n){return new Promise(function(t,e){Cn(H,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.account.definitions.update=function(n,i){return new Promise(function(t,e){n?En(H+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.delete=function(n){return new Promise(function(t,e){n?In(H+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.name?H+s+"/groups/"+o.name+"/":o&&o.filters?(i="?"+Nn(o.filters),H+s+"/groups/"+i):H+s+"/groups/",Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.create=function(n,i){return new Promise(function(t,e){n?Cn(H+n+"/groups/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.update=function(n,i,s){return new Promise(function(t,e){n?i?En(H+n+"/groups/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.delete=function(n,i){return new Promise(function(t,e){n?i?In(H+n+"/groups/"+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.get=function(s,o,u){return new Promise(function(t,e){var n,i;s?o?(n=u&&u.code?H+s+"/groups/"+o+"/currencies/"+u.code+"/":u&&u.filters?(i="?"+Nn(u.filters),H+s+"/groups/"+o+"/currencies/"+i):H+s+"/groups/"+o+"/currencies/",Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.currencies.create=function(n,i,s){return new Promise(function(t,e){n?i?Cn(H+n+"/groups/"+i+"/currencies/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.update=function(n,i,s,o){return new Promise(function(t,e){n?i?s?En(H+n+"/groups/"+i+"/currencies/"+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.delete=function(n,i,s){return new Promise(function(t,e){n?i?s?In(H+n+"/groups/"+i+"/currencies/"+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.currencies.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.reference?G+s.reference+"/":s&&s.filters?(i="?"+Nn(s.filters),G+i):G,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.account.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.create=function(n){return new Promise(function(t,e){Cn(U,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.update=function(n,i){return new Promise(function(t,e){n?En(U+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference has been given"})})},this.admin.accounts.currencies.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.code?U+s+F+o.code+"/":o&&o.filters?(i="?"+Nn(o.filters),U+s+F+i):U+s+F,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No reference has been given"})})},this.admin.accounts.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.currencies.create=function(n,i){return new Promise(function(t,e){Cn(U+n+F,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.currencies.update=function(n,i,s){return new Promise(function(t,e){n&&i?En(U+n+F+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.limits.get=function(i,s,o){return new Promise(function(t,e){var n;i&&s?(n=o&&o.id?U+i+F+s+z+o.id+"/":U+i+F+s+z,Sn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.limits.create=function(n,i,s){return new Promise(function(t,e){Cn(U+n+F+i+z,s).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.currencies.limits.update=function(n,i,s,o){return new Promise(function(t,e){n&&i&&s?En(U+n+F+i+z+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.limits.delete=function(n,i,s){return new Promise(function(t,e){n&&i&&s?In(U+n+F+i+z+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.fees.get=function(i,s,o){return new Promise(function(t,e){var n;i&&s?(n=o&&o.id?U+i+F+s+L+o.id+"/":U+i+F+s+L,Sn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.fees.create=function(n,i,s){return new Promise(function(t,e){Cn(U+n+F+i+L,s).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.currencies.fees.update=function(n,i,s,o){return new Promise(function(t,e){n&&i&&s?En(U+n+F+i+L+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.fees.delete=function(n,i,s){return new Promise(function(t,e){n&&i&&s?In(U+n+F+i+L+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.settings.get=function(n,i){return new Promise(function(t,e){n&&i?Sn(U+n+F+i+M).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.settings.update=function(n,i,s){return new Promise(function(t,e){n&&i?En(U+n+F+i+M,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code has been given"})})},this.admin.currencies.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.code?J+s.code+"/":s&&s.filters?(i="?"+Nn(s.filters),J+i):J,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.create=function(n){return new Promise(function(t,e){Cn(J,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.update=function(n,i){return new Promise(function(t,e){if(!n)return currencies.update,void e({status:400,message:"No code has been given"});En(J+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.delete=function(n){return new Promise(function(t,e){n?In(J+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No code has been given"})})},this.admin.currencies.overview.get=function(n){return new Promise(function(t,e){n||e({status:400,message:"No code provided"}),Sn(J+n+"/overview/").then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.id?J+s+V+o.id+"/":o&&o.filters?(i="?"+Nn(o.filters),J+s+V+i):J+s+V,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.bankAccounts.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.bankAccounts.create=function(n,i){return new Promise(function(t,e){Cn(J+n+V,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.delete=function(n,i){return new Promise(function(t,e){In(J+n+V+i+"/").then(function(n){t(n)},function(n){e(n)})})},this.admin.company.get=function(){return new Promise(function(t,e){Sn(X).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.update=function(n){return new Promise(function(t,e){En(X,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.settings.get=function(){return new Promise(function(t,e){Sn(X+W).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.settings.update=function(n){return new Promise(function(t,e){En(X+W,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.address.get=function(){return new Promise(function(t,e){Sn(X+$).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.address.update=function(n){return new Promise(function(t,e){En(X+$,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.links.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?K+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),K+i):K,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.company.links.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.company.links.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.company.links.create=function(n){return new Promise(function(t,e){Cn(K,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.links.update=function(n,i){return new Promise(function(t,e){n?En(K+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.company.links.delete=function(n){return new Promise(function(t,e){n?In(K+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.bankAccounts.get=function(n){var i;return i=n&&n.id?un+n.id+"/":un,new Promise(function(t,e){Sn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.create=function(n){return new Promise(function(t,e){Cn(un,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.update=function(n,i){return new Promise(function(t,e){En(un+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.delete=function(n){return new Promise(function(t,e){In(un+n+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.currencies.get=function(i,s){return new Promise(function(t,e){if(i){var n=un+i+"/currencies/";s&&(n+=s),Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})}else e({status:400,message:"No bank ID has been given"})})},this.admin.bankAccounts.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){n.next&&Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.bankAccounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.bankAccounts.currencies.create=function(n,i){if(i.currency)return new Promise(function(t,e){Cn(un+n+"/currencies/",i).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No currency has been given"})},this.admin.bankAccounts.currencies.delete=function(n,i){if(n){if(i)return new Promise(function(t,e){In(un+n+"/currencies/"+i,{}).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No currency has been given"})}else reject({status:400,message:"No bank ID has been given"})},this.admin.webhooks.get=function(n){var i,t;return i=n&&n.id?Q+n.id+"/":n&&n.filters?(t="?"+Nn(n.filters),Q+t):Q,new Promise(function(t,e){Sn(i).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.webhooks.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhooks.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhooks.create=function(n){return new Promise(function(t,e){Cn(Q,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhooks.update=function(n,i){return new Promise(function(t,e){En(Q+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhooks.delete=function(n){return new Promise(function(t,e){In(Q+n+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhookTasks.get=function(n){var i,t;return i=n&&n.id?Y+n.id+"/":n&&n.filters?(t="?"+Nn(n.filters),Y+t):Y,n&&n.id?new Promise(function(t,e){var n=kn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"GET",headers:y}).then(_n).then(function(n){"success"==n.status?n.data&&t(n.data):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})}):new Promise(function(t,e){Sn(i).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.webhookTasks.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhookTasks.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhookTasks.requests.get=function(n,t){var i,e;return i=t&&t.id?Y+n+Z+t.id+"/":t&&t.filters?(e="?"+Nn(t.filters),Y+n+Z+e):Y,new Promise(function(t,e){Sn(i).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.webhookTasks.requests.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhookTasks.requests.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.subtypes.get=function(n){var i;return i=n&&n.id?nn+n.id+"/":n&&n.filters?(filters="?"+Nn(n.filters),nn+filters):nn,new Promise(function(t,e){Sn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.subtypes.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.subtypes.create=function(n){return new Promise(function(t,e){Cn(nn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.update=function(n,i){return new Promise(function(t,e){En(nn+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.delete=function(n){return new Promise(function(t,e){In(nn+n+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.notifications.get=function(n){var i;return i=n&&n.id?tn+n.id+"/":tn,new Promise(function(t,e){Sn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.notifications.update=function(n,i){return new Promise(function(t,e){En(tn+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?rn+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),rn+i):rn,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.services.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.services.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.services.update=function(n,i){return new Promise(function(t,e){En(rn+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.create=function(n){return new Promise(function(t,e){Cn(rn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.delete=function(n){return new Promise(function(t,e){n?In(rn+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.requests.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?cn+s.id+"/":s&&s.filters?(i="?"+Nn(s.filters),cn+i):cn,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.requests.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){n.next&&Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.requests.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.name?an+s.name+"/":s&&s.filters?(i="?"+Nn(s.filters),an+i):an,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.groups.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.create=function(n){return new Promise(function(t,e){Cn(an,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.update=function(n,i){return new Promise(function(t,e){n?En(an+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.delete=function(n){return new Promise(function(t,e){n?In(an+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.fees.get=function(i,s){return new Promise(function(t,e){var n;i?(n=an+i+"/fees/",s&&s.id?n+=s.id+"/":s&&s.filters&&(n+="?"+Nn(s.filters)),Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No group name has been given"})})},this.admin.groups.fees.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.fees.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.fees.create=function(n,i){return new Promise(function(t,e){n?Cn(an+n+"/fees/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.fees.update=function(n,i,s){return new Promise(function(t,e){n?i?En(an+n+"/fees/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No fee id has been given"}):e({status:400,message:"No group name has been given"})})},this.admin.groups.fees.delete=function(n,i){return new Promise(function(t,e){n?i?In(an+n+"/fees/"+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No fee id has been given"}):e({status:400,message:"No group name has been given"})})},this.admin.groups.permissions.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.id?an+s+fn+o.id+"/":o&&o.filters?(i="?"+Nn(o.filters),an+s+fn+i):an+s+fn,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.groups.permissions.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.permissions.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.permissions.create=function(n,i){return new Promise(function(t,e){n?Cn(an+n+fn,i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.permissions.delete=function(n,i){return new Promise(function(t,e){n&&i?In(an+n+fn+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name or permission id has been given"})})},this.admin.groups.settings.get=function(n){return new Promise(function(t,e){n?Sn(an+n+mn).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.settings.update=function(n,i){if(n)return new Promise(function(t,e){En(an+n+mn,i).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No group name has been given"})},this.admin.groups.tiers.get=function(n,t){var i;return i=t&&t.id?an+n+dn+t.id+"/":an+n+dn,new Promise(function(t,e){Sn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.create=function(n,i){return new Promise(function(t,e){Cn(an+n+dn,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.update=function(n,i,s){return new Promise(function(t,e){En(an+n+dn+i+"/",s).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.delete=function(n,i){return new Promise(function(t,e){In(an+n+dn+i+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.requirements.get=function(i,s,o){return new Promise(function(t,e){var n;s?(n=o&&o.id?an+i+dn+s+en+o.id+"/":an+i+dn+s+en,Sn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.requirements.create=function(n,i,s){return new Promise(function(t,e){i?Cn(an+n+dn+i+en,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.requirements.update=function(n,i,s,o){return new Promise(function(t,e){i?s?En(an+n+dn+i+en+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No requirement id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.requirements.delete=function(n,i,s){return new Promise(function(t,e){i?s?In(an+n+dn+i+en+s+"/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No requirement id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.get=function(i,s,o){return new Promise(function(t,e){var n;s?(n=o&&o.id?an+i+dn+s+on+o.id+"/":an+i+dn+s+on,Sn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.create=function(n,i,s){return new Promise(function(t,e){i?Cn(an+n+dn+i+on,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.update=function(n,i,s,o){return new Promise(function(t,e){i?s?En(an+n+dn+i+on+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No fee id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.delete=function(n,i,s){return new Promise(function(t,e){i?s?In(an+n+dn+i+on+s+"/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No fee id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.get=function(i,s,o){return new Promise(function(t,e){var n;s?(n=o&&o.id?an+i+dn+s+sn+o.id+"/":an+i+dn+s+sn,Sn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.create=function(n,i,s){return new Promise(function(t,e){i?Cn(an+n+dn+i+sn,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.update=function(n,i,s,o){return new Promise(function(t,e){i?s?En(an+n+dn+i+sn+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No limit id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.delete=function(n,i,s){return new Promise(function(t,e){i?s?In(an+n+dn+i+sn+s+"/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No limit id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.settings.get=function(n,i){return new Promise(function(t,e){n?Sn(an+n+dn+i+gn).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.tiers.settings.update=function(n,i,s){if(n)return new Promise(function(t,e){En(an+n+dn+i+gn,s).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No group name has been given"})},this.admin.groups.accountConfigurations.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.name?an+s+hn+o.name+"/":o&&o.filters?(i="?"+Nn(o.filters),an+s+hn+i):an+s+hn,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.create=function(n,i){return new Promise(function(t,e){Cn(an+n+hn,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.update=function(n,i,s){return new Promise(function(t,e){n?En(an+n+hn+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.accountConfigurations.delete=function(n,i){return new Promise(function(t,e){n?In(an+n+hn+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.accountConfigurations.currencies.get=function(s,o,u){return new Promise(function(t,e){var n,i;n=u&&u.code?an+s+hn+o+ln+u.code+"/":u&&u.filters?(i="?"+Nn(u.filters),an+s+hn+o+ln+i):an+s+hn+o+ln,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.currencies.create=function(n,i,s){return new Promise(function(t,e){Cn(an+n+hn+i+ln,s).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.currencies.delete=function(n,i,s){return new Promise(function(t,e){n?In(an+n+hn+i+ln+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})}}"undefined"!=typeof module&&module.exports?(module.exports=Rehive,global.fetch&&!process.env.IS_BROWSER?fetch=global.fetch:(fetch=require("node-fetch"),isNode=!0)):(window.this,isNode=!1,fetch=window.fetch);
1
+ !function(n){var t=setTimeout;function i(){}function o(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(n,this)}function s(e,i){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn(function(){var n=1===e._state?i.onFulfilled:i.onRejected;if(null!==n){var t;try{t=n(e._value)}catch(n){return void r(i.promise,n)}u(i.promise,t)}else(1===e._state?u:r)(i.promise,e._value)})):e._deferreds.push(i)}function u(t,n){try{if(n===t)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if(n instanceof o)return t._state=3,t._value=n,void a(t);if("function"==typeof e)return void f((i=e,s=n,function(){i.apply(s,arguments)}),t)}t._state=1,t._value=n,a(t)}catch(n){r(t,n)}var i,s}function r(n,t){n._state=2,n._value=t,a(n)}function a(n){2===n._state&&0===n._deferreds.length&&o._immediateFn(function(){n._handled||o._unhandledRejectionFn(n._value)});for(var t=0,e=n._deferreds.length;t<e;t++)s(n,n._deferreds[t]);n._deferreds=null}function c(n,t,e){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.promise=e}function f(n,t){var e=!1;try{n(function(n){e||(e=!0,u(t,n))},function(n){e||(e=!0,r(t,n))})}catch(n){if(e)return;e=!0,r(t,n)}}o.prototype.catch=function(n){return this.then(null,n)},o.prototype.then=function(n,t){var e=new this.constructor(i);return s(this,new c(n,t,e)),e},o.all=function(n){var r=Array.prototype.slice.call(n);return new o(function(i,s){if(0===r.length)return i([]);var o=r.length;function u(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void e.call(n,function(n){u(t,n)},s)}r[t]=n,0==--o&&i(r)}catch(n){s(n)}}for(var n=0;n<r.length;n++)u(n,r[n])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(n){n(t)})},o.reject=function(e){return new o(function(n,t){t(e)})},o.race=function(s){return new o(function(n,t){for(var e=0,i=s.length;e<i;e++)s[e].then(n,t)})},o._immediateFn="function"==typeof setImmediate&&function(n){setImmediate(n)}||function(n){t(n,0)},o._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},o._setImmediateFn=function(n){o._immediateFn=n},o._setUnhandledRejectionFn=function(n){o._unhandledRejectionFn=n},"undefined"!=typeof module&&module.exports?module.exports=o:n.Promise||(n.Promise=o)}(this),function(n){"use strict";if(!n.fetch){var t="URLSearchParams"in n,e="Symbol"in n&&"iterator"in Symbol,u="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(n){return!1}}(),i="FormData"in n,s="ArrayBuffer"in n;if(s)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=function(n){return n&&DataView.prototype.isPrototypeOf(n)},a=ArrayBuffer.isView||function(n){return n&&-1<o.indexOf(Object.prototype.toString.call(n))};l.prototype.append=function(n,t){n=m(n),t=d(t);var e=this.map[n];this.map[n]=e?e+","+t:t},l.prototype.delete=function(n){delete this.map[m(n)]},l.prototype.get=function(n){return n=m(n),this.has(n)?this.map[n]:null},l.prototype.has=function(n){return this.map.hasOwnProperty(m(n))},l.prototype.set=function(n,t){this.map[m(n)]=d(t)},l.prototype.forEach=function(n,t){for(var e in this.map)this.map.hasOwnProperty(e)&&n.call(t,this.map[e],e,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(n,t){e.push(t)}),h(e)},l.prototype.values=function(){var t=[];return this.forEach(function(n){t.push(n)}),h(t)},l.prototype.entries=function(){var e=[];return this.forEach(function(n,t){e.push([t,n])}),h(e)},e&&(l.prototype[Symbol.iterator]=l.prototype.entries);var c=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},P.call(b.prototype),P.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},y.error=function(){var n=new y(null,{status:0,statusText:""});return n.type="error",n};var f=[301,302,303,307,308];y.redirect=function(n,t){if(-1===f.indexOf(t))throw new RangeError("Invalid status code");return new y(null,{status:t,headers:{location:n}})},n.Headers=l,n.Request=b,n.Response=y,n.fetch=function(e,s){return new Promise(function(i,n){var t=new b(e,s),o=new XMLHttpRequest;o.onload=function(){var n,s,t={status:o.status,statusText:o.statusText,headers:(n=o.getAllResponseHeaders()||"",s=new l,n.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(n){var t=n.split(":"),e=t.shift().trim();if(e){var i=t.join(":").trim();s.append(e,i)}}),s)};t.url="responseURL"in o?o.responseURL:t.headers.get("X-Request-URL");var e="response"in o?o.response:o.responseText;i(new y(e,t))},o.onerror=function(){n(new TypeError("Network request failed"))},o.ontimeout=function(){n(new TypeError("Network request failed"))},o.open(t.method,t.url,!0),"include"===t.credentials?o.withCredentials=!0:"omit"===t.credentials&&(o.withCredentials=!1),"responseType"in o&&u&&(o.responseType="blob"),t.headers.forEach(function(n,t){o.setRequestHeader(t,n)}),o.send(void 0===t._bodyInit?null:t._bodyInit)})},n.fetch.polyfill=!0}function m(n){if("string"!=typeof n&&(n=String(n)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(n))throw new TypeError("Invalid character in header field name");return n.toLowerCase()}function d(n){return"string"!=typeof n&&(n=String(n)),n}function h(t){var n={next:function(){var n=t.shift();return{done:void 0===n,value:n}}};return e&&(n[Symbol.iterator]=function(){return n}),n}function l(t){this.map={},t instanceof l?t.forEach(function(n,t){this.append(t,n)},this):Array.isArray(t)?t.forEach(function(n){this.append(n[0],n[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(n){this.append(n,t[n])},this)}function g(n){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}function p(e){return new Promise(function(n,t){e.onload=function(){n(e.result)},e.onerror=function(){t(e.error)}})}function w(n){var t=new FileReader,e=p(t);return t.readAsArrayBuffer(n),e}function v(n){if(n.slice)return n.slice(0);var t=new Uint8Array(n.byteLength);return t.set(new Uint8Array(n)),t.buffer}function P(){return this.bodyUsed=!1,this._initBody=function(n){if(this._bodyInit=n)if("string"==typeof n)this._bodyText=n;else if(u&&Blob.prototype.isPrototypeOf(n))this._bodyBlob=n;else if(i&&FormData.prototype.isPrototypeOf(n))this._bodyFormData=n;else if(t&&URLSearchParams.prototype.isPrototypeOf(n))this._bodyText=n.toString();else if(s&&u&&r(n))this._bodyArrayBuffer=v(n.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!s||!ArrayBuffer.prototype.isPrototypeOf(n)&&!a(n))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=v(n)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof n?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(n)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u&&(this.blob=function(){var n=g(this);if(n)return n;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(w)}),this.text=function(){var n,t,e,i=g(this);if(i)return i;if(this._bodyBlob)return n=this._bodyBlob,t=new FileReader,e=p(t),t.readAsText(n),e;if(this._bodyArrayBuffer)return Promise.resolve(function(n){for(var t=new Uint8Array(n),e=new Array(t.length),i=0;i<t.length;i++)e[i]=String.fromCharCode(t[i]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(N)}),this.json=function(){return this.text().then(JSON.parse)},this}function b(n,t){var e,i,s=(t=t||{}).body;if(n instanceof b){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,t.headers||(this.headers=new l(n.headers)),this.method=n.method,this.mode=n.mode,s||null==n._bodyInit||(s=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(e=t.method||this.method||"GET",i=e.toUpperCase(),-1<c.indexOf(i)?i:e),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(s)}function N(n){var s=new FormData;return n.trim().split("&").forEach(function(n){if(n){var t=n.split("="),e=t.shift().replace(/\+/g," "),i=t.join("=").replace(/\+/g," ");s.append(decodeURIComponent(e),decodeURIComponent(i))}}),s}function y(n,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(n)}}("undefined"!=typeof self?self:this);var fetch,isNode=!1;function Rehive(t){this.public={companies:[]},this.auth={password:{},email:{},mobile:{},tokens:{},mfa:{sms:{},token:{},status:{},authenticators:{}}},this.user={addresses:[],bankAccounts:{},cryptoAccounts:{},documents:{},emails:{},mobiles:{},legalTerms:{versions:{}}},this.transactions={totals:{}},this.transaction_collections={},this.accounts={currencies:{}},this.company={currencies:{},bankAccounts:{}},this.groups={},this.permissions={},this.admin={auth:{login:{},register:{}},accessControlRules:{},users:{overview:{},tiers:{},addresses:{},bankAccounts:{currencies:{}},settings:{},cryptoAccounts:{},documents:{},emails:{},mobiles:{},permissions:{},messages:{},groups:{},kyc:{},mfa:{token:{},sms:{},authenticators:{}}},requests:{},transactions:{messages:{},totals:{}},transaction_collections:{},accounts:{currencies:{limits:{},fees:{},settings:{}}},account:{currencies:{},definitions:{groups:{currencies:{}}}},currencies:{overview:{},bankAccounts:{}},company:{settings:{},address:{},links:{}},bankAccounts:{currencies:{}},webhooks:{},subtypes:{},notifications:{},services:{},groups:{tiers:{requirements:{},limits:{},fees:{},settings:{}},fees:{},permissions:{},accountConfigurations:{currencies:{}},settings:{}},webhookTasks:{requests:{}},exports:{sets:{}},metrics:{points:{}}};var u,n="3",i="public/companies/",s="auth/mfa/sms/",o="auth/mfa/token/",r="auth/mfa/authenticators/",a="auth/tokens/",c="user/addresses/",f="user/bank-accounts/",m="user/crypto-accounts/",d="user/documents/",h="user/emails/",l="user/mobiles/",g="user/legal-terms/",p="transactions/",w="transaction-collections/",v="accounts/",P="/currencies/",b="company/currencies/",N="permissions/",y="groups/",k={"Content-Type":"application/json",Accept:"application/json"},A="admin/users/",_="admin/access-control-rules/",T="admin/users/mfa/authenticators/",x="/settings/",C="admin/users/overview/",S="/permissions/",E="/groups/",I="admin/users/addresses/",R="admin/users/bank-accounts/",j="admin/users/crypto-accounts/",q="admin/users/documents/",O="admin/users/emails/",B="admin/users/mobiles/",D="admin/transactions/",U="admin/exports/",F="admin/transaction-collections/",z="admin/accounts/",L="/currencies/",M="/limits/",G="/fees/",H="/settings/",J="admin/account-currencies/",V="admin/account-definitions/",X="admin/currencies/",K="/bank-accounts/",W="admin/company/",$="admin/company/links/",Q="settings/",Y="address/",Z="admin/webhooks/",nn="admin/webhook-tasks/",tn="/requests/",en="admin/subtypes/",sn="admin/notifications/",on="/requirements/",un="/limits/",rn="/fees/",an="admin/bank-accounts/",cn="admin/services/",fn="admin/groups/",mn="admin/requests/",dn="/permissions/",hn="/settings/",ln="/tiers/",gn="/account-configurations/",pn="/currencies/",wn="/settings/",vn="admin/metrics/";t||(t={}),u=0<Object.keys(t).length?(t.apiToken&&An(t.apiToken),t.customAPIURL?t.customAPIURL:(n=t.apiVersion?t.apiVersion:"3",t.network&&"staging"==t.network?t.network="api.staging.rehive.com":t.network="api.rehive.com","https://"+t.network+"/"+n+"/")):(n="3",t.network="api.rehive.com","https://"+t.network+"/"+n+"/");var e,Pn,bn,Nn={},yn={};function kn(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(encodeURIComponent(e)+"="+encodeURIComponent(n[e]));return t.join("&")}function An(n){if(t&&t.storageMethod){if(void 0===sessionStorage||void 0===localStorage)return void console.log("sessionStorage and localStorage not supported.");"local"===t.storageMethod?localStorage.setItem("token",n):"session"===t.storageMethod&&sessionStorage.setItem("token",n)}e=n}function _n(){return t&&"local"===t.storageMethod?e=localStorage.getItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.getItem("token")),e||""}function Tn(){t&&"local"===t.storageMethod?e=localStorage.removeItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.removeItem("token")),delete k.Authorization,e=""}function xn(e){return e.json().then(function(t){return new Promise(function(n){e.ok||(t.status_code=e.status,t.ok=e.ok),n(t)})})}function Cn(n){Pn=n.next?n.next:null,bn=n.previous?n.previous:null}function Sn(n,t){n.next?Nn[t]=n.next:delete Nn[t],n.previous?yn[t]=n.previous:delete yn[t]}var En=function(i,s,o){return new Promise(function(t,e){var n=_n();n&&!o?k.Authorization="Token "+n:delete k.Authorization,fetch(u+i,{method:"POST",headers:k,body:JSON.stringify(s)}).then(xn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},In=function(i,s){return new Promise(function(t,e){var n=s||_n();n?k.Authorization="Token "+n:delete k.Authorization,fetch(u+i,{method:"GET",headers:k}).then(xn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},Rn=function(i,s){return new Promise(function(t,e){var n=_n();n?k.Authorization="Token "+n:delete k.Authorization,!isNode&&s instanceof FormData?delete k["Content-Type"]:(k["Content-Type"]="application/json",s=JSON.stringify(s)),fetch(u+i,{method:"PATCH",headers:k,body:s}).then(xn).then(function(n){k["Content-Type"]="application/json","success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},jn=function(i,s){return new Promise(function(t,e){var n=_n();n?k.Authorization="Token "+n:delete k.Authorization,fetch(u+i,{method:"DELETE",headers:k,body:JSON.stringify(s)}).then(xn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})};this.removeToken=function(){return t&&"local"===t.storageMethod?e=localStorage.removeItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.removeItem("token")),delete k.Authorization,e="","Token removed"},this.public.companies.get=function(n){return new Promise(function(t,e){In(n?i+n+"/":i).then(function(n){t(n)},function(n){e(n)})})},this.auth.register=function(n){return new Promise(function(t,e){fetch(u+"auth/register/",{method:"POST",headers:k,body:JSON.stringify(n)}).then(xn).then(function(n){"success"==n.status?(An(n.data.token),t({user:n.data.user,token:n.data.token})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.registerCompany=function(n){return new Promise(function(t,e){fetch(u+"auth/company/register/",{method:"POST",headers:k,body:JSON.stringify(n)}).then(xn).then(function(n){"success"==n.status?(An(n.data.token),t(n.data.user)):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.login=function(n){return new Promise(function(t,e){fetch(u+"auth/login/",{method:"POST",headers:k,body:JSON.stringify(n)}).then(xn).then(function(n){"success"==n.status?(An(n.data.token),t({user:n.data.user,token:n.data.token,challenges:n.data.challenges,mfa:void 0!==n.data.mfa?n.data.mfa:null})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.logout=function(){return new Promise(function(t,e){var n=_n();n?k.Authorization="Token "+n:delete k.Authorization,fetch(u+"auth/logout/",{method:"POST",headers:k}).then(xn).then(function(n){"success"==n.status?(Tn(),t({})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.logoutAll=function(){return new Promise(function(t,e){var n=_n();n?k.Authorization="Token "+n:delete k.Authorization,fetch(u+"auth/logout/all/",{method:"POST",headers:k}).then(xn).then(function(n){"success"==n.status?(Tn(),t({})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.password.change=function(n){return new Promise(function(t,e){En("auth/password/change/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.password.reset=function(n){return new Promise(function(t,e){En("auth/password/reset/",n,!0).then(function(n){t(n)},function(n){e(n)})})},this.auth.password.resetConfirm=function(n){return new Promise(function(t,e){En("auth/password/reset/confirm/",n,!0).then(function(n){t(n)},function(n){e(n)})})},this.auth.email.resendEmailVerification=function(n){return new Promise(function(t,e){En("auth/email/verify/resend/",n,!0).then(function(n){t(n)},function(n){e(n)})})},this.auth.mobile.resendMobileVerification=function(n){return new Promise(function(t,e){En("auth/mobile/verify/resend/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mobile.verify=function(n){return new Promise(function(t,e){En("auth/mobile/verify/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.email.verify=function(n){return new Promise(function(t,e){En("auth/email/verify/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.get=function(n){var i;return i=n?a+n:a,new Promise(function(t,e){In(i).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.create=function(n){return new Promise(function(t,e){En(a,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.delete=function(i){return new Promise(function(t,e){var n;i?n=a+i:e({status:"error",message:"A token is required"}),jn(n,{}).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.verify=function(n){return new Promise(function(t,e){In("auth/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.authenticators.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?r+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),r+i):r,In(n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.authenticators.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.auth.mfa.authenticators.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.auth.mfa.authenticators.create=function(n){return new Promise(function(t,e){En(r,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.authenticators.delete=function(n){return new Promise(function(t,e){n?jn(r+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.auth.mfa.deliver=function(n){return new Promise(function(t,e){En("auth/mfa/deliver/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.status.get=function(){return new Promise(function(t,e){In("auth/mfa/").then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.get=function(){return new Promise(function(t,e){In(s).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.enable=function(n){return new Promise(function(t,e){En(s,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.send=function(n){return new Promise(function(t,e){En("auth/mfa/sms/send/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.disable=function(n){return new Promise(function(t,e){jn(s,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.get=function(){return new Promise(function(t,e){In(o).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.enable=function(n){return new Promise(function(t,e){En(o,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.disable=function(){return new Promise(function(t,e){jn(o).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.verify=function(n){return new Promise(function(t,e){En("auth/mfa/verify/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?p+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),p+i):p,In(n).then(function(n){Sn(n,"Transaction"),t(n)},function(n){e(n)})})},this.transactions.getNext=function(){return new Promise(function(t,e){var n,i=Nn.Transaction;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"Transaction"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transactions.getPrevious=function(){return new Promise(function(t,e){var n,i=yn.Transaction;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"Transaction"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transactions.totals.get=function(n){return new Promise(function(t,e){n=n?"?"+kn(n):"",In(p+"totals/"+n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createDebit=function(n){return new Promise(function(t,e){En("transactions/debit/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createCredit=function(n){return new Promise(function(t,e){En("transactions/credit/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createTransfer=function(n){return new Promise(function(t,e){En("transactions/transfer/",n).then(function(n){t(n)},function(n){e(n)})})},this.transaction_collections.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?w+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),w+i):w,In(n).then(function(n){Sn(n,"Transaction Collection"),t(n)},function(n){e(n)})})},this.transaction_collections.getNext=function(){return new Promise(function(t,e){var n,i=Nn["Transaction Collection"];i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"Transaction Collection"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transaction_collections.getPrevious=function(){return new Promise(function(t,e){var n,i=yn["Transaction Collection"];i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"Transaction Collection"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transaction_collections.create=function(n){return new Promise(function(t,e){En(w,n).then(function(n){t(n)},function(n){e(n)})})},this.accounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.reference?v+s.reference+"/":s&&s.filters?(i="?"+kn(s.filters),v+i):v,In(n).then(function(n){Sn(n,"Account"),t(n)},function(n){e(n)})})},this.accounts.getNext=function(){return new Promise(function(t,e){var n,i=Nn.Account;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"Account"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.getPrevious=function(){return new Promise(function(t,e){var n,i=yn.Account;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"Account"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.create=function(n){return new Promise(function(t,e){En(v,n).then(function(n){t(n)},function(n){e(n)})})},this.accounts.currencies.get=function(s,o){return new Promise(function(t,e){var n,i;s&&"string"==typeof s?(n=o&&o.code?v+s+P+o.code+"/":o&&o.filters?(i="?"+kn(o.filters),v+s+P+i):v+s+P,In(n).then(function(n){Sn(n,"AccountCurrencies"),t(n)},function(n){e(n)})):e({status:"error",message:"Reference is required"})})},this.accounts.currencies.getNext=function(){return new Promise(function(t,e){var n,i=Nn.AccountCurrencies;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"AccountCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n,i=yn.AccountCurrencies;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"AccountCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.currencies.update=function(n,i,s){return new Promise(function(t,e){n&&"string"==typeof n?i&&"string"==typeof i?Rn(v+n+P+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Currency Code is required"}):e({status:"error",message:"Reference is required"})})},this.company.get=function(){return new Promise(function(t,e){In("company/").then(function(n){t(n)},function(n){e(n)})})},this.company.currencies.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.code?b+s.code+"/":s&&s.filters?(i="?"+kn(s.filters),b+i):b,In(n).then(function(n){Sn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})})},this.company.currencies.getNext=function(){return new Promise(function(t,e){var n,i=Nn.CompanyCurrencies;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.company.currencies.getPrevious=function(){return new Promise(function(t,e){var n,i=yn.CompanyCurrencies;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.company.bankAccounts.get=function(){return new Promise(function(t,e){In("company/bank-accounts/").then(function(n){t(n)},function(n){e(n)})})},this.permissions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?N+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),N+i):N,In(n).then(function(n){Sn(n,"Permissions"),t(n)},function(n){e(n)})})},this.permissions.getNext=function(){return new Promise(function(t,e){var n,i=Nn.Permissions;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"Permissions"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.permissions.getPrevious=function(){return new Promise(function(t,e){var n,i=yn.Permissions;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"Permissions"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.groups.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.name?y+s.name+"/":s&&s.filters?(i="?"+kn(s.filters),y+i):y,In(n).then(function(n){Sn(n,"Groups"),t(n)},function(n){e(n)})})},this.groups.getNext=function(){return new Promise(function(t,e){var n,i=Nn.Groups;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"Groups"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.groups.getPrevious=function(){return new Promise(function(t,e){var n,i=yn.Groups;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.get=function(){return new Promise(function(t,e){In("user/").then(function(n){t(n)},function(n){e(n)})})},this.user.update=function(n){return new Promise(function(t,e){Rn("user/",n).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.get=function(n){return new Promise(function(t,e){In(n?c+n:c).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.update=function(i){return new Promise(function(t,e){var n;i.id?n=c+i.id+"/":e({status:400,message:"No id has been given"}),Rn(n,i).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.create=function(n){return new Promise(function(t,e){En(c,n).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.delete=function(n){return new Promise(function(t,e){n?jn(c+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.user.bankAccounts.get=function(n){return new Promise(function(t,e){In(n?f+n+"/":f).then(function(n){t(n)},function(n){e(n)})})},this.user.bankAccounts.create=function(n){return new Promise(function(t,e){En(f,n).then(function(n){t(n)},function(n){e(n)})})},this.user.bankAccounts.update=function(n,i){return new Promise(function(t,e){n?Rn(f+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Account id is required"})})},this.user.bankAccounts.delete=function(n){return new Promise(function(t,e){n?jn(f+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Bank id is required"})})},this.user.cryptoAccounts.get=function(n){return new Promise(function(t,e){In(n?m+n+"/":m).then(function(n){t(n)},function(n){e(n)})})},this.user.cryptoAccounts.create=function(n){return new Promise(function(t,e){En(m,n).then(function(n){t(n)},function(n){e(n)})})},this.user.cryptoAccounts.update=function(n,i){return new Promise(function(t,e){n?Rn(m+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Crypto account id is required"})})},this.user.cryptoAccounts.delete=function(n){return new Promise(function(t,e){n?jn(m+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Crypto account id is required"})})},this.user.documents.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?d+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),d+i):d,In(n).then(function(n){Sn(n,"Documents"),t(n)},function(n){e(n)})})},this.user.documents.getNext=function(){return new Promise(function(t,e){var n,i=Nn.Documents;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"Documents"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.documents.getPrevious=function(){return new Promise(function(t,e){var n,i=yn.Documents;i?(n=i.split(u)[1],In(n).then(function(n){Sn(n,"Documents"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.documents.create=function(s){return new Promise(function(t,e){var n=_n(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+d,{method:"POST",headers:i,body:s}).then(xn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.user.emails.get=function(n){return new Promise(function(t,e){In(n?h+n+"/":h).then(function(n){t(n)},function(n){e(n)})})},this.user.emails.create=function(n){return new Promise(function(t,e){En(h,n).then(function(n){t(n)},function(n){e(n)})})},this.user.emails.update=function(n,i){return new Promise(function(t,e){n&&i?Rn(h+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Email address id is required"},null)})},this.user.emails.delete=function(n){return new Promise(function(t,e){n?jn(h+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Email address id is required"})})},this.user.mobiles.get=function(n){return new Promise(function(t,e){In(n?l+n+"/":l).then(function(n){t(n)},function(n){e(n)})})},this.user.mobiles.create=function(n){return new Promise(function(t,e){En(l,n).then(function(n){t(n)},function(n){e(n)})})},this.user.mobiles.update=function(n,i){return new Promise(function(t,e){n&&i?Rn(l+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Mobile number id is required"})})},this.user.mobiles.delete=function(n){return new Promise(function(t,e){n?jn(l+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Mobile number id is required"})})},this.user.legalTerms.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?g+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),g+i):g,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.user.legalTerms.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.legalTerms.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.legalTerms.versions.get=function(i,s){return new Promise(function(t,e){if(i){var n=g+i+"/versions/";s&&s.id?n+=s.id+"/":s&&s.filters&&(filters="?"+kn(s.filters),n+=filters),In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})}else e({status:400,message:"No term ID has been given"})})},this.user.legalTerms.versions.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){n.next&&Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.legalTerms.versions.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.legalTerms.versions.update=function(n,i,s){return new Promise(function(t,e){n?i?Rn(g+n+"/versions/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No version ID has been given"}):e({status:400,message:"No term ID has been given"})})},this.admin.auth.login=function(n){return new Promise(function(t,e){En("admin/auth/login/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.auth.register=function(n){return new Promise(function(t,e){En("admin/auth/register/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.metrics.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?vn+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),vn+i):vn,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.metrics.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.metrics.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.metrics.create=function(n){return new Promise(function(t,e){En(vn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.metrics.delete=function(n){return new Promise(function(t,e){n?jn(vn+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.metrics.points.get=function(i,s){return new Promise(function(t,e){var n;i?(n=vn+i+"/points/",s.filters&&(n+="?"+kn(s.filters)),In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"No id has been given"})})},this.admin.metrics.points.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.metrics.points.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.exports.sets.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?U+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),U+i):U,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.exports.sets.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.exports.sets.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.exports.sets.create=function(n){return new Promise(function(t,e){En(U,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.exports.sets.delete=function(n){return new Promise(function(t,e){n?jn(U+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.accessControlRules.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?_+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),_+i):_,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.accessControlRules.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accessControlRules.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accessControlRules.create=function(n){return new Promise(function(t,e){n?En(_,n).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No data has been given"})})},this.admin.accessControlRules.update=function(n,i){return new Promise(function(t,e){n?Rn(_+n,i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.accessControlRules.delete=function(n){return new Promise(function(t,e){n?jn(_+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.overview.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.filters?(i="?"+kn(s.filters),C+i):C,In(n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.settings.get=function(n){return new Promise(function(t,e){n?In(A+n+x).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.settings.update=function(n,i){return new Promise(function(t,e){n?Rn(A+n+x,i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.kyc.get=function(n){return new Promise(function(t,e){n?In(A+n+"/kyc/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.kyc.update=function(n,i){return new Promise(function(t,e){n?Rn(A+n+"/kyc/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?A+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),A+i):A,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.users.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.create=function(i){return new Promise(function(t,e){var n=_n();n?k.Authorization="Token "+n:delete k.Authorization,!isNode&&i instanceof FormData?delete k["Content-Type"]:i=JSON.stringify(i),fetch(u+A,{method:"POST",headers:k,body:i}).then(xn).then(function(n){k["Content-Type"]="application/json","success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.admin.users.update=function(s,o){return new Promise(function(t,e){if(s){var n=_n(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+A+s+"/",{method:"PATCH",headers:i,body:o}).then(xn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})}else e({status:400,message:"No id has been given"})})},this.admin.users.delete=function(n){return new Promise(function(t,e){n?jn(A+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.permissions.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.id?A+s+S+o.id+"/":o&&o.filters?(i="?"+kn(o.filters),A+s+S+i):A+s+S,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"No id has been given"})})},this.admin.users.permissions.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.permissions.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.permissions.create=function(n,i){return new Promise(function(t,e){En(A+n+S,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.permissions.delete=function(n,i){return new Promise(function(t,e){jn(A+n+S+i+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.messages.get=function(i,s){return new Promise(function(t,e){i||e({status:400,message:"User ID not found."});var n=A+i+"/messages/";s&&s.id?n+=s.id+"/":s&&s.filters&&(n+="?"+kn(s.filters)),In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.users.messages.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.messages.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.messages.create=function(n,i){return new Promise(function(t,e){n||e({status:400,message:"User ID not found."}),En(A+n+"/messages/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.groups.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.name?A+s+E+o.name+"/":o&&o.filters?(i="?"+kn(o.filters),A+s+E+i):A+s+E,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"No id has been given"})})},this.admin.users.groups.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.groups.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.groups.create=function(n,i){return new Promise(function(t,e){En(A+n+E,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.groups.delete=function(n,i){return new Promise(function(t,e){jn(A+n+E+i+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.addresses.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?I+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),I+i):I,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.users.addresses.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.addresses.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.addresses.create=function(n){return new Promise(function(t,e){En(I,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.addresses.update=function(n,i){return new Promise(function(t,e){n?Rn(I+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.addresses.delete=function(n){return new Promise(function(t,e){n?jn(I+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?R+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),R+i):R,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.create=function(n){return new Promise(function(t,e){En(R,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.update=function(n,i){return new Promise(function(t,e){n?Rn(R+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.delete=function(n){return new Promise(function(t,e){n?jn(R+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.currencies.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.code?R+s+"/currencies/"+o.code+"/":o&&o.filters?(i="?"+kn(o.filters),R+s+"/currencies/"+i):R+s+"/currencies/",In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.currencies.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.currencies.create=function(n,i){return new Promise(function(t,e){n?En(R+n+"/currencies/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.currencies.update=function(n,i,s){return new Promise(function(t,e){n?i?Rn(R+n+"/currencies/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.currencies.delete=function(n,i){return new Promise(function(t,e){n?i?jn(R+n+"/currencies/"+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No id has been given"})})},this.admin.users.cryptoAccounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?j+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),j+i):j,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.users.cryptoAccounts.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.cryptoAccounts.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.cryptoAccounts.create=function(n){return new Promise(function(t,e){En(j,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.cryptoAccounts.update=function(n,i){return new Promise(function(t,e){n?Rn(j+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.cryptoAccounts.delete=function(n){return new Promise(function(t,e){n?jn(j+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.documents.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?q+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),q+i):q,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.users.documents.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.documents.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.documents.create=function(s){return new Promise(function(t,e){var n=_n(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+q,{method:"POST",headers:i,body:s}).then(xn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.admin.users.documents.update=function(s,o){return new Promise(function(t,e){if(s){var n=_n(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+q+s+"/",{method:"PATCH",headers:i,body:o}).then(xn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})}else e({status:400,message:"No id has been given"})})},this.admin.users.documents.delete=function(n){return new Promise(function(t,e){n?jn(q+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.emails.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?O+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),O+i):O,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.users.emails.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.emails.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.emails.create=function(n){return new Promise(function(t,e){En(O,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.emails.update=function(n,i){return new Promise(function(t,e){n?Rn(O+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.emails.delete=function(n){return new Promise(function(t,e){n?jn(O+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mobiles.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?B+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),B+i):B,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.users.mobiles.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.mobiles.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.mobiles.create=function(n){return new Promise(function(t,e){En(B,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.mobiles.update=function(n,i){return new Promise(function(t,e){n?Rn(B+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mobiles.delete=function(n){return new Promise(function(t,e){n?jn(B+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mfa.authenticators.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?T+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),T+i):T,In(n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.mfa.authenticators.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.mfa.authenticators.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.mfa.authenticators.delete=function(n){return new Promise(function(t,e){n?jn(T+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No authenticator id has been given"})})},this.admin.users.mfa.get=function(n){return new Promise(function(t,e){n?In(A+n+"/mfa/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mfa.sms.delete=function(n){return new Promise(function(t,e){n?jn(A+n+"/mfa/sms/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mfa.token.delete=function(n){return new Promise(function(t,e){n?jn(A+n+"/mfa/token/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.transactions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?D+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),D+i):D,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.transactions.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transactions.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transactions.totals.get=function(i){return new Promise(function(t,e){var n;n=i?"?"+kn(i.filters):"",In("admin/transactions/totals/"+n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.transactions.update=function(n,i){return new Promise(function(t,e){n?Rn(D+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.transactions.createCredit=function(n){return new Promise(function(t,e){En("admin/transactions/credit/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transactions.createDebit=function(n){return new Promise(function(t,e){En("admin/transactions/debit/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transactions.createTransfer=function(n){return new Promise(function(t,e){En("admin/transactions/transfer/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transactions.messages.get=function(i,s){return new Promise(function(t,e){i||e({status:400,message:"Transaction ID not found."});var n=D+i+"/messages/";s&&s.id?n+=s.id+"/":s&&s.filters&&(n+="?"+kn(s.filters)),In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.transactions.messages.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transactions.messages.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transactions.messages.create=function(n,i){return new Promise(function(t,e){n||e({status:400,message:"Transaction ID not found."}),En(D+n+"/messages/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.transaction_collections.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?F+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),F+i):F,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.transaction_collections.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transaction_collections.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transaction_collections.create=function(n){return new Promise(function(t,e){En(F,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transaction_collections.update=function(n,i){return new Promise(function(t,e){n?Rn(F+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference has been given"})})},this.admin.transaction_collections.delete=function(n){return new Promise(function(t,e){n?jn(F+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.accounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.reference?z+s.reference+"/":s&&s.filters?(i="?"+kn(s.filters),z+i):z,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.accounts.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.name?V+s.name+"/":s&&s.filters?(i="?"+kn(s.filters),V+i):V,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.account.definitions.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.create=function(n){return new Promise(function(t,e){En(V,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.account.definitions.update=function(n,i){return new Promise(function(t,e){n?Rn(V+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.delete=function(n){return new Promise(function(t,e){n?jn(V+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.name?V+s+"/groups/"+o.name+"/":o&&o.filters?(i="?"+kn(o.filters),V+s+"/groups/"+i):V+s+"/groups/",In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.create=function(n,i){return new Promise(function(t,e){n?En(V+n+"/groups/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.update=function(n,i,s){return new Promise(function(t,e){n?i?Rn(V+n+"/groups/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.delete=function(n,i){return new Promise(function(t,e){n?i?jn(V+n+"/groups/"+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.get=function(s,o,u){return new Promise(function(t,e){var n,i;s?o?(n=u&&u.code?V+s+"/groups/"+o+"/currencies/"+u.code+"/":u&&u.filters?(i="?"+kn(u.filters),V+s+"/groups/"+o+"/currencies/"+i):V+s+"/groups/"+o+"/currencies/",In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.currencies.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.currencies.create=function(n,i,s){return new Promise(function(t,e){n?i?En(V+n+"/groups/"+i+"/currencies/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.update=function(n,i,s,o){return new Promise(function(t,e){n?i?s?Rn(V+n+"/groups/"+i+"/currencies/"+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.delete=function(n,i,s){return new Promise(function(t,e){n?i?s?jn(V+n+"/groups/"+i+"/currencies/"+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.currencies.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.reference?J+s.reference+"/":s&&s.filters?(i="?"+kn(s.filters),J+i):J,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.account.currencies.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.currencies.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.create=function(n){return new Promise(function(t,e){En(z,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.update=function(n,i){return new Promise(function(t,e){n?Rn(z+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference has been given"})})},this.admin.accounts.currencies.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.code?z+s+L+o.code+"/":o&&o.filters?(i="?"+kn(o.filters),z+s+L+i):z+s+L,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"No reference has been given"})})},this.admin.accounts.currencies.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.currencies.create=function(n,i){return new Promise(function(t,e){En(z+n+L,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.currencies.update=function(n,i,s){return new Promise(function(t,e){n&&i?Rn(z+n+L+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.limits.get=function(i,s,o){return new Promise(function(t,e){var n;i&&s?(n=o&&o.id?z+i+L+s+M+o.id+"/":z+i+L+s+M,In(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.limits.create=function(n,i,s){return new Promise(function(t,e){En(z+n+L+i+M,s).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.currencies.limits.update=function(n,i,s,o){return new Promise(function(t,e){n&&i&&s?Rn(z+n+L+i+M+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.limits.delete=function(n,i,s){return new Promise(function(t,e){n&&i&&s?jn(z+n+L+i+M+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.fees.get=function(i,s,o){return new Promise(function(t,e){var n;i&&s?(n=o&&o.id?z+i+L+s+G+o.id+"/":z+i+L+s+G,In(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.fees.create=function(n,i,s){return new Promise(function(t,e){En(z+n+L+i+G,s).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.currencies.fees.update=function(n,i,s,o){return new Promise(function(t,e){n&&i&&s?Rn(z+n+L+i+G+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.fees.delete=function(n,i,s){return new Promise(function(t,e){n&&i&&s?jn(z+n+L+i+G+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.settings.get=function(n,i){return new Promise(function(t,e){n&&i?In(z+n+L+i+H).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.settings.update=function(n,i,s){return new Promise(function(t,e){n&&i?Rn(z+n+L+i+H,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code has been given"})})},this.admin.currencies.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.code?X+s.code+"/":s&&s.filters?(i="?"+kn(s.filters),X+i):X,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.currencies.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.create=function(n){return new Promise(function(t,e){En(X,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.update=function(n,i){return new Promise(function(t,e){if(!n)return currencies.update,void e({status:400,message:"No code has been given"});Rn(X+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.delete=function(n){return new Promise(function(t,e){n?jn(X+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No code has been given"})})},this.admin.currencies.overview.get=function(n){return new Promise(function(t,e){n||e({status:400,message:"No code provided"}),In(X+n+"/overview/").then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.id?X+s+K+o.id+"/":o&&o.filters?(i="?"+kn(o.filters),X+s+K+i):X+s+K,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.bankAccounts.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.bankAccounts.create=function(n,i){return new Promise(function(t,e){En(X+n+K,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.delete=function(n,i){return new Promise(function(t,e){jn(X+n+K+i+"/").then(function(n){t(n)},function(n){e(n)})})},this.admin.company.get=function(){return new Promise(function(t,e){In(W).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.update=function(n){return new Promise(function(t,e){Rn(W,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.settings.get=function(){return new Promise(function(t,e){In(W+Q).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.settings.update=function(n){return new Promise(function(t,e){Rn(W+Q,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.address.get=function(){return new Promise(function(t,e){In(W+Y).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.address.update=function(n){return new Promise(function(t,e){Rn(W+Y,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.links.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?$+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),$+i):$,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.company.links.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.company.links.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.company.links.create=function(n){return new Promise(function(t,e){En($,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.links.update=function(n,i){return new Promise(function(t,e){n?Rn($+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.company.links.delete=function(n){return new Promise(function(t,e){n?jn($+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.bankAccounts.get=function(n){var i;return i=n&&n.id?an+n.id+"/":an,new Promise(function(t,e){In(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.create=function(n){return new Promise(function(t,e){En(an,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.update=function(n,i){return new Promise(function(t,e){Rn(an+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.delete=function(n){return new Promise(function(t,e){jn(an+n+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.currencies.get=function(i,s){return new Promise(function(t,e){if(i){var n=an+i+"/currencies/";s&&(n+=s),In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})}else e({status:400,message:"No bank ID has been given"})})},this.admin.bankAccounts.currencies.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){n.next&&Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.bankAccounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.bankAccounts.currencies.create=function(n,i){if(i.currency)return new Promise(function(t,e){En(an+n+"/currencies/",i).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No currency has been given"})},this.admin.bankAccounts.currencies.delete=function(n,i){if(n){if(i)return new Promise(function(t,e){jn(an+n+"/currencies/"+i,{}).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No currency has been given"})}else reject({status:400,message:"No bank ID has been given"})},this.admin.webhooks.get=function(n){var i,t;return i=n&&n.id?Z+n.id+"/":n&&n.filters?(t="?"+kn(n.filters),Z+t):Z,new Promise(function(t,e){In(i).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.webhooks.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhooks.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhooks.create=function(n){return new Promise(function(t,e){En(Z,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhooks.update=function(n,i){return new Promise(function(t,e){Rn(Z+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhooks.delete=function(n){return new Promise(function(t,e){jn(Z+n+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhookTasks.get=function(n){var i,t;return i=n&&n.id?nn+n.id+"/":n&&n.filters?(t="?"+kn(n.filters),nn+t):nn,n&&n.id?new Promise(function(t,e){var n=_n();n?k.Authorization="Token "+n:delete k.Authorization,fetch(u+i,{method:"GET",headers:k}).then(xn).then(function(n){"success"==n.status?n.data&&t(n.data):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})}):new Promise(function(t,e){In(i).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.webhookTasks.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhookTasks.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhookTasks.requests.get=function(n,t){var i,e;return i=t&&t.id?nn+n+tn+t.id+"/":t&&t.filters?(e="?"+kn(t.filters),nn+n+tn+e):nn,new Promise(function(t,e){In(i).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.webhookTasks.requests.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhookTasks.requests.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.subtypes.get=function(n){var i;return i=n&&n.id?en+n.id+"/":n&&n.filters?(filters="?"+kn(n.filters),en+filters):en,new Promise(function(t,e){In(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.subtypes.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.subtypes.create=function(n){return new Promise(function(t,e){En(en,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.update=function(n,i){return new Promise(function(t,e){Rn(en+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.delete=function(n){return new Promise(function(t,e){jn(en+n+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.notifications.get=function(n){var i;return i=n&&n.id?sn+n.id+"/":sn,new Promise(function(t,e){In(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.notifications.update=function(n,i){return new Promise(function(t,e){Rn(sn+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?cn+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),cn+i):cn,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.services.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.services.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.services.update=function(n,i){return new Promise(function(t,e){Rn(cn+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.create=function(n){return new Promise(function(t,e){En(cn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.delete=function(n){return new Promise(function(t,e){n?jn(cn+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.requests.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?mn+s.id+"/":s&&s.filters?(i="?"+kn(s.filters),mn+i):mn,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.requests.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){n.next&&Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.requests.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.name?fn+s.name+"/":s&&s.filters?(i="?"+kn(s.filters),fn+i):fn,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.groups.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.create=function(n){return new Promise(function(t,e){En(fn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.update=function(n,i){return new Promise(function(t,e){n?Rn(fn+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.delete=function(n){return new Promise(function(t,e){n?jn(fn+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.fees.get=function(i,s){return new Promise(function(t,e){var n;i?(n=fn+i+"/fees/",s&&s.id?n+=s.id+"/":s&&s.filters&&(n+="?"+kn(s.filters)),In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"No group name has been given"})})},this.admin.groups.fees.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.fees.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.fees.create=function(n,i){return new Promise(function(t,e){n?En(fn+n+"/fees/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.fees.update=function(n,i,s){return new Promise(function(t,e){n?i?Rn(fn+n+"/fees/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No fee id has been given"}):e({status:400,message:"No group name has been given"})})},this.admin.groups.fees.delete=function(n,i){return new Promise(function(t,e){n?i?jn(fn+n+"/fees/"+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No fee id has been given"}):e({status:400,message:"No group name has been given"})})},this.admin.groups.permissions.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.id?fn+s+dn+o.id+"/":o&&o.filters?(i="?"+kn(o.filters),fn+s+dn+i):fn+s+dn,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.groups.permissions.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.permissions.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.permissions.create=function(n,i){return new Promise(function(t,e){n?En(fn+n+dn,i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.permissions.delete=function(n,i){return new Promise(function(t,e){n&&i?jn(fn+n+dn+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name or permission id has been given"})})},this.admin.groups.settings.get=function(n){return new Promise(function(t,e){n?In(fn+n+hn).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.settings.update=function(n,i){if(n)return new Promise(function(t,e){Rn(fn+n+hn,i).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No group name has been given"})},this.admin.groups.tiers.get=function(n,t){var i;return i=t&&t.id?fn+n+ln+t.id+"/":fn+n+ln,new Promise(function(t,e){In(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.create=function(n,i){return new Promise(function(t,e){En(fn+n+ln,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.update=function(n,i,s){return new Promise(function(t,e){Rn(fn+n+ln+i+"/",s).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.delete=function(n,i){return new Promise(function(t,e){jn(fn+n+ln+i+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.requirements.get=function(i,s,o){return new Promise(function(t,e){var n;s?(n=o&&o.id?fn+i+ln+s+on+o.id+"/":fn+i+ln+s+on,In(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.requirements.create=function(n,i,s){return new Promise(function(t,e){i?En(fn+n+ln+i+on,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.requirements.update=function(n,i,s,o){return new Promise(function(t,e){i?s?Rn(fn+n+ln+i+on+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No requirement id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.requirements.delete=function(n,i,s){return new Promise(function(t,e){i?s?jn(fn+n+ln+i+on+s+"/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No requirement id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.get=function(i,s,o){return new Promise(function(t,e){var n;s?(n=o&&o.id?fn+i+ln+s+rn+o.id+"/":fn+i+ln+s+rn,In(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.create=function(n,i,s){return new Promise(function(t,e){i?En(fn+n+ln+i+rn,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.update=function(n,i,s,o){return new Promise(function(t,e){i?s?Rn(fn+n+ln+i+rn+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No fee id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.delete=function(n,i,s){return new Promise(function(t,e){i?s?jn(fn+n+ln+i+rn+s+"/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No fee id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.get=function(i,s,o){return new Promise(function(t,e){var n;s?(n=o&&o.id?fn+i+ln+s+un+o.id+"/":fn+i+ln+s+un,In(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.create=function(n,i,s){return new Promise(function(t,e){i?En(fn+n+ln+i+un,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.update=function(n,i,s,o){return new Promise(function(t,e){i?s?Rn(fn+n+ln+i+un+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No limit id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.delete=function(n,i,s){return new Promise(function(t,e){i?s?jn(fn+n+ln+i+un+s+"/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No limit id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.settings.get=function(n,i){return new Promise(function(t,e){n?In(fn+n+ln+i+wn).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.tiers.settings.update=function(n,i,s){if(n)return new Promise(function(t,e){Rn(fn+n+ln+i+wn,s).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No group name has been given"})},this.admin.groups.accountConfigurations.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.name?fn+s+gn+o.name+"/":o&&o.filters?(i="?"+kn(o.filters),fn+s+gn+i):fn+s+gn,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.create=function(n,i){return new Promise(function(t,e){En(fn+n+gn,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.update=function(n,i,s){return new Promise(function(t,e){n?Rn(fn+n+gn+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.accountConfigurations.delete=function(n,i){return new Promise(function(t,e){n?jn(fn+n+gn+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.accountConfigurations.currencies.get=function(s,o,u){return new Promise(function(t,e){var n,i;n=u&&u.code?fn+s+gn+o+pn+u.code+"/":u&&u.filters?(i="?"+kn(u.filters),fn+s+gn+o+pn+i):fn+s+gn+o+pn,In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.currencies.getNext=function(){return new Promise(function(t,e){var n;Pn?(n=Pn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.currencies.getPrevious=function(){return new Promise(function(t,e){var n;bn?(n=bn.split(u)[1],In(n).then(function(n){Cn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.currencies.create=function(n,i,s){return new Promise(function(t,e){En(fn+n+gn+i+pn,s).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.currencies.delete=function(n,i,s){return new Promise(function(t,e){n?jn(fn+n+gn+i+pn+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})}}"undefined"!=typeof module&&module.exports?(module.exports=Rehive,global.fetch&&!process.env.IS_BROWSER?fetch=global.fetch:(fetch=require("node-fetch"),isNode=!0)):(window.this,isNode=!1,fetch=window.fetch);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rehive",
3
- "version": "1.34.2",
3
+ "version": "1.35.0",
4
4
  "description": "Javascript sdk for rehive APIs",
5
5
  "main": "rehive.js",
6
6
  "dependencies": {
package/rehive.js CHANGED
@@ -28,7 +28,8 @@ function Rehive(config) {
28
28
  mfa: {
29
29
  sms: {},
30
30
  token: {},
31
- status: {}
31
+ status: {},
32
+ authenticators: {}
32
33
  }
33
34
  };
34
35
 
@@ -87,7 +88,8 @@ function Rehive(config) {
87
88
  kyc: {},
88
89
  mfa: {
89
90
  token: {},
90
- sms: {}
91
+ sms: {},
92
+ authenticators: {}
91
93
  }
92
94
  },
93
95
  requests: {},
@@ -171,6 +173,8 @@ function Rehive(config) {
171
173
  multiFactorAuthSendSmsAPI = 'auth/mfa/sms/send/',
172
174
  multiFactorApiTokenAPI = 'auth/mfa/token/',
173
175
  multiFactorAuthVerifyAPI = 'auth/mfa/verify/',
176
+ multiFactorAuthenticatorsAPI = 'auth/mfa/authenticators/',
177
+ multiFactorAuthDeliverAPI = 'auth/mfa/deliver/',
174
178
  tokensAPI = 'auth/tokens/',
175
179
  tokensVerifyAPI = 'auth/',
176
180
  userProfileAPI = 'user/',
@@ -200,6 +204,7 @@ function Rehive(config) {
200
204
  adminAccessControlRulesAPI = 'admin/access-control-rules/',
201
205
  adminUserKYCAPI = '/kyc/',
202
206
  adminUserMFAAPI = '/mfa/',
207
+ adminUserMFAAuthenticatorsAPI = 'admin/users/mfa/authenticators/',
203
208
  adminUserMFASMSAPI = '/mfa/sms/',
204
209
  adminUserMFATokenAPI = '/mfa/token/',
205
210
  adminUsersSettingsAPI = '/settings/',
@@ -828,6 +833,99 @@ function Rehive(config) {
828
833
  });
829
834
  };
830
835
 
836
+ this.auth.mfa.authenticators.get = function (obj) {
837
+ return new Promise(function (resolve, reject) {
838
+ var url,filters;
839
+
840
+ if(obj && obj.id) {
841
+ url = multiFactorAuthenticatorsAPI + obj.id + '/';
842
+ } else if(obj && obj.filters){
843
+ filters = '?' + serialize(obj.filters);
844
+ url = multiFactorAuthenticatorsAPI + filters;
845
+ } else {
846
+ url = multiFactorAuthenticatorsAPI;
847
+ }
848
+ httpGetRehive(url).then(function (response) {
849
+ resolve(response);
850
+ }, function (error) {
851
+ reject(error);
852
+ });
853
+ });
854
+ };
855
+
856
+ this.auth.mfa.authenticators.getNext = function () {
857
+ return new Promise(function (resolve, reject) {
858
+ var url = nextFilterForLists, mainUrl;
859
+ if (url) {
860
+ var urlArray = url.split(baseAPI);
861
+ mainUrl = urlArray[1];
862
+
863
+ httpGetRehive(mainUrl).then(function (response) {
864
+ saveFilter(response);
865
+ resolve(response);
866
+ }, function (error) {
867
+ reject(error);
868
+ });
869
+ } else {
870
+ reject({ status: 400, message: 'Not allowed' });
871
+ }
872
+ });
873
+ };
874
+
875
+ this.auth.mfa.authenticators.getPrevious = function () {
876
+ return new Promise(function (resolve, reject) {
877
+ var url = previousFilterForLists, mainUrl;
878
+ if (url) {
879
+ var urlArray = url.split(baseAPI);
880
+ mainUrl = urlArray[1];
881
+
882
+ httpGetRehive(mainUrl).then(function (response) {
883
+ saveFilter(response)
884
+ resolve(response);
885
+ }, function (error) {
886
+ reject(error);
887
+ });
888
+ } else {
889
+ reject({ status: 400, message: 'Not allowed' });
890
+ }
891
+ });
892
+ };
893
+
894
+ this.auth.mfa.authenticators.create = function(data) {
895
+ return new Promise(function (resolve, reject) {
896
+ httpPostRehive(multiFactorAuthenticatorsAPI, data).then(function (response) {
897
+ resolve(response);
898
+ }, function (error) {
899
+ reject(error);
900
+ });
901
+ });
902
+ };
903
+
904
+ this.auth.mfa.authenticators.delete = function (id) {
905
+ return new Promise(function (resolve, reject) {
906
+ if (!id) {
907
+ reject({ status: 400, message: 'No id has been given' });
908
+ return;
909
+ }
910
+
911
+ httpDeleteRehive(multiFactorAuthenticatorsAPI + id + '/', {}).then(function (response) {
912
+ resolve(response);
913
+ }, function (error) {
914
+ reject(error);
915
+ });
916
+ });
917
+ };
918
+
919
+ this.auth.mfa.deliver = function(data) {
920
+ return new Promise(function (resolve, reject) {
921
+ httpPostRehive(multiFactorAuthDeliverAPI, data).then(function (response) {
922
+ resolve(response);
923
+ }, function (error) {
924
+ reject(error);
925
+ });
926
+ });
927
+ };
928
+
831
929
  this.auth.mfa.status.get = function () {
832
930
  return new Promise(function (resolve, reject) {
833
931
  httpGetRehive(multiFactorAuthStatusAPI).then(function (response) {
@@ -3653,7 +3751,80 @@ function Rehive(config) {
3653
3751
  });
3654
3752
  });
3655
3753
  };
3754
+
3755
+ this.admin.users.mfa.authenticators.get = function(obj) {
3756
+ return new Promise(function (resolve, reject) {
3757
+ var url,filters;
3758
+
3759
+ if(obj && obj.id) {
3760
+ url = adminUserMFAAuthenticatorsAPI + obj.id + '/';
3761
+ } else if(obj && obj.filters){
3762
+ filters = '?' + serialize(obj.filters);
3763
+ url = adminUserMFAAuthenticatorsAPI + filters;
3764
+ } else {
3765
+ url = adminUserMFAAuthenticatorsAPI;
3766
+ }
3767
+ httpGetRehive(url).then(function (response) {
3768
+ resolve(response);
3769
+ }, function (error) {
3770
+ reject(error);
3771
+ });
3772
+ });
3773
+ };
3774
+
3775
+ this.admin.users.mfa.authenticators.getNext = function () {
3776
+ return new Promise(function (resolve, reject) {
3777
+ var url = nextFilterForLists, mainUrl;
3778
+ if (url) {
3779
+ var urlArray = url.split(baseAPI);
3780
+ mainUrl = urlArray[1];
3781
+
3782
+ httpGetRehive(mainUrl).then(function (response) {
3783
+ saveFilter(response);
3784
+ resolve(response);
3785
+ }, function (error) {
3786
+ reject(error);
3787
+ });
3788
+ } else {
3789
+ reject({ status: 400, message: 'Not allowed' });
3790
+ }
3791
+ });
3792
+ };
3793
+
3794
+ this.admin.users.mfa.authenticators.getPrevious = function () {
3795
+ return new Promise(function (resolve, reject) {
3796
+ var url = previousFilterForLists, mainUrl;
3797
+ if (url) {
3798
+ var urlArray = url.split(baseAPI);
3799
+ mainUrl = urlArray[1];
3800
+
3801
+ httpGetRehive(mainUrl).then(function (response) {
3802
+ saveFilter(response)
3803
+ resolve(response);
3804
+ }, function (error) {
3805
+ reject(error);
3806
+ });
3807
+ } else {
3808
+ reject({ status: 400, message: 'Not allowed' });
3809
+ }
3810
+ });
3811
+ };
3812
+
3813
+ this.admin.users.mfa.authenticators.delete = function (authId) {
3814
+ return new Promise(function (resolve, reject) {
3815
+ if (!authId) {
3816
+ reject({ status: 400, message: 'No authenticator id has been given' });
3817
+ return;
3818
+ }
3656
3819
 
3820
+ httpDeleteRehive(adminUserMFAAuthenticatorsAPI + authId + '/', {}).then(function (response) {
3821
+ resolve(response);
3822
+ }, function (error) {
3823
+ reject(error);
3824
+ });
3825
+ });
3826
+ };
3827
+
3657
3828
  this.admin.users.mfa.get = function (id) {
3658
3829
  return new Promise(function (resolve, reject) {
3659
3830
  if(!id){