@massalabs/wallet-provider 1.2.1-dev.20230803113644 → 1.2.1-dev.20230803141012
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.js +5649 -5049
- package/bundle.min.js +3 -0
- package/dist/cmd/account/Account.d.ts +103 -0
- package/dist/cmd/account/Account.d.ts.map +1 -0
- package/dist/cmd/account/Account.js +179 -0
- package/dist/cmd/account/Account.js.map +1 -0
- package/dist/cmd/account/AccountBalance.d.ts +14 -0
- package/dist/cmd/account/AccountBalance.d.ts.map +1 -0
- package/dist/cmd/account/AccountBalance.js +3 -0
- package/dist/cmd/account/AccountBalance.js.map +1 -0
- package/dist/cmd/account/AccountSign.d.ts +16 -0
- package/dist/cmd/account/AccountSign.d.ts.map +1 -0
- package/dist/cmd/account/AccountSign.js +3 -0
- package/dist/cmd/account/AccountSign.js.map +1 -0
- package/dist/cmd/account/IAccount.d.ts +20 -0
- package/dist/cmd/account/IAccount.d.ts.map +1 -0
- package/dist/cmd/account/IAccount.js +3 -0
- package/dist/cmd/account/IAccount.js.map +1 -0
- package/dist/cmd/account/IAccountCallSCRequest.d.ts +25 -0
- package/dist/cmd/account/IAccountCallSCRequest.d.ts.map +1 -0
- package/dist/cmd/account/IAccountCallSCRequest.js +3 -0
- package/dist/cmd/account/IAccountCallSCRequest.js.map +1 -0
- package/dist/cmd/account/IAccountDetails.d.ts +8 -0
- package/dist/cmd/account/IAccountDetails.d.ts.map +1 -0
- package/dist/cmd/account/IAccountDetails.js +3 -0
- package/dist/cmd/account/IAccountDetails.js.map +1 -0
- package/dist/cmd/account/IAccountRolls.d.ts +8 -0
- package/dist/cmd/account/IAccountRolls.d.ts.map +1 -0
- package/dist/cmd/account/IAccountRolls.js +3 -0
- package/dist/cmd/account/IAccountRolls.js.map +1 -0
- package/dist/cmd/account/IAccountSendTransaction.d.ts +9 -0
- package/dist/cmd/account/IAccountSendTransaction.d.ts.map +1 -0
- package/dist/cmd/account/IAccountSendTransaction.js +3 -0
- package/dist/cmd/account/IAccountSendTransaction.js.map +1 -0
- package/dist/cmd/account/index.d.ts +9 -0
- package/dist/cmd/account/index.d.ts.map +1 -0
- package/dist/cmd/account/index.js +6 -0
- package/dist/cmd/account/index.js.map +1 -0
- package/dist/cmd/connector/Connector.d.ts +87 -0
- package/dist/cmd/connector/Connector.d.ts.map +1 -0
- package/dist/cmd/connector/Connector.js +173 -0
- package/dist/cmd/connector/Connector.js.map +1 -0
- package/dist/cmd/connector/ICustomEventMessageRequest.d.ts +10 -0
- package/dist/cmd/connector/ICustomEventMessageRequest.d.ts.map +1 -0
- package/dist/cmd/connector/ICustomEventMessageRequest.js +3 -0
- package/dist/cmd/connector/ICustomEventMessageRequest.js.map +1 -0
- package/dist/cmd/connector/ICustomEventMessageResponse.d.ts +11 -0
- package/dist/cmd/connector/ICustomEventMessageResponse.d.ts.map +1 -0
- package/dist/cmd/connector/ICustomEventMessageResponse.js +3 -0
- package/dist/cmd/connector/ICustomEventMessageResponse.js.map +1 -0
- package/dist/cmd/connector/IRegisterEvent.d.ts +8 -0
- package/dist/cmd/connector/IRegisterEvent.d.ts.map +1 -0
- package/dist/cmd/connector/IRegisterEvent.js +3 -0
- package/dist/cmd/connector/IRegisterEvent.js.map +1 -0
- package/dist/cmd/connector/index.d.ts +5 -0
- package/dist/cmd/connector/index.d.ts.map +1 -0
- package/dist/cmd/connector/index.js +7 -0
- package/dist/cmd/connector/index.js.map +1 -0
- package/dist/cmd/index.d.ts +48 -0
- package/dist/cmd/index.d.ts.map +1 -0
- package/dist/cmd/index.js +89 -0
- package/dist/cmd/index.js.map +1 -0
- package/dist/cmd/massaStation/MassaStationAccount.d.ts +103 -0
- package/dist/cmd/massaStation/MassaStationAccount.d.ts.map +1 -0
- package/dist/cmd/massaStation/MassaStationAccount.js +312 -0
- package/dist/cmd/massaStation/MassaStationAccount.js.map +1 -0
- package/dist/cmd/massaStation/MassaStationDiscovery.d.ts +57 -0
- package/dist/cmd/massaStation/MassaStationDiscovery.d.ts.map +1 -0
- package/dist/cmd/massaStation/MassaStationDiscovery.js +80 -0
- package/dist/cmd/massaStation/MassaStationDiscovery.js.map +1 -0
- package/dist/cmd/massaStation/MassaStationProvider.d.ts +91 -0
- package/dist/cmd/massaStation/MassaStationProvider.d.ts.map +1 -0
- package/dist/cmd/massaStation/MassaStationProvider.js +193 -0
- package/dist/cmd/massaStation/MassaStationProvider.js.map +1 -0
- package/dist/cmd/massaStation/RequestHandler.d.ts +47 -0
- package/dist/cmd/massaStation/RequestHandler.d.ts.map +1 -0
- package/dist/cmd/massaStation/RequestHandler.js +133 -0
- package/dist/cmd/massaStation/RequestHandler.js.map +1 -0
- package/dist/cmd/provider/AccountDeletion.d.ts +24 -0
- package/dist/cmd/provider/AccountDeletion.d.ts.map +1 -0
- package/dist/cmd/provider/AccountDeletion.js +14 -0
- package/dist/cmd/provider/AccountDeletion.js.map +1 -0
- package/dist/cmd/provider/AccountImport.d.ts +26 -0
- package/dist/cmd/provider/AccountImport.d.ts.map +1 -0
- package/dist/cmd/provider/AccountImport.js +14 -0
- package/dist/cmd/provider/AccountImport.js.map +1 -0
- package/dist/cmd/provider/AccoutGeneration.d.ts +8 -0
- package/dist/cmd/provider/AccoutGeneration.d.ts.map +1 -0
- package/dist/cmd/provider/AccoutGeneration.js +3 -0
- package/dist/cmd/provider/AccoutGeneration.js.map +1 -0
- package/dist/cmd/provider/IProvider.d.ts +16 -0
- package/dist/cmd/provider/IProvider.d.ts.map +1 -0
- package/dist/cmd/provider/IProvider.js +3 -0
- package/dist/cmd/provider/IProvider.js.map +1 -0
- package/dist/cmd/provider/Provider.d.ts +68 -0
- package/dist/cmd/provider/Provider.d.ts.map +1 -0
- package/dist/cmd/provider/Provider.js +126 -0
- package/dist/cmd/provider/Provider.js.map +1 -0
- package/dist/cmd/provider/index.d.ts +5 -0
- package/dist/cmd/provider/index.d.ts.map +1 -0
- package/dist/cmd/provider/index.js +10 -0
- package/dist/cmd/provider/index.js.map +1 -0
- package/dist/cmd/utils/argsToBase64.d.ts +16 -0
- package/dist/cmd/utils/argsToBase64.d.ts.map +1 -0
- package/dist/cmd/utils/argsToBase64.js +25 -0
- package/dist/cmd/utils/argsToBase64.js.map +1 -0
- package/dist/cmd/utils/time.d.ts +77 -0
- package/dist/cmd/utils/time.d.ts.map +1 -0
- package/dist/cmd/utils/time.js +120 -0
- package/dist/cmd/utils/time.js.map +1 -0
- package/dist/esm/account/Account.d.ts +103 -0
- package/dist/esm/account/Account.d.ts.map +1 -0
- package/dist/esm/account/Account.js +178 -0
- package/dist/esm/account/Account.js.map +1 -0
- package/dist/esm/account/AccountBalance.d.ts +14 -0
- package/dist/esm/account/AccountBalance.d.ts.map +1 -0
- package/dist/esm/account/AccountBalance.js +2 -0
- package/dist/esm/account/AccountBalance.js.map +1 -0
- package/dist/esm/account/AccountSign.d.ts +16 -0
- package/dist/esm/account/AccountSign.d.ts.map +1 -0
- package/dist/esm/account/AccountSign.js +2 -0
- package/dist/esm/account/AccountSign.js.map +1 -0
- package/dist/esm/account/IAccount.d.ts +20 -0
- package/dist/esm/account/IAccount.d.ts.map +1 -0
- package/dist/esm/account/IAccount.js +2 -0
- package/dist/esm/account/IAccount.js.map +1 -0
- package/dist/esm/account/IAccountCallSCRequest.d.ts +25 -0
- package/dist/esm/account/IAccountCallSCRequest.d.ts.map +1 -0
- package/dist/esm/account/IAccountCallSCRequest.js +2 -0
- package/dist/esm/account/IAccountCallSCRequest.js.map +1 -0
- package/dist/esm/account/IAccountDetails.d.ts +8 -0
- package/dist/esm/account/IAccountDetails.d.ts.map +1 -0
- package/dist/esm/account/IAccountDetails.js +2 -0
- package/dist/esm/account/IAccountDetails.js.map +1 -0
- package/dist/esm/account/IAccountRolls.d.ts +8 -0
- package/dist/esm/account/IAccountRolls.d.ts.map +1 -0
- package/dist/esm/account/IAccountRolls.js +2 -0
- package/dist/esm/account/IAccountRolls.js.map +1 -0
- package/dist/esm/account/IAccountSendTransaction.d.ts +9 -0
- package/dist/esm/account/IAccountSendTransaction.d.ts.map +1 -0
- package/dist/esm/account/IAccountSendTransaction.js +2 -0
- package/dist/esm/account/IAccountSendTransaction.js.map +1 -0
- package/dist/esm/account/index.d.ts +9 -0
- package/dist/esm/account/index.d.ts.map +1 -0
- package/dist/esm/account/index.js +2 -0
- package/dist/esm/account/index.js.map +1 -0
- package/dist/esm/connector/Connector.d.ts +87 -0
- package/dist/esm/connector/Connector.d.ts.map +1 -0
- package/dist/esm/connector/Connector.js +172 -0
- package/dist/esm/connector/Connector.js.map +1 -0
- package/dist/esm/connector/ICustomEventMessageRequest.d.ts +10 -0
- package/dist/esm/connector/ICustomEventMessageRequest.d.ts.map +1 -0
- package/dist/esm/connector/ICustomEventMessageRequest.js +2 -0
- package/dist/esm/connector/ICustomEventMessageRequest.js.map +1 -0
- package/dist/esm/connector/ICustomEventMessageResponse.d.ts +11 -0
- package/dist/esm/connector/ICustomEventMessageResponse.d.ts.map +1 -0
- package/dist/esm/connector/ICustomEventMessageResponse.js +2 -0
- package/dist/esm/connector/ICustomEventMessageResponse.js.map +1 -0
- package/dist/esm/connector/IRegisterEvent.d.ts +8 -0
- package/dist/esm/connector/IRegisterEvent.d.ts.map +1 -0
- package/dist/esm/connector/IRegisterEvent.js +2 -0
- package/dist/esm/connector/IRegisterEvent.js.map +1 -0
- package/dist/esm/connector/index.d.ts +5 -0
- package/dist/esm/connector/index.d.ts.map +1 -0
- package/dist/esm/connector/index.js +2 -0
- package/dist/esm/connector/index.js.map +1 -0
- package/dist/esm/index.d.ts +48 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +79 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/massaStation/MassaStationAccount.d.ts +103 -0
- package/dist/esm/massaStation/MassaStationAccount.d.ts.map +1 -0
- package/dist/esm/massaStation/MassaStationAccount.js +311 -0
- package/dist/esm/massaStation/MassaStationAccount.js.map +1 -0
- package/dist/esm/massaStation/MassaStationDiscovery.d.ts +57 -0
- package/dist/esm/massaStation/MassaStationDiscovery.d.ts.map +1 -0
- package/dist/esm/massaStation/MassaStationDiscovery.js +76 -0
- package/dist/esm/massaStation/MassaStationDiscovery.js.map +1 -0
- package/dist/esm/massaStation/MassaStationProvider.d.ts +91 -0
- package/dist/esm/massaStation/MassaStationProvider.d.ts.map +1 -0
- package/dist/esm/massaStation/MassaStationProvider.js +190 -0
- package/dist/esm/massaStation/MassaStationProvider.js.map +1 -0
- package/dist/esm/massaStation/RequestHandler.d.ts +47 -0
- package/dist/esm/massaStation/RequestHandler.d.ts.map +1 -0
- package/dist/esm/massaStation/RequestHandler.js +126 -0
- package/dist/esm/massaStation/RequestHandler.js.map +1 -0
- package/dist/esm/provider/AccountDeletion.d.ts +24 -0
- package/dist/esm/provider/AccountDeletion.d.ts.map +1 -0
- package/dist/esm/provider/AccountDeletion.js +11 -0
- package/dist/esm/provider/AccountDeletion.js.map +1 -0
- package/dist/esm/provider/AccountImport.d.ts +26 -0
- package/dist/esm/provider/AccountImport.d.ts.map +1 -0
- package/dist/esm/provider/AccountImport.js +11 -0
- package/dist/esm/provider/AccountImport.js.map +1 -0
- package/dist/esm/provider/AccoutGeneration.d.ts +8 -0
- package/dist/esm/provider/AccoutGeneration.d.ts.map +1 -0
- package/dist/esm/provider/AccoutGeneration.js +2 -0
- package/dist/esm/provider/AccoutGeneration.js.map +1 -0
- package/dist/esm/provider/IProvider.d.ts +16 -0
- package/dist/esm/provider/IProvider.d.ts.map +1 -0
- package/dist/esm/provider/IProvider.js +2 -0
- package/dist/esm/provider/IProvider.js.map +1 -0
- package/dist/esm/provider/Provider.d.ts +68 -0
- package/dist/esm/provider/Provider.d.ts.map +1 -0
- package/dist/esm/provider/Provider.js +123 -0
- package/dist/esm/provider/Provider.js.map +1 -0
- package/dist/esm/provider/index.d.ts +5 -0
- package/dist/esm/provider/index.d.ts.map +1 -0
- package/dist/esm/provider/index.js +4 -0
- package/dist/esm/provider/index.js.map +1 -0
- package/dist/esm/utils/argsToBase64.d.ts +16 -0
- package/dist/esm/utils/argsToBase64.d.ts.map +1 -0
- package/dist/esm/utils/argsToBase64.js +20 -0
- package/dist/esm/utils/argsToBase64.js.map +1 -0
- package/dist/esm/utils/time.d.ts +77 -0
- package/dist/esm/utils/time.d.ts.map +1 -0
- package/dist/esm/utils/time.js +119 -0
- package/dist/esm/utils/time.js.map +1 -0
- package/package.json +11 -8
package/bundle.min.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see bundle.min.js.LICENSE.txt */
|
|
2
|
+
(()=>{var e={"./node_modules/axios/index.js":(e,t,r)=>{e.exports=r("./node_modules/axios/lib/axios.js")},"./node_modules/axios/lib/adapters/xhr.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js"),o=r("./node_modules/axios/lib/core/settle.js"),s=r("./node_modules/axios/lib/helpers/cookies.js"),i=r("./node_modules/axios/lib/helpers/buildURL.js"),a=r("./node_modules/axios/lib/core/buildFullPath.js"),u=r("./node_modules/axios/lib/helpers/parseHeaders.js"),c=r("./node_modules/axios/lib/helpers/isURLSameOrigin.js"),l=r("./node_modules/axios/lib/core/createError.js"),f=r("./node_modules/axios/lib/defaults/transitional.js"),d=r("./node_modules/axios/lib/cancel/Cancel.js");e.exports=function(e){return new Promise((function(t,r){var h,p=e.data,m=e.headers,g=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}n.isFormData(p)&&delete m["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var A=e.auth.username||"",b=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(A+":"+b)}var _=a(e.baseURL,e.url);function w(){if(v){var n="getAllResponseHeaders"in v?u(v.getAllResponseHeaders()):null,s={data:g&&"text"!==g&&"json"!==g?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};o((function(e){t(e),y()}),(function(e){r(e),y()}),s),v=null}}if(v.open(e.method.toUpperCase(),i(_,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=w:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(w)},v.onabort=function(){v&&(r(l("Request aborted",e,"ECONNABORTED",v)),v=null)},v.onerror=function(){r(l("Network Error",e,null,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||f;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(l(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},n.isStandardBrowserEnv()){var S=(e.withCredentials||c(_))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;S&&(m[e.xsrfHeaderName]=S)}"setRequestHeader"in v&&n.forEach(m,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete m[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),g&&"json"!==g&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){v&&(r(!e||e&&e.type?new d("canceled"):e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),p||(p=null),v.send(p)}))}},"./node_modules/axios/lib/axios.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js"),o=r("./node_modules/axios/lib/helpers/bind.js"),s=r("./node_modules/axios/lib/core/Axios.js"),i=r("./node_modules/axios/lib/core/mergeConfig.js"),a=function e(t){var r=new s(t),a=o(s.prototype.request,r);return n.extend(a,s.prototype,r),n.extend(a,r),a.create=function(r){return e(i(t,r))},a}(r("./node_modules/axios/lib/defaults/index.js"));a.Axios=s,a.Cancel=r("./node_modules/axios/lib/cancel/Cancel.js"),a.CancelToken=r("./node_modules/axios/lib/cancel/CancelToken.js"),a.isCancel=r("./node_modules/axios/lib/cancel/isCancel.js"),a.VERSION=r("./node_modules/axios/lib/env/data.js").version,a.all=function(e){return Promise.all(e)},a.spread=r("./node_modules/axios/lib/helpers/spread.js"),a.isAxiosError=r("./node_modules/axios/lib/helpers/isAxiosError.js"),e.exports=a,e.exports.default=a},"./node_modules/axios/lib/cancel/Cancel.js":e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},"./node_modules/axios/lib/cancel/CancelToken.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/cancel/Cancel.js");function o(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;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},o.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},"./node_modules/axios/lib/cancel/isCancel.js":e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},"./node_modules/axios/lib/core/Axios.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js"),o=r("./node_modules/axios/lib/helpers/buildURL.js"),s=r("./node_modules/axios/lib/core/InterceptorManager.js"),i=r("./node_modules/axios/lib/core/dispatchRequest.js"),a=r("./node_modules/axios/lib/core/mergeConfig.js"),u=r("./node_modules/axios/lib/helpers/validator.js"),c=u.validators;function l(e){this.defaults=e,this.interceptors={request:new s,response:new s}}l.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&u.assertOptions(r,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var n=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var s,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!o){var f=[i,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(l),s=Promise.resolve(t);f.length;)s=s.then(f.shift(),f.shift());return s}for(var d=t;n.length;){var h=n.shift(),p=n.shift();try{d=h(d)}catch(e){p(e);break}}try{s=i(d)}catch(e){return Promise.reject(e)}for(;l.length;)s=s.then(l.shift(),l.shift());return s},l.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=l},"./node_modules/axios/lib/core/InterceptorManager.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js");function o(){this.handlers=[]}o.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},"./node_modules/axios/lib/core/buildFullPath.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/helpers/isAbsoluteURL.js"),o=r("./node_modules/axios/lib/helpers/combineURLs.js");e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},"./node_modules/axios/lib/core/createError.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/core/enhanceError.js");e.exports=function(e,t,r,o,s){var i=new Error(e);return n(i,t,r,o,s)}},"./node_modules/axios/lib/core/dispatchRequest.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js"),o=r("./node_modules/axios/lib/core/transformData.js"),s=r("./node_modules/axios/lib/cancel/isCancel.js"),i=r("./node_modules/axios/lib/defaults/index.js"),a=r("./node_modules/axios/lib/cancel/Cancel.js");function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=o.call(e,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||i.adapter)(e).then((function(t){return u(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return s(t)||(u(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},"./node_modules/axios/lib/core/enhanceError.js":e=>{"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,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,status:this.response&&this.response.status?this.response.status:null}},e}},"./node_modules/axios/lib/core/mergeConfig.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js");e.exports=function(e,t){t=t||{};var r={};function o(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function s(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:o(void 0,e[r]):o(e[r],t[r])}function i(e){if(!n.isUndefined(t[e]))return o(void 0,t[e])}function a(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:o(void 0,e[r]):o(void 0,t[r])}function u(r){return r in t?o(e[r],t[r]):r in e?o(void 0,e[r]):void 0}var c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||s,o=t(e);n.isUndefined(o)&&t!==u||(r[e]=o)})),r}},"./node_modules/axios/lib/core/settle.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/core/createError.js");e.exports=function(e,t,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},"./node_modules/axios/lib/core/transformData.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js"),o=r("./node_modules/axios/lib/defaults/index.js");e.exports=function(e,t,r){var s=this||o;return n.forEach(r,(function(r){e=r.call(s,e,t)})),e}},"./node_modules/axios/lib/defaults/index.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js"),o=r("./node_modules/axios/lib/helpers/normalizeHeaderName.js"),s=r("./node_modules/axios/lib/core/enhanceError.js"),i=r("./node_modules/axios/lib/defaults/transitional.js"),a={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,l={transitional:i,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=r("./node_modules/axios/lib/adapters/xhr.js")),c),transformRequest:[function(e,t){return o(t,"Accept"),o(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)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(u(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(0,JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,r=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,i=!r&&"json"===this.responseType;if(i||o&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){l.headers[e]=n.merge(a)})),e.exports=l},"./node_modules/axios/lib/defaults/transitional.js":e=>{"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},"./node_modules/axios/lib/env/data.js":e=>{e.exports={version:"0.26.1"}},"./node_modules/axios/lib/helpers/bind.js":e=>{"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)}}},"./node_modules/axios/lib/helpers/buildURL.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js");function o(e){return encodeURIComponent(e).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 s;if(r)s=r(t);else if(n.isURLSearchParams(t))s=t.toString();else{var i=[];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)),i.push(o(t)+"="+o(e))})))})),s=i.join("&")}if(s){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},"./node_modules/axios/lib/helpers/combineURLs.js":e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},"./node_modules/axios/lib/helpers/cookies.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js");e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(s)&&a.push("domain="+s),!0===i&&a.push("secure"),document.cookie=a.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(){}}},"./node_modules/axios/lib/helpers/isAbsoluteURL.js":e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},"./node_modules/axios/lib/helpers/isAxiosError.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js");e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},"./node_modules/axios/lib/helpers/isURLSameOrigin.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js");e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(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=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},"./node_modules/axios/lib/helpers/normalizeHeaderName.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js");e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},"./node_modules/axios/lib/helpers/parseHeaders.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/utils.js"),o=["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,s,i={};return e?(n.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=n.trim(e.substr(0,s)).toLowerCase(),r=n.trim(e.substr(s+1)),t){if(i[t]&&o.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([r]):i[t]?i[t]+", "+r:r}})),i):i}},"./node_modules/axios/lib/helpers/spread.js":e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},"./node_modules/axios/lib/helpers/validator.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/env/data.js").version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var s={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,i){if(!1===e)throw new Error(o(n," has been removed"+(t?" in "+t:"")));return t&&!s[n]&&(s[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,i)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var s=n[o],i=t[s];if(i){var a=e[s],u=void 0===a||i(a,s,e);if(!0!==u)throw new TypeError("option "+s+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+s)}},validators:o}},"./node_modules/axios/lib/utils.js":(e,t,r)=>{"use strict";var n=r("./node_modules/axios/lib/helpers/bind.js"),o=Object.prototype.toString;function s(e){return Array.isArray(e)}function i(e){return void 0===e}function a(e){return"[object ArrayBuffer]"===o.call(e)}function u(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:s,isArrayBuffer:a,isBuffer:function(e){return null!==e&&!i(e)&&null!==e.constructor&&!i(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===o.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&a(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:c,isUndefined:i,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:l,isStream:function(e){return u(e)&&l(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===o.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:f,merge:function e(){var t={};function r(r,n){c(t[n])&&c(r)?t[n]=e(t[n],r):c(r)?t[n]=e({},r):s(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)f(arguments[n],r);return t},extend:function(e,t,r){return f(t,(function(t,o){e[o]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},"./node_modules/base64-js/index.js":(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,s=a(e),i=s[0],u=s[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,i,u)),l=0,f=u>0?i-4:i;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,s=[],i=16383,a=0,c=n-o;a<c;a+=i)s.push(u(e,a,a+i>c?c:a+i));return 1===o?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),s.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)r[i]=s[i],n[s.charCodeAt(i)]=i;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,s,i=[],a=t;a<n;a+=3)o=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(r[(s=o)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},"./node_modules/buffer/index.js":(e,t,r)=>{"use strict";const n=r("./node_modules/base64-js/index.js"),o=r("./node_modules/ieee754/index.js"),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const i=2147483647;function a(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=a(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const o=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function m(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return J(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(o)return n?-1:J(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:A(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):A(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function A(e,t,r,n,o){let s,i=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,a/=2,u/=2,r/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){let n=-1;for(s=r;s<a;s++)if(c(e,s)===c(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===u)return n*i}else-1!==n&&(s-=s-n),n=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){let r=!0;for(let n=0;n<u;n++)if(c(e,s+n)!==c(t,n)){r=!1;break}if(r)return s}return-1}function b(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const s=t.length;let i;for(n>s/2&&(n=s/2),i=0;i<n;++i){const n=parseInt(t.substr(2*i,2),16);if(Y(n))return i;e[r+i]=n}return i}function _(e,t,r,n){return G(J(t,e.length-r),e,r,n)}function w(e,t,r,n){return G(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return G(H(t),e,r,n)}function E(e,t,r,n){return G(function(e,t){let r,n,o;const s=[];for(let i=0;i<e.length&&!((t-=2)<0);++i)r=e.charCodeAt(i),n=r>>8,o=r%256,s.push(o),s.push(n);return s}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let s=null,i=t>239?4:t>223?3:t>191?2:1;if(o+i<=r){let r,n,a,u;switch(i){case 1:t<128&&(s=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(s=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:r=e[o+1],n=e[o+2],a=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(s=u))}}null===s?(s=65533,i=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=i}return function(e){const t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=R));return r}(n)}t.kMaxLength=i,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,s=Math.min(r,n);o<s;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))o+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(u.prototype[s]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(t>>>=0);const a=Math.min(s,i),c=this.slice(n,o),l=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==l[e]){s=c[e],i=l[e];break}return s<i?-1:i<s?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const R=4096;function x(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function C(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function N(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=X[e[n]];return o}function I(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function j(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,r,n,o,s){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function U(e,t,r,n,o){F(t,n,o,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,r}function M(e,t,r,n,o){F(t,n,o,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=i,i>>=8,e[r+2]=i,i>>=8,e[r+1]=i,i>>=8,e[r]=i,r+8}function L(e,t,r,n,o,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(e,t,r,n,s){return t=+t,r>>>=0,s||L(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,s){return t=+t,r>>>=0,s||L(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],o=1,s=0;for(;++s<t&&(o*=256);)n+=this[e+s]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Z((function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))})),u.prototype.readBigUInt64BE=Z((function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],o=1,s=0;for(;++s<t&&(o*=256);)n+=this[e+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=t,o=1,s=this[e+--n];for(;n>0&&(o*=256);)s+=this[e+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*t)),s},u.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Z((function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=Z((function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||j(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||B(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,s=0;for(this[t]=255&e;++s<r&&(o*=256);)this[t+s]=e/o&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||B(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Z((function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Z((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);B(this,e,t,r,n-1,-n)}let o=0,s=1,i=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===i&&0!==this[t+o-1]&&(i=1),this[t+o]=(e/s>>0)-i&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);B(this,e,t,r,n-1,-n)}let o=r-1,s=1,i=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===i&&0!==this[t+o+1]&&(i=1),this[t+o]=(e/s>>0)-i&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Z((function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Z((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return P(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return P(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const s=u.isBuffer(e)?e:u.from(e,n),i=s.length;if(0===i)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%i]}return this};const $={};function k(e,t,r){$[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,n,o,s){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=s>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new $.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,o,s)}function W(e,t){if("number"!=typeof e)throw new $.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw W(e,r),new $.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new $.ERR_BUFFER_OUT_OF_BOUNDS;throw new $.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}k("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),k("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),k("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=q(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=q(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function J(e,t){let r;t=t||1/0;const n=e.length;let o=null;const s=[];for(let i=0;i<n;++i){if(r=e.charCodeAt(i),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&s.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function H(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},"./node_modules/events/events.js":e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}m(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,o)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var i=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,s,i,c;if(a(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),i=s[t]),void 0===i)i=s[t]=r,++e._eventsCount;else if("function"==typeof i?i=s[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(o=u(e))>0&&i.length>o&&!i.warned){i.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=i.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=l.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):p(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function m(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(s){n.once&&e.removeEventListener(t,o),r(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,s=this._events;if(void 0!==s)o=o&&void 0===s.error;else if(!o)return!1;if(o){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,l=p(u,c);for(r=0;r<c;++r)n(l[r],this,t)}return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,o,s,i;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){i=r[s].listener,o=s;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(o=s[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},"./node_modules/ieee754/index.js":(e,t)=>{t.read=function(e,t,r,n,o){var s,i,a=8*o-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,s=h&(1<<-l)-1,h>>=-l,l+=a;l>0;s=256*s+e[t+f],f+=d,l-=8);for(i=s&(1<<-l)-1,s>>=-l,l+=n;l>0;i=256*i+e[t+f],f+=d,l-=8);if(0===s)s=1-c;else{if(s===u)return i?NaN:1/0*(h?-1:1);i+=Math.pow(2,n),s-=c}return(h?-1:1)*i*Math.pow(2,s-n)},t.write=function(e,t,r,n,o,s){var i,a,u,c=8*s-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:s-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),(t+=i+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(i++,u/=2),i+f>=l?(a=0,i=l):i+f>=1?(a=(t*u-1)*Math.pow(2,o),i+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;e[r+h]=255&a,h+=p,a/=256,o-=8);for(i=i<<o|a,c+=o;c>0;e[r+h]=255&i,h+=p,i/=256,c-=8);e[r+h-p]|=128*m}},"./src/account/Account.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;const n=r("./src/connector/Connector.ts"),o=r("./src/index.ts");t.Account=class{constructor({address:e,name:t},r){this._address=e,this._name=t??"",this._providerName=r}address(){return this._address}name(){return this._name}providerName(){return this._providerName}async balance(){return new Promise(((e,t)=>{n.connector.sendMessageToContentScript(this._providerName,o.AvailableCommands.AccountBalance,{address:this._address},((r,n)=>n?t(n):e(r)))}))}async sign(e){return new Promise(((t,r)=>{n.connector.sendMessageToContentScript(this._providerName,o.AvailableCommands.AccountSign,{address:this._address,data:e},((e,n)=>n?r(n):t(e)))}))}async buyRolls(e,t){return new Promise(((r,s)=>{n.connector.sendMessageToContentScript(this._providerName,o.AvailableCommands.AccountBuyRolls,{amount:e.toString(),fee:t.toString()},((e,t)=>t?s(t):r(e)))}))}async sellRolls(e,t){return new Promise(((r,s)=>{n.connector.sendMessageToContentScript(this._providerName,o.AvailableCommands.AccountSellRolls,{amount:e.toString(),fee:t.toString()},((e,t)=>t?s(t):r(e)))}))}async sendTransaction(e,t,r){return new Promise(((s,i)=>{n.connector.sendMessageToContentScript(this._providerName,o.AvailableCommands.AccountSendTransaction,{amount:e.toString(),recipientAddress:t,fee:r.toString()},((e,t)=>t?i(t):s(e)))}))}async callSC(e,t,r,s,i,a,u=!1){return new Promise(((c,l)=>{n.connector.sendMessageToContentScript(this._providerName,o.AvailableCommands.AccountCallSC,{nickname:this._name,name:t,at:e,args:r,coins:s,fee:i,maxGas:a,nonPersistentExecution:u},((e,t)=>t?l(t):c(e)))}))}}},"./src/account/index.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;var n=r("./src/account/Account.ts");Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return n.Account}})},"./src/connector/Connector.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connector=t.MASSA_WINDOW_OBJECT=void 0;const n=r("./node_modules/uid/dist/index.js"),o=r("./src/index.ts"),s=r("./src/massaStation/MassaStationDiscovery.ts"),i=r("./src/massaStation/MassaStationProvider.ts");t.MASSA_WINDOW_OBJECT="massaWalletProvider",t.connector=new class{constructor(){this.registeredProviders={},this.pendingRequests=new Map,this.massaStationListener=new s.MassaStationDiscovery,this.initMassaStationListener(),this.register(),document.getElementById(t.MASSA_WINDOW_OBJECT).addEventListener("message",this.handleResponseFromContentScript.bind(this))}register(){if(!document.getElementById(t.MASSA_WINDOW_OBJECT)){const e=document.createElement("p");e.id=t.MASSA_WINDOW_OBJECT,e.setAttribute("style","display:none"),document.body.appendChild(e)}document.getElementById(t.MASSA_WINDOW_OBJECT).addEventListener("register",(e=>{const r=e.detail,n=`${t.MASSA_WINDOW_OBJECT}_${r.providerName}`;this.registeredProviders[r.providerName]=n}))}initMassaStationListener(){this.massaStationListener.on(s.ON_MASSA_STATION_DISCOVERED,(()=>{this.registeredProviders[i.MASSA_STATION_PROVIDER_NAME]=`${t.MASSA_WINDOW_OBJECT}_${i.MASSA_STATION_PROVIDER_NAME}`})),this.massaStationListener.on(s.ON_MASSA_STATION_DISCONNECTED,(()=>{delete this.registeredProviders[i.MASSA_STATION_PROVIDER_NAME]}))}async startMassaStationDiscovery(){try{await this.massaStationListener.startListening()}catch(e){console.log("MassaStation is not detected")}}sendMessageToContentScript(e,t,r,s){if(!Object.values(o.AvailableCommands).includes(t))throw new Error(`Unknown command ${t}`);const i=(0,n.uid)(),a={params:r,requestId:i};this.pendingRequests.set(i,s);const u=document.getElementById(`${this.registeredProviders[e]}`);if(!u)throw new Error(`Registered provider with name ${e} does not exist`);if(!u.dispatchEvent(new CustomEvent(t,{detail:a})))throw new Error(`Could not dispatch a message to ${this.registeredProviders[e]}`)}getWalletProviders(){return this.registeredProviders}handleResponseFromContentScript(e){const{result:t,error:r,requestId:n}=e.detail,o=this.pendingRequests.get(n);o?(r?o(null,new Error(r.message)):o(t,null),this.pendingRequests.delete(n)||console.error(`Error deleting a pending request with id ${n}`)):console.error(`Request Id ${n} not found in response callback map`)}}},"./src/index.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MassaStationAccount=t.Provider=t.EAccountImportResponse=t.EAccountDeletionResponse=t.Account=t.registerProvider=t.providers=t.AvailableCommands=void 0;const n=r("./node_modules/buffer/index.js");"undefined"!=typeof window&&(window.Buffer=n.Buffer);const o=r("./src/connector/Connector.ts"),s=r("./src/provider/Provider.ts"),i=r("./src/massaStation/MassaStationProvider.ts");var a;(a=t.AvailableCommands||(t.AvailableCommands={})).ProviderListAccounts="LIST_ACCOUNTS",a.ProviderDeleteAccount="DELETE_ACCOUNT",a.ProviderImportAccount="IMPORT_ACCOUNT",a.ProviderGetNodesUrls="GET_NODES_URLS",a.AccountBalance="ACCOUNT_BALANCE",a.AccountSign="ACCOUNT_SIGN",a.ProviderGenerateNewAccount="GENERATE_NEW_ACCOUNT",a.AccountSellRolls="ACCOUNT_SELL_ROLLS",a.AccountBuyRolls="ACCOUNT_BUY_ROLLS",a.AccountSendTransaction="ACCOUNT_SEND_TRANSACTION",a.AccountCallSC="ACCOUNT_CALL_SC",t.providers=async function e(t=!0,r=3e3,n=500){return r<=0?[]:(await o.connector.startMassaStationDiscovery(),new Promise((a=>{let u=[];for(const e of Object.keys(o.connector.getWalletProviders()))if(e===i.MASSA_STATION_PROVIDER_NAME){const e=new i.MassaStationProvider;u.push(e)}else{const t=new s.Provider(e);u.push(t)}t&&0===u.length?setTimeout((()=>{e(t,r-n,n).then(a)}),n):a(u)})))},t.registerProvider=function(e,t=o.MASSA_WINDOW_OBJECT){const r=new CustomEvent("register",{detail:{providerName:e}}),n=document.getElementById(t);n&&n.dispatchEvent(r)};var u=r("./src/account/index.ts");Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return u.Account}});var c=r("./src/provider/index.ts");Object.defineProperty(t,"EAccountDeletionResponse",{enumerable:!0,get:function(){return c.EAccountDeletionResponse}}),Object.defineProperty(t,"EAccountImportResponse",{enumerable:!0,get:function(){return c.EAccountImportResponse}}),Object.defineProperty(t,"Provider",{enumerable:!0,get:function(){return c.Provider}});var l=r("./src/massaStation/MassaStationAccount.ts");Object.defineProperty(t,"MassaStationAccount",{enumerable:!0,get:function(){return l.MassaStationAccount}})},"./src/massaStation/MassaStationAccount.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MassaStationAccount=void 0;const n=r("./src/massaStation/RequestHandler.ts"),o=r("./src/massaStation/MassaStationProvider.ts"),s=r("./src/utils/argsToBase64.ts"),i=BigInt(4294967295);t.MassaStationAccount=class{constructor({address:e,name:t},r){this._address=e,this._name=t,this._providerName=r}address(){return this._address}name(){return this._name}providerName(){return this._providerName}async balance(){let e=null;try{e=await(0,n.getRequest)(`${o.MASSA_STATION_URL}massa/addresses?attributes=balance&addresses=${this._address}`)}catch(e){throw console.error("MassaStation account balance error"),e}if(e.isError||e.error)throw e.error;const t=e.result.addressesAttributes[this._address].balance;return{finalBalance:t.final,candidateBalance:t.pending}}async sign(e){let t=null;try{t=await(0,n.postRequest)(`${o.MASSA_STATION_ACCOUNTS_URL}/${this._name}/sign`,{operation:e,batch:!1})}catch(e){throw console.error("MassaStation account signing error"),e}if(t.isError||t.error)throw t.error;return t.result}async buyRolls(e,t){let r=null;const s=`${o.MASSA_STATION_ACCOUNTS_URL}/${this._name}/rolls`,i={fee:t.toString(),amount:e.toString(),side:"buy"};try{r=await(0,n.postRequest)(s,i)}catch(e){throw console.error(`MassaStation account: error while buying rolls: ${e}`),e}if(r.isError||r.error)throw r.error;return r.result}async sellRolls(e,t){let r=null;const s=`${o.MASSA_STATION_ACCOUNTS_URL}/${this._name}/rolls`,i={fee:t.toString(),amount:e.toString(),side:"sell"};try{r=await(0,n.postRequest)(s,i)}catch(e){throw console.error(`MassaStation account: error while selling rolls: ${e}`),e}if(r.isError||r.error)throw r.error;return r.result}async sendTransaction(e,t,r){let s=null;const i=`${o.MASSA_STATION_ACCOUNTS_URL}/${this._name}/transfer`,a={fee:r.toString(),amount:e.toString(),recipientAddress:t};try{s=await(0,n.postRequest)(i,a)}catch(e){throw console.error(`MassaStation account: error while sending transaction: ${e}`),e}if(s.isError||s.error)throw s.error;return s.result}async callSC(e,t,r,i,a,u,c=!1){if(c)return this.nonPersistentCallSC(e,t,r,i,a,u);let l="";l=r instanceof Uint8Array?(0,s.uint8ArrayToBase64)(r):(0,s.argsToBase64)(r);let f=null;const d=`${o.MASSA_STATION_URL}cmd/executeFunction`,h={nickname:this._name,name:t,at:e,args:l,coins:Number(i)};try{f=await(0,n.postRequest)(d,h)}catch(e){throw console.log(`MassaStation account: error while interacting with smart contract: ${e}`),e}if(f.isError||f.error)throw f.error;return f.result}async getNodeUrlFromMassaStation(){let e=null,t="";try{if(e=await(0,n.getRequest)(`${o.MASSA_STATION_URL}massa/node`),e.isError||e.error)throw e.error.message;t=e.result.url}catch(e){throw new Error(`MassaStation nodes retrieval error: ${e}`)}return t}async nonPersistentCallSC(e,t,r,o,s,a){const u=await this.getNodeUrlFromMassaStation();if(a>i)throw new Error(`\n The gas submitted ${a.toString()} exceeds the max. allowed block gas of \n ${i.toString()}\n `);let c=[];c=r instanceof Uint8Array?Array.from(r):Array.from(r.serialize());const l=[{jsonrpc:"2.0",method:"execute_read_only_call",params:[[{max_gas:Number(a),target_address:e,target_function:t,parameter:c,caller_address:this._address}]],id:0}];let f=[];try{let e=await(0,n.postRequest)(u,l);if(e.isError||e.error)throw e.error.message;f=e.result}catch(e){throw new Error(`MassaStation account: error while interacting with smart contract: ${e}`)}if(f.length<=0)throw new Error("Read operation bad response. No results array in json rpc response. Inspect smart contract");if(f[0].result.Error)throw new Error(f[0].result.Error);return{returnValue:new Uint8Array(f[0].result[0].result.Ok),info:f[0]}}}},"./src/massaStation/MassaStationDiscovery.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MassaStationDiscovery=t.ON_MASSA_STATION_DISCONNECTED=t.ON_MASSA_STATION_DISCOVERED=t.MASSA_STATION_DISCOVERY_URL=void 0;const n=r("./node_modules/events/events.js"),o=r("./src/massaStation/RequestHandler.ts");t.MASSA_STATION_DISCOVERY_URL="https://station.massa/web/index",t.ON_MASSA_STATION_DISCOVERED="ON_MASSA_STATION_DISCOVERED",t.ON_MASSA_STATION_DISCONNECTED="ON_MASSA_STATION_DISCONNECTED";class s extends n.EventEmitter{constructor(){super(),this.isDiscovered=!1,this.startListening=this.startListening.bind(this)}async startListening(){let e=null;try{e=await(0,o.getRequest)(t.MASSA_STATION_DISCOVERY_URL)}catch(e){console.error(`Error calling ${t.MASSA_STATION_DISCOVERY_URL}`)}e.isError||e.error||(this.isDiscovered=!0,this.emit(t.ON_MASSA_STATION_DISCOVERED)),(e.isError||e.error)&&this.isDiscovered&&(this.isDiscovered=!1,this.emit(t.ON_MASSA_STATION_DISCONNECTED))}}t.MassaStationDiscovery=s},"./src/massaStation/MassaStationProvider.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MassaStationProvider=t.MASSA_STATION_PROVIDER_NAME=t.MASSA_STATION_IMPORT_ACCOUNTS_URL=t.MASSA_STATION_ACCOUNTS_URL=t.MASSA_STATION_URL=void 0;const n=r("./src/provider/AccountDeletion.ts"),o=r("./src/provider/AccountImport.ts"),s=r("./src/massaStation/RequestHandler.ts"),i=r("./src/massaStation/MassaStationAccount.ts");t.MASSA_STATION_URL="https://station.massa/",t.MASSA_STATION_ACCOUNTS_URL=`${t.MASSA_STATION_URL}plugin/massa-labs/massa-wallet/api/accounts`,t.MASSA_STATION_IMPORT_ACCOUNTS_URL=`${t.MASSA_STATION_ACCOUNTS_URL}/import/`,t.MASSA_STATION_PROVIDER_NAME="MASSASTATION",t.MassaStationProvider=class{constructor(){this.providerName=t.MASSA_STATION_PROVIDER_NAME}name(){return this.providerName}async accounts(){let e=null;try{e=await(0,s.getRequest)(t.MASSA_STATION_ACCOUNTS_URL)}catch(e){throw console.error("MassaStation accounts retrieval error"),e}if(e.isError||e.error)throw e.error.message;return e.result.map((e=>new i.MassaStationAccount({address:e.address,name:e.nickname},this.providerName)))}async importAccount(e,r){const n={publicKey:e,privateKey:r};let i=null;try{i=await(0,s.putRequest)(t.MASSA_STATION_ACCOUNTS_URL,n)}catch(e){throw console.log(`MassaStation accounts retrieval error: ${e}`),e}if(i.isError||i.error)throw i.error.message;return{response:o.EAccountImportResponse.OK,message:"Account imported successfully"}}async deleteAccount(e){let r=null;try{r=await(0,s.getRequest)(t.MASSA_STATION_ACCOUNTS_URL)}catch(e){throw console.log(`MassaStation accounts retrieval error: ${e}`),e}if(r.isError||r.error)throw r.error.message;const o=r.result.find((t=>t.address.toLowerCase()===e.toLowerCase()));let i=null;try{i=await(0,s.deleteRequest)(`${t.MASSA_STATION_ACCOUNTS_URL}/${o.nickname}`)}catch(e){return console.log("MassaStation accounts deletion error",e),{response:n.EAccountDeletionResponse.ERROR}}return i.isError||i.error?(console.log("MassaStation accounts deletion error",i.error.message),{response:n.EAccountDeletionResponse.ERROR}):{response:n.EAccountDeletionResponse.OK}}async getNodesUrls(){let e=null;try{if(e=await(0,s.getRequest)(`${t.MASSA_STATION_URL}massa/node`),e.isError||e.error)throw e.error.message;const r=e.result;return Array(r.url)}catch(e){throw console.error("MassaStation nodes retrieval error",e),e}}async generateNewAccount(e){let r=null;console.log(t.MASSA_STATION_ACCOUNTS_URL+"/"+e);try{if(r=await(0,s.postRequest)(t.MASSA_STATION_ACCOUNTS_URL+"/"+e,{}),r.isError||r.error)throw r.error.message;return{address:r.result.address,name:r.result.nickname}}catch(e){throw console.error(`Error while generating account: ${e}`),e}}}},"./src/massaStation/RequestHandler.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.putRequest=t.deleteRequest=t.postRequest=t.getRequest=void 0;const n=r("./node_modules/axios/index.js"),o={Accept:"application/json,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8","Access-Control-Allow-Origin":"*","Access-Control-Allow-Credentials":!0,"Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-Type":"application/json","Access-Control-Allow-Headers":"Accept,authorization,Authorization,Content-Type"};t.getRequest=async function(e){let t=null;try{t=await n.default.get(e,o)}catch(e){return{isError:!0,result:null,error:new Error("Axios Error: "+String(e))}}return{isError:!1,result:t.data,error:null}},t.postRequest=async function(e,t){try{return{isError:!1,result:(await n.default.post(e,t,o)).data,error:null}}catch(e){return{isError:!0,result:null,error:e.response?.data?.message?new Error(String(e.response.data.message)):new Error("Axios error: "+String(e))}}},t.deleteRequest=async function(e){let t=null;try{t=await n.default.delete(e,o)}catch(e){return{isError:!0,result:null,error:new Error("Axios Error: "+String(e))}}return{isError:!1,result:t.data,error:null}},t.putRequest=async function(e,t){let r=null;try{r=await n.default.put(e,t,o)}catch(e){return{isError:!0,result:null,error:new Error("Axios error: "+String(e))}}return{isError:!1,result:r.data,error:null}}},"./src/provider/AccountDeletion.ts":(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.EAccountDeletionResponse=void 0,(r=t.EAccountDeletionResponse||(t.EAccountDeletionResponse={}))[r.OK=0]="OK",r[r.REFUSED=1]="REFUSED",r[r.ERROR=2]="ERROR"},"./src/provider/AccountImport.ts":(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.EAccountImportResponse=void 0,(r=t.EAccountImportResponse||(t.EAccountImportResponse={}))[r.OK=0]="OK",r[r.REFUSED=1]="REFUSED",r[r.ERROR=2]="ERROR"},"./src/provider/Provider.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;const n=r("./src/connector/Connector.ts"),o=r("./src/account/Account.ts"),s=r("./src/index.ts");t.Provider=class{constructor(e){this.providerName=e}name(){return this.providerName}async accounts(){const e=new Promise(((e,t)=>{n.connector.sendMessageToContentScript(this.providerName,s.AvailableCommands.ProviderListAccounts,{},((r,n)=>n?t(n):e(r)))})),t=await e;let r=[];for(const e of t){const t=new o.Account(e,this.providerName);r.push(t)}return r}async importAccount(e,t){const r={publicKey:e,privateKey:t};return new Promise(((e,t)=>{n.connector.sendMessageToContentScript(this.providerName,s.AvailableCommands.ProviderImportAccount,r,((r,n)=>n?t(n):e(r)))}))}async deleteAccount(e){const t={address:e};return new Promise(((e,r)=>{n.connector.sendMessageToContentScript(this.providerName,s.AvailableCommands.ProviderDeleteAccount,t,((t,n)=>n?r(n):e(t)))}))}async getNodesUrls(){return new Promise(((e,t)=>{n.connector.sendMessageToContentScript(this.providerName,s.AvailableCommands.ProviderGetNodesUrls,{},((r,n)=>n?t(n):e(r)))}))}async generateNewAccount(e){const t={name:e};return new Promise(((e,r)=>{n.connector.sendMessageToContentScript(this.providerName,s.AvailableCommands.ProviderGenerateNewAccount,t,((t,n)=>n?r(n):e(t)))}))}}},"./src/provider/index.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=t.EAccountImportResponse=t.EAccountDeletionResponse=void 0;var n=r("./src/provider/AccountDeletion.ts");Object.defineProperty(t,"EAccountDeletionResponse",{enumerable:!0,get:function(){return n.EAccountDeletionResponse}});var o=r("./src/provider/AccountImport.ts");Object.defineProperty(t,"EAccountImportResponse",{enumerable:!0,get:function(){return o.EAccountImportResponse}});var s=r("./src/provider/Provider.ts");Object.defineProperty(t,"Provider",{enumerable:!0,get:function(){return s.Provider}})},"./src/utils/argsToBase64.ts":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint8ArrayToBase64=t.argsToBase64=void 0,t.argsToBase64=function(e){const t=e.serialize();return Buffer.from(t).toString("base64")},t.uint8ArrayToBase64=function(e){return Buffer.from(e).toString("base64")}},"./node_modules/uid/dist/index.js":(e,t)=>{for(var r,n=256,o=[];n--;)o[n]=(n+256).toString(16).substring(1);t.uid=function(e){var t=0,s=e||11;if(!r||n+s>512)for(r="",n=0;t<256;t++)r+=o[256*Math.random()|0];return r.substring(n,n+++s)}}},t={},r=function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}("./src/index.ts");window.massa=r})();
|
|
3
|
+
//# sourceMappingURL=bundle.min.js.map
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { IAccountBalanceResponse } from './AccountBalance';
|
|
2
|
+
import { IAccountSignResponse } from './AccountSign';
|
|
3
|
+
import { IAccountDetails } from './IAccountDetails';
|
|
4
|
+
import { ITransactionDetails } from '..';
|
|
5
|
+
import { IAccount } from './IAccount';
|
|
6
|
+
import { Args, IContractReadOperationResponse } from '@massalabs/web3-utils';
|
|
7
|
+
/**
|
|
8
|
+
* This module contains the Account class. It is responsible for representing an account in the wallet.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* This class provides methods to interact with the account's {@link balance} and to {@link sign} messages.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export declare class Account implements IAccount {
|
|
15
|
+
private _providerName;
|
|
16
|
+
private _address;
|
|
17
|
+
private _name;
|
|
18
|
+
/**
|
|
19
|
+
* This constructor takes an object of type IAccountDetails and a providerName string as its arguments.
|
|
20
|
+
*
|
|
21
|
+
* @param address - The address of the account.
|
|
22
|
+
* @param name - The name of the account.
|
|
23
|
+
* @param providerName - The name of the provider.
|
|
24
|
+
* @returns An instance of the Account class.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* - The Account constructor takes an object of type IAccountDetails and a providerName string as its arguments.
|
|
28
|
+
* - The IAccountDetails object contains the account's address and name.
|
|
29
|
+
* - The providerName string identifies the provider that is used to interact with the blockchain.
|
|
30
|
+
*/
|
|
31
|
+
constructor({ address, name }: IAccountDetails, providerName: string);
|
|
32
|
+
/**
|
|
33
|
+
* @returns The address of the account.
|
|
34
|
+
*/
|
|
35
|
+
address(): string;
|
|
36
|
+
/**
|
|
37
|
+
* @returns The name of the account.
|
|
38
|
+
*/
|
|
39
|
+
name(): string;
|
|
40
|
+
/**
|
|
41
|
+
* @returns The name of the provider.
|
|
42
|
+
*/
|
|
43
|
+
providerName(): string;
|
|
44
|
+
/**
|
|
45
|
+
* This method aims to retrieve the account's balance.
|
|
46
|
+
*
|
|
47
|
+
* @returns A promise that resolves to an object of type IAccountBalanceResponse. It contains the account's balance.
|
|
48
|
+
*/
|
|
49
|
+
balance(): Promise<IAccountBalanceResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* This method aims to sign a message.
|
|
52
|
+
*
|
|
53
|
+
* @param data - The message to be signed.
|
|
54
|
+
* @returns An IAccountSignResponse object. It contains the signature of the message.
|
|
55
|
+
*/
|
|
56
|
+
sign(data: Uint8Array): Promise<IAccountSignResponse>;
|
|
57
|
+
/**
|
|
58
|
+
* This method aims to buy rolls on behalf of the sender.
|
|
59
|
+
*
|
|
60
|
+
* @param amount - The amount of rolls to be purchased
|
|
61
|
+
* @param fee - The fee to be paid for the transaction execution by the node..
|
|
62
|
+
* @returns An ITransactionDetails object. It contains the operationId on the network.
|
|
63
|
+
*/
|
|
64
|
+
buyRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;
|
|
65
|
+
/**
|
|
66
|
+
* This method aims to sell rolls on behalf of the sender.
|
|
67
|
+
*
|
|
68
|
+
* @param amount - The amount of rolls to be sold.
|
|
69
|
+
* @param fee - The fee to be paid for the transaction execution by the node..
|
|
70
|
+
* @returns An ITransactionDetails object. It contains the operationId on the network.
|
|
71
|
+
*/
|
|
72
|
+
sellRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;
|
|
73
|
+
/**
|
|
74
|
+
* This method aims to transfer MAS on behalf of the sender to a recipient.
|
|
75
|
+
*
|
|
76
|
+
* @param amount - The amount of MAS (in the smallest unit) to be transferred.
|
|
77
|
+
* @param fee - The fee to be paid for the transaction execution (in the smallest unit).
|
|
78
|
+
* @returns An ITransactionDetails object. It contains the operationId on the network.
|
|
79
|
+
*/
|
|
80
|
+
sendTransaction(amount: bigint, recipientAddress: string, fee: bigint): Promise<ITransactionDetails>;
|
|
81
|
+
/**
|
|
82
|
+
* This method aims to interact with a smart contract deployed on the MASSA blockchain.
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* If dryRun.dryRun is true, the method will dry run the smart contract call and return an
|
|
86
|
+
* IContractReadOperationResponse object which contains all the information about the dry run
|
|
87
|
+
* (state changes, gas used, etc.)
|
|
88
|
+
*
|
|
89
|
+
* @param contractAddress - The address of the smart contract.
|
|
90
|
+
* @param functionName - The name of the function to be called.
|
|
91
|
+
* @param parameter - The parameters as an Args object to be passed to the function.
|
|
92
|
+
* @param amount - The amount of MASSA coins to be sent to the contract (in the smallest unit).
|
|
93
|
+
* @param fee - The fee to be paid for the transaction execution (in the smallest unit).
|
|
94
|
+
* @param maxGas - The maximum amount of gas to be used for the transaction execution.
|
|
95
|
+
* @param nonPersistentExecution - The dryRun object to be passed to the function.
|
|
96
|
+
*
|
|
97
|
+
* @returns if 'nonPersistentExecution' is true, it returns an IContractReadOperationResponse object.
|
|
98
|
+
* Otherwise, it returns an ITransactionDetails object which contains the operationId on the network.
|
|
99
|
+
*
|
|
100
|
+
*/
|
|
101
|
+
callSC(contractAddress: string, functionName: string, parameter: Uint8Array | Args, amount: bigint, fee: bigint, maxGas: bigint, nonPersistentExecution?: boolean): Promise<ITransactionDetails | IContractReadOperationResponse>;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=Account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../../src/account/Account.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAuB,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAqB,mBAAmB,EAAE,MAAM,IAAI,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,EAAE,IAAI,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAE7E;;;;;;GAMG;AACH,qBAAa,OAAQ,YAAW,QAAQ;IACtC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,KAAK,CAAS;IAEtB;;;;;;;;;;;;OAYG;gBACgB,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM;IAM3E;;OAEG;IACI,OAAO,IAAI,MAAM;IAIxB;;OAEG;IACI,IAAI,IAAI,MAAM;IAIrB;;OAEG;IACI,YAAY,IAAI,MAAM;IAI7B;;;;OAIG;IACU,OAAO,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAcxD;;;;;OAKG;IACU,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAclE;;;;;;OAMG;IACU,QAAQ,CACnB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,mBAAmB,CAAC;IAiB/B;;;;;;OAMG;IACU,SAAS,CACpB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,mBAAmB,CAAC;IAiB/B;;;;;;OAMG;IACU,eAAe,CAC1B,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,EACxB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,mBAAmB,CAAC;IAkB/B;;;;;;;;;;;;;;;;;;;OAmBG;IACU,MAAM,CACjB,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,UAAU,GAAG,IAAI,EAC5B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,sBAAsB,UAAQ,GAC7B,OAAO,CAAC,mBAAmB,GAAG,8BAA8B,CAAC;CA0BjE"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Account = void 0;
|
|
4
|
+
const Connector_1 = require("../connector/Connector");
|
|
5
|
+
const __1 = require("..");
|
|
6
|
+
/**
|
|
7
|
+
* This module contains the Account class. It is responsible for representing an account in the wallet.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This class provides methods to interact with the account's {@link balance} and to {@link sign} messages.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
class Account {
|
|
14
|
+
/**
|
|
15
|
+
* This constructor takes an object of type IAccountDetails and a providerName string as its arguments.
|
|
16
|
+
*
|
|
17
|
+
* @param address - The address of the account.
|
|
18
|
+
* @param name - The name of the account.
|
|
19
|
+
* @param providerName - The name of the provider.
|
|
20
|
+
* @returns An instance of the Account class.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* - The Account constructor takes an object of type IAccountDetails and a providerName string as its arguments.
|
|
24
|
+
* - The IAccountDetails object contains the account's address and name.
|
|
25
|
+
* - The providerName string identifies the provider that is used to interact with the blockchain.
|
|
26
|
+
*/
|
|
27
|
+
constructor({ address, name }, providerName) {
|
|
28
|
+
this._address = address;
|
|
29
|
+
this._name = name ?? '';
|
|
30
|
+
this._providerName = providerName;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @returns The address of the account.
|
|
34
|
+
*/
|
|
35
|
+
address() {
|
|
36
|
+
return this._address;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @returns The name of the account.
|
|
40
|
+
*/
|
|
41
|
+
name() {
|
|
42
|
+
return this._name;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @returns The name of the provider.
|
|
46
|
+
*/
|
|
47
|
+
providerName() {
|
|
48
|
+
return this._providerName;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* This method aims to retrieve the account's balance.
|
|
52
|
+
*
|
|
53
|
+
* @returns A promise that resolves to an object of type IAccountBalanceResponse. It contains the account's balance.
|
|
54
|
+
*/
|
|
55
|
+
async balance() {
|
|
56
|
+
return new Promise((resolve, reject) => {
|
|
57
|
+
Connector_1.connector.sendMessageToContentScript(this._providerName, __1.AvailableCommands.AccountBalance, { address: this._address }, (result, err) => {
|
|
58
|
+
if (err)
|
|
59
|
+
return reject(err);
|
|
60
|
+
return resolve(result);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* This method aims to sign a message.
|
|
66
|
+
*
|
|
67
|
+
* @param data - The message to be signed.
|
|
68
|
+
* @returns An IAccountSignResponse object. It contains the signature of the message.
|
|
69
|
+
*/
|
|
70
|
+
async sign(data) {
|
|
71
|
+
return new Promise((resolve, reject) => {
|
|
72
|
+
Connector_1.connector.sendMessageToContentScript(this._providerName, __1.AvailableCommands.AccountSign, { address: this._address, data }, (result, err) => {
|
|
73
|
+
if (err)
|
|
74
|
+
return reject(err);
|
|
75
|
+
return resolve(result);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* This method aims to buy rolls on behalf of the sender.
|
|
81
|
+
*
|
|
82
|
+
* @param amount - The amount of rolls to be purchased
|
|
83
|
+
* @param fee - The fee to be paid for the transaction execution by the node..
|
|
84
|
+
* @returns An ITransactionDetails object. It contains the operationId on the network.
|
|
85
|
+
*/
|
|
86
|
+
async buyRolls(amount, fee) {
|
|
87
|
+
return new Promise((resolve, reject) => {
|
|
88
|
+
Connector_1.connector.sendMessageToContentScript(this._providerName, __1.AvailableCommands.AccountBuyRolls, {
|
|
89
|
+
amount: amount.toString(),
|
|
90
|
+
fee: fee.toString(),
|
|
91
|
+
}, (result, err) => {
|
|
92
|
+
if (err)
|
|
93
|
+
return reject(err);
|
|
94
|
+
return resolve(result);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* This method aims to sell rolls on behalf of the sender.
|
|
100
|
+
*
|
|
101
|
+
* @param amount - The amount of rolls to be sold.
|
|
102
|
+
* @param fee - The fee to be paid for the transaction execution by the node..
|
|
103
|
+
* @returns An ITransactionDetails object. It contains the operationId on the network.
|
|
104
|
+
*/
|
|
105
|
+
async sellRolls(amount, fee) {
|
|
106
|
+
return new Promise((resolve, reject) => {
|
|
107
|
+
Connector_1.connector.sendMessageToContentScript(this._providerName, __1.AvailableCommands.AccountSellRolls, {
|
|
108
|
+
amount: amount.toString(),
|
|
109
|
+
fee: fee.toString(),
|
|
110
|
+
}, (result, err) => {
|
|
111
|
+
if (err)
|
|
112
|
+
return reject(err);
|
|
113
|
+
return resolve(result);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* This method aims to transfer MAS on behalf of the sender to a recipient.
|
|
119
|
+
*
|
|
120
|
+
* @param amount - The amount of MAS (in the smallest unit) to be transferred.
|
|
121
|
+
* @param fee - The fee to be paid for the transaction execution (in the smallest unit).
|
|
122
|
+
* @returns An ITransactionDetails object. It contains the operationId on the network.
|
|
123
|
+
*/
|
|
124
|
+
async sendTransaction(amount, recipientAddress, fee) {
|
|
125
|
+
return new Promise((resolve, reject) => {
|
|
126
|
+
Connector_1.connector.sendMessageToContentScript(this._providerName, __1.AvailableCommands.AccountSendTransaction, {
|
|
127
|
+
amount: amount.toString(),
|
|
128
|
+
recipientAddress,
|
|
129
|
+
fee: fee.toString(),
|
|
130
|
+
}, (result, err) => {
|
|
131
|
+
if (err)
|
|
132
|
+
return reject(err);
|
|
133
|
+
return resolve(result);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* This method aims to interact with a smart contract deployed on the MASSA blockchain.
|
|
139
|
+
*
|
|
140
|
+
* @remarks
|
|
141
|
+
* If dryRun.dryRun is true, the method will dry run the smart contract call and return an
|
|
142
|
+
* IContractReadOperationResponse object which contains all the information about the dry run
|
|
143
|
+
* (state changes, gas used, etc.)
|
|
144
|
+
*
|
|
145
|
+
* @param contractAddress - The address of the smart contract.
|
|
146
|
+
* @param functionName - The name of the function to be called.
|
|
147
|
+
* @param parameter - The parameters as an Args object to be passed to the function.
|
|
148
|
+
* @param amount - The amount of MASSA coins to be sent to the contract (in the smallest unit).
|
|
149
|
+
* @param fee - The fee to be paid for the transaction execution (in the smallest unit).
|
|
150
|
+
* @param maxGas - The maximum amount of gas to be used for the transaction execution.
|
|
151
|
+
* @param nonPersistentExecution - The dryRun object to be passed to the function.
|
|
152
|
+
*
|
|
153
|
+
* @returns if 'nonPersistentExecution' is true, it returns an IContractReadOperationResponse object.
|
|
154
|
+
* Otherwise, it returns an ITransactionDetails object which contains the operationId on the network.
|
|
155
|
+
*
|
|
156
|
+
*/
|
|
157
|
+
async callSC(contractAddress, functionName, parameter, amount, fee, maxGas, nonPersistentExecution = false) {
|
|
158
|
+
return new Promise((resolve, reject) => {
|
|
159
|
+
Connector_1.connector.sendMessageToContentScript(this._providerName, __1.AvailableCommands.AccountCallSC, {
|
|
160
|
+
nickname: this._name,
|
|
161
|
+
name: functionName,
|
|
162
|
+
at: contractAddress,
|
|
163
|
+
args: parameter,
|
|
164
|
+
coins: amount,
|
|
165
|
+
fee: fee,
|
|
166
|
+
maxGas: maxGas,
|
|
167
|
+
nonPersistentExecution: nonPersistentExecution,
|
|
168
|
+
}, (result, err) => {
|
|
169
|
+
if (err)
|
|
170
|
+
return reject(err);
|
|
171
|
+
return resolve(nonPersistentExecution
|
|
172
|
+
? result
|
|
173
|
+
: result);
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
exports.Account = Account;
|
|
179
|
+
//# sourceMappingURL=Account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Account.js","sourceRoot":"","sources":["../../../src/account/Account.ts"],"names":[],"mappings":";;;AAKA,sDAAmD;AAEnD,0BAA4D;AAO5D;;;;;;GAMG;AACH,MAAa,OAAO;IAKlB;;;;;;;;;;;;OAYG;IACH,YAAmB,EAAE,OAAO,EAAE,IAAI,EAAmB,EAAE,YAAoB;QACzE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,OAAO;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,IAAI;QACT,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACI,YAAY;QACjB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAO;QAClB,OAAO,IAAI,OAAO,CAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC9D,qBAAS,CAAC,0BAA0B,CAClC,IAAI,CAAC,aAAa,EAClB,qBAAiB,CAAC,cAAc,EAChC,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAA4B,EACpD,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;gBACd,IAAI,GAAG;oBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC5B,OAAO,OAAO,CAAC,MAAiC,CAAC,CAAC;YACpD,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CAAC,IAAgB;QAChC,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3D,qBAAS,CAAC,0BAA0B,CAClC,IAAI,CAAC,aAAa,EAClB,qBAAiB,CAAC,WAAW,EAC7B,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAyB,EACvD,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;gBACd,IAAI,GAAG;oBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC5B,OAAO,OAAO,CAAC,MAA8B,CAAC,CAAC;YACjD,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,QAAQ,CACnB,MAAc,EACd,GAAW;QAEX,OAAO,IAAI,OAAO,CAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1D,qBAAS,CAAC,0BAA0B,CAClC,IAAI,CAAC,aAAa,EAClB,qBAAiB,CAAC,eAAe,EACjC;gBACE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE;gBACzB,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;aACI,EACzB,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;gBACd,IAAI,GAAG;oBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC5B,OAAO,OAAO,CAAC,MAA6B,CAAC,CAAC;YAChD,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,SAAS,CACpB,MAAc,EACd,GAAW;QAEX,OAAO,IAAI,OAAO,CAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1D,qBAAS,CAAC,0BAA0B,CAClC,IAAI,CAAC,aAAa,EAClB,qBAAiB,CAAC,gBAAgB,EAClC;gBACE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE;gBACzB,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;aACI,EACzB,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;gBACd,IAAI,GAAG;oBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC5B,OAAO,OAAO,CAAC,MAA6B,CAAC,CAAC;YAChD,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,eAAe,CAC1B,MAAc,EACd,gBAAwB,EACxB,GAAW;QAEX,OAAO,IAAI,OAAO,CAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1D,qBAAS,CAAC,0BAA0B,CAClC,IAAI,CAAC,aAAa,EAClB,qBAAiB,CAAC,sBAAsB,EACxC;gBACE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE;gBACzB,gBAAgB;gBAChB,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;aACc,EACnC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;gBACd,IAAI,GAAG;oBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC5B,OAAO,OAAO,CAAC,MAA6B,CAAC,CAAC;YAChD,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACI,KAAK,CAAC,MAAM,CACjB,eAAuB,EACvB,YAAoB,EACpB,SAA4B,EAC5B,MAAc,EACd,GAAW,EACX,MAAc,EACd,sBAAsB,GAAG,KAAK;QAE9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,qBAAS,CAAC,0BAA0B,CAClC,IAAI,CAAC,aAAa,EAClB,qBAAiB,CAAC,aAAa,EAC/B;gBACE,QAAQ,EAAE,IAAI,CAAC,KAAK;gBACpB,IAAI,EAAE,YAAY;gBAClB,EAAE,EAAE,eAAe;gBACnB,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,MAAM;gBACb,GAAG,EAAE,GAAG;gBACR,MAAM,EAAE,MAAM;gBACd,sBAAsB,EAAE,sBAAsB;aACtB,EAC1B,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;gBACd,IAAI,GAAG;oBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC5B,OAAO,OAAO,CACZ,sBAAsB;oBACpB,CAAC,CAAE,MAAyC;oBAC5C,CAAC,CAAE,MAA8B,CACpC,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA7ND,0BA6NC","sourcesContent":["import {\n IAccountBalanceRequest,\n IAccountBalanceResponse,\n} from './AccountBalance';\nimport { IAccountSignRequest, IAccountSignResponse } from './AccountSign';\nimport { connector } from '../connector/Connector';\nimport { IAccountDetails } from './IAccountDetails';\nimport { AvailableCommands, ITransactionDetails } from '..';\nimport { IAccount } from './IAccount';\nimport { IAccountRollsRequest } from './IAccountRolls';\nimport { IAccountSendTransactionRequest } from './IAccountSendTransaction';\nimport { IAccountCallSCRequest } from './IAccountCallSCRequest';\nimport { Args, IContractReadOperationResponse } from '@massalabs/web3-utils';\n\n/**\n * This module contains the Account class. It is responsible for representing an account in the wallet.\n *\n * @remarks\n * This class provides methods to interact with the account's {@link balance} and to {@link sign} messages.\n *\n */\nexport class Account implements IAccount {\n private _providerName: string;\n private _address: string;\n private _name: string;\n\n /**\n * This constructor takes an object of type IAccountDetails and a providerName string as its arguments.\n *\n * @param address - The address of the account.\n * @param name - The name of the account.\n * @param providerName - The name of the provider.\n * @returns An instance of the Account class.\n *\n * @remarks\n * - The Account constructor takes an object of type IAccountDetails and a providerName string as its arguments.\n * - The IAccountDetails object contains the account's address and name.\n * - The providerName string identifies the provider that is used to interact with the blockchain.\n */\n public constructor({ address, name }: IAccountDetails, providerName: string) {\n this._address = address;\n this._name = name ?? '';\n this._providerName = providerName;\n }\n\n /**\n * @returns The address of the account.\n */\n public address(): string {\n return this._address;\n }\n\n /**\n * @returns The name of the account.\n */\n public name(): string {\n return this._name;\n }\n\n /**\n * @returns The name of the provider.\n */\n public providerName(): string {\n return this._providerName;\n }\n\n /**\n * This method aims to retrieve the account's balance.\n *\n * @returns A promise that resolves to an object of type IAccountBalanceResponse. It contains the account's balance.\n */\n public async balance(): Promise<IAccountBalanceResponse> {\n return new Promise<IAccountBalanceResponse>((resolve, reject) => {\n connector.sendMessageToContentScript(\n this._providerName,\n AvailableCommands.AccountBalance,\n { address: this._address } as IAccountBalanceRequest,\n (result, err) => {\n if (err) return reject(err);\n return resolve(result as IAccountBalanceResponse);\n },\n );\n });\n }\n\n /**\n * This method aims to sign a message.\n *\n * @param data - The message to be signed.\n * @returns An IAccountSignResponse object. It contains the signature of the message.\n */\n public async sign(data: Uint8Array): Promise<IAccountSignResponse> {\n return new Promise<IAccountSignResponse>((resolve, reject) => {\n connector.sendMessageToContentScript(\n this._providerName,\n AvailableCommands.AccountSign,\n { address: this._address, data } as IAccountSignRequest,\n (result, err) => {\n if (err) return reject(err);\n return resolve(result as IAccountSignResponse);\n },\n );\n });\n }\n\n /**\n * This method aims to buy rolls on behalf of the sender.\n *\n * @param amount - The amount of rolls to be purchased\n * @param fee - The fee to be paid for the transaction execution by the node..\n * @returns An ITransactionDetails object. It contains the operationId on the network.\n */\n public async buyRolls(\n amount: bigint,\n fee: bigint,\n ): Promise<ITransactionDetails> {\n return new Promise<ITransactionDetails>((resolve, reject) => {\n connector.sendMessageToContentScript(\n this._providerName,\n AvailableCommands.AccountBuyRolls,\n {\n amount: amount.toString(),\n fee: fee.toString(),\n } as IAccountRollsRequest,\n (result, err) => {\n if (err) return reject(err);\n return resolve(result as ITransactionDetails);\n },\n );\n });\n }\n\n /**\n * This method aims to sell rolls on behalf of the sender.\n *\n * @param amount - The amount of rolls to be sold.\n * @param fee - The fee to be paid for the transaction execution by the node..\n * @returns An ITransactionDetails object. It contains the operationId on the network.\n */\n public async sellRolls(\n amount: bigint,\n fee: bigint,\n ): Promise<ITransactionDetails> {\n return new Promise<ITransactionDetails>((resolve, reject) => {\n connector.sendMessageToContentScript(\n this._providerName,\n AvailableCommands.AccountSellRolls,\n {\n amount: amount.toString(),\n fee: fee.toString(),\n } as IAccountRollsRequest,\n (result, err) => {\n if (err) return reject(err);\n return resolve(result as ITransactionDetails);\n },\n );\n });\n }\n\n /**\n * This method aims to transfer MAS on behalf of the sender to a recipient.\n *\n * @param amount - The amount of MAS (in the smallest unit) to be transferred.\n * @param fee - The fee to be paid for the transaction execution (in the smallest unit).\n * @returns An ITransactionDetails object. It contains the operationId on the network.\n */\n public async sendTransaction(\n amount: bigint,\n recipientAddress: string,\n fee: bigint,\n ): Promise<ITransactionDetails> {\n return new Promise<ITransactionDetails>((resolve, reject) => {\n connector.sendMessageToContentScript(\n this._providerName,\n AvailableCommands.AccountSendTransaction,\n {\n amount: amount.toString(),\n recipientAddress,\n fee: fee.toString(),\n } as IAccountSendTransactionRequest,\n (result, err) => {\n if (err) return reject(err);\n return resolve(result as ITransactionDetails);\n },\n );\n });\n }\n\n /**\n * This method aims to interact with a smart contract deployed on the MASSA blockchain.\n *\n * @remarks\n * If dryRun.dryRun is true, the method will dry run the smart contract call and return an\n * IContractReadOperationResponse object which contains all the information about the dry run\n * (state changes, gas used, etc.)\n *\n * @param contractAddress - The address of the smart contract.\n * @param functionName - The name of the function to be called.\n * @param parameter - The parameters as an Args object to be passed to the function.\n * @param amount - The amount of MASSA coins to be sent to the contract (in the smallest unit).\n * @param fee - The fee to be paid for the transaction execution (in the smallest unit).\n * @param maxGas - The maximum amount of gas to be used for the transaction execution.\n * @param nonPersistentExecution - The dryRun object to be passed to the function.\n *\n * @returns if 'nonPersistentExecution' is true, it returns an IContractReadOperationResponse object.\n * Otherwise, it returns an ITransactionDetails object which contains the operationId on the network.\n *\n */\n public async callSC(\n contractAddress: string,\n functionName: string,\n parameter: Uint8Array | Args,\n amount: bigint,\n fee: bigint,\n maxGas: bigint,\n nonPersistentExecution = false,\n ): Promise<ITransactionDetails | IContractReadOperationResponse> {\n return new Promise((resolve, reject) => {\n connector.sendMessageToContentScript(\n this._providerName,\n AvailableCommands.AccountCallSC,\n {\n nickname: this._name,\n name: functionName,\n at: contractAddress,\n args: parameter,\n coins: amount,\n fee: fee,\n maxGas: maxGas,\n nonPersistentExecution: nonPersistentExecution,\n } as IAccountCallSCRequest,\n (result, err) => {\n if (err) return reject(err);\n return resolve(\n nonPersistentExecution\n ? (result as IContractReadOperationResponse)\n : (result as ITransactionDetails),\n );\n },\n );\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This interface represents the request object of the AccountBalance command.
|
|
3
|
+
*/
|
|
4
|
+
export interface IAccountBalanceRequest {
|
|
5
|
+
address: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* This interface represents the response object of the AccountBalance command sent by the content script.
|
|
9
|
+
*/
|
|
10
|
+
export interface IAccountBalanceResponse {
|
|
11
|
+
finalBalance: string;
|
|
12
|
+
candidateBalance: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=AccountBalance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountBalance.d.ts","sourceRoot":"","sources":["../../../src/account/AccountBalance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountBalance.js","sourceRoot":"","sources":["../../../src/account/AccountBalance.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * This interface represents the request object of the AccountBalance command.\n */\nexport interface IAccountBalanceRequest {\n address: string;\n}\n\n/**\n * This interface represents the response object of the AccountBalance command sent by the content script.\n */\nexport interface IAccountBalanceResponse {\n finalBalance: string;\n candidateBalance: string;\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This interface represents the request object for the signing operation sent to the content script.
|
|
3
|
+
*/
|
|
4
|
+
export interface IAccountSignRequest {
|
|
5
|
+
address: string;
|
|
6
|
+
data: Uint8Array;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* This interface represents the response object containing the signed message data, which is sent by the content script
|
|
10
|
+
* after the signing operation.
|
|
11
|
+
*/
|
|
12
|
+
export interface IAccountSignResponse {
|
|
13
|
+
publicKey: string;
|
|
14
|
+
signature: Uint8Array;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=AccountSign.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountSign.d.ts","sourceRoot":"","sources":["../../../src/account/AccountSign.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,UAAU,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountSign.js","sourceRoot":"","sources":["../../../src/account/AccountSign.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * This interface represents the request object for the signing operation sent to the content script.\n */\nexport interface IAccountSignRequest {\n address: string;\n data: Uint8Array;\n}\n\n/**\n * This interface represents the response object containing the signed message data, which is sent by the content script\n * after the signing operation.\n */\nexport interface IAccountSignResponse {\n publicKey: string;\n signature: Uint8Array;\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ITransactionDetails } from '..';
|
|
2
|
+
import { IAccountBalanceResponse } from './AccountBalance';
|
|
3
|
+
import { IAccountSignResponse } from './AccountSign';
|
|
4
|
+
import { Args } from '@massalabs/web3-utils';
|
|
5
|
+
/**
|
|
6
|
+
* This interface represents an Account object.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export interface IAccount {
|
|
10
|
+
address(): string;
|
|
11
|
+
name(): string;
|
|
12
|
+
providerName(): string;
|
|
13
|
+
balance(): Promise<IAccountBalanceResponse>;
|
|
14
|
+
sign(data: Uint8Array | string): Promise<IAccountSignResponse>;
|
|
15
|
+
buyRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;
|
|
16
|
+
sellRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;
|
|
17
|
+
sendTransaction(amount: bigint, recipientAddress: string, fee: bigint): Promise<ITransactionDetails>;
|
|
18
|
+
callSC(contractAddress: string, functionName: string, parameter: Uint8Array | Args, amount: bigint, fee: bigint, maxGas: bigint, nonPersistentExecution?: boolean): any;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=IAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAccount.d.ts","sourceRoot":"","sources":["../../../src/account/IAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,IAAI,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,IAAI,MAAM,CAAC;IAClB,IAAI,IAAI,MAAM,CAAC;IACf,YAAY,IAAI,MAAM,CAAC;IACvB,OAAO,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC5C,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC/D,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACpE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACrE,eAAe,CACb,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,EACxB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,MAAM,CACJ,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,UAAU,GAAG,IAAI,EAC5B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,sBAAsB,CAAC,EAAE,OAAO,OAChC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAccount.js","sourceRoot":"","sources":["../../../src/account/IAccount.ts"],"names":[],"mappings":"","sourcesContent":["import { ITransactionDetails } from '..';\nimport { IAccountBalanceResponse } from './AccountBalance';\nimport { IAccountSignResponse } from './AccountSign';\nimport { Args } from '@massalabs/web3-utils';\n\n/**\n * This interface represents an Account object.\n *\n */\nexport interface IAccount {\n address(): string;\n name(): string;\n providerName(): string;\n balance(): Promise<IAccountBalanceResponse>;\n sign(data: Uint8Array | string): Promise<IAccountSignResponse>;\n buyRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;\n sellRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;\n sendTransaction(\n amount: bigint,\n recipientAddress: string,\n fee: bigint,\n ): Promise<ITransactionDetails>;\n callSC(\n contractAddress: string,\n functionName: string,\n parameter: Uint8Array | Args,\n amount: bigint,\n fee: bigint,\n maxGas: bigint,\n nonPersistentExecution?: boolean,\n );\n}\n"]}
|