Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arweave

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arweave - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

19

dist/node/arweave/arweave.js

@@ -32,3 +32,3 @@ "use strict";

}
let from = await this.wallets.jwkToAddress(jwk);
const from = await this.wallets.jwkToAddress(jwk);
if (attributes.owner == undefined) {

@@ -41,4 +41,4 @@ attributes.owner = jwk.n;

if (attributes.reward == undefined) {
let length = (typeof attributes.data == 'string' && attributes.data.length > 0) ? attributes.data.length : 0;
let target = (typeof attributes.target == 'string' && attributes.target.length > 0) ? attributes.target : null;
const length = (typeof attributes.data == 'string' && attributes.data.length > 0) ? attributes.data.length : 0;
const target = (typeof attributes.target == 'string' && attributes.target.length > 0) ? attributes.target : null;
attributes.reward = await this.transactions.getPrice(length, target);

@@ -61,3 +61,3 @@ }

}
let from = await this.wallets.jwkToAddress(jwk);
const from = await this.wallets.jwkToAddress(jwk);
if (attributes.owner == undefined) {

@@ -69,10 +69,13 @@ attributes.owner = jwk.n;

}
const siloResource = await this.silo.parseUri(siloUri);
const encrypted = await this.crypto.encrypt(utils_1.ArweaveUtils.stringToBuffer(attributes.data), siloResource.getEncryptionKey());
if (attributes.reward == undefined) {
let length = (typeof attributes.data == 'string' && attributes.data.length > 0) ? attributes.data.length : 0;
const length = encrypted.byteLength;
attributes.reward = await this.transactions.getPrice(length);
}
const siloResource = await this.silo.parseUri(siloUri);
const encrypted = await this.crypto.encrypt(utils_1.ArweaveUtils.stringToBuffer(attributes.data), siloResource.getEncryptionKey());
attributes.data = utils_1.ArweaveUtils.bufferTob64Url(encrypted);
return new transaction_1.Transaction(attributes);
const transaction = new transaction_1.Transaction(attributes);
transaction.addTag('Silo-Name', siloResource.getAccessKey());
transaction.addTag('Silo-Version', siloResource.getAccessKey());
return transaction;
}

@@ -79,0 +82,0 @@ }

@@ -13,2 +13,3 @@ /// <reference types="node" />

get(id: string): Promise<Transaction>;
fromRaw(attributes: object): Transaction;
search(tagName: string, tagValue: string): Promise<string[]>;

@@ -15,0 +16,0 @@ getStatus(id: string): Promise<number>;

