libra-sdk-mol
Version:
Javascript SDK for Libra Network and Move Smart Contract powered by MoveOnLibra OpenAPI
8 lines • 43.2 kB
JavaScript
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)r.d(n,s,function(t){return e[t]}.bind(null,s));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=16)}([function(e,t,r){"use strict";var n=r(4),s=r(20),a=Object.prototype.toString;function o(e){return"[object Array]"===a.call(e)}function i(e){return null!==e&&"object"==typeof e}function c(e){return"[object Function]"===a.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===a.call(e)},isBuffer:s,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:i,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===a.call(e)},isFile:function(e){return"[object File]"===a.call(e)},isBlob:function(e){return"[object Blob]"===a.call(e)},isFunction:c,isStream:function(e){return i(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:u,merge:function e(){var t={};function r(r,n){"object"==typeof t[n]&&"object"==typeof r?t[n]=e(t[n],r):t[n]=r}for(var n=0,s=arguments.length;n<s;n++)u(arguments[n],r);return t},deepMerge:function e(){var t={};function r(r,n){"object"==typeof t[n]&&"object"==typeof r?t[n]=e(t[n],r):t[n]="object"==typeof r?e({},r):r}for(var n=0,s=arguments.length;n<s;n++)u(arguments[n],r);return t},extend:function(e,t,r){return u(t,(function(t,s){e[s]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t){e.exports=class{constructor(e){this.client=e,this.checkParam=function(e,t,r,n){if(null==e){if(n)throw new Error("Missing the required parameter: "+t);return e}if(("string"===r||"integer"===r)&&"object"==typeof e)if(void 0!==e[t])e=e[t];else if(n)throw new Error(JSON.stringify(e)+" does not have requried param: "+t);return this.checkParamType(e,t,r),"string"===r&&(e=e.trim(),t.endsWith("address")),e},this.checkParamType=function(e,t,r){if("string"===r){if("string"!=typeof e)throw new Error(t+"'s type should be string, but real type is "+typeof e)}else if("number"===r){if(!Number.isInteger(e))throw new Error(t+"'s type should be integer, but real type is "+typeof e)}else if("array"===r){if(!Array.isArray(e))throw new Error(t+"'s type should be array, but real type is "+typeof e)}else{if("file"!==r)throw new Error("Unsupport type:"+r);if(!e instanceof File)throw new Error(t+"'s type should be file, but real type is "+typeof e)}}}}},function(e,t,r){"use strict";var n=r(0);function s(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var a;if(r)a=r(t);else if(n.isURLSearchParams(t))a=t.toString();else{var o=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),o.push(s(t)+"="+s(e))})))})),a=o.join("&")}if(a){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}},function(e,t,r){"use strict";var n=r(8);e.exports=function(e,t,r,s,a){var o=new Error(e);return n(o,t,r,s,a)}},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";var n=r(0),s=r(25),a={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var i,c={adapter:("undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)?i=r(26):"undefined"!=typeof XMLHttpRequest&&(i=r(40)),i),transformRequest:[function(e,t){return s(t,"Accept"),s(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(a)})),e.exports=c},function(e,t,r){"use strict";var n=r(3);e.exports=function(e,t,r){var s=r.config.validateStatus;!s||s(r.status)?e(r):t(n("Request failed with status code "+r.status,r.config,null,r.request,r))}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,s){return e.config=t,r&&(e.code=r),e.request=n,e.response=s,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t){e.exports=require("http")},function(e,t){e.exports=require("https")},function(e,t,r){var n=r(12),s=r(9),a=r(10),o=r(27),i=r(28).Writable,c=r(29)("follow-redirects"),u={GET:!0,HEAD:!0,OPTIONS:!0,TRACE:!0},l=Object.create(null);function p(e,t){i.call(this),e.headers=e.headers||{},this._options=e,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e.host&&(e.hostname||(e.hostname=e.host),delete e.host),t&&this.on("response",t);var r=this;if(this._onNativeResponse=function(e){r._processResponse(e)},!e.pathname&&e.path){var n=e.path.indexOf("?");n<0?e.pathname=e.path:(e.pathname=e.path.substring(0,n),e.search=e.path.substring(n))}this._performRequest()}function f(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach((function(s){var a=s+":",i=r[a]=e[s],u=t[s]=Object.create(i);u.request=function(e,s){return"string"==typeof e?(e=n.parse(e)).maxRedirects=t.maxRedirects:e=Object.assign({protocol:a,maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e),e.nativeProtocols=r,o.equal(e.protocol,a,"protocol mismatch"),c("options",e),new p(e,s)},u.get=function(e,t){var r=u.request(e,t);return r.end(),r}})),t}["abort","aborted","error","socket","timeout"].forEach((function(e){l[e]=function(t){this._redirectable.emit(e,t)}})),p.prototype=Object.create(i.prototype),p.prototype.write=function(e,t,r){if(!("string"==typeof e||"object"==typeof e&&"length"in e))throw new Error("data should be a string, Buffer or Uint8Array");"function"==typeof t&&(r=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new Error("Request body larger than maxBodyLength limit")),this.abort()):r&&r()},p.prototype.end=function(e,t,r){"function"==typeof e?(r=e,e=t=null):"function"==typeof t&&(r=t,t=null);var n=this._currentRequest;this.write(e||"",t,(function(){n.end(null,null,r)}))},p.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},p.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},["abort","flushHeaders","getHeader","setNoDelay","setSocketKeepAlive","setTimeout"].forEach((function(e){p.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(p.prototype,e,{get:function(){return this._currentRequest[e]}})})),p.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(t){if(this._options.agents){var r=e.substr(0,e.length-1);this._options.agent=this._options.agents[r]}var s=this._currentRequest=t.request(this._options,this._onNativeResponse);for(var a in this._currentUrl=n.format(this._options),s._redirectable=this,l)a&&s.on(a,l[a]);if(this._isRedirect){var o=0,i=this._requestBodyBuffers;!function e(){if(o<i.length){var t=i[o++];s.write(t.data,t.encoding,e)}else s.end()}()}}else this.emit("error",new Error("Unsupported protocol "+e))},p.prototype._processResponse=function(e){this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:e.statusCode});var t=e.headers.location;if(t&&!1!==this._options.followRedirects&&e.statusCode>=300&&e.statusCode<400){if(++this._redirectCount>this._options.maxRedirects)return void this.emit("error",new Error("Max redirects exceeded."));var r,s=this._options.headers;if(307!==e.statusCode&&!(this._options.method in u))for(r in this._options.method="GET",this._requestBodyBuffers=[],s)/^content-/i.test(r)&&delete s[r];if(!this._isRedirect)for(r in s)/^host$/i.test(r)&&delete s[r];var a=n.resolve(this._currentUrl,t);c("redirecting to",a),Object.assign(this._options,n.parse(a)),this._isRedirect=!0,this._performRequest(),e.destroy()}else e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[]},e.exports=f({http:s,https:a}),e.exports.wrap=f},function(e,t){e.exports=require("url")},function(e,t,r){function n(e){var r;function n(){if(n.enabled){var e=n,s=+new Date,a=s-(r||s);e.diff=a,e.prev=r,e.curr=s,r=s;for(var o=new Array(arguments.length),i=0;i<o.length;i++)o[i]=arguments[i];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;c++;var s=t.formatters[n];if("function"==typeof s){var a=o[c];r=s.call(e,a),o.splice(c,1),c--}return r})),t.formatArgs.call(e,o),(n.log||t.log||console.log.bind(console)).apply(e,o)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=function(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),n.destroy=s,"function"==typeof t.init&&t.init(n),t.instances.push(n),n}function s(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var r;t.save(e),t.names=[],t.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),s=n.length;for(r=0;r<s;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(r=0;r<t.instances.length;r++){var a=t.instances[r];a.enabled=t.enabled(a.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(31),t.instances=[],t.names=[],t.skips=[],t.formatters={}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){t=t||{};var r={};return n.forEach(["url","method","params","data"],(function(e){void 0!==t[e]&&(r[e]=t[e])})),n.forEach(["headers","auth","proxy"],(function(s){n.isObject(t[s])?r[s]=n.deepMerge(e[s],t[s]):void 0!==t[s]?r[s]=t[s]:n.isObject(e[s])?r[s]=n.deepMerge(e[s]):void 0!==e[s]&&(r[s]=e[s])})),n.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],(function(n){void 0!==t[n]?r[n]=t[n]:void 0!==e[n]&&(r[n]=e[n])})),r}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,r){const n=r(17),s=r(48),a=r(49),o=r(50),i=r(51),c=r(52),u=r(53),l=r(54);function p(e){return e.response?e.response.status+": "+e.response.data.error:e.request?e.request:e.message}function f(e){throw e.response?(console.log(e.response.data),console.log(e.response.status),console.log(e.response.headers)):e.request?console.log(e.request):console.log("Error",e.message),e}e.exports=class{constructor(e,t=null,r=f){if(null==e)throw new Error("Missing the required parameter 'network'.");this.apiClient=new n(e,t,r),this.parseError=p,this.addressAPI=new s(this.apiClient),this.authkeyAPI=new a(this.apiClient),this.eventAPI=new o(this.apiClient),this.libraAPI=new i(this.apiClient),this.moveAPI=new c(this.apiClient),this.transactionAPI=new u(this.apiClient),this.walletAPI=new l(this.apiClient)}}},function(e,t,r){const n=r(18);e.exports=class{constructor(e,t,r,n={}){this.network=e,this.appkey=t,this.errorHandler=r,this.config=n}async call_api(e,t,r="GET"){let s={url:e,method:r};if(this.config.baseURL)s.baseURL=this.config.baseURL;else if("testnet"===this.network||"devnet"===this.network)s.baseURL="https://apitest.moveonLibra.com";else{if("mainnet"!==this.network)throw new Error("Unknown network: "+this.network);s.baseURL="https://api.moveonLibra.com"}this.appkey&&(s.headers={Authorization:this.appkey}),"POST"===r?s.data=t:s.params=t;let a=this;return(await n(s).catch((function(e){if(!a.errorHandler)throw e;a.errorHandler(e)}))).data}}},function(e,t,r){e.exports=r(19)},function(e,t,r){"use strict";var n=r(0),s=r(4),a=r(21),o=r(14);function i(e){var t=new a(e),r=s(a.prototype.request,t);return n.extend(r,a.prototype,t),n.extend(r,t),r}var c=i(r(6));c.Axios=a,c.create=function(e){return i(o(c.defaults,e))},c.Cancel=r(15),c.CancelToken=r(46),c.isCancel=r(5),c.all=function(e){return Promise.all(e)},c.spread=r(47),e.exports=c,e.exports.default=c},function(e,t){
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,r){"use strict";var n=r(0),s=r(2),a=r(22),o=r(23),i=r(14);function c(e){this.defaults=e,this.interceptors={request:new a,response:new a}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=i(this.defaults,e)).method=e.method?e.method.toLowerCase():"get";var t=[o,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},c.prototype.getUri=function(e){return e=i(this.defaults,e),s(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,r){return this.request(n.merge(r||{},{method:e,url:t}))}})),n.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,r,s){return this.request(n.merge(s||{},{method:e,url:t,data:r}))}})),e.exports=c},function(e,t,r){"use strict";var n=r(0);function s(){this.handlers=[]}s.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},s.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},s.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=s},function(e,t,r){"use strict";var n=r(0),s=r(24),a=r(5),o=r(6),i=r(44),c=r(45);function u(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return u(e),e.baseURL&&!i(e.url)&&(e.url=c(e.baseURL,e.url)),e.headers=e.headers||{},e.data=s(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return u(e),t.data=s(t.data,t.headers,e.transformResponse),t}),(function(t){return a(t)||(u(e),t&&t.response&&(t.response.data=s(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(0),s=r(7),a=r(2),o=r(9),i=r(10),c=r(11).http,u=r(11).https,l=r(12),p=r(38),f=r(39),h=r(3),d=r(8),m=/https:?/;e.exports=function(e){return new Promise((function(t,r){var g,v=function(e){clearTimeout(g),t(e)},y=function(e){clearTimeout(g),r(e)},_=e.data,b=e.headers;if(b["User-Agent"]||b["user-agent"]||(b["User-Agent"]="axios/"+f.version),_&&!n.isStream(_)){if(Buffer.isBuffer(_));else if(n.isArrayBuffer(_))_=Buffer.from(new Uint8Array(_));else{if(!n.isString(_))return y(h("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));_=Buffer.from(_,"utf-8")}b["Content-Length"]=_.length}var C=void 0;e.auth&&(C=(e.auth.username||"")+":"+(e.auth.password||""));var w=l.parse(e.url),x=w.protocol||"http:";if(!C&&w.auth){var k=w.auth.split(":");C=(k[0]||"")+":"+(k[1]||"")}C&&delete b.Authorization;var P=m.test(x),O=P?e.httpsAgent:e.httpAgent,R={path:a(w.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method.toUpperCase(),headers:b,agent:O,auth:C};e.socketPath?R.socketPath=e.socketPath:(R.hostname=w.hostname,R.port=w.port);var E,A=e.proxy;if(!A&&!1!==A){var F=x.slice(0,-1)+"_proxy",T=process.env[F]||process.env[F.toUpperCase()];if(T){var S=l.parse(T),q=process.env.no_proxy||process.env.NO_PROXY,j=!0;if(q)j=!q.split(",").map((function(e){return e.trim()})).some((function(e){return!!e&&("*"===e||("."===e[0]&&w.hostname.substr(w.hostname.length-e.length)===e&&e.match(/\./g).length===w.hostname.match(/\./g).length||w.hostname===e))}));if(j&&(A={host:S.hostname,port:S.port},S.auth)){var L=S.auth.split(":");A.auth={username:L[0],password:L[1]}}}}if(A&&(R.hostname=A.host,R.host=A.host,R.headers.host=w.hostname+(w.port?":"+w.port:""),R.port=A.port,R.path=x+"//"+w.hostname+(w.port?":"+w.port:"")+R.path,A.auth)){var B=Buffer.from(A.auth.username+":"+A.auth.password,"utf8").toString("base64");R.headers["Proxy-Authorization"]="Basic "+B}var N=P&&(!A||m.test(A.protocol));e.transport?E=e.transport:0===e.maxRedirects?E=N?i:o:(e.maxRedirects&&(R.maxRedirects=e.maxRedirects),E=N?u:c),e.maxContentLength&&e.maxContentLength>-1&&(R.maxBodyLength=e.maxContentLength);var U=E.request(R,(function(t){if(!U.aborted){var r=t;switch(t.headers["content-encoding"]){case"gzip":case"compress":case"deflate":r=204===t.statusCode?r:r.pipe(p.createUnzip()),delete t.headers["content-encoding"]}var n=t.req||U,a={status:t.statusCode,statusText:t.statusMessage,headers:t.headers,config:e,request:n};if("stream"===e.responseType)a.data=r,s(v,y,a);else{var o=[];r.on("data",(function(t){o.push(t),e.maxContentLength>-1&&Buffer.concat(o).length>e.maxContentLength&&(r.destroy(),y(h("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,n)))})),r.on("error",(function(t){U.aborted||y(d(t,e,null,n))})),r.on("end",(function(){var t=Buffer.concat(o);"arraybuffer"!==e.responseType&&(t=t.toString(e.responseEncoding)),a.data=t,s(v,y,a)}))}}}));U.on("error",(function(t){U.aborted||y(d(t,e,null,U))})),e.timeout&&(g=setTimeout((function(){U.abort(),y(h("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",U))}),e.timeout)),e.cancelToken&&e.cancelToken.promise.then((function(e){U.aborted||(U.abort(),y(e))})),n.isStream(_)?_.on("error",(function(t){y(d(t,e,null,U))})).pipe(U):U.end(_)}))}},function(e,t){e.exports=require("assert")},function(e,t){e.exports=require("stream")},function(e,t,r){"undefined"==typeof process||"renderer"===process.type?e.exports=r(30):e.exports=r(32)},function(e,t,r){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=r(13)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),!r)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var s=0,a=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(s++,"%c"===e&&(a=s))})),e.splice(a,0,n)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())},function(e,t){var r=1e3,n=60*r,s=60*n,a=24*s,o=365.25*a;function i(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}e.exports=function(e,t){t=t||{};var c,u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var i=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return i*o;case"days":case"day":case"d":return i*a;case"hours":case"hour":case"hrs":case"hr":case"h":return i*s;case"minutes":case"minute":case"mins":case"min":case"m":return i*n;case"seconds":case"second":case"secs":case"sec":case"s":return i*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?i(c=e,a,"day")||i(c,s,"hour")||i(c,n,"minute")||i(c,r,"second")||c+" ms":function(e){if(e>=a)return Math.round(e/a)+"d";if(e>=s)return Math.round(e/s)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){var n=r(33),s=r(34);(t=e.exports=r(13)).init=function(e){e.inspectOpts={};for(var r=Object.keys(t.inspectOpts),n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(){return process.stderr.write(s.format.apply(s,arguments)+"\n")},t.formatArgs=function(e){var r=this.namespace;if(this.useColors){var n=this.color,s="[3"+(n<8?n:"8;5;"+n),a=" "+s+";1m"+r+" [0m";e[0]=a+e[0].split("\n").join("\n"+a),e.push(s+"m+"+t.humanize(this.diff)+"[0m")}else e[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+r+" "+e[0]},t.save=function(e){null==e?delete process.env.DEBUG:process.env.DEBUG=e},t.load=o,t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.colors=[6,2,3,4,5,1];try{var a=r(35);a&&a.level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}function o(){return process.env.DEBUG}t.inspectOpts=Object.keys(process.env).filter((function(e){return/^debug_/i.test(e)})).reduce((function(e,t){var r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(function(e,t){return t.toUpperCase()})),n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e}),{}),t.formatters.o=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts).split("\n").map((function(e){return e.trim()})).join(" ")},t.formatters.O=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts)},t.enable(o())},function(e,t){e.exports=require("tty")},function(e,t){e.exports=require("util")},function(e,t,r){"use strict";const n=r(36),s=r(37),{env:a}=process;let o;function i(e){return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(function(e){if(0===o)return 0;if(s("color=16m")||s("color=full")||s("color=truecolor"))return 3;if(s("color=256"))return 2;if(e&&!e.isTTY&&void 0===o)return 0;const t=o||0;if("dumb"===a.TERM)return t;if("win32"===process.platform){const e=n.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in a)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in a)||"codeship"===a.CI_NAME?1:t;if("TEAMCITY_VERSION"in a)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0;if("truecolor"===a.COLORTERM)return 3;if("TERM_PROGRAM"in a){const e=parseInt((a.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(a.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)?1:"COLORTERM"in a?1:t}(e))}s("no-color")||s("no-colors")||s("color=false")||s("color=never")?o=0:(s("color")||s("colors")||s("color=true")||s("color=always"))&&(o=1),"FORCE_COLOR"in a&&(o=!0===a.FORCE_COLOR||"true"===a.FORCE_COLOR?1:!1===a.FORCE_COLOR||"false"===a.FORCE_COLOR?0:0===a.FORCE_COLOR.length?1:Math.min(parseInt(a.FORCE_COLOR,10),3)),e.exports={supportsColor:i,stdout:i(process.stdout),stderr:i(process.stderr)}},function(e,t){e.exports=require("os")},function(e,t,r){"use strict";e.exports=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return-1!==n&&(-1===s||n<s)}},function(e,t){e.exports=require("zlib")},function(e){e.exports=JSON.parse('{"name":"axios","version":"0.19.0","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test && bundlesize","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://github.com/axios/axios","devDependencies":{"bundlesize":"^0.17.0","coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.0.2","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^20.1.0","grunt-karma":"^2.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^1.0.18","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^1.3.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-opera-launcher":"^1.0.0","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^1.2.0","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^1.7.0","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^5.2.0","sinon":"^4.5.0","typescript":"^2.8.1","url-search-params":"^0.10.0","webpack":"^1.13.1","webpack-dev-server":"^1.14.1"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"typings":"./index.d.ts","dependencies":{"follow-redirects":"1.5.10","is-buffer":"^2.0.2"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}],"__npminstall_done":"Sat Dec 21 2019 23:15:41 GMT+0800 (China Standard Time)","_from":"axios@0.19.0","_resolved":"https://registry.npm.taobao.org/axios/download/axios-0.19.0.tgz"}')},function(e,t,r){"use strict";var n=r(0),s=r(7),a=r(2),o=r(41),i=r(42),c=r(3);e.exports=function(e){return new Promise((function(t,u){var l=e.data,p=e.headers;n.isFormData(l)&&delete p["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",d=e.auth.password||"";p.Authorization="Basic "+btoa(h+":"+d)}if(f.open(e.method.toUpperCase(),a(e.url,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,f.onreadystatechange=function(){if(f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in f?o(f.getAllResponseHeaders()):null,n={data:e.responseType&&"text"!==e.responseType?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:r,config:e,request:f};s(t,u,n),f=null}},f.onabort=function(){f&&(u(c("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){u(c("Network Error",e,null,f)),f=null},f.ontimeout=function(){u(c("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",f)),f=null},n.isStandardBrowserEnv()){var m=r(43),g=(e.withCredentials||i(e.url))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;g&&(p[e.xsrfHeaderName]=g)}if("setRequestHeader"in f&&n.forEach(p,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete p[t]:f.setRequestHeader(t,e)})),e.withCredentials&&(f.withCredentials=!0),e.responseType)try{f.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){f&&(f.abort(),u(e),f=null)})),void 0===l&&(l=null),f.send(l)}))}},function(e,t,r){"use strict";var n=r(0),s=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,a,o={};return e?(n.forEach(e.split("\n"),(function(e){if(a=e.indexOf(":"),t=n.trim(e.substr(0,a)).toLowerCase(),r=n.trim(e.substr(a+1)),t){if(o[t]&&s.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function s(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=s(window.location.href),function(t){var r=n.isString(t)?s(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,s,a,o){var i=[];i.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),n.isString(s)&&i.push("path="+s),n.isString(a)&&i.push("domain="+a),!0===o&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(15);function s(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}s.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},s.source=function(){var e;return{token:new s((function(t){e=t})),cancel:e}},e.exports=s},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){const n=r(1);e.exports=class extends n{async getAccountState(e){e=this.checkParam(e,"address","string",!0);let t="/v1/address/{address}";t=t.replace("{address}",e);return await this.client.call_api(t,{})}async getAccountResource(e){e=this.checkParam(e,"address","string",!0);let t="/v1/address/account_resource/{address}";t=t.replace("{address}",e);return await this.client.call_api(t,{})}async getAccountBalance(e){e=this.checkParam(e,"address","string",!0);let t="/v1/address/balance/{address}";t=t.replace("{address}",e);return await this.client.call_api(t,{})}async getAccountSequence(e){e=this.checkParam(e,"address","string",!0);let t="/v1/address/sequence_number/{address}";t=t.replace("{address}",e);return await this.client.call_api(t,{})}}},function(e,t,r){const n=r(1);e.exports=class extends n{async postClientKey(e){e=this.checkParam(e,"valid_hours","number",!0);let t={};return t.valid_hours=e,await this.client.call_api("/v1/authkey/clients",t,"POST")}async getClientKeys(){return await this.client.call_api("/v1/authkey/clients",{})}async debugKey(){return await this.client.call_api("/v1/authkey/debug",{})}}},function(e,t,r){const n=r(1);e.exports=class extends n{async getAccountEventsSent(e,t,r){e=this.checkParam(e,"address","string",!0),t=this.checkParam(t,"start_event_seq_number","number",!0),r=this.checkParam(r,"limit","number",!1);let n="/v1/events/sent/{address}";n=n.replace("{address}",e);let s={};return s.start_event_seq_number=t,s.limit=r,await this.client.call_api(n,s)}async getAccountEventsReceived(e,t,r){e=this.checkParam(e,"address","string",!0),t=this.checkParam(t,"start_event_seq_number","number",!0),r=this.checkParam(r,"limit","number",!1);let n="/v1/events/received/{address}";n=n.replace("{address}",e);let s={};return s.start_event_seq_number=t,s.limit=r,await this.client.call_api(n,s)}async getAccountEventsLatestSent(e,t){e=this.checkParam(e,"address","string",!0),t=this.checkParam(t,"limit","number",!1);let r="/v1/events/latest/sent/{address}";r=r.replace("{address}",e);let n={};return n.limit=t,await this.client.call_api(r,n)}async getAccountEventsLatestReceived(e,t){e=this.checkParam(e,"address","string",!0),t=this.checkParam(t,"limit","number",!1);let r="/v1/events/latest/received/{address}";r=r.replace("{address}",e);let n={};return n.limit=t,await this.client.call_api(r,n)}async getAccountEvents(e,t,r){e=this.checkParam(e,"address","string",!0),t=this.checkParam(t,"start_event_seq_number","number",!0),r=this.checkParam(r,"limit","number",!1);let n="/v1/events/{address}";n=n.replace("{address}",e);let s={};return s.start_event_seq_number=t,s.limit=r,await this.client.call_api(n,s)}async getAccountEventsLatest(e,t){e=this.checkParam(e,"address","string",!0),t=this.checkParam(t,"limit","number",!1);let r="/v1/events/latest/{address}";r=r.replace("{address}",e);let n={};return n.limit=t,await this.client.call_api(r,n)}}},function(e,t,r){const n=r(1);e.exports=class extends n{async getVmErrorCodes(){return await this.client.call_api("/v1/libra/vm_errors",{})}async getVmErrorCode(e){e=this.checkParam(e,"code","number",!0);let t="/v1/libra/vm_errors/{code}";t=t.replace("{code}",e);return await this.client.call_api(t,{})}}},function(e,t,r){const n=r(1);e.exports=class extends n{async compileModule(e,t){e=this.checkParam(e,"publish_account_address","string",!0),t=this.checkParam(t,"source_file","file",!0);let r={};return r.publish_account_address=e,r.source_file=t,await this.client.call_api("/v1/move/compile/module",r,"POST")}async compileScript(e,t){e=this.checkParam(e,"sender_address","string",!1),t=this.checkParam(t,"source_file","file",!0);let r={};return r.sender_address=e,r.source_file=t,await this.client.call_api("/v1/move/compile/script",r,"POST")}async getCode(e){e=this.checkParam(e,"code_id","string",!0);let t="/v1/move/download/{code_id}";t=t.replace("{code_id}",e);return await this.client.call_api(t,{})}async publish(e,t){e=this.checkParam(e,"code_id","string",!0),t=this.checkParam(t,"publish_account_address","string",!0);let r={};return r.code_id=e,r.publish_account_address=t,await this.client.call_api("/v1/move/publish",r,"POST")}async execute(e,t,r){e=this.checkParam(e,"code_id","string",!0),t=this.checkParam(t,"sender_account_address","string",!0),r=this.checkParam(r,"script_args","array",!0);let n={};return n.code_id=e,n.sender_account_address=t,n.script_args=r,await this.client.call_api("/v1/move/execute",n,"POST")}}},function(e,t,r){const n=r(1);e.exports=class extends n{async getTransaction(e){e=this.checkParam(e,"version","number",!0);let t="/v1/transactions/{version}";t=t.replace("{version}",e);return await this.client.call_api(t,{})}async getTransactions(e,t){e=this.checkParam(e,"start_version","number",!0),t=this.checkParam(t,"limit","number",!1);let r={};return r.start_version=e,r.limit=t,await this.client.call_api("/v1/transactions",r)}async getLatestVersion(){return await this.client.call_api("/v1/transactions/latest_version",{})}async getTransactionLatest(e){e=this.checkParam(e,"limit","number",!1);let t={};return t.limit=e,await this.client.call_api("/v1/transactions/latest",t)}async getByAccountSeq(e,t){e=this.checkParam(e,"account_address","string",!0),t=this.checkParam(t,"sequence_number","number",!0);let r={};return r.account_address=e,r.sequence_number=t,await this.client.call_api("/v1/transactions/acc_seq",r)}async waitTransaction(e,t){e=this.checkParam(e,"account_address","string",!0),t=this.checkParam(t,"sequence_number","number",!0);let r={};return r.account_address=e,r.sequence_number=t,await this.client.call_api("/v1/transactions/wait_for_transaction",r)}async mint(e,t,r,n){e=this.checkParam(e,"receiver_account_address","string",!0),t=this.checkParam(t,"auth_key_prefix","string",!0),r=this.checkParam(r,"number_of_micro_libra","number",!0),n=this.checkParam(n,"force_offical","number",!1);let s={};return s.receiver_account_address=e,s.auth_key_prefix=t,s.number_of_micro_libra=r,s.force_offical=n,await this.client.call_api("/v1/transactions/mint",s,"POST")}async mintMol(e,t,r){e=this.checkParam(e,"receiver_account_address","string",!0),t=this.checkParam(t,"auth_key_prefix","string",!0),r=this.checkParam(r,"number_of_micro_libra","number",!0);let n={};return n.receiver_account_address=e,n.auth_key_prefix=t,n.number_of_micro_libra=r,await this.client.call_api("/v1/transactions/mint_mol",n,"POST")}async createAccount(e,t){e=this.checkParam(e,"account_address","string",!0),t=this.checkParam(t,"auth_key_prefix","string",!0);let r={};return r.account_address=e,r.auth_key_prefix=t,await this.client.call_api("/v1/transactions/create_account",r,"POST")}async p2pTransfer(e,t,r,n){e=this.checkParam(e,"wallet_id","number",!0),t=this.checkParam(t,"sender_account_address","string",!0),r=this.checkParam(r,"receiver_account_address","string",!0),n=this.checkParam(n,"number_of_micro_libra","number",!0);let s={};return s.wallet_id=e,s.sender_account_address=t,s.receiver_account_address=r,s.number_of_micro_libra=n,await this.client.call_api("/v1/transactions/transfer",s,"POST")}}},function(e,t,r){const n=r(1);e.exports=class extends n{async createWallet(e){e=this.checkParam(e,"name","string",!0);let t={};return t.name=e,await this.client.call_api("/v1/wallets",t,"POST")}async getWallets(){return await this.client.call_api("/v1/wallets",{})}async getWallet(e){e=this.checkParam(e,"wallet_id","number",!0);let t="/v1/wallets/{wallet_id}";t=t.replace("{wallet_id}",e);return await this.client.call_api(t,{})}async backupWallet(e){e=this.checkParam(e,"wallet_id","number",!0);let t="/v1/wallets/backup/{wallet_id}";t=t.replace("{wallet_id}",e);return await this.client.call_api(t,{})}async createWalletAccount(e){e=this.checkParam(e,"wallet_id","number",!0);let t="/v1/wallets/{wallet_id}/accounts";t=t.replace("{wallet_id}",e);return await this.client.call_api(t,{},"POST")}async getWalletAccounts(e){e=this.checkParam(e,"wallet_id","number",!0);let t="/v1/wallets/{wallet_id}/accounts";t=t.replace("{wallet_id}",e);return await this.client.call_api(t,{})}}}]);