@@ -47,2 +47,5 @@ "use strict";

}
fromRaw(attributes) {
return new transaction_1.Transaction(attributes);
}
async search(tagName, tagValue) {

@@ -49,0 +52,0 @@ return this.api.post(`arql`, {

@@ -1,2 +0,2 @@

!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t,r){"use strict";var n=r(4),i=r(18),o=Object.prototype.toString;function s(e){return"[object Array]"===o.call(e)}function a(e){return null!==e&&"object"==typeof e}function u(e){return"[object Function]"===o.call(e)}function c(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 i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:i,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isUndefined:function(e){return void 0===e},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:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function e(){var t={};function r(r,n){"object"==typeof t[n]&&"object"==typeof r?t[n]=e(t[n],r):t[n]=r}for(var n=0,i=arguments.length;n<i;n++)c(arguments[n],r);return t},extend:function(e,t,r){return c(t,function(t,i){e[i]=r&&"function"==typeof t?n(t,r):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(38);class i{static concatBuffers(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].byteLength;let r=new Uint8Array(t),n=0;r.set(new Uint8Array(e[0]),n),n+=e[0].byteLength;for(let t=1;t<e.length;t++)r.set(new Uint8Array(e[t]),n),n+=e[t].byteLength;return r}static b64UrlToString(e){let t=i.b64UrlToBuffer(e);if("undefined"==typeof TextDecoder){return new(0,r(3).TextDecoder)("utf-8",{fatal:!0}).decode(t)}return new TextDecoder("utf-8",{fatal:!0}).decode(t)}static bufferToString(e){if("undefined"==typeof TextDecoder){return new(0,r(3).TextDecoder)("utf-8",{fatal:!0}).decode(e)}return new TextDecoder("utf-8",{fatal:!0}).decode(e)}static stringToBuffer(e){if("undefined"==typeof TextEncoder){return(new(0,r(3).TextEncoder)).encode(e)}return(new TextEncoder).encode(e)}static stringToB64Url(e){return i.bufferTob64Url(i.stringToBuffer(e))}static b64UrlToBuffer(e){return new Uint8Array(n.toByteArray(i.b64UrlDecode(e)))}static bufferTob64(e){return n.fromByteArray(new Uint8Array(e))}static bufferTob64Url(e){return i.b64UrlEncode(i.bufferTob64(e))}static b64UrlEncode(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static b64UrlDecode(e){let t;return t=(e=e.replace(/\-/g,"+").replace(/\_/g,"/")).length%4==0?0:4-e.length%4,e.concat("=".repeat(t))}}t.ArweaveUtils=i},function(e,t,r){"use strict";(function(t){var n=r(0),i=r(20),o={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,u={adapter:("undefined"!=typeof XMLHttpRequest?a=r(6):void 0!==t&&(a=r(6)),a),transformRequest:[function(e,t){return i(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)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],function(e){u.headers[e]={}}),n.forEach(["post","put","patch"],function(e){u.headers[e]=n.merge(o)}),e.exports=u}).call(this,r(5))},function(e,t,r){(function(e,n){var i=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(a(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(e).replace(i,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r<o;u=n[++r])g(u)||!b(u)?s+=" "+u:s+=" "+a(u);return s},t.deprecate=function(r,i){if(m(e.process))return function(){return t.deprecate(r,i).apply(this,arguments)};if(!0===n.noDeprecation)return r;var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),o=!0}return r.apply(this,arguments)}};var o,s={};function a(e,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&t._extend(n,r),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,e,n.depth)}function u(e,t){var r=a.styles[t];return r?"["+a.colors[r][0]+"m"+e+"["+a.colors[r][1]+"m":e}function c(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return w(i)||(i=f(e,i,n)),i}var o=function(e,t){if(m(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(y(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(E(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(A(r))return e.stylize(Date.prototype.toString.call(r),"date");if(T(r))return l(r)}var c,b="",S=!1,x=["{","}"];(h(r)&&(S=!0,x=["[","]"]),E(r))&&(b=" [Function"+(r.name?": "+r.name:"")+"]");return v(r)&&(b=" "+RegExp.prototype.toString.call(r)),A(r)&&(b=" "+Date.prototype.toUTCString.call(r)),T(r)&&(b=" "+l(r)),0!==s.length||S&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=S?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)U(t,String(s))?o.push(p(e,t,r,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(p(e,t,r,n,i,!0))}),o}(e,r,n,a,s):s.map(function(t){return p(e,r,n,a,t,S)}),e.seen.pop(),function(e,t,r){if(e.reduce(function(e,t){return 0,t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,b,x)):x[0]+b+x[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),U(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=g(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),m(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function g(e){return null===e}function y(e){return"number"==typeof e}function w(e){return"string"==typeof e}function m(e){return void 0===e}function v(e){return b(e)&&"[object RegExp]"===S(e)}function b(e){return"object"==typeof e&&null!==e}function A(e){return b(e)&&"[object Date]"===S(e)}function T(e){return b(e)&&("[object Error]"===S(e)||e instanceof Error)}function E(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function x(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(m(o)&&(o=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!s[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=d,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=m,t.isRegExp=v,t.isObject=b,t.isDate=A,t.isError=T,t.isFunction=E,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(40);var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function U(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[x(e.getHours()),x(e.getMinutes()),x(e.getSeconds())].join(":"),[e.getDate(),O[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(41),t._extend=function(e,t){if(!t||!b(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,r(39),r(5))},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var u,c=[],f=!1,l=-1;function p(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&h())}function h(){if(!f){var e=a(p);f=!0;for(var t=c.length;t;){for(u=c,c=[];++l<t;)u&&u[l].run();l=-1,t=c.length}u=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new d(e,t)),1!==c.length||f||a(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(0),i=r(21),o=r(23),s=r(24),a=r(25),u=r(7),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||r(26);e.exports=function(e){return new Promise(function(t,f){var l=e.data,p=e.headers;n.isFormData(l)&&delete p["Content-Type"];var h=new XMLHttpRequest,d="onreadystatechange",g=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in h||a(e.url)||(h=new window.XDomainRequest,d="onload",g=!0,h.onprogress=function(){},h.ontimeout=function(){}),e.auth){var y=e.auth.username||"",w=e.auth.password||"";p.Authorization="Basic "+c(y+":"+w)}if(h.open(e.method.toUpperCase(),o(e.url,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h[d]=function(){if(h&&(4===h.readyState||g)&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in h?s(h.getAllResponseHeaders()):null,n={data:e.responseType&&"text"!==e.responseType?h.response:h.responseText,status:1223===h.status?204:h.status,statusText:1223===h.status?"No Content":h.statusText,headers:r,config:e,request:h};i(t,f,n),h=null}},h.onerror=function(){f(u("Network Error",e,null,h)),h=null},h.ontimeout=function(){f(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var m=r(27),v=(e.withCredentials||a(e.url))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;v&&(p[e.xsrfHeaderName]=v)}if("setRequestHeader"in h&&n.forEach(p,function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete p[t]:h.setRequestHeader(t,e)}),e.withCredentials&&(h.withCredentials=!0),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){h&&(h.abort(),f(e),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(e,t,r){"use strict";var n=r(22);e.exports=function(e,t,r,i,o){var s=new Error(e);return n(s,t,r,i,o)}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);class i{get(e,t){if(!Object.getOwnPropertyNames(this).includes(e))throw new Error(`Field "${e}" is not a property of the Arweave Transaction class.`);return t&&1==t.decode?t&&t.string?n.ArweaveUtils.b64UrlToString(this[e]):n.ArweaveUtils.b64UrlToBuffer(this[e]):this[e]}}class o extends i{constructor(e,t,r=!1){super(),this.name=e,this.value=t}}t.Tag=o;t.Transaction=class extends i{constructor(e){super(),this.last_tx="",this.owner="",this.tags=[],this.target="",this.quantity="0",this.data="",this.reward="0",this.signature="",Object.assign(this,e),e.tags&&(this.tags=e.tags.map(e=>new o(e.name,e.value)))}addTag(e,t){this.tags.push(new o(n.ArweaveUtils.stringToB64Url(e),n.ArweaveUtils.stringToB64Url(t)))}toJSON(){return{id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:this.data,reward:this.reward,signature:this.signature}}setSignature({signature:e,id:t}){this.signature=e,this.id=t}getSignatureData(){let e=this.tags.reduce((e,t)=>e+t.get("name",{decode:!0,string:!0})+t.get("value",{decode:!0,string:!0}),"");return n.ArweaveUtils.concatBuffers([this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),this.get("data",{decode:!0,string:!1}),n.ArweaveUtils.stringToBuffer(this.quantity),n.ArweaveUtils.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),n.ArweaveUtils.stringToBuffer(e)])}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(44);window.Arweave={init:e=>new n.Arweave({api:e,crypto:new i.WebCryptoDriver})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(13),i=r(15),o=r(35),s=r(36),a=r(42),u=r(10),c=r(1),f=r(43);t.Arweave=class{constructor(e){this.crypto=e.crypto,this.api=new i.Api(e.api),this.wallets=new a.Wallets(this.api,e.crypto),this.transactions=new s.Transactions(this.api,e.crypto),this.silo=new f.Silo(this.api,this.crypto,this.transactions),this.network=new o.Network(this.api),this.ar=new n.Ar,this.utils=c.ArweaveUtils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(e,t){if(!(e.data||e.target&&e.quantity))throw new Error("A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.");let r=await this.wallets.jwkToAddress(t);if(null==e.owner&&(e.owner=t.n),null==e.last_tx&&(e.last_tx=await this.wallets.getLastTransactionID(r)),null==e.reward){let t="string"==typeof e.data&&e.data.length>0?e.data.length:0,r="string"==typeof e.target&&e.target.length>0?e.target:null;e.reward=await this.transactions.getPrice(t,r)}return e.data&&(e.data=c.ArweaveUtils.stringToB64Url(e.data)),new u.Transaction(e)}async createSiloTransaction(e,t,r){if(!e.data)throw new Error("Silo transactions must have a 'data' value");if(!r)throw new Error("No Silo URI specified.");if(e.target||e.quantity)throw new Error("Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.");let n=await this.wallets.jwkToAddress(t);if(null==e.owner&&(e.owner=t.n),null==e.last_tx&&(e.last_tx=await this.wallets.getLastTransactionID(n)),null==e.reward){let t="string"==typeof e.data&&e.data.length>0?e.data.length:0;e.reward=await this.transactions.getPrice(t)}const i=await this.silo.parseUri(r),o=await this.crypto.encrypt(c.ArweaveUtils.stringToBuffer(e.data),i.getEncryptionKey());return e.data=c.ArweaveUtils.bufferTob64Url(o),new u.Transaction(e)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(14);t.Ar=class{constructor(){this.BigNum=((e,t)=>new(n.BigNumber.clone({DECIMAL_PLACES:t}))(e))}winstonToAr(e,{formatted:t=!1,decimals:r=12,trim:n=!0}={}){let i=this.stringToBigNum(e,r).shiftedBy(-12);return t?i.toFormat(r):i.toFixed(r)}arToWinston(e,{formatted:t=!1}={}){let r=this.stringToBigNum(e).shiftedBy(12);return t?r.toFormat():r.toFixed(0)}compare(e,t){let r=this.stringToBigNum(e),n=this.stringToBigNum(t);return r.comparedTo(n)}isEqual(e,t){return 0===this.compare(e,t)}isLessThan(e,t){let r=this.stringToBigNum(e),n=this.stringToBigNum(t);return r.isLessThan(n)}isGreaterThan(e,t){let r=this.stringToBigNum(e),n=this.stringToBigNum(t);return r.isGreaterThan(n)}add(e,t){let r=this.stringToBigNum(e);return this.stringToBigNum(t),r.plus(t).toFixed(0)}sub(e,t){let r=this.stringToBigNum(e);return this.stringToBigNum(t),r.minus(t).toFixed(0)}stringToBigNum(e,t=12){return this.BigNum(e,t)}}},function(e,t,r){var n;!function(i){"use strict";var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,u=Math.floor,c="[BigNumber Error] ",f=c+"Number primitive has more than 15 significant digits: ",l=1e14,p=14,h=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,y=1e9;function w(e){var t=0|e;return e>0||e===t?t:t-1}function m(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=p-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function v(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,u=e.e,c=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=u==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(a=(u=i.length)<(c=o.length)?u:c,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return u==c?0:u>c^r?1:-1}function b(e,t,r,n){if(e<t||e>r||e!==(e<0?a(e):u(e)))throw Error(c+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function A(e){var t=e.c.length-1;return w(e.e/p)==t&&e.c[t]%2!=0}function T(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function E(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(o=function e(t){var r,n,i,o,S,x,O,U,N,B=z.prototype={constructor:z,toString:null,valueOf:null},C=new z(1),j=20,_=4,D=-7,R=21,P=-1e7,L=1e7,I=!1,q=1,k=0,M={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz";function z(e,t){var r,o,a,c,l,d,g,y,w=this;if(!(w instanceof z))return new z(e,t);if(null==t){if(e instanceof z)return w.s=e.s,w.e=e.e,void(w.c=(e=e.c)?e.slice():e);if((d="number"==typeof e)&&0*e==0){if(w.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,l=e;l>=10;l/=10,c++);return w.e=c,void(w.c=[e])}y=String(e)}else{if(y=String(e),!s.test(y))return i(w,y,d);w.s=45==y.charCodeAt(0)?(y=y.slice(1),-1):1}(c=y.indexOf("."))>-1&&(y=y.replace(".","")),(l=y.search(/e/i))>0?(c<0&&(c=l),c+=+y.slice(l+1),y=y.substring(0,l)):c<0&&(c=y.length)}else{if(b(t,2,F.length,"Base"),y=String(e),10==t)return G(w=new z(e instanceof z?e:y),j+w.e+1,_);if(d="number"==typeof e){if(0*e!=0)return i(w,y,d,t);if(w.s=1/e<0?(y=y.slice(1),-1):1,z.DEBUG&&y.replace(/^0\.0*|\./,"").length>15)throw Error(f+e);d=!1}else w.s=45===y.charCodeAt(0)?(y=y.slice(1),-1):1;for(r=F.slice(0,t),c=l=0,g=y.length;l<g;l++)if(r.indexOf(o=y.charAt(l))<0){if("."==o){if(l>c){c=g;continue}}else if(!a&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){a=!0,l=-1,c=0;continue}return i(w,String(e),d,t)}(c=(y=n(y,t,10,w.s)).indexOf("."))>-1?y=y.replace(".",""):c=y.length}for(l=0;48===y.charCodeAt(l);l++);for(g=y.length;48===y.charCodeAt(--g););if(y=y.slice(l,++g)){if(g-=l,d&&z.DEBUG&&g>15&&(e>h||e!==u(e)))throw Error(f+w.s*e);if((c=c-l-1)>L)w.c=w.e=null;else if(c<P)w.c=[w.e=0];else{if(w.e=c,w.c=[],l=(c+1)%p,c<0&&(l+=p),l<g){for(l&&w.c.push(+y.slice(0,l)),g-=p;l<g;)w.c.push(+y.slice(l,l+=p));y=y.slice(l),l=p-y.length}else l-=g;for(;l--;y+="0");w.c.push(+y)}}else w.c=[w.e=0]}function K(e,t,r,n){var i,o,s,a,u;if(null==r?r=_:b(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)u=m(e.c),u=1==n||2==n&&s<=D?T(u,s):E(u,s,"0");else if(o=(e=G(new z(e),t,r)).e,a=(u=m(e.c)).length,1==n||2==n&&(t<=o||o<=D)){for(;a<t;u+="0",a++);u=T(u,o)}else if(t-=s,u=E(u,o,"0"),o+1>a){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-a)>0)for(o+1==a&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function $(e,t){for(var r,n=1,i=new z(e[0]);n<e.length;n++){if(!(r=new z(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function H(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*p-1)>L?e.c=e.e=null:r<P?e.c=[e.e=0]:(e.e=r,e.c=t),e}function G(e,t,r,n){var i,o,s,c,f,h,g,y=e.c,w=d;if(y){e:{for(i=1,c=y[0];c>=10;c/=10,i++);if((o=t-i)<0)o+=p,s=t,g=(f=y[h=0])/w[i-s-1]%10|0;else if((h=a((o+1)/p))>=y.length){if(!n)break e;for(;y.length<=h;y.push(0));f=g=0,i=1,s=(o%=p)-p+1}else{for(f=c=y[h],i=1;c>=10;c/=10,i++);g=(s=(o%=p)-p+i)<0?0:f/w[i-s-1]%10|0}if(n=n||t<0||null!=y[h+1]||(s<0?f:f%w[i-s-1]),n=r<4?(g||n)&&(0==r||r==(e.s<0?3:2)):g>5||5==g&&(4==r||n||6==r&&(o>0?s>0?f/w[i-s]:0:y[h-1])%10&1||r==(e.s<0?8:7)),t<1||!y[0])return y.length=0,n?(t-=e.e+1,y[0]=w[(p-t%p)%p],e.e=-t||0):y[0]=e.e=0,e;if(0==o?(y.length=h,c=1,h--):(y.length=h+1,c=w[p-o],y[h]=s>0?u(f/w[i-s]%w[s])*c:0),n)for(;;){if(0==h){for(o=1,s=y[0];s>=10;s/=10,o++);for(s=y[0]+=c,c=1;s>=10;s/=10,c++);o!=c&&(e.e++,y[0]==l&&(y[0]=1));break}if(y[h]+=c,y[h]!=l)break;y[h--]=0,c=1}for(o=y.length;0===y[--o];y.pop());}e.e>L?e.c=e.e=null:e.e<P&&(e.c=[e.e=0])}return e}function J(e){var t,r=e.e;return null===r?e.toString():(t=m(e.c),t=r<=D||r>=R?T(t,r):E(t,r,"0"),e.s<0?"-"+t:t)}return z.clone=e,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(b(r=e[t],0,y,t),j=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(b(r=e[t],0,8,t),_=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(b(r[0],-y,0,t),b(r[1],0,y,t),D=r[0],R=r[1]):(b(r,-y,y,t),D=-(R=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)b(r[0],-y,-1,t),b(r[1],1,y,t),P=r[0],L=r[1];else{if(b(r,-y,y,t),!r)throw Error(c+t+" cannot be zero: "+r);P=-(L=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw I=!r,Error(c+"crypto unavailable");I=r}else I=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(r=e[t],0,9,t),q=r),e.hasOwnProperty(t="POW_PRECISION")&&(b(r=e[t],0,y,t),k=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);M=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);F=r}}return{DECIMAL_PLACES:j,ROUNDING_MODE:_,EXPONENTIAL_AT:[D,R],RANGE:[P,L],CRYPTO:I,MODULO_MODE:q,POW_PRECISION:k,FORMAT:M,ALPHABET:F}},z.isBigNumber=function(e){return e instanceof z||e&&!0===e._isBigNumber||!1},z.maximum=z.max=function(){return $(arguments,B.lt)},z.minimum=z.min=function(){return $(arguments,B.gt)},z.random=(o=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,s,f=0,l=[],h=new z(C);if(null==e?e=j:b(e,0,y),i=a(e/p),I)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));f<i;)(s=131072*t[f]+(t[f+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[f]=r[0],t[f+1]=r[1]):(l.push(s%1e14),f+=2);f=i/2}else{if(!crypto.randomBytes)throw I=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);f<i;)(s=281474976710656*(31&t[f])+1099511627776*t[f+1]+4294967296*t[f+2]+16777216*t[f+3]+(t[f+4]<<16)+(t[f+5]<<8)+t[f+6])>=9e15?crypto.randomBytes(7).copy(t,f):(l.push(s%1e14),f+=7);f=i/7}if(!I)for(;f<i;)(s=o())<9e15&&(l[f++]=s%1e14);for(i=l[--f],e%=p,i&&e&&(s=d[p-e],l[f]=u(i/s)*s);0===l[f];l.pop(),f--);if(f<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=p);for(f=1,s=l[0];s>=10;s/=10,f++);f<p&&(n-=p-f)}return h.e=n,h.c=l,h}),z.sum=function(){for(var e=1,t=arguments,r=new z(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){function e(e,t,r,n){for(var i,o,s=[0],a=0,u=e.length;a<u;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(t,n,i,o,s){var a,u,c,f,l,p,h,d,g=t.indexOf("."),y=j,w=_;for(g>=0&&(f=k,k=0,t=t.replace(".",""),p=(d=new z(n)).pow(t.length-g),k=f,d.c=e(E(m(p.c),p.e,"0"),10,i,"0123456789"),d.e=d.c.length),c=f=(h=e(t,n,i,s?(a=F,"0123456789"):(a="0123456789",F))).length;0==h[--f];h.pop());if(!h[0])return a.charAt(0);if(g<0?--c:(p.c=h,p.e=c,p.s=o,h=(p=r(p,d,y,w,i)).c,l=p.r,c=p.e),g=h[u=c+y+1],f=i/2,l=l||u<0||null!=h[u+1],l=w<4?(null!=g||l)&&(0==w||w==(p.s<0?3:2)):g>f||g==f&&(4==w||l||6==w&&1&h[u-1]||w==(p.s<0?8:7)),u<1||!h[0])t=l?E(a.charAt(1),-y,a.charAt(0)):a.charAt(0);else{if(h.length=u,l)for(--i;++h[--u]>i;)h[u]=0,u||(++c,h=[1].concat(h));for(f=h.length;!h[--f];);for(g=0,t="";g<=f;t+=a.charAt(h[g++]));t=E(t,c,a.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,u=e.length,c=t%g,f=t/g|0;for(e=e.slice();u--;)a=((i=c*(o=e[u]%g)+(n=f*o+(s=e[u]/g|0)*c)%g*g+a)/r|0)+(n/g|0)+f*s,e[u]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,s,a){var c,f,h,d,g,y,m,v,b,A,T,E,S,x,O,U,N,B=n.s==i.s?1:-1,C=n.c,j=i.c;if(!(C&&C[0]&&j&&j[0]))return new z(n.s&&i.s&&(C?!j||C[0]!=j[0]:j)?C&&0==C[0]||!j?0*B:B/0:NaN);for(b=(v=new z(B)).c=[],B=o+(f=n.e-i.e)+1,a||(a=l,f=w(n.e/p)-w(i.e/p),B=B/p|0),h=0;j[h]==(C[h]||0);h++);if(j[h]>(C[h]||0)&&f--,B<0)b.push(1),d=!0;else{for(x=C.length,U=j.length,h=0,B+=2,(g=u(a/(j[0]+1)))>1&&(j=e(j,g,a),C=e(C,g,a),U=j.length,x=C.length),S=U,T=(A=C.slice(0,U)).length;T<U;A[T++]=0);N=j.slice(),N=[0].concat(N),O=j[0],j[1]>=a/2&&O++;do{if(g=0,(c=t(j,A,U,T))<0){if(E=A[0],U!=T&&(E=E*a+(A[1]||0)),(g=u(E/O))>1)for(g>=a&&(g=a-1),m=(y=e(j,g,a)).length,T=A.length;1==t(y,A,m,T);)g--,r(y,U<m?N:j,m,a),m=y.length,c=1;else 0==g&&(c=g=1),m=(y=j.slice()).length;if(m<T&&(y=[0].concat(y)),r(A,y,T,a),T=A.length,-1==c)for(;t(j,A,U,T)<1;)g++,r(A,U<T?N:j,T,a),T=A.length}else 0===c&&(g++,A=[0]);b[h++]=g,A[0]?A[T++]=C[S]||0:(A=[C[S]],T=1)}while((S++<x||null!=A[0])&&B--);d=null!=A[0],b[0]||b.splice(0,1)}if(a==l){for(h=1,B=b[0];B>=10;B/=10,h++);G(v,o+(v.e=h+f*p-1)+1,s,d)}else v.e=f,v.r=+d;return v}}(),S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,O=/^\.([^.]+)$/,U=/^-?(Infinity|NaN)$/,N=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(N,"");if(U.test(o))e.s=isNaN(o)?null:o<0?-1:1,e.c=e.e=null;else{if(!r&&(o=o.replace(S,function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t}),n&&(i=n,o=o.replace(x,"$1").replace(O,"0.$1")),t!=o))return new z(o,i);if(z.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.c=e.e=e.s=null}},B.absoluteValue=B.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},B.comparedTo=function(e,t){return v(this,new z(e,t))},B.decimalPlaces=B.dp=function(e,t){var r,n,i,o=this;if(null!=e)return b(e,0,y),null==t?t=_:b(t,0,8),G(new z(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-w(this.e/p))*p,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},B.dividedBy=B.div=function(e,t){return r(this,new z(e,t),j,_)},B.dividedToIntegerBy=B.idiv=function(e,t){return r(this,new z(e,t),0,1)},B.exponentiatedBy=B.pow=function(e,t){var r,n,i,o,s,f,l,h,d=this;if((e=new z(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+J(e));if(null!=t&&(t=new z(t)),s=e.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!e.c||!e.c[0])return h=new z(Math.pow(+J(d),s?2-A(e):+J(e))),t?h.mod(t):h;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new z(NaN);(n=!f&&d.isInteger()&&t.isInteger())&&(d=d.mod(t))}else{if(e.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||s&&d.c[1]>=24e7:d.c[0]<8e13||s&&d.c[0]<=9999975e7)))return o=d.s<0&&A(e)?-0:0,d.e>-1&&(o=1/o),new z(f?1/o:o);k&&(o=a(k/p+2))}for(s?(r=new z(.5),f&&(e.s=1),l=A(e)):l=(i=Math.abs(+J(e)))%2,h=new z(C);;){if(l){if(!(h=h.times(d)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}if(i){if(0===(i=u(i/2)))break;l=i%2}else if(G(e=e.times(r),e.e+1,1),e.e>14)l=A(e);else{if(0==(i=+J(e)))break;l=i%2}d=d.times(d),o?d.c&&d.c.length>o&&(d.c.length=o):n&&(d=d.mod(t))}return n?h:(f&&(h=C.div(h)),t?h.mod(t):o?G(h,k,_,void 0):h)},B.integerValue=function(e){var t=new z(this);return null==e?e=_:b(e,0,8),G(t,t.e+1,e)},B.isEqualTo=B.eq=function(e,t){return 0===v(this,new z(e,t))},B.isFinite=function(){return!!this.c},B.isGreaterThan=B.gt=function(e,t){return v(this,new z(e,t))>0},B.isGreaterThanOrEqualTo=B.gte=function(e,t){return 1===(t=v(this,new z(e,t)))||0===t},B.isInteger=function(){return!!this.c&&w(this.e/p)>this.c.length-2},B.isLessThan=B.lt=function(e,t){return v(this,new z(e,t))<0},B.isLessThanOrEqualTo=B.lte=function(e,t){return-1===(t=v(this,new z(e,t)))||0===t},B.isNaN=function(){return!this.s},B.isNegative=function(){return this.s<0},B.isPositive=function(){return this.s>0},B.isZero=function(){return!!this.c&&0==this.c[0]},B.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new z(e,t)).s,!a||!t)return new z(NaN);if(a!=t)return e.s=-t,s.plus(e);var u=s.e/p,c=e.e/p,f=s.c,h=e.c;if(!u||!c){if(!f||!h)return f?(e.s=-t,e):new z(h?s:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new z(f[0]?s:3==_?-0:0)}if(u=w(u),c=w(c),f=f.slice(),a=u-c){for((o=a<0)?(a=-a,i=f):(c=u,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=f.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(f[t]!=h[t]){o=f[t]<h[t];break}if(o&&(i=f,f=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=l-1;n>a;){if(f[--n]<h[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=l}f[n]-=h[n]}for(;0==f[0];f.splice(0,1),--c);return f[0]?H(e,f,c):(e.s=3==_?-1:1,e.c=[e.e=0],e)},B.modulo=B.mod=function(e,t){var n,i,o=this;return e=new z(e,t),!o.c||!e.s||e.c&&!e.c[0]?new z(NaN):!e.c||o.c&&!o.c[0]?new z(o):(9==q?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,q),(e=o.minus(n.times(e))).c[0]||1!=q||(e.s=o.s),e)},B.multipliedBy=B.times=function(e,t){var r,n,i,o,s,a,u,c,f,h,d,y,m,v,b,A=this,T=A.c,E=(e=new z(e,t)).c;if(!(T&&E&&T[0]&&E[0]))return!A.s||!e.s||T&&!T[0]&&!E||E&&!E[0]&&!T?e.c=e.e=e.s=null:(e.s*=A.s,T&&E?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=w(A.e/p)+w(e.e/p),e.s*=A.s,(u=T.length)<(h=E.length)&&(m=T,T=E,E=m,i=u,u=h,h=i),i=u+h,m=[];i--;m.push(0));for(v=l,b=g,i=h;--i>=0;){for(r=0,d=E[i]%b,y=E[i]/b|0,o=i+(s=u);o>i;)r=((c=d*(c=T[--s]%b)+(a=y*c+(f=T[s]/b|0)*d)%b*b+m[o]+r)/v|0)+(a/b|0)+y*f,m[o--]=c%v;m[o]=r}return r?++n:m.splice(0,1),H(e,m,n)},B.negated=function(){var e=new z(this);return e.s=-e.s||null,e},B.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new z(e,t)).s,!i||!t)return new z(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/p,s=e.e/p,a=n.c,u=e.c;if(!o||!s){if(!a||!u)return new z(i/0);if(!a[0]||!u[0])return u[0]?e:new z(a[0]?n:0*i)}if(o=w(o),s=w(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=u):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+u[t]+i)/l|0,a[t]=l===a[t]?0:a[t]%l;return i&&(a=[i].concat(a),++s),H(e,a,s)},B.precision=B.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return b(e,1,y),null==t?t=_:b(t,0,8),G(new z(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*p+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},B.shiftedBy=function(e){return b(e,-h,h),this.times("1e"+e)},B.squareRoot=B.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,u=s.s,c=s.e,f=j+4,l=new z("0.5");if(1!==u||!a||!a[0])return new z(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+J(s)))||u==1/0?(((t=m(a)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=w((c+1)/2)-(c<0||c%2),n=new z(t=u==1/0?"1e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new z(u+""),n.c[0])for((u=(c=n.e)+f)<3&&(u=0);;)if(o=n,n=l.times(o.plus(r(s,o,f,1))),m(o.c).slice(0,u)===(t=m(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(G(n,n.e+j+2,1),e=!n.times(n).eq(s));break}if(!i&&(G(o,o.e+j+2,0),o.times(o).eq(s))){n=o;break}f+=4,u+=4,i=1}return G(n,n.e+j+1,_,e)},B.toExponential=function(e,t){return null!=e&&(b(e,0,y),e++),K(this,e,t,1)},B.toFixed=function(e,t){return null!=e&&(b(e,0,y),e=e+this.e+1),K(this,e,t)},B.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=M;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,s=n.split("."),a=+r.groupSize,u=+r.secondaryGroupSize,f=r.groupSeparator||"",l=s[0],p=s[1],h=i.s<0,d=h?l.slice(1):l,g=d.length;if(u&&(o=a,a=u,u=o,g-=o),a>0&&g>0){for(o=g%a||a,l=d.substr(0,o);o<g;o+=a)l+=f+d.substr(o,a);u>0&&(l+=f+d.slice(o)),h&&(l="-"+l)}n=p?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):l}return(r.prefix||"")+n+(r.suffix||"")},B.toFraction=function(e){var t,n,i,o,s,a,u,f,l,h,g,y,w=this,v=w.c;if(null!=e&&(!(u=new z(e)).isInteger()&&(u.c||1!==u.s)||u.lt(C)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+J(u));if(!v)return new z(w);for(t=new z(C),l=n=new z(C),i=f=new z(C),y=m(v),s=t.e=y.length-w.e-1,t.c[0]=d[(a=s%p)<0?p+a:a],e=!e||u.comparedTo(t)>0?s>0?t:l:u,a=L,L=1/0,u=new z(y),f.c[0]=0;h=r(u,t,0,1),1!=(o=n.plus(h.times(i))).comparedTo(e);)n=i,i=o,l=f.plus(h.times(o=l)),f=o,t=u.minus(h.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),f=f.plus(o.times(l)),n=n.plus(o.times(i)),f.s=l.s=w.s,g=r(l,i,s*=2,_).minus(w).abs().comparedTo(r(f,n,s,_).minus(w).abs())<1?[l,i]:[f,n],L=a,g},B.toNumber=function(){return+J(this)},B.toPrecision=function(e,t){return null!=e&&b(e,1,y),K(this,e,t,2)},B.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(t=m(r.c),null==e?t=o<=D||o>=R?T(t,o):E(t,o,"0"):(b(e,2,F.length,"Base"),t=n(E(t,o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},B.valueOf=B.toJSON=function(){return J(this)},B._isBigNumber=!0,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(B[Symbol.toStringTag]="BigNumber",B[Symbol.for("nodejs.util.inspect.custom")]=B.valueOf),null!=t&&z.set(t),z}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(16);t.Api=class{constructor(e){this.METHOD_GET="GET",this.METHOD_POST="POST",this.applyConfig(e)}applyConfig(e){this.config=this.mergeDefaults(e)}getConfig(){return this.config}mergeDefaults(e){return{host:e.host,protocol:e.protocol||"http",port:e.port||1984,timeout:e.timeout||2e4,logging:e.logging||!1}}async get(e,t){try{return await this.request().get(e,t)}catch(e){if(e.response&&e.response.status)return e.response;throw e}}async post(e,t,r){try{return await this.request().post(e,t,r)}catch(e){if(e.response&&e.response.status)return e.response;throw e}}request(){let e=n.default.create({baseURL:`${this.config.protocol}://${this.config.host}:${this.config.port}`,timeout:1e3});return this.config.logging&&(e.interceptors.request.use(e=>(console.log(`Requesting: ${e.baseURL}/${e.url}`),e)),e.interceptors.response.use(e=>(console.log(`Response: ${e.config.url} - ${e.status}`),e))),e}}},function(e,t,r){e.exports=r(17)},function(e,t,r){"use strict";var n=r(0),i=r(4),o=r(19),s=r(2);function a(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var u=a(s);u.Axios=o,u.create=function(e){return a(n.merge(s,e))},u.Cancel=r(9),u.CancelToken=r(33),u.isCancel=r(8),u.all=function(e){return Promise.all(e)},u.spread=r(34),e.exports=u,e.exports.default=u},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t,r){"use strict";var n=r(4),i=r(18),o=Object.prototype.toString;function s(e){return"[object Array]"===o.call(e)}function a(e){return null!==e&&"object"==typeof e}function u(e){return"[object Function]"===o.call(e)}function c(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 i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:i,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isUndefined:function(e){return void 0===e},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:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function e(){var t={};function r(r,n){"object"==typeof t[n]&&"object"==typeof r?t[n]=e(t[n],r):t[n]=r}for(var n=0,i=arguments.length;n<i;n++)c(arguments[n],r);return t},extend:function(e,t,r){return c(t,function(t,i){e[i]=r&&"function"==typeof t?n(t,r):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(38);class i{static concatBuffers(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].byteLength;let r=new Uint8Array(t),n=0;r.set(new Uint8Array(e[0]),n),n+=e[0].byteLength;for(let t=1;t<e.length;t++)r.set(new Uint8Array(e[t]),n),n+=e[t].byteLength;return r}static b64UrlToString(e){let t=i.b64UrlToBuffer(e);if("undefined"==typeof TextDecoder){return new(0,r(3).TextDecoder)("utf-8",{fatal:!0}).decode(t)}return new TextDecoder("utf-8",{fatal:!0}).decode(t)}static bufferToString(e){if("undefined"==typeof TextDecoder){return new(0,r(3).TextDecoder)("utf-8",{fatal:!0}).decode(e)}return new TextDecoder("utf-8",{fatal:!0}).decode(e)}static stringToBuffer(e){if("undefined"==typeof TextEncoder){return(new(0,r(3).TextEncoder)).encode(e)}return(new TextEncoder).encode(e)}static stringToB64Url(e){return i.bufferTob64Url(i.stringToBuffer(e))}static b64UrlToBuffer(e){return new Uint8Array(n.toByteArray(i.b64UrlDecode(e)))}static bufferTob64(e){return n.fromByteArray(new Uint8Array(e))}static bufferTob64Url(e){return i.b64UrlEncode(i.bufferTob64(e))}static b64UrlEncode(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static b64UrlDecode(e){let t;return t=(e=e.replace(/\-/g,"+").replace(/\_/g,"/")).length%4==0?0:4-e.length%4,e.concat("=".repeat(t))}}t.ArweaveUtils=i},function(e,t,r){"use strict";(function(t){var n=r(0),i=r(20),o={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,u={adapter:("undefined"!=typeof XMLHttpRequest?a=r(6):void 0!==t&&(a=r(6)),a),transformRequest:[function(e,t){return i(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)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],function(e){u.headers[e]={}}),n.forEach(["post","put","patch"],function(e){u.headers[e]=n.merge(o)}),e.exports=u}).call(this,r(5))},function(e,t,r){(function(e,n){var i=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(a(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(e).replace(i,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r<o;u=n[++r])g(u)||!b(u)?s+=" "+u:s+=" "+a(u);return s},t.deprecate=function(r,i){if(m(e.process))return function(){return t.deprecate(r,i).apply(this,arguments)};if(!0===n.noDeprecation)return r;var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),o=!0}return r.apply(this,arguments)}};var o,s={};function a(e,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&t._extend(n,r),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,e,n.depth)}function u(e,t){var r=a.styles[t];return r?"["+a.colors[r][0]+"m"+e+"["+a.colors[r][1]+"m":e}function c(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return w(i)||(i=f(e,i,n)),i}var o=function(e,t){if(m(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(y(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(S(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(A(r))return e.stylize(Date.prototype.toString.call(r),"date");if(T(r))return l(r)}var c,b="",E=!1,x=["{","}"];(h(r)&&(E=!0,x=["[","]"]),S(r))&&(b=" [Function"+(r.name?": "+r.name:"")+"]");return v(r)&&(b=" "+RegExp.prototype.toString.call(r)),A(r)&&(b=" "+Date.prototype.toUTCString.call(r)),T(r)&&(b=" "+l(r)),0!==s.length||E&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=E?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)U(t,String(s))?o.push(p(e,t,r,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(p(e,t,r,n,i,!0))}),o}(e,r,n,a,s):s.map(function(t){return p(e,r,n,a,t,E)}),e.seen.pop(),function(e,t,r){if(e.reduce(function(e,t){return 0,t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,b,x)):x[0]+b+x[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),U(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=g(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),m(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function g(e){return null===e}function y(e){return"number"==typeof e}function w(e){return"string"==typeof e}function m(e){return void 0===e}function v(e){return b(e)&&"[object RegExp]"===E(e)}function b(e){return"object"==typeof e&&null!==e}function A(e){return b(e)&&"[object Date]"===E(e)}function T(e){return b(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function x(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(m(o)&&(o=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!s[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=d,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=m,t.isRegExp=v,t.isObject=b,t.isDate=A,t.isError=T,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(40);var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function U(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[x(e.getHours()),x(e.getMinutes()),x(e.getSeconds())].join(":"),[e.getDate(),O[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(41),t._extend=function(e,t){if(!t||!b(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,r(39),r(5))},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var u,c=[],f=!1,l=-1;function p(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&h())}function h(){if(!f){var e=a(p);f=!0;for(var t=c.length;t;){for(u=c,c=[];++l<t;)u&&u[l].run();l=-1,t=c.length}u=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new d(e,t)),1!==c.length||f||a(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(0),i=r(21),o=r(23),s=r(24),a=r(25),u=r(7),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||r(26);e.exports=function(e){return new Promise(function(t,f){var l=e.data,p=e.headers;n.isFormData(l)&&delete p["Content-Type"];var h=new XMLHttpRequest,d="onreadystatechange",g=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in h||a(e.url)||(h=new window.XDomainRequest,d="onload",g=!0,h.onprogress=function(){},h.ontimeout=function(){}),e.auth){var y=e.auth.username||"",w=e.auth.password||"";p.Authorization="Basic "+c(y+":"+w)}if(h.open(e.method.toUpperCase(),o(e.url,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h[d]=function(){if(h&&(4===h.readyState||g)&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in h?s(h.getAllResponseHeaders()):null,n={data:e.responseType&&"text"!==e.responseType?h.response:h.responseText,status:1223===h.status?204:h.status,statusText:1223===h.status?"No Content":h.statusText,headers:r,config:e,request:h};i(t,f,n),h=null}},h.onerror=function(){f(u("Network Error",e,null,h)),h=null},h.ontimeout=function(){f(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var m=r(27),v=(e.withCredentials||a(e.url))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;v&&(p[e.xsrfHeaderName]=v)}if("setRequestHeader"in h&&n.forEach(p,function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete p[t]:h.setRequestHeader(t,e)}),e.withCredentials&&(h.withCredentials=!0),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){h&&(h.abort(),f(e),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(e,t,r){"use strict";var n=r(22);e.exports=function(e,t,r,i,o){var s=new Error(e);return n(s,t,r,i,o)}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);class i{get(e,t){if(!Object.getOwnPropertyNames(this).includes(e))throw new Error(`Field "${e}" is not a property of the Arweave Transaction class.`);return t&&1==t.decode?t&&t.string?n.ArweaveUtils.b64UrlToString(this[e]):n.ArweaveUtils.b64UrlToBuffer(this[e]):this[e]}}class o extends i{constructor(e,t,r=!1){super(),this.name=e,this.value=t}}t.Tag=o;t.Transaction=class extends i{constructor(e){super(),this.last_tx="",this.owner="",this.tags=[],this.target="",this.quantity="0",this.data="",this.reward="0",this.signature="",Object.assign(this,e),e.tags&&(this.tags=e.tags.map(e=>new o(e.name,e.value)))}addTag(e,t){this.tags.push(new o(n.ArweaveUtils.stringToB64Url(e),n.ArweaveUtils.stringToB64Url(t)))}toJSON(){return{id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:this.data,reward:this.reward,signature:this.signature}}setSignature({signature:e,id:t}){this.signature=e,this.id=t}getSignatureData(){let e=this.tags.reduce((e,t)=>e+t.get("name",{decode:!0,string:!0})+t.get("value",{decode:!0,string:!0}),"");return n.ArweaveUtils.concatBuffers([this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),this.get("data",{decode:!0,string:!1}),n.ArweaveUtils.stringToBuffer(this.quantity),n.ArweaveUtils.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),n.ArweaveUtils.stringToBuffer(e)])}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(44);window.Arweave={init:e=>new n.Arweave({api:e,crypto:new i.WebCryptoDriver})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(13),i=r(15),o=r(35),s=r(36),a=r(42),u=r(10),c=r(1),f=r(43);t.Arweave=class{constructor(e){this.crypto=e.crypto,this.api=new i.Api(e.api),this.wallets=new a.Wallets(this.api,e.crypto),this.transactions=new s.Transactions(this.api,e.crypto),this.silo=new f.Silo(this.api,this.crypto,this.transactions),this.network=new o.Network(this.api),this.ar=new n.Ar,this.utils=c.ArweaveUtils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(e,t){if(!(e.data||e.target&&e.quantity))throw new Error("A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.");const r=await this.wallets.jwkToAddress(t);if(null==e.owner&&(e.owner=t.n),null==e.last_tx&&(e.last_tx=await this.wallets.getLastTransactionID(r)),null==e.reward){const t="string"==typeof e.data&&e.data.length>0?e.data.length:0,r="string"==typeof e.target&&e.target.length>0?e.target:null;e.reward=await this.transactions.getPrice(t,r)}return e.data&&(e.data=c.ArweaveUtils.stringToB64Url(e.data)),new u.Transaction(e)}async createSiloTransaction(e,t,r){if(!e.data)throw new Error("Silo transactions must have a 'data' value");if(!r)throw new Error("No Silo URI specified.");if(e.target||e.quantity)throw new Error("Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.");const n=await this.wallets.jwkToAddress(t);null==e.owner&&(e.owner=t.n),null==e.last_tx&&(e.last_tx=await this.wallets.getLastTransactionID(n));const i=await this.silo.parseUri(r),o=await this.crypto.encrypt(c.ArweaveUtils.stringToBuffer(e.data),i.getEncryptionKey());if(null==e.reward){const t=o.byteLength;e.reward=await this.transactions.getPrice(t)}e.data=c.ArweaveUtils.bufferTob64Url(o);const s=new u.Transaction(e);return s.addTag("Silo-Name",i.getAccessKey()),s.addTag("Silo-Version",i.getAccessKey()),s}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(14);t.Ar=class{constructor(){this.BigNum=((e,t)=>new(n.BigNumber.clone({DECIMAL_PLACES:t}))(e))}winstonToAr(e,{formatted:t=!1,decimals:r=12,trim:n=!0}={}){let i=this.stringToBigNum(e,r).shiftedBy(-12);return t?i.toFormat(r):i.toFixed(r)}arToWinston(e,{formatted:t=!1}={}){let r=this.stringToBigNum(e).shiftedBy(12);return t?r.toFormat():r.toFixed(0)}compare(e,t){let r=this.stringToBigNum(e),n=this.stringToBigNum(t);return r.comparedTo(n)}isEqual(e,t){return 0===this.compare(e,t)}isLessThan(e,t){let r=this.stringToBigNum(e),n=this.stringToBigNum(t);return r.isLessThan(n)}isGreaterThan(e,t){let r=this.stringToBigNum(e),n=this.stringToBigNum(t);return r.isGreaterThan(n)}add(e,t){let r=this.stringToBigNum(e);return this.stringToBigNum(t),r.plus(t).toFixed(0)}sub(e,t){let r=this.stringToBigNum(e);return this.stringToBigNum(t),r.minus(t).toFixed(0)}stringToBigNum(e,t=12){return this.BigNum(e,t)}}},function(e,t,r){var n;!function(i){"use strict";var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,u=Math.floor,c="[BigNumber Error] ",f=c+"Number primitive has more than 15 significant digits: ",l=1e14,p=14,h=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,y=1e9;function w(e){var t=0|e;return e>0||e===t?t:t-1}function m(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=p-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function v(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,u=e.e,c=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=u==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(a=(u=i.length)<(c=o.length)?u:c,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return u==c?0:u>c^r?1:-1}function b(e,t,r,n){if(e<t||e>r||e!==(e<0?a(e):u(e)))throw Error(c+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function A(e){var t=e.c.length-1;return w(e.e/p)==t&&e.c[t]%2!=0}function T(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function S(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(o=function e(t){var r,n,i,o,E,x,O,U,N,B=K.prototype={constructor:K,toString:null,valueOf:null},C=new K(1),j=20,_=4,R=-7,D=21,P=-1e7,L=1e7,I=!1,q=1,k=0,M={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz";function K(e,t){var r,o,a,c,l,d,g,y,w=this;if(!(w instanceof K))return new K(e,t);if(null==t){if(e instanceof K)return w.s=e.s,w.e=e.e,void(w.c=(e=e.c)?e.slice():e);if((d="number"==typeof e)&&0*e==0){if(w.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,l=e;l>=10;l/=10,c++);return w.e=c,void(w.c=[e])}y=String(e)}else{if(y=String(e),!s.test(y))return i(w,y,d);w.s=45==y.charCodeAt(0)?(y=y.slice(1),-1):1}(c=y.indexOf("."))>-1&&(y=y.replace(".","")),(l=y.search(/e/i))>0?(c<0&&(c=l),c+=+y.slice(l+1),y=y.substring(0,l)):c<0&&(c=y.length)}else{if(b(t,2,F.length,"Base"),y=String(e),10==t)return G(w=new K(e instanceof K?e:y),j+w.e+1,_);if(d="number"==typeof e){if(0*e!=0)return i(w,y,d,t);if(w.s=1/e<0?(y=y.slice(1),-1):1,K.DEBUG&&y.replace(/^0\.0*|\./,"").length>15)throw Error(f+e);d=!1}else w.s=45===y.charCodeAt(0)?(y=y.slice(1),-1):1;for(r=F.slice(0,t),c=l=0,g=y.length;l<g;l++)if(r.indexOf(o=y.charAt(l))<0){if("."==o){if(l>c){c=g;continue}}else if(!a&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){a=!0,l=-1,c=0;continue}return i(w,String(e),d,t)}(c=(y=n(y,t,10,w.s)).indexOf("."))>-1?y=y.replace(".",""):c=y.length}for(l=0;48===y.charCodeAt(l);l++);for(g=y.length;48===y.charCodeAt(--g););if(y=y.slice(l,++g)){if(g-=l,d&&K.DEBUG&&g>15&&(e>h||e!==u(e)))throw Error(f+w.s*e);if((c=c-l-1)>L)w.c=w.e=null;else if(c<P)w.c=[w.e=0];else{if(w.e=c,w.c=[],l=(c+1)%p,c<0&&(l+=p),l<g){for(l&&w.c.push(+y.slice(0,l)),g-=p;l<g;)w.c.push(+y.slice(l,l+=p));y=y.slice(l),l=p-y.length}else l-=g;for(;l--;y+="0");w.c.push(+y)}}else w.c=[w.e=0]}function z(e,t,r,n){var i,o,s,a,u;if(null==r?r=_:b(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)u=m(e.c),u=1==n||2==n&&s<=R?T(u,s):S(u,s,"0");else if(o=(e=G(new K(e),t,r)).e,a=(u=m(e.c)).length,1==n||2==n&&(t<=o||o<=R)){for(;a<t;u+="0",a++);u=T(u,o)}else if(t-=s,u=S(u,o,"0"),o+1>a){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-a)>0)for(o+1==a&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function $(e,t){for(var r,n=1,i=new K(e[0]);n<e.length;n++){if(!(r=new K(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function H(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*p-1)>L?e.c=e.e=null:r<P?e.c=[e.e=0]:(e.e=r,e.c=t),e}function G(e,t,r,n){var i,o,s,c,f,h,g,y=e.c,w=d;if(y){e:{for(i=1,c=y[0];c>=10;c/=10,i++);if((o=t-i)<0)o+=p,s=t,g=(f=y[h=0])/w[i-s-1]%10|0;else if((h=a((o+1)/p))>=y.length){if(!n)break e;for(;y.length<=h;y.push(0));f=g=0,i=1,s=(o%=p)-p+1}else{for(f=c=y[h],i=1;c>=10;c/=10,i++);g=(s=(o%=p)-p+i)<0?0:f/w[i-s-1]%10|0}if(n=n||t<0||null!=y[h+1]||(s<0?f:f%w[i-s-1]),n=r<4?(g||n)&&(0==r||r==(e.s<0?3:2)):g>5||5==g&&(4==r||n||6==r&&(o>0?s>0?f/w[i-s]:0:y[h-1])%10&1||r==(e.s<0?8:7)),t<1||!y[0])return y.length=0,n?(t-=e.e+1,y[0]=w[(p-t%p)%p],e.e=-t||0):y[0]=e.e=0,e;if(0==o?(y.length=h,c=1,h--):(y.length=h+1,c=w[p-o],y[h]=s>0?u(f/w[i-s]%w[s])*c:0),n)for(;;){if(0==h){for(o=1,s=y[0];s>=10;s/=10,o++);for(s=y[0]+=c,c=1;s>=10;s/=10,c++);o!=c&&(e.e++,y[0]==l&&(y[0]=1));break}if(y[h]+=c,y[h]!=l)break;y[h--]=0,c=1}for(o=y.length;0===y[--o];y.pop());}e.e>L?e.c=e.e=null:e.e<P&&(e.c=[e.e=0])}return e}function V(e){var t,r=e.e;return null===r?e.toString():(t=m(e.c),t=r<=R||r>=D?T(t,r):S(t,r,"0"),e.s<0?"-"+t:t)}return K.clone=e,K.ROUND_UP=0,K.ROUND_DOWN=1,K.ROUND_CEIL=2,K.ROUND_FLOOR=3,K.ROUND_HALF_UP=4,K.ROUND_HALF_DOWN=5,K.ROUND_HALF_EVEN=6,K.ROUND_HALF_CEIL=7,K.ROUND_HALF_FLOOR=8,K.EUCLID=9,K.config=K.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(b(r=e[t],0,y,t),j=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(b(r=e[t],0,8,t),_=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(b(r[0],-y,0,t),b(r[1],0,y,t),R=r[0],D=r[1]):(b(r,-y,y,t),R=-(D=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)b(r[0],-y,-1,t),b(r[1],1,y,t),P=r[0],L=r[1];else{if(b(r,-y,y,t),!r)throw Error(c+t+" cannot be zero: "+r);P=-(L=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw I=!r,Error(c+"crypto unavailable");I=r}else I=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(r=e[t],0,9,t),q=r),e.hasOwnProperty(t="POW_PRECISION")&&(b(r=e[t],0,y,t),k=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);M=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);F=r}}return{DECIMAL_PLACES:j,ROUNDING_MODE:_,EXPONENTIAL_AT:[R,D],RANGE:[P,L],CRYPTO:I,MODULO_MODE:q,POW_PRECISION:k,FORMAT:M,ALPHABET:F}},K.isBigNumber=function(e){return e instanceof K||e&&!0===e._isBigNumber||!1},K.maximum=K.max=function(){return $(arguments,B.lt)},K.minimum=K.min=function(){return $(arguments,B.gt)},K.random=(o=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,s,f=0,l=[],h=new K(C);if(null==e?e=j:b(e,0,y),i=a(e/p),I)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));f<i;)(s=131072*t[f]+(t[f+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[f]=r[0],t[f+1]=r[1]):(l.push(s%1e14),f+=2);f=i/2}else{if(!crypto.randomBytes)throw I=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);f<i;)(s=281474976710656*(31&t[f])+1099511627776*t[f+1]+4294967296*t[f+2]+16777216*t[f+3]+(t[f+4]<<16)+(t[f+5]<<8)+t[f+6])>=9e15?crypto.randomBytes(7).copy(t,f):(l.push(s%1e14),f+=7);f=i/7}if(!I)for(;f<i;)(s=o())<9e15&&(l[f++]=s%1e14);for(i=l[--f],e%=p,i&&e&&(s=d[p-e],l[f]=u(i/s)*s);0===l[f];l.pop(),f--);if(f<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=p);for(f=1,s=l[0];s>=10;s/=10,f++);f<p&&(n-=p-f)}return h.e=n,h.c=l,h}),K.sum=function(){for(var e=1,t=arguments,r=new K(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){function e(e,t,r,n){for(var i,o,s=[0],a=0,u=e.length;a<u;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(t,n,i,o,s){var a,u,c,f,l,p,h,d,g=t.indexOf("."),y=j,w=_;for(g>=0&&(f=k,k=0,t=t.replace(".",""),p=(d=new K(n)).pow(t.length-g),k=f,d.c=e(S(m(p.c),p.e,"0"),10,i,"0123456789"),d.e=d.c.length),c=f=(h=e(t,n,i,s?(a=F,"0123456789"):(a="0123456789",F))).length;0==h[--f];h.pop());if(!h[0])return a.charAt(0);if(g<0?--c:(p.c=h,p.e=c,p.s=o,h=(p=r(p,d,y,w,i)).c,l=p.r,c=p.e),g=h[u=c+y+1],f=i/2,l=l||u<0||null!=h[u+1],l=w<4?(null!=g||l)&&(0==w||w==(p.s<0?3:2)):g>f||g==f&&(4==w||l||6==w&&1&h[u-1]||w==(p.s<0?8:7)),u<1||!h[0])t=l?S(a.charAt(1),-y,a.charAt(0)):a.charAt(0);else{if(h.length=u,l)for(--i;++h[--u]>i;)h[u]=0,u||(++c,h=[1].concat(h));for(f=h.length;!h[--f];);for(g=0,t="";g<=f;t+=a.charAt(h[g++]));t=S(t,c,a.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,u=e.length,c=t%g,f=t/g|0;for(e=e.slice();u--;)a=((i=c*(o=e[u]%g)+(n=f*o+(s=e[u]/g|0)*c)%g*g+a)/r|0)+(n/g|0)+f*s,e[u]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,s,a){var c,f,h,d,g,y,m,v,b,A,T,S,E,x,O,U,N,B=n.s==i.s?1:-1,C=n.c,j=i.c;if(!(C&&C[0]&&j&&j[0]))return new K(n.s&&i.s&&(C?!j||C[0]!=j[0]:j)?C&&0==C[0]||!j?0*B:B/0:NaN);for(b=(v=new K(B)).c=[],B=o+(f=n.e-i.e)+1,a||(a=l,f=w(n.e/p)-w(i.e/p),B=B/p|0),h=0;j[h]==(C[h]||0);h++);if(j[h]>(C[h]||0)&&f--,B<0)b.push(1),d=!0;else{for(x=C.length,U=j.length,h=0,B+=2,(g=u(a/(j[0]+1)))>1&&(j=e(j,g,a),C=e(C,g,a),U=j.length,x=C.length),E=U,T=(A=C.slice(0,U)).length;T<U;A[T++]=0);N=j.slice(),N=[0].concat(N),O=j[0],j[1]>=a/2&&O++;do{if(g=0,(c=t(j,A,U,T))<0){if(S=A[0],U!=T&&(S=S*a+(A[1]||0)),(g=u(S/O))>1)for(g>=a&&(g=a-1),m=(y=e(j,g,a)).length,T=A.length;1==t(y,A,m,T);)g--,r(y,U<m?N:j,m,a),m=y.length,c=1;else 0==g&&(c=g=1),m=(y=j.slice()).length;if(m<T&&(y=[0].concat(y)),r(A,y,T,a),T=A.length,-1==c)for(;t(j,A,U,T)<1;)g++,r(A,U<T?N:j,T,a),T=A.length}else 0===c&&(g++,A=[0]);b[h++]=g,A[0]?A[T++]=C[E]||0:(A=[C[E]],T=1)}while((E++<x||null!=A[0])&&B--);d=null!=A[0],b[0]||b.splice(0,1)}if(a==l){for(h=1,B=b[0];B>=10;B/=10,h++);G(v,o+(v.e=h+f*p-1)+1,s,d)}else v.e=f,v.r=+d;return v}}(),E=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,O=/^\.([^.]+)$/,U=/^-?(Infinity|NaN)$/,N=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(N,"");if(U.test(o))e.s=isNaN(o)?null:o<0?-1:1,e.c=e.e=null;else{if(!r&&(o=o.replace(E,function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t}),n&&(i=n,o=o.replace(x,"$1").replace(O,"0.$1")),t!=o))return new K(o,i);if(K.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.c=e.e=e.s=null}},B.absoluteValue=B.abs=function(){var e=new K(this);return e.s<0&&(e.s=1),e},B.comparedTo=function(e,t){return v(this,new K(e,t))},B.decimalPlaces=B.dp=function(e,t){var r,n,i,o=this;if(null!=e)return b(e,0,y),null==t?t=_:b(t,0,8),G(new K(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-w(this.e/p))*p,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},B.dividedBy=B.div=function(e,t){return r(this,new K(e,t),j,_)},B.dividedToIntegerBy=B.idiv=function(e,t){return r(this,new K(e,t),0,1)},B.exponentiatedBy=B.pow=function(e,t){var r,n,i,o,s,f,l,h,d=this;if((e=new K(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+V(e));if(null!=t&&(t=new K(t)),s=e.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!e.c||!e.c[0])return h=new K(Math.pow(+V(d),s?2-A(e):+V(e))),t?h.mod(t):h;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new K(NaN);(n=!f&&d.isInteger()&&t.isInteger())&&(d=d.mod(t))}else{if(e.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||s&&d.c[1]>=24e7:d.c[0]<8e13||s&&d.c[0]<=9999975e7)))return o=d.s<0&&A(e)?-0:0,d.e>-1&&(o=1/o),new K(f?1/o:o);k&&(o=a(k/p+2))}for(s?(r=new K(.5),f&&(e.s=1),l=A(e)):l=(i=Math.abs(+V(e)))%2,h=new K(C);;){if(l){if(!(h=h.times(d)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}if(i){if(0===(i=u(i/2)))break;l=i%2}else if(G(e=e.times(r),e.e+1,1),e.e>14)l=A(e);else{if(0==(i=+V(e)))break;l=i%2}d=d.times(d),o?d.c&&d.c.length>o&&(d.c.length=o):n&&(d=d.mod(t))}return n?h:(f&&(h=C.div(h)),t?h.mod(t):o?G(h,k,_,void 0):h)},B.integerValue=function(e){var t=new K(this);return null==e?e=_:b(e,0,8),G(t,t.e+1,e)},B.isEqualTo=B.eq=function(e,t){return 0===v(this,new K(e,t))},B.isFinite=function(){return!!this.c},B.isGreaterThan=B.gt=function(e,t){return v(this,new K(e,t))>0},B.isGreaterThanOrEqualTo=B.gte=function(e,t){return 1===(t=v(this,new K(e,t)))||0===t},B.isInteger=function(){return!!this.c&&w(this.e/p)>this.c.length-2},B.isLessThan=B.lt=function(e,t){return v(this,new K(e,t))<0},B.isLessThanOrEqualTo=B.lte=function(e,t){return-1===(t=v(this,new K(e,t)))||0===t},B.isNaN=function(){return!this.s},B.isNegative=function(){return this.s<0},B.isPositive=function(){return this.s>0},B.isZero=function(){return!!this.c&&0==this.c[0]},B.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new K(e,t)).s,!a||!t)return new K(NaN);if(a!=t)return e.s=-t,s.plus(e);var u=s.e/p,c=e.e/p,f=s.c,h=e.c;if(!u||!c){if(!f||!h)return f?(e.s=-t,e):new K(h?s:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new K(f[0]?s:3==_?-0:0)}if(u=w(u),c=w(c),f=f.slice(),a=u-c){for((o=a<0)?(a=-a,i=f):(c=u,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=f.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(f[t]!=h[t]){o=f[t]<h[t];break}if(o&&(i=f,f=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=l-1;n>a;){if(f[--n]<h[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=l}f[n]-=h[n]}for(;0==f[0];f.splice(0,1),--c);return f[0]?H(e,f,c):(e.s=3==_?-1:1,e.c=[e.e=0],e)},B.modulo=B.mod=function(e,t){var n,i,o=this;return e=new K(e,t),!o.c||!e.s||e.c&&!e.c[0]?new K(NaN):!e.c||o.c&&!o.c[0]?new K(o):(9==q?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,q),(e=o.minus(n.times(e))).c[0]||1!=q||(e.s=o.s),e)},B.multipliedBy=B.times=function(e,t){var r,n,i,o,s,a,u,c,f,h,d,y,m,v,b,A=this,T=A.c,S=(e=new K(e,t)).c;if(!(T&&S&&T[0]&&S[0]))return!A.s||!e.s||T&&!T[0]&&!S||S&&!S[0]&&!T?e.c=e.e=e.s=null:(e.s*=A.s,T&&S?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=w(A.e/p)+w(e.e/p),e.s*=A.s,(u=T.length)<(h=S.length)&&(m=T,T=S,S=m,i=u,u=h,h=i),i=u+h,m=[];i--;m.push(0));for(v=l,b=g,i=h;--i>=0;){for(r=0,d=S[i]%b,y=S[i]/b|0,o=i+(s=u);o>i;)r=((c=d*(c=T[--s]%b)+(a=y*c+(f=T[s]/b|0)*d)%b*b+m[o]+r)/v|0)+(a/b|0)+y*f,m[o--]=c%v;m[o]=r}return r?++n:m.splice(0,1),H(e,m,n)},B.negated=function(){var e=new K(this);return e.s=-e.s||null,e},B.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new K(e,t)).s,!i||!t)return new K(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/p,s=e.e/p,a=n.c,u=e.c;if(!o||!s){if(!a||!u)return new K(i/0);if(!a[0]||!u[0])return u[0]?e:new K(a[0]?n:0*i)}if(o=w(o),s=w(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=u):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+u[t]+i)/l|0,a[t]=l===a[t]?0:a[t]%l;return i&&(a=[i].concat(a),++s),H(e,a,s)},B.precision=B.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return b(e,1,y),null==t?t=_:b(t,0,8),G(new K(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*p+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},B.shiftedBy=function(e){return b(e,-h,h),this.times("1e"+e)},B.squareRoot=B.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,u=s.s,c=s.e,f=j+4,l=new K("0.5");if(1!==u||!a||!a[0])return new K(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+V(s)))||u==1/0?(((t=m(a)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=w((c+1)/2)-(c<0||c%2),n=new K(t=u==1/0?"1e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new K(u+""),n.c[0])for((u=(c=n.e)+f)<3&&(u=0);;)if(o=n,n=l.times(o.plus(r(s,o,f,1))),m(o.c).slice(0,u)===(t=m(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(G(n,n.e+j+2,1),e=!n.times(n).eq(s));break}if(!i&&(G(o,o.e+j+2,0),o.times(o).eq(s))){n=o;break}f+=4,u+=4,i=1}return G(n,n.e+j+1,_,e)},B.toExponential=function(e,t){return null!=e&&(b(e,0,y),e++),z(this,e,t,1)},B.toFixed=function(e,t){return null!=e&&(b(e,0,y),e=e+this.e+1),z(this,e,t)},B.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=M;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,s=n.split("."),a=+r.groupSize,u=+r.secondaryGroupSize,f=r.groupSeparator||"",l=s[0],p=s[1],h=i.s<0,d=h?l.slice(1):l,g=d.length;if(u&&(o=a,a=u,u=o,g-=o),a>0&&g>0){for(o=g%a||a,l=d.substr(0,o);o<g;o+=a)l+=f+d.substr(o,a);u>0&&(l+=f+d.slice(o)),h&&(l="-"+l)}n=p?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):l}return(r.prefix||"")+n+(r.suffix||"")},B.toFraction=function(e){var t,n,i,o,s,a,u,f,l,h,g,y,w=this,v=w.c;if(null!=e&&(!(u=new K(e)).isInteger()&&(u.c||1!==u.s)||u.lt(C)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+V(u));if(!v)return new K(w);for(t=new K(C),l=n=new K(C),i=f=new K(C),y=m(v),s=t.e=y.length-w.e-1,t.c[0]=d[(a=s%p)<0?p+a:a],e=!e||u.comparedTo(t)>0?s>0?t:l:u,a=L,L=1/0,u=new K(y),f.c[0]=0;h=r(u,t,0,1),1!=(o=n.plus(h.times(i))).comparedTo(e);)n=i,i=o,l=f.plus(h.times(o=l)),f=o,t=u.minus(h.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),f=f.plus(o.times(l)),n=n.plus(o.times(i)),f.s=l.s=w.s,g=r(l,i,s*=2,_).minus(w).abs().comparedTo(r(f,n,s,_).minus(w).abs())<1?[l,i]:[f,n],L=a,g},B.toNumber=function(){return+V(this)},B.toPrecision=function(e,t){return null!=e&&b(e,1,y),z(this,e,t,2)},B.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(t=m(r.c),null==e?t=o<=R||o>=D?T(t,o):S(t,o,"0"):(b(e,2,F.length,"Base"),t=n(S(t,o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},B.valueOf=B.toJSON=function(){return V(this)},B._isBigNumber=!0,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(B[Symbol.toStringTag]="BigNumber",B[Symbol.for("nodejs.util.inspect.custom")]=B.valueOf),null!=t&&K.set(t),K}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(16);t.Api=class{constructor(e){this.METHOD_GET="GET",this.METHOD_POST="POST",this.applyConfig(e)}applyConfig(e){this.config=this.mergeDefaults(e)}getConfig(){return this.config}mergeDefaults(e){return{host:e.host,protocol:e.protocol||"http",port:e.port||1984,timeout:e.timeout||2e4,logging:e.logging||!1}}async get(e,t){try{return await this.request().get(e,t)}catch(e){if(e.response&&e.response.status)return e.response;throw e}}async post(e,t,r){try{return await this.request().post(e,t,r)}catch(e){if(e.response&&e.response.status)return e.response;throw e}}request(){let e=n.default.create({baseURL:`${this.config.protocol}://${this.config.host}:${this.config.port}`,timeout:1e3});return this.config.logging&&(e.interceptors.request.use(e=>(console.log(`Requesting: ${e.baseURL}/${e.url}`),e)),e.interceptors.response.use(e=>(console.log(`Response: ${e.config.url} - ${e.status}`),e))),e}}},function(e,t,r){e.exports=r(17)},function(e,t,r){"use strict";var n=r(0),i=r(4),o=r(19),s=r(2);function a(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var u=a(s);u.Axios=o,u.create=function(e){return a(n.merge(s,e))},u.Cancel=r(9),u.CancelToken=r(33),u.isCancel=r(8),u.all=function(e){return Promise.all(e)},u.spread=r(34),e.exports=u,e.exports.default=u},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
/*!

@@ -8,2 +8,2 @@ * Determine if an object is a Buffer

*/
e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict";var n=r(2),i=r(0),o=r(28),s=r(29);function a(e){this.defaults=e,this.interceptors={request:new o,response:new o}}a.prototype.request=function(e){"string"==typeof e&&(e=i.merge({url:arguments[0]},arguments[1])),(e=i.merge(n,{method:"get"},this.defaults,e)).method=e.method.toLowerCase();var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},i.forEach(["delete","get","head","options"],function(e){a.prototype[e]=function(t,r){return this.request(i.merge(r||{},{method:e,url:t}))}}),i.forEach(["post","put","patch"],function(e){a.prototype[e]=function(t,r,n){return this.request(i.merge(n||{},{method:e,url:t,data:r}))}}),e.exports=a},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){n.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})}},function(e,t,r){"use strict";var n=r(7);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e}},function(e,t,r){"use strict";var n=r(0);function i(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];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)),s.push(i(t)+"="+i(e))}))}),o=s.join("&")}return o&&(e+=(-1===e.indexOf("?")?"?":"&")+o),e}},function(e,t,r){"use strict";var n=r(0),i=["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,o,s={};return e?(n.forEach(e.split("\n"),function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}}),s):s}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(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=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(){this.message="String contains an invalid character"}i.prototype=new Error,i.prototype.code=5,i.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,r,o=String(e),s="",a=0,u=n;o.charAt(0|a)||(u="=",a%1);s+=u.charAt(63&t>>8-a%1*8)){if((r=o.charCodeAt(a+=.75))>255)throw new i;t=t<<8|r}return s}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&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(){}}},function(e,t,r){"use strict";var n=r(0);function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=i},function(e,t,r){"use strict";var n=r(0),i=r(30),o=r(8),s=r(2),a=r(31),u=r(32);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return c(e),e.baseURL&&!a(e.url)&&(e.url=u(e.baseURL,e.url)),e.headers=e.headers||{},e.data=i(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||s.adapter)(e).then(function(t){return c(e),t.data=i(t.data,t.headers,e.transformResponse),t},function(t){return o(t)||(c(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t,r){return n.forEach(r,function(r){e=r(e,t)}),e}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(9);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var r=this;e(function(e){r.reason||(r.reason=new n(e),t(r.reason))})}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i(function(t){e=t}),cancel:e}},e.exports=i},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Network=class{constructor(e){this.api=e}getInfo(){return this.api.get("info").then(e=>e.data)}getPeers(){return this.api.get("peers").then(e=>e.data)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(37),i=r(10),o=r(1);t.Transactions=class{constructor(e,t){this.api=e,this.crypto=t}getPrice(e,t){let r=t?`price/${e}/${t}`:`price/${e}`;return this.api.get(r,{transformResponse:[function(e){return e}]}).then(e=>e.data)}get(e){return this.api.get(`tx/${e}`).then(t=>{if(200==t.status&&t.data&&t.data.id==e)return new i.Transaction(t.data);if(202==t.status)throw new n.ArweaveError("TX_PENDING");if(404==t.status)throw new n.ArweaveError("TX_NOT_FOUND");if(410==t.status)throw new n.ArweaveError("TX_FAILED");throw new n.ArweaveError("TX_INVALID")})}async search(e,t){return this.api.post("arql",{op:"equals",expr1:e,expr2:t}).then(e=>e.data?e.data:[])}getStatus(e){return this.api.get(`tx/${e}/id`).then(e=>e.status)}async sign(e,t){let r=e.getSignatureData(),n=await this.crypto.sign(t,r),i=await this.crypto.hash(n);return e.setSignature({signature:o.ArweaveUtils.bufferTob64Url(n),id:o.ArweaveUtils.bufferTob64Url(i)}),e}async verify(e){const t=e.getSignatureData(),r=e.get("signature",{decode:!0,string:!1}),n=o.ArweaveUtils.bufferTob64Url(await this.crypto.hash(r));if(e.id!==n)throw new Error("Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.");return this.crypto.verify(e.owner,t,r)}post(e){return this.api.post("tx",e).then(e=>e)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ArweaveError=class extends Error{constructor(e,t){t.message?super(t.message):super(),this.type=e,this.response=t.response}getType(){return this.type}}},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=c(e),n=r[0],s=r[1],a=new o(function(e,t,r){return 3*(t+r)/4-r}(0,n,s)),u=0,f=s>0?n-4:n,l=0;l<f;l+=4)t=i[e.charCodeAt(l)]<<18|i[e.charCodeAt(l+1)]<<12|i[e.charCodeAt(l+2)]<<6|i[e.charCodeAt(l+3)],a[u++]=t>>16&255,a[u++]=t>>8&255,a[u++]=255&t;2===s&&(t=i[e.charCodeAt(l)]<<2|i[e.charCodeAt(l+1)]>>4,a[u++]=255&t);1===s&&(t=i[e.charCodeAt(l)]<<10|i[e.charCodeAt(l+1)]<<4|i[e.charCodeAt(l+2)]>>2,a[u++]=t>>8&255,a[u++]=255&t);return a},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(f(e,s,s+16383>a?a:s+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function c(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 f(e,t,r){for(var i,o,s=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);t.Wallets=class{constructor(e,t){this.api=e,this.crypto=t}getBalance(e){return this.api.get(`wallet/${e}/balance`,{transformResponse:[function(e){return e}]}).then(e=>e.data)}getLastTransactionID(e){return this.api.get(`wallet/${e}/last_tx`).then(e=>e.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(e){return n.ArweaveUtils.bufferTob64Url(await this.crypto.hash(n.ArweaveUtils.b64UrlToBuffer(e.n)))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);t.Silo=class{constructor(e,t,r){this.api=e,this.crypto=t,this.transactions=r}async get(e){if(!e)throw new Error("No Silo URI specified");const t=await this.parseUri(e),r=await this.transactions.search("Silo-Name",t.getAccessKey());if(0==r.length)throw new Error(`No data could be found for the Silo URI: ${e}`);const n=await this.transactions.get(r[0]);if(!n)throw new Error(`No data could be found for the Silo URI: ${e}`);const i=n.get("data",{decode:!0,string:!1});return this.crypto.decrypt(i,t.getEncryptionKey())}async readTransactionData(e,t){if(!t)throw new Error("No Silo URI specified");const r=await this.parseUri(t),n=e.get("data",{decode:!0,string:!1});return this.crypto.decrypt(n,r.getEncryptionKey())}async parseUri(e){const t=e.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!t)throw new Error("Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'");const r=t[1],o=Math.pow(2,parseInt(t[2])),s=await this.hash(n.ArweaveUtils.stringToBuffer(r),o),a=n.ArweaveUtils.bufferTob64(s.slice(0,15)),u=await this.hash(s.slice(16,31),1);return new i(e,a,u)}async hash(e,t){let r=await this.crypto.hash(e);for(let e=0;e<t-1;e++)r=await this.crypto.hash(r);return r}};class i{constructor(e,t,r){this.uri=e,this.accessKey=t,this.encryptionKey=r}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}}t.SiloResource=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);t.WebCryptoDriver=class{constructor(){if(this.keyLength=4096,this.publicExponent=65537,this.hashAlgorithm="sha256",!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=window.crypto.subtle}async generateJWK(){let e=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),t=await this.driver.exportKey("jwk",e.privateKey);return{kty:t.kty,e:t.e,n:t.n,d:t.d,p:t.p,q:t.q,dp:t.dp,dq:t.dq,qi:t.qi}}async sign(e,t){let r=await this.driver.sign({name:"RSA-PSS",saltLength:0},await this.jwkToCryptoKey(e),t);return new Uint8Array(r)}async hash(e){let t=await this.driver.digest("SHA-256",e);return new Uint8Array(t)}async verify(e,t,r){const n={kty:"RSA",e:"AQAB",n:e},i=await this.jwkToPublicCryptoKey(n);return this.driver.verify({name:"RSA-PSS",saltLength:0},i,r,t)}async jwkToCryptoKey(e){return this.driver.importKey("jwk",e,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(e){return this.driver.importKey("jwk",e,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(!window||!window.crypto||!window.crypto.subtle)return!1;let e=window.crypto.subtle;return"function"==typeof e.generateKey&&"function"==typeof e.importKey&&"function"==typeof e.exportKey&&"function"==typeof e.digest&&"function"==typeof e.sign}async encrypt(e,t){const r=await this.driver.importKey("raw","string"==typeof t?n.ArweaveUtils.stringToBuffer(t):t,{name:"PBKDF2",length:32},!1,["deriveKey"]),i=n.ArweaveUtils.stringToBuffer("salt"),o=await this.driver.deriveKey({name:"PBKDF2",salt:i,iterations:1e5,hash:"SHA-256"},r,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),s=new Uint8Array(16);crypto.getRandomValues(s);const a=await this.driver.encrypt({name:"AES-CBC",iv:s},o,e);return n.ArweaveUtils.concatBuffers([s,a])}async decrypt(e,t){const r=await this.driver.importKey("raw","string"==typeof t?n.ArweaveUtils.stringToBuffer(t):t,{name:"PBKDF2",length:32},!1,["deriveKey"]),i=n.ArweaveUtils.stringToBuffer("salt"),o=await this.driver.deriveKey({name:"PBKDF2",salt:i,iterations:1e5,hash:"SHA-256"},r,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),s=e.slice(0,16),a=await this.driver.decrypt({name:"AES-CBC",iv:s},o,e.slice(16));return n.ArweaveUtils.concatBuffers([a])}}}]);
e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict";var n=r(2),i=r(0),o=r(28),s=r(29);function a(e){this.defaults=e,this.interceptors={request:new o,response:new o}}a.prototype.request=function(e){"string"==typeof e&&(e=i.merge({url:arguments[0]},arguments[1])),(e=i.merge(n,{method:"get"},this.defaults,e)).method=e.method.toLowerCase();var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},i.forEach(["delete","get","head","options"],function(e){a.prototype[e]=function(t,r){return this.request(i.merge(r||{},{method:e,url:t}))}}),i.forEach(["post","put","patch"],function(e){a.prototype[e]=function(t,r,n){return this.request(i.merge(n||{},{method:e,url:t,data:r}))}}),e.exports=a},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){n.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})}},function(e,t,r){"use strict";var n=r(7);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e}},function(e,t,r){"use strict";var n=r(0);function i(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];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)),s.push(i(t)+"="+i(e))}))}),o=s.join("&")}return o&&(e+=(-1===e.indexOf("?")?"?":"&")+o),e}},function(e,t,r){"use strict";var n=r(0),i=["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,o,s={};return e?(n.forEach(e.split("\n"),function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}}),s):s}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(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=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(){this.message="String contains an invalid character"}i.prototype=new Error,i.prototype.code=5,i.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,r,o=String(e),s="",a=0,u=n;o.charAt(0|a)||(u="=",a%1);s+=u.charAt(63&t>>8-a%1*8)){if((r=o.charCodeAt(a+=.75))>255)throw new i;t=t<<8|r}return s}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&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(){}}},function(e,t,r){"use strict";var n=r(0);function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=i},function(e,t,r){"use strict";var n=r(0),i=r(30),o=r(8),s=r(2),a=r(31),u=r(32);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return c(e),e.baseURL&&!a(e.url)&&(e.url=u(e.baseURL,e.url)),e.headers=e.headers||{},e.data=i(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||s.adapter)(e).then(function(t){return c(e),t.data=i(t.data,t.headers,e.transformResponse),t},function(t){return o(t)||(c(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t,r){return n.forEach(r,function(r){e=r(e,t)}),e}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(9);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var r=this;e(function(e){r.reason||(r.reason=new n(e),t(r.reason))})}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i(function(t){e=t}),cancel:e}},e.exports=i},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Network=class{constructor(e){this.api=e}getInfo(){return this.api.get("info").then(e=>e.data)}getPeers(){return this.api.get("peers").then(e=>e.data)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(37),i=r(10),o=r(1);t.Transactions=class{constructor(e,t){this.api=e,this.crypto=t}getPrice(e,t){let r=t?`price/${e}/${t}`:`price/${e}`;return this.api.get(r,{transformResponse:[function(e){return e}]}).then(e=>e.data)}get(e){return this.api.get(`tx/${e}`).then(t=>{if(200==t.status&&t.data&&t.data.id==e)return new i.Transaction(t.data);if(202==t.status)throw new n.ArweaveError("TX_PENDING");if(404==t.status)throw new n.ArweaveError("TX_NOT_FOUND");if(410==t.status)throw new n.ArweaveError("TX_FAILED");throw new n.ArweaveError("TX_INVALID")})}fromRaw(e){return new i.Transaction(e)}async search(e,t){return this.api.post("arql",{op:"equals",expr1:e,expr2:t}).then(e=>e.data?e.data:[])}getStatus(e){return this.api.get(`tx/${e}/id`).then(e=>e.status)}async sign(e,t){let r=e.getSignatureData(),n=await this.crypto.sign(t,r),i=await this.crypto.hash(n);return e.setSignature({signature:o.ArweaveUtils.bufferTob64Url(n),id:o.ArweaveUtils.bufferTob64Url(i)}),e}async verify(e){const t=e.getSignatureData(),r=e.get("signature",{decode:!0,string:!1}),n=o.ArweaveUtils.bufferTob64Url(await this.crypto.hash(r));if(e.id!==n)throw new Error("Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.");return this.crypto.verify(e.owner,t,r)}post(e){return this.api.post("tx",e).then(e=>e)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ArweaveError=class extends Error{constructor(e,t){t.message?super(t.message):super(),this.type=e,this.response=t.response}getType(){return this.type}}},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=c(e),n=r[0],s=r[1],a=new o(function(e,t,r){return 3*(t+r)/4-r}(0,n,s)),u=0,f=s>0?n-4:n,l=0;l<f;l+=4)t=i[e.charCodeAt(l)]<<18|i[e.charCodeAt(l+1)]<<12|i[e.charCodeAt(l+2)]<<6|i[e.charCodeAt(l+3)],a[u++]=t>>16&255,a[u++]=t>>8&255,a[u++]=255&t;2===s&&(t=i[e.charCodeAt(l)]<<2|i[e.charCodeAt(l+1)]>>4,a[u++]=255&t);1===s&&(t=i[e.charCodeAt(l)]<<10|i[e.charCodeAt(l+1)]<<4|i[e.charCodeAt(l+2)]>>2,a[u++]=t>>8&255,a[u++]=255&t);return a},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(f(e,s,s+16383>a?a:s+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function c(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 f(e,t,r){for(var i,o,s=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);t.Wallets=class{constructor(e,t){this.api=e,this.crypto=t}getBalance(e){return this.api.get(`wallet/${e}/balance`,{transformResponse:[function(e){return e}]}).then(e=>e.data)}getLastTransactionID(e){return this.api.get(`wallet/${e}/last_tx`).then(e=>e.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(e){return n.ArweaveUtils.bufferTob64Url(await this.crypto.hash(n.ArweaveUtils.b64UrlToBuffer(e.n)))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);t.Silo=class{constructor(e,t,r){this.api=e,this.crypto=t,this.transactions=r}async get(e){if(!e)throw new Error("No Silo URI specified");const t=await this.parseUri(e),r=await this.transactions.search("Silo-Name",t.getAccessKey());if(0==r.length)throw new Error(`No data could be found for the Silo URI: ${e}`);const n=await this.transactions.get(r[0]);if(!n)throw new Error(`No data could be found for the Silo URI: ${e}`);const i=n.get("data",{decode:!0,string:!1});return this.crypto.decrypt(i,t.getEncryptionKey())}async readTransactionData(e,t){if(!t)throw new Error("No Silo URI specified");const r=await this.parseUri(t),n=e.get("data",{decode:!0,string:!1});return this.crypto.decrypt(n,r.getEncryptionKey())}async parseUri(e){const t=e.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!t)throw new Error("Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'");const r=t[1],o=Math.pow(2,parseInt(t[2])),s=await this.hash(n.ArweaveUtils.stringToBuffer(r),o),a=n.ArweaveUtils.bufferTob64(s.slice(0,15)),u=await this.hash(s.slice(16,31),1);return new i(e,a,u)}async hash(e,t){let r=await this.crypto.hash(e);for(let e=0;e<t-1;e++)r=await this.crypto.hash(r);return r}};class i{constructor(e,t,r){this.uri=e,this.accessKey=t,this.encryptionKey=r}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}}t.SiloResource=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);t.WebCryptoDriver=class{constructor(){if(this.keyLength=4096,this.publicExponent=65537,this.hashAlgorithm="sha256",!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=window.crypto.subtle}async generateJWK(){let e=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),t=await this.driver.exportKey("jwk",e.privateKey);return{kty:t.kty,e:t.e,n:t.n,d:t.d,p:t.p,q:t.q,dp:t.dp,dq:t.dq,qi:t.qi}}async sign(e,t){let r=await this.driver.sign({name:"RSA-PSS",saltLength:0},await this.jwkToCryptoKey(e),t);return new Uint8Array(r)}async hash(e){let t=await this.driver.digest("SHA-256",e);return new Uint8Array(t)}async verify(e,t,r){const n={kty:"RSA",e:"AQAB",n:e},i=await this.jwkToPublicCryptoKey(n);return this.driver.verify({name:"RSA-PSS",saltLength:0},i,r,t)}async jwkToCryptoKey(e){return this.driver.importKey("jwk",e,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(e){return this.driver.importKey("jwk",e,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(!window||!window.crypto||!window.crypto.subtle)return!1;let e=window.crypto.subtle;return"function"==typeof e.generateKey&&"function"==typeof e.importKey&&"function"==typeof e.exportKey&&"function"==typeof e.digest&&"function"==typeof e.sign}async encrypt(e,t){const r=await this.driver.importKey("raw","string"==typeof t?n.ArweaveUtils.stringToBuffer(t):t,{name:"PBKDF2",length:32},!1,["deriveKey"]),i=n.ArweaveUtils.stringToBuffer("salt"),o=await this.driver.deriveKey({name:"PBKDF2",salt:i,iterations:1e5,hash:"SHA-256"},r,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),s=new Uint8Array(16);crypto.getRandomValues(s);const a=await this.driver.encrypt({name:"AES-CBC",iv:s},o,e);return n.ArweaveUtils.concatBuffers([s,a])}async decrypt(e,t){const r=await this.driver.importKey("raw","string"==typeof t?n.ArweaveUtils.stringToBuffer(t):t,{name:"PBKDF2",length:32},!1,["deriveKey"]),i=n.ArweaveUtils.stringToBuffer("salt"),o=await this.driver.deriveKey({name:"PBKDF2",salt:i,iterations:1e5,hash:"SHA-256"},r,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),s=e.slice(0,16),a=await this.driver.decrypt({name:"AES-CBC",iv:s},o,e.slice(16));return n.ArweaveUtils.concatBuffers([a])}}}]);

@@ -30,3 +30,3 @@ import { Ar } from "./ar";

}
let from = await this.wallets.jwkToAddress(jwk);
const from = await this.wallets.jwkToAddress(jwk);
if (attributes.owner == undefined) {

@@ -39,4 +39,4 @@ attributes.owner = jwk.n;

if (attributes.reward == undefined) {
let length = (typeof attributes.data == 'string' && attributes.data.length > 0) ? attributes.data.length : 0;
let target = (typeof attributes.target == 'string' && attributes.target.length > 0) ? attributes.target : null;
const length = (typeof attributes.data == 'string' && attributes.data.length > 0) ? attributes.data.length : 0;
const target = (typeof attributes.target == 'string' && attributes.target.length > 0) ? attributes.target : null;
attributes.reward = await this.transactions.getPrice(length, target);

@@ -59,3 +59,3 @@ }

}
let from = await this.wallets.jwkToAddress(jwk);
const from = await this.wallets.jwkToAddress(jwk);
if (attributes.owner == undefined) {

@@ -67,12 +67,15 @@ attributes.owner = jwk.n;

}
const siloResource = await this.silo.parseUri(siloUri);
const encrypted = await this.crypto.encrypt(ArweaveUtils.stringToBuffer(attributes.data), siloResource.getEncryptionKey());
if (attributes.reward == undefined) {
let length = (typeof attributes.data == 'string' && attributes.data.length > 0) ? attributes.data.length : 0;
const length = encrypted.byteLength;
attributes.reward = await this.transactions.getPrice(length);
}
const siloResource = await this.silo.parseUri(siloUri);
const encrypted = await this.crypto.encrypt(ArweaveUtils.stringToBuffer(attributes.data), siloResource.getEncryptionKey());
attributes.data = ArweaveUtils.bufferTob64Url(encrypted);
return new Transaction(attributes);
const transaction = new Transaction(attributes);
transaction.addTag('Silo-Name', siloResource.getAccessKey());
transaction.addTag('Silo-Version', siloResource.getAccessKey());
return transaction;
}
}
//# sourceMappingURL=arweave.js.map

@@ -13,2 +13,3 @@ /// <reference types="node" />

get(id: string): Promise<Transaction>;
fromRaw(attributes: object): Transaction;
search(tagName: string, tagValue: string): Promise<string[]>;

@@ -15,0 +16,0 @@ getStatus(id: string): Promise<number>;

@@ -45,2 +45,5 @@ import { ArweaveError } from './lib/error';

}
fromRaw(attributes) {
return new Transaction(attributes);
}
async search(tagName, tagValue) {

@@ -47,0 +50,0 @@ return this.api.post(`arql`, {

{
"name": "arweave",
"version": "1.1.1",
"version": "1.1.2",
"description": "Arweave JS client library",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -65,3 +65,3 @@ import { Ar } from "./ar";

let from = await this.wallets.jwkToAddress(jwk);
const from = await this.wallets.jwkToAddress(jwk);

@@ -78,5 +78,5 @@ if (attributes.owner == undefined) {

let length = (typeof attributes.data == 'string' && attributes.data.length > 0) ? attributes.data.length : 0;
const length = (typeof attributes.data == 'string' && attributes.data.length > 0) ? attributes.data.length : 0;
let target = (typeof attributes.target == 'string' && attributes.target.length > 0) ? attributes.target : null;
const target = (typeof attributes.target == 'string' && attributes.target.length > 0) ? attributes.target : null;

@@ -107,3 +107,3 @@ attributes.reward = await this.transactions.getPrice(length, target);

let from = await this.wallets.jwkToAddress(jwk);
const from = await this.wallets.jwkToAddress(jwk);

@@ -118,5 +118,9 @@ if (attributes.owner == undefined) {

const siloResource = await this.silo.parseUri(siloUri);
const encrypted = await this.crypto.encrypt(ArweaveUtils.stringToBuffer(attributes.data), siloResource.getEncryptionKey());
if (attributes.reward == undefined) {
let length = (typeof attributes.data == 'string' && attributes.data.length > 0) ? attributes.data.length : 0;
const length = encrypted.byteLength;

@@ -126,9 +130,10 @@ attributes.reward = await this.transactions.getPrice(length);

const siloResource = await this.silo.parseUri(siloUri);
attributes.data = ArweaveUtils.bufferTob64Url(encrypted);
const encrypted = await this.crypto.encrypt(ArweaveUtils.stringToBuffer(attributes.data), siloResource.getEncryptionKey());
const transaction = new Transaction(attributes);
attributes.data = ArweaveUtils.bufferTob64Url(encrypted);
transaction.addTag('Silo-Name', siloResource.getAccessKey())
transaction.addTag('Silo-Version', siloResource.getAccessKey())
return new Transaction(attributes);
return transaction;
}

@@ -135,0 +140,0 @@

@@ -67,2 +67,6 @@ import { Api } from "./lib/api";

public fromRaw(attributes: object): Transaction {
return new Transaction(attributes);
}
public async search(tagName: string, tagValue: string): Promise<string[]> {

@@ -69,0 +73,0 @@ return this.api.post(`arql`, {

@@ -162,6 +162,4 @@ import * as chai from 'chai';

expect(verified).to.be.a('boolean');
expect(verified).to.be.a('boolean').and.to.be.true;
expect(verified).to.be.true;
//@ts-ignore

@@ -295,18 +293,27 @@ // Needs ts-ignoring as tags are readonly so chaning the tag like this isn't

// uri = 'secret.1'
const transaction = new Transaction({
last_tx: '',
const transaction = arweave.transactions.fromRaw({
last_tx: 'Sgmyo7nUqPpVQWUfK72p5yIpd85QQbhGaWAF-I8L6yE',
owner:
'2xkkxcnA0HyqpFqR1g14rnyiF_zZKZ_2EMVos3lb0Vd8l6RxKGumxTrFairo5fMLmTvrokYVNhl_ohmZvRVojwBC3nbbrY2mLpBWgwgpIXgcFug6GMu2p1W730IYCvi4EYpWDYx5sj_IzyMrDB7FB9jabl2AAefSrAdTfsmlg8f1WVJRp2SwPq3BqeUyHy7X1XNq7Bh6DBekbbywQgnX5zL2G2o8ySmeg72EFlH5T5dKbGqP6AIhRD7My8F1cq2MUe5ov1teLZeNhgnBZGoOoJmhqnimYkCY4e7jIrhZojHuDMidFLKkAORso6WlHZPWxVKo14xkRTBpNokwB6Crf9kJ-yNbjqagbhztf5ovrlGfNVtTZp3lt2btUzEyKHHIDjnb4r3HpF6dklGbGQjSoboZ67Os5fz44trAbz8HbtjmoGYdjzziO6Svpd_DX0YDyDai1lLR1c7CERuLGXOPCWyn0g9uEXkjJzdAM3BUlsfIZMdlZnN66EWoRUor9xZQkH3MitzTxPV8Eph2vtIJKDN7hybwp5EhNxJlaGA3sjG_Fhc1esntyo0W80wpFcAbwKp1gARqTeR1xsfsj-LuzFRNIK-wj5z6jQMVD5Dxu6wwT9RkVu-kZrL-rN56uGsfPQgXpurL0WyZzBM2MbrbQTd1aDR_rkl9khhCM3X--8k',
'pJjRtSRLpHUVAKCtWC9pjajI_VEpiPEEAHX0k1B1jrB_jDlZsMJPyGRVX6n7N16vNyDTnKAofC_aNmTFegW-uyJmdxsteO1TXKrR_KJvuv_vACX4N8BkSgplB7mTTALBMNPmiINHXkDSxZEkBxAGV0GyL8pLd2-0X6TG16wDFShyS7rZzW8xFsQYiAp9-g330hPhCV7KBdVFtCxA0h1RifDYloMUwHbAWCTvzm72aLI1nWaLzotcM4cZTTdzw5VTdGtjo9fMdoT7uTqikIIhM3C4f9Ws-ECqjBUXtZFg7q6jYbUcTVNr1o2UFPKbLnDl4vcUZBaeqkL0FWQuo7F1hw36PVm_b9lVVzSVVkeA_HF2tQotkaITyOQmYfTHi1d31m5fwFZje_M-YgeyvOIuiqX4-lIGz8pohTutY3Z5_LKfO_a8jsJL8_jFLqcjSCRvVZSRmQDpzB4hJ9-W89m95DDmZci2wLbxFR8GwekNbpHeeC2EaJorhU0qBn_Hlcxql30fLveycjhSO03bu3MJwN9moT2q0T222iIXutEjpNezt5VzZKao8_JuI3ZnTFy5dM5GYO773TbgUihlVjVQsnv73FFPZaHfaRssK4sfGlBHjItwkzEQe9gOtFhkAFihiw45ppo6FnBkvmNcD59GfteifKPg5oSGYqMWZWcKPt0',
tags:
[{ name: 'Q29udGVudC1UeXBl', value: 'dGV4dC9odG1s' },
{ name: 'VXNlci1BZ2VudA', value: 'QXJ3ZWF2ZURlcGxveS8xLjAuMA' },
{ name: 'U2lsby1WZXJzaW9u', value: 'MC4xLjA' }],
target: '',
quantity: '0',
data: 'euyLRlvfca996OV5ayXwHboUNNxIiapq-I-II6zuQHo',
reward: '322080219',
data:
'0HgHqou5BTRNYJIsCciZb2-85Qlg9cYpiHO62KbRCEeX_cjSvn--Cex8uksInemd6FWWkczaqjs3SWzr7BRc0BSjHXxlVHkKuQp7WvRRJeNJPk_nC0KZrjkFSIPLIx_oOSeXigaPSEBSC4ry_5Iygt7z0Dgl7z1eFplIs6MlxKuBwiXfCtlwRDQK_fJlPWZhGjOpNLP5dyOLwMKrvG2dbAOeyAYbr117rn19CiDkTQAI3m2gAcJlXDZTNeA-1rJqb6X73u0AQt4Ao-OkktxdZ1UMfMfXnwdlsAEKK14NiKRbL1UbVRGh1nyWjUl90BP5Qj74L6_CKxQc_us7gxdeUhkzIKr4-LMY4LoCr-l0Law_tIGekkRsqb5oN7JiketqWazgsyo-Gq-0Blvhwh8nww',
reward: '349612332',
signature:
'yiZRcHcOxTMQm6gkpxrt9i9Zzok_PGlPeNBwyl_EhAbvJDie_CEkbxhegoK57UzVTczAiG7hGFvAawT_NAwvqTw5pF1v7OooIYDowQvTBnHBIXzOMVTqUjL5HwZ8DrJZrY9HJ6XSmERivNYwXrwloDuDCYYBv1cTCoRBt43BTaVFRzYZdccQXla89VN6HYDHszzAIgONfhdkv5LtChaZqQgdugrr8JAgWqjyvP02uL_tB_cEsumyOhXkFpQlHjIbTlqCxA4Hr06U6S37EfScztKbqwkKxS_J73nNO2HvGgy0NBxY52_BCzQs3tBdGnd3UQn5TcqXBYSYW082mIU4eCHqa1sCj60V7cfOlUwk_1tZOgtOQt9Kx2N6qTmZs1vlQjcPhmyLRLTFrLXPw7bHpTfLGE4AEG0kcIcKCvSSxjSaN_n-LvITmSFQ05Wb8EMQFo9pUDrFjpsum4rSq2hevfB51FDJCpAQ_57Hd1infcTKs32Yom5FR4WXp9Yr0G1DpQJIh5XbkczkRIYXtk8l6j7pY1DZ4rnm7INLTXL75e4YKxW-jlOKIILE8oyJkmgd4kA-BjVZ7FsiD0MjX0c5PRo0sX6rf7VATeG8l5vvGn2XDQyXlWYAKCzUJvGr-Z5TYakPE5yawvFUA5qXav_jH_Cw4qx-rzNpnvNRiQko5i8',
id: 'aBrnjAQG07iVziQkrlNaZUs7kpUN9zjqqpXC7rkgGf0'
'DJ6V8zXFMvkyNS4nNHxdFgXx1cbMuzQfWdtP_navPG1STMUarYKHWnJvFQqNkFl5CekNql0xTOjY5hWLt2AVxfMWgvvi5498vNUpbFoWxjrVl6fk86ARx2lzYB7iQK4YFIuIQ7MdR0w8Dy836hW7c8gXe_FPRAqOI7J_l8fqUSzaUtlcwLSfvhXJM-2a3WmoGLcg8Gvj53B8-RizvM3BrKQQWrcat78zeOgb-Fzl3PQ_Ej3CiRIDgAYnTxmd7M6jI84uck1gBRjMql42n0F8pQuTgMqzDbeXW2iBuvIE5tYVmUgnNrPjkDedLWe0Hp4KLDQyDY9lO-zIJLpiYCbc7kUfDBontxCCJIy9N8XM9gHqQofCItYAEO4v3B7sXgdSAQzcibnM3j6EhB9-mhiDcKKRuTSvyJh3sBTWHFrnWylfq84JOJLNhR4aZA_UfjkccA7Z-yqoiMI0mOB0HaAEmsa6ZsoLs5C-6vDnGaBCqYeVKKqKizfOQGsc9IuzdsSQwY7yTE-C3Xb3eAgnq0BLn6iUNqFU-mkwHi-c_hpxoR0lY91k98Ra9UhrgFS5m_9x3BhCXNhDaUXb16p0fHKGYSggqgqS3FbEcdOnsQlhw3IFEccFOTvuv1xEoE1zYeZ06q6NkFKMik6soXl9LXXgJgZvpEut_2LaHKtojbWqSkc',
id: 'S-9ICDleH3PEx9LXVEbguVffe5dHEM0I3wEr_MJidqU'
});
let decrypted = await arweave.silo.readTransactionData(transaction, 'secret.1');
const verified = await arweave.transactions.verify(transaction);
expect(ArweaveUtils.bufferToString(decrypted)).to.be.a('string').and.equal('something');
expect(verified).to.be.a('boolean').and.to.be.true;
const decrypted = await arweave.silo.readTransactionData(transaction, 'thing.1');
expect(ArweaveUtils.bufferToString(decrypted)).to.be.a('string').and.contain('<title>Hello world!</title>');
})

@@ -322,2 +329,8 @@

await arweave.transactions.sign(transaction, wallet);
const verified = await arweave.transactions.verify(transaction);
expect(verified).to.be.a('boolean').and.to.be.true;
let decrypted = await arweave.silo.readTransactionData(transaction, 'my-silo-ref.1');

@@ -324,0 +337,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc