Socket
Socket
Sign inDemoInstall

arweave

Package Overview
Dependencies
Maintainers
1
Versions
80
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 0.1.0 to 1.0.0

dist/node/arweave/lib/Transaction.d.ts

1

dist/node/arweave/lib/crypto/crypto-interface.d.ts

@@ -5,3 +5,4 @@ import { JWKInterface } from "../Wallet";

sign(jwk: JWKInterface, data: Uint8Array): Promise<Uint8Array>;
verify(publicModulus: string, data: Uint8Array, signature: Uint8Array): Promise<boolean>;
hash(data: Uint8Array): Promise<Uint8Array>;
}

8

dist/node/arweave/lib/crypto/node-driver.d.ts

@@ -9,11 +9,7 @@ /// <reference types="node" />

generateJWK(): Promise<JWKInterface>;
/**
*
* @param jwk
* @param data
*/
sign(jwk: object, data: Uint8Array): Promise<Uint8Array>;
verify(publicModulus: string, data: Uint8Array, signature: Uint8Array): Promise<boolean>;
hash(data: Buffer): Promise<Uint8Array>;
private jwkToPem;
jwkToPem(jwk: object): string;
private pemToJWK;
}

@@ -12,4 +12,4 @@ "use strict";

generateJWK() {
if (typeof !crypto.generateKeyPair == 'function') {
throw new Error('Keypair generation not supported in this version of Node, only supported in versions 10.x+');
if (typeof crypto.generateKeyPair != "function") {
throw new Error('Keypair generation not supported in this version of Node, only supported in versions 10+');
}

@@ -37,7 +37,2 @@ return new Promise((resolve, reject) => {

}
/**
*
* @param jwk
* @param data
*/
sign(jwk, data) {

@@ -55,2 +50,20 @@ return new Promise((resolve, reject) => {

}
verify(publicModulus, data, signature) {
return new Promise((resolve, reject) => {
const publicKey = {
kty: 'RSA',
e: 'AQAB',
n: publicModulus,
};
const pem = this.jwkToPem(publicKey);
resolve(crypto
.createVerify(this.hashAlgorithm)
.update(data)
.verify({
key: pem,
padding: crypto.constants.RSA_PKCS1_PSS_PADDING,
saltLength: 0
}, signature));
});
}
hash(data) {

@@ -65,6 +78,6 @@ return new Promise((resolve, reject) => {

jwkToPem(jwk) {
return pem_1.jwk2pem(jwk);
return pem_1.jwkTopem(jwk);
}
pemToJWK(pem) {
let jwk = pem_1.pem2jwk(pem);
let jwk = pem_1.pemTojwk(pem);
return jwk;

@@ -71,0 +84,0 @@ }

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

export declare function pem2jwk(pem: any, extras?: any): any;
export declare function jwk2pem(json: any): any;
export declare function pemTojwk(pem: any, extras?: any): any;
export declare function jwkTopem(json: any): any;

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

}
function pem2jwk(pem, extras) {
function pemTojwk(pem, extras) {
var text = pem.toString().split(/(\r\n|\r|\n)+/g);

@@ -130,4 +130,4 @@ text = text.filter(function (line) {

}
exports.pem2jwk = pem2jwk;
function jwk2pem(json) {
exports.pemTojwk = pemTojwk;
function jwkTopem(json) {
var jwk = parse(json);

@@ -149,3 +149,3 @@ var isPrivate = !!(jwk.d);

}
exports.jwk2pem = jwk2pem;
exports.jwkTopem = jwkTopem;
//# sourceMappingURL=pem.js.map

@@ -10,11 +10,8 @@ import { JWKInterface } from "../Wallet";

generateJWK(): Promise<JWKInterface>;
/**
*
* @param jwk
* @param data
*/
sign(jwk: JWKInterface, data: any): Promise<Uint8Array>;
sign(jwk: JWKInterface, data: Uint8Array): Promise<Uint8Array>;
hash(data: Uint8Array): Promise<Uint8Array>;
verify(publicModulus: string, data: Uint8Array, signature: Uint8Array): Promise<boolean>;
private jwkToCryptoKey;
private jwkToPublicCryptoKey;
private detectWebCrypto;
}

@@ -39,7 +39,2 @@ "use strict";

}
/**
*
* @param jwk
* @param data
*/
async sign(jwk, data) {

@@ -60,2 +55,14 @@ let signature = await this

}
async verify(publicModulus, data, signature) {
const publicKey = {
kty: 'RSA',
e: 'AQAB',
n: publicModulus,
};
const key = await this.jwkToPublicCryptoKey(publicKey);
return this.driver.verify({
name: 'RSA-PSS',
saltLength: 0,
}, key, signature, data);
}
async jwkToCryptoKey(jwk) {

@@ -67,4 +74,12 @@ return this.driver.importKey('jwk', jwk, {

}
}, false, ['sign']);
}, false, ["sign"]);
}
async jwkToPublicCryptoKey(publicJwk) {
return this.driver.importKey('jwk', publicJwk, {
name: 'RSA-PSS',
hash: {
name: 'SHA-256',
}
}, false, ["verify"]);
}
detectWebCrypto() {

@@ -71,0 +86,0 @@ if (!window || !window.crypto || !window.crypto.subtle) {

@@ -5,3 +5,4 @@ import { AxiosResponse } from "axios";

TX_NOT_FOUND = "TX_NOT_FOUND",
TX_FAILED = "TX_FAILED"
TX_FAILED = "TX_FAILED",
TX_INVALID = "TX_INVALID"
}

@@ -8,0 +9,0 @@ export declare class ArweaveError extends Error {

@@ -12,1 +12,6 @@ export interface JWKInterface {

}
export interface JWKPublicInterface {
kty: string;
e: string;
n: string;
}

@@ -15,3 +15,4 @@ /// <reference types="node" />

sign(transaction: Transaction, jwk: JWKInterface): Promise<Transaction>;
verify(transaction: Transaction): Promise<boolean>;
post(transaction: Transaction | Buffer | string | object): Promise<AxiosResponse>;
}

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

return this.api.get(`tx/${id}`).then(response => {
if (response.status == 200) {
if (response.status == 200 && response.data && response.data.id == id) {
return new transaction_1.Transaction(response.data);

@@ -45,2 +45,3 @@ }

}
new error_1.ArweaveError("TX_INVALID" /* TX_INVALID */);
});

@@ -63,2 +64,18 @@ }

}
async verify(transaction) {
const signaturePayload = transaction.getSignatureData();
/**
* The transaction ID should be a SHA-256 hash of the raw signature bytes, so this needs
* to be recalculated from the signature and checked against the transaction ID.
*/
const rawSignature = transaction.get('signature', { decode: true, string: false });
const expectedId = utils_1.ArweaveUtils.bufferTob64Url(await this.crypto.hash(rawSignature));
if (transaction.id !== expectedId) {
throw new Error(`Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.`);
}
/**
* Now verify the signature is valid and signed by the owner wallet (owner field = originating wallet public key).
*/
return this.crypto.verify(transaction.owner, signaturePayload, rawSignature);
}
post(transaction) {

@@ -65,0 +82,0 @@ return this.api.post(`tx`, transaction).then(response => {

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

!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.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 o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));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(3),o=r(18),i=Object.prototype.toString;function s(e){return"[object Array]"===i.call(e)}function u(e){return null!==e&&"object"==typeof e}function a(e){return"[object Function]"===i.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 o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:o,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:u,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:a,isStream:function(e){return u(e)&&a(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,o=arguments.length;n<o;n++)c(arguments[n],r);return t},extend:function(e,t,r){return c(t,function(t,o){e[o]=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 o{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=o.b64UrlToBuffer(e);if("undefined"==typeof TextDecoder){return new(0,r(10).TextDecoder)("utf-8",{fatal:!0}).decode(t)}return new TextDecoder("utf-8",{fatal:!0}).decode(t)}static stringToBuffer(e){if("undefined"==typeof TextEncoder){return(new(0,r(10).TextEncoder)).encode(e)}return(new TextEncoder).encode(e)}static stringToB64Url(e){return o.bufferTob64Url(o.stringToBuffer(e))}static b64UrlToBuffer(e){return new Uint8Array(n.toByteArray(o.b64UrlDecode(e)))}static bufferTob64(e){return n.fromByteArray(new Uint8Array(e))}static bufferTob64Url(e){return o.b64UrlEncode(o.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=o},function(e,t,r){"use strict";(function(t){var n=r(0),o=r(20),i={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,a={adapter:("undefined"!=typeof XMLHttpRequest?u=r(5):void 0!==t&&(u=r(5)),u),transformRequest:[function(e,t){return o(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(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}};a.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],function(e){a.headers[e]={}}),n.forEach(["post","put","patch"],function(e){a.headers[e]=n.merge(i)}),e.exports=a}).call(this,r(4))},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,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!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:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,c=[],f=!1,l=-1;function p(){f&&a&&(f=!1,a.length?c=a.concat(c):l=-1,c.length&&h())}function h(){if(!f){var e=u(p);f=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=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(){}o.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||u(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(0),o=r(21),i=r(23),s=r(24),u=r(25),a=r(6),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||u(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(),i(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};o(t,f,n),h=null}},h.onerror=function(){f(a("Network Error",e,null,h)),h=null},h.ontimeout=function(){f(a("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var m=r(27),v=(e.withCredentials||u(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,o,i){var s=new Error(e);return n(s,t,r,o,i)}},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 o{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 i extends o{constructor(e,t,r=!1){super(),this.name=e,this.value=t}}t.Tag=i;t.Transaction=class extends o{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)}addTag(e,t){this.tags.push(new i(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){(function(e,n){var o=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(e).replace(o,function(e){if("%%"===e)return"%";if(r>=i)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}}),a=n[r];r<i;a=n[++r])g(a)||!b(a)?s+=" "+a:s+=" "+u(a);return s},t.deprecate=function(r,o){if(m(e.process))return function(){return t.deprecate(r,o).apply(this,arguments)};if(!0===n.noDeprecation)return r;var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(o);n.traceDeprecation?console.trace(o):console.error(o),i=!0}return r.apply(this,arguments)}};var i,s={};function u(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=a),f(n,e,n.depth)}function a(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function c(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&x(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return w(o)||(o=f(e,o,n)),o}var i=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(i)return i;var s=Object.keys(r),u=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(x(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","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="",O=!1,E=["{","}"];(h(r)&&(O=!0,E=["[","]"]),x(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||O&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=O?function(e,t,r,n,o){for(var i=[],s=0,u=t.length;s<u;++s)N(t,String(s))?i.push(p(e,t,r,n,String(s),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(p(e,t,r,n,o,!0))}),i}(e,r,n,u,s):s.map(function(t){return p(e,r,n,u,t,O)}),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,E)):E[0]+b+E[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,o,i){var s,u,a;if((a=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?u=a.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):a.set&&(u=e.stylize("[Setter]","special")),N(n,o)||(s="["+o+"]"),u||(e.seen.indexOf(a.value)<0?(u=g(r)?f(e,a.value,null):f(e,a.value,r-1)).indexOf("\n")>-1&&(u=i?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n")):u=e.stylize("[Circular]","special")),m(s)){if(i&&o.match(/^\d+$/))return u;(s=JSON.stringify(""+o)).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+": "+u}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]"===O(e)}function b(e){return"object"==typeof e&&null!==e}function A(e){return b(e)&&"[object Date]"===O(e)}function T(e){return b(e)&&("[object Error]"===O(e)||e instanceof Error)}function x(e){return"function"==typeof e}function O(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(m(i)&&(i=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!s[e])if(new RegExp("\\b"+e+"\\b","i").test(i)){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=u,u.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]},u.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=x,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 S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":"),[e.getDate(),S[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(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),o=r(43);window.arweave={init:e=>new n.Arweave({api:e,crypto:new o.WebCryptoDriver})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(13),o=r(15),i=r(35),s=r(36),u=r(42),a=r(9),c=r(1);t.Arweave=class{constructor(e){this.crypto=e.crypto,this.api=new o.Api(e.api),this.wallets=new u.Wallets(this.api,e.crypto),this.transactions=new s.Transactions(this.api,e.crypto),this.network=new i.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 a.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 o=this.stringToBigNum(e,r).shiftedBy(-12);return t?o.toFormat(r):o.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(o){"use strict";var i,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,u=Math.ceil,a=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,o=e.length,i=e[0]+"";n<o;){for(t=e[n++]+"",r=p-t.length;r--;t="0"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function v(e,t){var r,n,o=e.c,i=t.c,s=e.s,u=t.s,a=e.e,c=t.e;if(!s||!u)return null;if(r=o&&!o[0],n=i&&!i[0],r||n)return r?n?0:-u:s;if(s!=u)return s;if(r=s<0,n=a==c,!o||!i)return n?0:!o^r?1:-1;if(!n)return a>c^r?1:-1;for(u=(a=o.length)<(c=i.length)?a:c,s=0;s<u;s++)if(o[s]!=i[s])return o[s]>i[s]^r?1:-1;return a==c?0:a>c^r?1:-1}function b(e,t,r,n){if(e<t||e>r||e!==(e<0?u(e):a(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 x(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(i=function e(t){var r,n,o,i,O,E,S,N,U,j=z.prototype={constructor:z,toString:null,valueOf:null},B=new z(1),C=20,_=4,R=-7,D=21,P=-1e7,L=1e7,q=!1,M=1,k=0,F={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},I="0123456789abcdefghijklmnopqrstuvwxyz";function z(e,t){var r,i,u,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 o(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,I.length,"Base"),y=String(e),10==t)return J(w=new z(e instanceof z?e:y),C+w.e+1,_);if(d="number"==typeof e){if(0*e!=0)return o(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=I.slice(0,t),c=l=0,g=y.length;l<g;l++)if(r.indexOf(i=y.charAt(l))<0){if("."==i){if(l>c){c=g;continue}}else if(!u&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){u=!0,l=-1,c=0;continue}return o(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!==a(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 $(e,t,r,n){var o,i,s,u,a;if(null==r?r=_:b(r,0,8),!e.c)return e.toString();if(o=e.c[0],s=e.e,null==t)a=m(e.c),a=1==n||2==n&&s<=R?T(a,s):x(a,s,"0");else if(i=(e=J(new z(e),t,r)).e,u=(a=m(e.c)).length,1==n||2==n&&(t<=i||i<=R)){for(;u<t;a+="0",u++);a=T(a,i)}else if(t-=s,a=x(a,i,"0"),i+1>u){if(--t>0)for(a+=".";t--;a+="0");}else if((t+=i-u)>0)for(i+1==u&&(a+=".");t--;a+="0");return e.s<0&&o?"-"+a:a}function H(e,t){for(var r,n=1,o=new z(e[0]);n<e.length;n++){if(!(r=new z(e[n])).s){o=r;break}t.call(o,r)&&(o=r)}return o}function G(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=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 J(e,t,r,n){var o,i,s,c,f,h,g,y=e.c,w=d;if(y){e:{for(o=1,c=y[0];c>=10;c/=10,o++);if((i=t-o)<0)i+=p,s=t,g=(f=y[h=0])/w[o-s-1]%10|0;else if((h=u((i+1)/p))>=y.length){if(!n)break e;for(;y.length<=h;y.push(0));f=g=0,o=1,s=(i%=p)-p+1}else{for(f=c=y[h],o=1;c>=10;c/=10,o++);g=(s=(i%=p)-p+o)<0?0:f/w[o-s-1]%10|0}if(n=n||t<0||null!=y[h+1]||(s<0?f:f%w[o-s-1]),n=r<4?(g||n)&&(0==r||r==(e.s<0?3:2)):g>5||5==g&&(4==r||n||6==r&&(i>0?s>0?f/w[o-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==i?(y.length=h,c=1,h--):(y.length=h+1,c=w[p-i],y[h]=s>0?a(f/w[o-s]%w[s])*c:0),n)for(;;){if(0==h){for(i=1,s=y[0];s>=10;s/=10,i++);for(s=y[0]+=c,c=1;s>=10;s/=10,c++);i!=c&&(e.e++,y[0]==l&&(y[0]=1));break}if(y[h]+=c,y[h]!=l)break;y[h--]=0,c=1}for(i=y.length;0===y[--i];y.pop());}e.e>L?e.c=e.e=null:e.e<P&&(e.c=[e.e=0])}return e}function K(e){var t,r=e.e;return null===r?e.toString():(t=m(e.c),t=r<=R||r>=D?T(t,r):x(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),C=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 q=!r,Error(c+"crypto unavailable");q=r}else q=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(r=e[t],0,9,t),M=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);F=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);I=r}}return{DECIMAL_PLACES:C,ROUNDING_MODE:_,EXPONENTIAL_AT:[R,D],RANGE:[P,L],CRYPTO:q,MODULO_MODE:M,POW_PRECISION:k,FORMAT:F,ALPHABET:I}},z.isBigNumber=function(e){return e instanceof z||e&&!0===e._isBigNumber||!1},z.maximum=z.max=function(){return H(arguments,j.lt)},z.minimum=z.min=function(){return H(arguments,j.gt)},z.random=(i=9007199254740992*Math.random()&2097151?function(){return a(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,s,f=0,l=[],h=new z(B);if(null==e?e=C:b(e,0,y),o=u(e/p),q)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));f<o;)(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=o/2}else{if(!crypto.randomBytes)throw q=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(o*=7);f<o;)(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=o/7}if(!q)for(;f<o;)(s=i())<9e15&&(l[f++]=s%1e14);for(o=l[--f],e%=p,o&&e&&(s=d[p-e],l[f]=a(o/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 o,i,s=[0],u=0,a=e.length;u<a;){for(i=s.length;i--;s[i]*=t);for(s[0]+=n.indexOf(e.charAt(u++)),o=0;o<s.length;o++)s[o]>r-1&&(null==s[o+1]&&(s[o+1]=0),s[o+1]+=s[o]/r|0,s[o]%=r)}return s.reverse()}return function(t,n,o,i,s){var u,a,c,f,l,p,h,d,g=t.indexOf("."),y=C,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(x(m(p.c),p.e,"0"),10,o,"0123456789"),d.e=d.c.length),c=f=(h=e(t,n,o,s?(u=I,"0123456789"):(u="0123456789",I))).length;0==h[--f];h.pop());if(!h[0])return u.charAt(0);if(g<0?--c:(p.c=h,p.e=c,p.s=i,h=(p=r(p,d,y,w,o)).c,l=p.r,c=p.e),g=h[a=c+y+1],f=o/2,l=l||a<0||null!=h[a+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[a-1]||w==(p.s<0?8:7)),a<1||!h[0])t=l?x(u.charAt(1),-y,u.charAt(0)):u.charAt(0);else{if(h.length=a,l)for(--o;++h[--a]>o;)h[a]=0,a||(++c,h=[1].concat(h));for(f=h.length;!h[--f];);for(g=0,t="";g<=f;t+=u.charAt(h[g++]));t=x(t,c,u.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,o,i,s,u=0,a=e.length,c=t%g,f=t/g|0;for(e=e.slice();a--;)u=((o=c*(i=e[a]%g)+(n=f*i+(s=e[a]/g|0)*c)%g*g+u)/r|0)+(n/g|0)+f*s,e[a]=o%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;o<r;o++)if(e[o]!=t[o]){i=e[o]>t[o]?1:-1;break}return i}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,i,s,u){var c,f,h,d,g,y,m,v,b,A,T,x,O,E,S,N,U,j=n.s==o.s?1:-1,B=n.c,C=o.c;if(!(B&&B[0]&&C&&C[0]))return new z(n.s&&o.s&&(B?!C||B[0]!=C[0]:C)?B&&0==B[0]||!C?0*j:j/0:NaN);for(b=(v=new z(j)).c=[],j=i+(f=n.e-o.e)+1,u||(u=l,f=w(n.e/p)-w(o.e/p),j=j/p|0),h=0;C[h]==(B[h]||0);h++);if(C[h]>(B[h]||0)&&f--,j<0)b.push(1),d=!0;else{for(E=B.length,N=C.length,h=0,j+=2,(g=a(u/(C[0]+1)))>1&&(C=e(C,g,u),B=e(B,g,u),N=C.length,E=B.length),O=N,T=(A=B.slice(0,N)).length;T<N;A[T++]=0);U=C.slice(),U=[0].concat(U),S=C[0],C[1]>=u/2&&S++;do{if(g=0,(c=t(C,A,N,T))<0){if(x=A[0],N!=T&&(x=x*u+(A[1]||0)),(g=a(x/S))>1)for(g>=u&&(g=u-1),m=(y=e(C,g,u)).length,T=A.length;1==t(y,A,m,T);)g--,r(y,N<m?U:C,m,u),m=y.length,c=1;else 0==g&&(c=g=1),m=(y=C.slice()).length;if(m<T&&(y=[0].concat(y)),r(A,y,T,u),T=A.length,-1==c)for(;t(C,A,N,T)<1;)g++,r(A,N<T?U:C,T,u),T=A.length}else 0===c&&(g++,A=[0]);b[h++]=g,A[0]?A[T++]=B[O]||0:(A=[B[O]],T=1)}while((O++<E||null!=A[0])&&j--);d=null!=A[0],b[0]||b.splice(0,1)}if(u==l){for(h=1,j=b[0];j>=10;j/=10,h++);J(v,i+(v.e=h+f*p-1)+1,s,d)}else v.e=f,v.r=+d;return v}}(),O=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,S=/^\.([^.]+)$/,N=/^-?(Infinity|NaN)$/,U=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,i=r?t:t.replace(U,"");if(N.test(i))e.s=isNaN(i)?null:i<0?-1:1,e.c=e.e=null;else{if(!r&&(i=i.replace(O,function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t}),n&&(o=n,i=i.replace(E,"$1").replace(S,"0.$1")),t!=i))return new z(i,o);if(z.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.c=e.e=e.s=null}},j.absoluteValue=j.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},j.comparedTo=function(e,t){return v(this,new z(e,t))},j.decimalPlaces=j.dp=function(e,t){var r,n,o,i=this;if(null!=e)return b(e,0,y),null==t?t=_:b(t,0,8),J(new z(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-w(this.e/p))*p,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},j.dividedBy=j.div=function(e,t){return r(this,new z(e,t),C,_)},j.dividedToIntegerBy=j.idiv=function(e,t){return r(this,new z(e,t),0,1)},j.exponentiatedBy=j.pow=function(e,t){var r,n,o,i,s,f,l,h,d=this;if((e=new z(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+K(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(+K(d),s?2-A(e):+K(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 i=d.s<0&&A(e)?-0:0,d.e>-1&&(i=1/i),new z(f?1/i:i);k&&(i=u(k/p+2))}for(s?(r=new z(.5),f&&(e.s=1),l=A(e)):l=(o=Math.abs(+K(e)))%2,h=new z(B);;){if(l){if(!(h=h.times(d)).c)break;i?h.c.length>i&&(h.c.length=i):n&&(h=h.mod(t))}if(o){if(0===(o=a(o/2)))break;l=o%2}else if(J(e=e.times(r),e.e+1,1),e.e>14)l=A(e);else{if(0==(o=+K(e)))break;l=o%2}d=d.times(d),i?d.c&&d.c.length>i&&(d.c.length=i):n&&(d=d.mod(t))}return n?h:(f&&(h=B.div(h)),t?h.mod(t):i?J(h,k,_,void 0):h)},j.integerValue=function(e){var t=new z(this);return null==e?e=_:b(e,0,8),J(t,t.e+1,e)},j.isEqualTo=j.eq=function(e,t){return 0===v(this,new z(e,t))},j.isFinite=function(){return!!this.c},j.isGreaterThan=j.gt=function(e,t){return v(this,new z(e,t))>0},j.isGreaterThanOrEqualTo=j.gte=function(e,t){return 1===(t=v(this,new z(e,t)))||0===t},j.isInteger=function(){return!!this.c&&w(this.e/p)>this.c.length-2},j.isLessThan=j.lt=function(e,t){return v(this,new z(e,t))<0},j.isLessThanOrEqualTo=j.lte=function(e,t){return-1===(t=v(this,new z(e,t)))||0===t},j.isNaN=function(){return!this.s},j.isNegative=function(){return this.s<0},j.isPositive=function(){return this.s>0},j.isZero=function(){return!!this.c&&0==this.c[0]},j.minus=function(e,t){var r,n,o,i,s=this,u=s.s;if(t=(e=new z(e,t)).s,!u||!t)return new z(NaN);if(u!=t)return e.s=-t,s.plus(e);var a=s.e/p,c=e.e/p,f=s.c,h=e.c;if(!a||!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(a=w(a),c=w(c),f=f.slice(),u=a-c){for((i=u<0)?(u=-u,o=f):(c=a,o=h),o.reverse(),t=u;t--;o.push(0));o.reverse()}else for(n=(i=(u=f.length)<(t=h.length))?u:t,u=t=0;t<n;t++)if(f[t]!=h[t]){i=f[t]<h[t];break}if(i&&(o=f,f=h,h=o,e.s=-e.s),(t=(n=h.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=l-1;n>u;){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]?G(e,f,c):(e.s=3==_?-1:1,e.c=[e.e=0],e)},j.modulo=j.mod=function(e,t){var n,o,i=this;return e=new z(e,t),!i.c||!e.s||e.c&&!e.c[0]?new z(NaN):!e.c||i.c&&!i.c[0]?new z(i):(9==M?(o=e.s,e.s=1,n=r(i,e,0,3),e.s=o,n.s*=o):n=r(i,e,0,M),(e=i.minus(n.times(e))).c[0]||1!=M||(e.s=i.s),e)},j.multipliedBy=j.times=function(e,t){var r,n,o,i,s,u,a,c,f,h,d,y,m,v,b,A=this,T=A.c,x=(e=new z(e,t)).c;if(!(T&&x&&T[0]&&x[0]))return!A.s||!e.s||T&&!T[0]&&!x||x&&!x[0]&&!T?e.c=e.e=e.s=null:(e.s*=A.s,T&&x?(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,(a=T.length)<(h=x.length)&&(m=T,T=x,x=m,o=a,a=h,h=o),o=a+h,m=[];o--;m.push(0));for(v=l,b=g,o=h;--o>=0;){for(r=0,d=x[o]%b,y=x[o]/b|0,i=o+(s=a);i>o;)r=((c=d*(c=T[--s]%b)+(u=y*c+(f=T[s]/b|0)*d)%b*b+m[i]+r)/v|0)+(u/b|0)+y*f,m[i--]=c%v;m[i]=r}return r?++n:m.splice(0,1),G(e,m,n)},j.negated=function(){var e=new z(this);return e.s=-e.s||null,e},j.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new z(e,t)).s,!o||!t)return new z(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/p,s=e.e/p,u=n.c,a=e.c;if(!i||!s){if(!u||!a)return new z(o/0);if(!u[0]||!a[0])return a[0]?e:new z(u[0]?n:0*o)}if(i=w(i),s=w(s),u=u.slice(),o=i-s){for(o>0?(s=i,r=a):(o=-o,r=u),r.reverse();o--;r.push(0));r.reverse()}for((o=u.length)-(t=a.length)<0&&(r=a,a=u,u=r,t=o),o=0;t;)o=(u[--t]=u[t]+a[t]+o)/l|0,u[t]=l===u[t]?0:u[t]%l;return o&&(u=[o].concat(u),++s),G(e,u,s)},j.precision=j.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return b(e,1,y),null==t?t=_:b(t,0,8),J(new z(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*p+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},j.shiftedBy=function(e){return b(e,-h,h),this.times("1e"+e)},j.squareRoot=j.sqrt=function(){var e,t,n,o,i,s=this,u=s.c,a=s.s,c=s.e,f=C+4,l=new z("0.5");if(1!==a||!u||!u[0])return new z(!a||a<0&&(!u||u[0])?NaN:u?s:1/0);if(0==(a=Math.sqrt(+K(s)))||a==1/0?(((t=m(u)).length+c)%2==0&&(t+="0"),a=Math.sqrt(+t),c=w((c+1)/2)-(c<0||c%2),n=new z(t=a==1/0?"1e"+c:(t=a.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new z(a+""),n.c[0])for((a=(c=n.e)+f)<3&&(a=0);;)if(i=n,n=l.times(i.plus(r(s,i,f,1))),m(i.c).slice(0,a)===(t=m(n.c)).slice(0,a)){if(n.e<c&&--a,"9999"!=(t=t.slice(a-3,a+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(J(n,n.e+C+2,1),e=!n.times(n).eq(s));break}if(!o&&(J(i,i.e+C+2,0),i.times(i).eq(s))){n=i;break}f+=4,a+=4,o=1}return J(n,n.e+C+1,_,e)},j.toExponential=function(e,t){return null!=e&&(b(e,0,y),e++),$(this,e,t,1)},j.toFixed=function(e,t){return null!=e&&(b(e,0,y),e=e+this.e+1),$(this,e,t)},j.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=F;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var i,s=n.split("."),u=+r.groupSize,a=+r.secondaryGroupSize,f=r.groupSeparator||"",l=s[0],p=s[1],h=o.s<0,d=h?l.slice(1):l,g=d.length;if(a&&(i=u,u=a,a=i,g-=i),u>0&&g>0){for(i=g%u||u,l=d.substr(0,i);i<g;i+=u)l+=f+d.substr(i,u);a>0&&(l+=f+d.slice(i)),h&&(l="-"+l)}n=p?l+(r.decimalSeparator||"")+((a=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):l}return(r.prefix||"")+n+(r.suffix||"")},j.toFraction=function(e){var t,n,o,i,s,u,a,f,l,h,g,y,w=this,v=w.c;if(null!=e&&(!(a=new z(e)).isInteger()&&(a.c||1!==a.s)||a.lt(B)))throw Error(c+"Argument "+(a.isInteger()?"out of range: ":"not an integer: ")+K(a));if(!v)return new z(w);for(t=new z(B),l=n=new z(B),o=f=new z(B),y=m(v),s=t.e=y.length-w.e-1,t.c[0]=d[(u=s%p)<0?p+u:u],e=!e||a.comparedTo(t)>0?s>0?t:l:a,u=L,L=1/0,a=new z(y),f.c[0]=0;h=r(a,t,0,1),1!=(i=n.plus(h.times(o))).comparedTo(e);)n=o,o=i,l=f.plus(h.times(i=l)),f=i,t=a.minus(h.times(i=t)),a=i;return i=r(e.minus(n),o,0,1),f=f.plus(i.times(l)),n=n.plus(i.times(o)),f.s=l.s=w.s,g=r(l,o,s*=2,_).minus(w).abs().comparedTo(r(f,n,s,_).minus(w).abs())<1?[l,o]:[f,n],L=u,g},j.toNumber=function(){return+K(this)},j.toPrecision=function(e,t){return null!=e&&b(e,1,y),$(this,e,t,2)},j.toString=function(e){var t,r=this,o=r.s,i=r.e;return null===i?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(t=m(r.c),null==e?t=i<=R||i>=D?T(t,i):x(t,i,"0"):(b(e,2,I.length,"Base"),t=n(x(t,i,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},j.valueOf=j.toJSON=function(){return K(this)},j._isBigNumber=!0,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(j[Symbol.toStringTag]="BigNumber",j[Symbol.for("nodejs.util.inspect.custom")]=j.valueOf),null!=t&&z.set(t),z}()).default=i.BigNumber=i,void 0===(n=function(){return i}.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),o=r(3),i=r(19),s=r(2);function u(e){var t=new i(e),r=o(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var a=u(s);a.Axios=i,a.create=function(e){return u(n.merge(s,e))},a.Cancel=r(8),a.CancelToken=r(33),a.isCancel=r(7),a.all=function(e){return Promise.all(e)},a.spread=r(34),e.exports=a,e.exports.default=a},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(3),i=r(18),o=Object.prototype.toString;function s(e){return"[object Array]"===o.call(e)}function u(e){return null!==e&&"object"==typeof e}function a(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:u,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:a,isStream:function(e){return u(e)&&a(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(10).TextDecoder)("utf-8",{fatal:!0}).decode(t)}return new TextDecoder("utf-8",{fatal:!0}).decode(t)}static stringToBuffer(e){if("undefined"==typeof TextEncoder){return(new(0,r(10).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 u,a={adapter:("undefined"!=typeof XMLHttpRequest?u=r(5):void 0!==t&&(u=r(5)),u),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}};a.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],function(e){a.headers[e]={}}),n.forEach(["post","put","patch"],function(e){a.headers[e]=n.merge(o)}),e.exports=a}).call(this,r(4))},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 u(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 a,c=[],f=!1,l=-1;function p(){f&&a&&(f=!1,a.length?c=a.concat(c):l=-1,c.length&&h())}function h(){if(!f){var e=u(p);f=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=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||u(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),u=r(25),a=r(6),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||u(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(a("Network Error",e,null,h)),h=null},h.ontimeout=function(){f(a("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var m=r(27),v=(e.withCredentials||u(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){(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(u(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}}),a=n[r];r<o;a=n[++r])g(a)||!b(a)?s+=" "+a:s+=" "+u(a);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 u(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=a),f(n,e,n.depth)}function a(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function c(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&x(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),u=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(x(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","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,O=["{","}"];(h(r)&&(E=!0,O=["[","]"]),x(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,u=t.length;s<u;++s)N(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,u,s):s.map(function(t){return p(e,r,n,u,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,O)):O[0]+b+O[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,o){var s,u,a;if((a=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?u=a.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):a.set&&(u=e.stylize("[Setter]","special")),N(n,i)||(s="["+i+"]"),u||(e.seen.indexOf(a.value)<0?(u=g(r)?f(e,a.value,null):f(e,a.value,r-1)).indexOf("\n")>-1&&(u=o?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n")):u=e.stylize("[Circular]","special")),m(s)){if(o&&i.match(/^\d+$/))return u;(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+": "+u}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 x(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function O(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=u,u.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]},u.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=x,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 S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[O(e.getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":"),[e.getDate(),S[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(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(43);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),u=r(42),a=r(9),c=r(1);t.Arweave=class{constructor(e){this.crypto=e.crypto,this.api=new i.Api(e.api),this.wallets=new u.Wallets(this.api,e.crypto),this.transactions=new s.Transactions(this.api,e.crypto),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 a.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,u=Math.ceil,a=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,u=t.s,a=e.e,c=t.e;if(!s||!u)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-u:s;if(s!=u)return s;if(r=s<0,n=a==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return a>c^r?1:-1;for(u=(a=i.length)<(c=o.length)?a:c,s=0;s<u;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return a==c?0:a>c^r?1:-1}function b(e,t,r,n){if(e<t||e>r||e!==(e<0?u(e):a(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 x(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,O,S,N,U,j=z.prototype={constructor:z,toString:null,valueOf:null},B=new z(1),C=20,_=4,R=-7,D=21,P=-1e7,L=1e7,q=!1,k=1,I=0,M={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz";function z(e,t){var r,o,u,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 K(w=new z(e instanceof z?e:y),C+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(!u&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){u=!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!==a(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 $(e,t,r,n){var i,o,s,u,a;if(null==r?r=_:b(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)a=m(e.c),a=1==n||2==n&&s<=R?T(a,s):x(a,s,"0");else if(o=(e=K(new z(e),t,r)).e,u=(a=m(e.c)).length,1==n||2==n&&(t<=o||o<=R)){for(;u<t;a+="0",u++);a=T(a,o)}else if(t-=s,a=x(a,o,"0"),o+1>u){if(--t>0)for(a+=".";t--;a+="0");}else if((t+=o-u)>0)for(o+1==u&&(a+=".");t--;a+="0");return e.s<0&&i?"-"+a:a}function H(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 G(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 K(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=u((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?a(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<=R||r>=D?T(t,r):x(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),C=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 q=!r,Error(c+"crypto unavailable");q=r}else q=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(r=e[t],0,9,t),k=r),e.hasOwnProperty(t="POW_PRECISION")&&(b(r=e[t],0,y,t),I=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:C,ROUNDING_MODE:_,EXPONENTIAL_AT:[R,D],RANGE:[P,L],CRYPTO:q,MODULO_MODE:k,POW_PRECISION:I,FORMAT:M,ALPHABET:F}},z.isBigNumber=function(e){return e instanceof z||e&&!0===e._isBigNumber||!1},z.maximum=z.max=function(){return H(arguments,j.lt)},z.minimum=z.min=function(){return H(arguments,j.gt)},z.random=(o=9007199254740992*Math.random()&2097151?function(){return a(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(B);if(null==e?e=C:b(e,0,y),i=u(e/p),q)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 q=!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(!q)for(;f<i;)(s=o())<9e15&&(l[f++]=s%1e14);for(i=l[--f],e%=p,i&&e&&(s=d[p-e],l[f]=a(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],u=0,a=e.length;u<a;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(u++)),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 u,a,c,f,l,p,h,d,g=t.indexOf("."),y=C,w=_;for(g>=0&&(f=I,I=0,t=t.replace(".",""),p=(d=new z(n)).pow(t.length-g),I=f,d.c=e(x(m(p.c),p.e,"0"),10,i,"0123456789"),d.e=d.c.length),c=f=(h=e(t,n,i,s?(u=F,"0123456789"):(u="0123456789",F))).length;0==h[--f];h.pop());if(!h[0])return u.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[a=c+y+1],f=i/2,l=l||a<0||null!=h[a+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[a-1]||w==(p.s<0?8:7)),a<1||!h[0])t=l?x(u.charAt(1),-y,u.charAt(0)):u.charAt(0);else{if(h.length=a,l)for(--i;++h[--a]>i;)h[a]=0,a||(++c,h=[1].concat(h));for(f=h.length;!h[--f];);for(g=0,t="";g<=f;t+=u.charAt(h[g++]));t=x(t,c,u.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,o,s,u=0,a=e.length,c=t%g,f=t/g|0;for(e=e.slice();a--;)u=((i=c*(o=e[a]%g)+(n=f*o+(s=e[a]/g|0)*c)%g*g+u)/r|0)+(n/g|0)+f*s,e[a]=i%r;return u&&(e=[u].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,u){var c,f,h,d,g,y,m,v,b,A,T,x,E,O,S,N,U,j=n.s==i.s?1:-1,B=n.c,C=i.c;if(!(B&&B[0]&&C&&C[0]))return new z(n.s&&i.s&&(B?!C||B[0]!=C[0]:C)?B&&0==B[0]||!C?0*j:j/0:NaN);for(b=(v=new z(j)).c=[],j=o+(f=n.e-i.e)+1,u||(u=l,f=w(n.e/p)-w(i.e/p),j=j/p|0),h=0;C[h]==(B[h]||0);h++);if(C[h]>(B[h]||0)&&f--,j<0)b.push(1),d=!0;else{for(O=B.length,N=C.length,h=0,j+=2,(g=a(u/(C[0]+1)))>1&&(C=e(C,g,u),B=e(B,g,u),N=C.length,O=B.length),E=N,T=(A=B.slice(0,N)).length;T<N;A[T++]=0);U=C.slice(),U=[0].concat(U),S=C[0],C[1]>=u/2&&S++;do{if(g=0,(c=t(C,A,N,T))<0){if(x=A[0],N!=T&&(x=x*u+(A[1]||0)),(g=a(x/S))>1)for(g>=u&&(g=u-1),m=(y=e(C,g,u)).length,T=A.length;1==t(y,A,m,T);)g--,r(y,N<m?U:C,m,u),m=y.length,c=1;else 0==g&&(c=g=1),m=(y=C.slice()).length;if(m<T&&(y=[0].concat(y)),r(A,y,T,u),T=A.length,-1==c)for(;t(C,A,N,T)<1;)g++,r(A,N<T?U:C,T,u),T=A.length}else 0===c&&(g++,A=[0]);b[h++]=g,A[0]?A[T++]=B[E]||0:(A=[B[E]],T=1)}while((E++<O||null!=A[0])&&j--);d=null!=A[0],b[0]||b.splice(0,1)}if(u==l){for(h=1,j=b[0];j>=10;j/=10,h++);K(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,O=/^([^.]+)\.$/,S=/^\.([^.]+)$/,N=/^-?(Infinity|NaN)$/,U=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(U,"");if(N.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(O,"$1").replace(S,"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}},j.absoluteValue=j.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},j.comparedTo=function(e,t){return v(this,new z(e,t))},j.decimalPlaces=j.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),K(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},j.dividedBy=j.div=function(e,t){return r(this,new z(e,t),C,_)},j.dividedToIntegerBy=j.idiv=function(e,t){return r(this,new z(e,t),0,1)},j.exponentiatedBy=j.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);I&&(o=u(I/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(B);;){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=a(i/2)))break;l=i%2}else if(K(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=B.div(h)),t?h.mod(t):o?K(h,I,_,void 0):h)},j.integerValue=function(e){var t=new z(this);return null==e?e=_:b(e,0,8),K(t,t.e+1,e)},j.isEqualTo=j.eq=function(e,t){return 0===v(this,new z(e,t))},j.isFinite=function(){return!!this.c},j.isGreaterThan=j.gt=function(e,t){return v(this,new z(e,t))>0},j.isGreaterThanOrEqualTo=j.gte=function(e,t){return 1===(t=v(this,new z(e,t)))||0===t},j.isInteger=function(){return!!this.c&&w(this.e/p)>this.c.length-2},j.isLessThan=j.lt=function(e,t){return v(this,new z(e,t))<0},j.isLessThanOrEqualTo=j.lte=function(e,t){return-1===(t=v(this,new z(e,t)))||0===t},j.isNaN=function(){return!this.s},j.isNegative=function(){return this.s<0},j.isPositive=function(){return this.s>0},j.isZero=function(){return!!this.c&&0==this.c[0]},j.minus=function(e,t){var r,n,i,o,s=this,u=s.s;if(t=(e=new z(e,t)).s,!u||!t)return new z(NaN);if(u!=t)return e.s=-t,s.plus(e);var a=s.e/p,c=e.e/p,f=s.c,h=e.c;if(!a||!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(a=w(a),c=w(c),f=f.slice(),u=a-c){for((o=u<0)?(u=-u,i=f):(c=a,i=h),i.reverse(),t=u;t--;i.push(0));i.reverse()}else for(n=(o=(u=f.length)<(t=h.length))?u:t,u=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>u;){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]?G(e,f,c):(e.s=3==_?-1:1,e.c=[e.e=0],e)},j.modulo=j.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==k?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,k),(e=o.minus(n.times(e))).c[0]||1!=k||(e.s=o.s),e)},j.multipliedBy=j.times=function(e,t){var r,n,i,o,s,u,a,c,f,h,d,y,m,v,b,A=this,T=A.c,x=(e=new z(e,t)).c;if(!(T&&x&&T[0]&&x[0]))return!A.s||!e.s||T&&!T[0]&&!x||x&&!x[0]&&!T?e.c=e.e=e.s=null:(e.s*=A.s,T&&x?(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,(a=T.length)<(h=x.length)&&(m=T,T=x,x=m,i=a,a=h,h=i),i=a+h,m=[];i--;m.push(0));for(v=l,b=g,i=h;--i>=0;){for(r=0,d=x[i]%b,y=x[i]/b|0,o=i+(s=a);o>i;)r=((c=d*(c=T[--s]%b)+(u=y*c+(f=T[s]/b|0)*d)%b*b+m[o]+r)/v|0)+(u/b|0)+y*f,m[o--]=c%v;m[o]=r}return r?++n:m.splice(0,1),G(e,m,n)},j.negated=function(){var e=new z(this);return e.s=-e.s||null,e},j.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,u=n.c,a=e.c;if(!o||!s){if(!u||!a)return new z(i/0);if(!u[0]||!a[0])return a[0]?e:new z(u[0]?n:0*i)}if(o=w(o),s=w(s),u=u.slice(),i=o-s){for(i>0?(s=o,r=a):(i=-i,r=u),r.reverse();i--;r.push(0));r.reverse()}for((i=u.length)-(t=a.length)<0&&(r=a,a=u,u=r,t=i),i=0;t;)i=(u[--t]=u[t]+a[t]+i)/l|0,u[t]=l===u[t]?0:u[t]%l;return i&&(u=[i].concat(u),++s),G(e,u,s)},j.precision=j.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),K(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},j.shiftedBy=function(e){return b(e,-h,h),this.times("1e"+e)},j.squareRoot=j.sqrt=function(){var e,t,n,i,o,s=this,u=s.c,a=s.s,c=s.e,f=C+4,l=new z("0.5");if(1!==a||!u||!u[0])return new z(!a||a<0&&(!u||u[0])?NaN:u?s:1/0);if(0==(a=Math.sqrt(+J(s)))||a==1/0?(((t=m(u)).length+c)%2==0&&(t+="0"),a=Math.sqrt(+t),c=w((c+1)/2)-(c<0||c%2),n=new z(t=a==1/0?"1e"+c:(t=a.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new z(a+""),n.c[0])for((a=(c=n.e)+f)<3&&(a=0);;)if(o=n,n=l.times(o.plus(r(s,o,f,1))),m(o.c).slice(0,a)===(t=m(n.c)).slice(0,a)){if(n.e<c&&--a,"9999"!=(t=t.slice(a-3,a+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(K(n,n.e+C+2,1),e=!n.times(n).eq(s));break}if(!i&&(K(o,o.e+C+2,0),o.times(o).eq(s))){n=o;break}f+=4,a+=4,i=1}return K(n,n.e+C+1,_,e)},j.toExponential=function(e,t){return null!=e&&(b(e,0,y),e++),$(this,e,t,1)},j.toFixed=function(e,t){return null!=e&&(b(e,0,y),e=e+this.e+1),$(this,e,t)},j.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("."),u=+r.groupSize,a=+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(a&&(o=u,u=a,a=o,g-=o),u>0&&g>0){for(o=g%u||u,l=d.substr(0,o);o<g;o+=u)l+=f+d.substr(o,u);a>0&&(l+=f+d.slice(o)),h&&(l="-"+l)}n=p?l+(r.decimalSeparator||"")+((a=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):l}return(r.prefix||"")+n+(r.suffix||"")},j.toFraction=function(e){var t,n,i,o,s,u,a,f,l,h,g,y,w=this,v=w.c;if(null!=e&&(!(a=new z(e)).isInteger()&&(a.c||1!==a.s)||a.lt(B)))throw Error(c+"Argument "+(a.isInteger()?"out of range: ":"not an integer: ")+J(a));if(!v)return new z(w);for(t=new z(B),l=n=new z(B),i=f=new z(B),y=m(v),s=t.e=y.length-w.e-1,t.c[0]=d[(u=s%p)<0?p+u:u],e=!e||a.comparedTo(t)>0?s>0?t:l:a,u=L,L=1/0,a=new z(y),f.c[0]=0;h=r(a,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=a.minus(h.times(o=t)),a=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=u,g},j.toNumber=function(){return+J(this)},j.toPrecision=function(e,t){return null!=e&&b(e,1,y),$(this,e,t,2)},j.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):x(t,o,"0"):(b(e,2,F.length,"Base"),t=n(x(t,o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},j.valueOf=j.toJSON=function(){return J(this)},j._isBigNumber=!0,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(j[Symbol.toStringTag]="BigNumber",j[Symbol.for("nodejs.util.inspect.custom")]=j.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(3),o=r(19),s=r(2);function u(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 a=u(s);a.Axios=o,a.create=function(e){return u(n.merge(s,e))},a.Cancel=r(8),a.CancelToken=r(33),a.isCancel=r(7),a.all=function(e){return Promise.all(e)},a.spread=r(34),e.exports=a,e.exports.default=a},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),o=r(0),i=r(28),s=r(29);function u(e){this.defaults=e,this.interceptors={request:new i,response:new i}}u.prototype.request=function(e){"string"==typeof e&&(e=o.merge({url:arguments[0]},arguments[1])),(e=o.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},o.forEach(["delete","get","head","options"],function(e){u.prototype[e]=function(t,r){return this.request(o.merge(r||{},{method:e,url:t}))}}),o.forEach(["post","put","patch"],function(e){u.prototype[e]=function(t,r,n){return this.request(o.merge(n||{},{method:e,url:t,data:r}))}}),e.exports=u},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(6);e.exports=function(e,t,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e}},function(e,t,r){"use strict";var n=r(0);function o(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 i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=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(o(t)+"="+o(e))}))}),i=s.join("&")}return i&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t,r){"use strict";var n=r(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,s={};return e?(n.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(s[t]&&o.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 o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function o(){this.message="String contains an invalid character"}o.prototype=new Error,o.prototype.code=5,o.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,r,i=String(e),s="",u=0,a=n;i.charAt(0|u)||(a="=",u%1);s+=a.charAt(63&t>>8-u%1*8)){if((r=i.charCodeAt(u+=.75))>255)throw new o;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,o,i,s){var u=[];u.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),n.isString(o)&&u.push("path="+o),n.isString(i)&&u.push("domain="+i),!0===s&&u.push("secure"),document.cookie=u.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 o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=o},function(e,t,r){"use strict";var n=r(0),o=r(30),i=r(7),s=r(2),u=r(31),a=r(32);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return c(e),e.baseURL&&!u(e.url)&&(e.url=a(e.baseURL,e.url)),e.headers=e.headers||{},e.data=o(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=o(t.data,t.headers,e.transformResponse),t},function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=o(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(8);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var r=this;e(function(e){r.reason||(r.reason=new n(e),t(r.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o(function(t){e=t}),cancel:e}},e.exports=o},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),o=r(9),i=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(e=>{if(200==e.status)return new o.Transaction(e.data);202==e.status&&new n.ArweaveError("TX_PENDING"),404==e.status&&new n.ArweaveError("TX_NOT_FOUND"),410==e.status&&new n.ArweaveError("TX_FAILED")})}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),o=await this.crypto.hash(n);return e.setSignature({signature:i.ArweaveUtils.bufferTob64Url(n),id:i.ArweaveUtils.bufferTob64Url(o)}),e}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],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,n,s)),a=0,f=s>0?n-4:n,l=0;l<f;l+=4)t=o[e.charCodeAt(l)]<<18|o[e.charCodeAt(l+1)]<<12|o[e.charCodeAt(l+2)]<<6|o[e.charCodeAt(l+3)],u[a++]=t>>16&255,u[a++]=t>>8&255,u[a++]=255&t;2===s&&(t=o[e.charCodeAt(l)]<<2|o[e.charCodeAt(l+1)]>>4,u[a++]=255&t);1===s&&(t=o[e.charCodeAt(l)]<<10|o[e.charCodeAt(l+1)]<<4|o[e.charCodeAt(l+2)]>>2,u[a++]=t>>8&255,u[a++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],s=0,u=r-o;s<u;s+=16383)i.push(f(e,s,s+16383>u?u:s+16383));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,a=s.length;u<a;++u)n[u]=s[u],o[s.charCodeAt(u)]=u;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 o,i,s=[],u=t;u<r;u+=3)o=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(255&e[u+2]),s.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".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});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 jwkToCryptoKey(e){return this.driver.importKey("jwk",e,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}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}}}]);
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 u(e){this.defaults=e,this.interceptors={request:new o,response:new o}}u.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){u.prototype[e]=function(t,r){return this.request(i.merge(r||{},{method:e,url:t}))}}),i.forEach(["post","put","patch"],function(e){u.prototype[e]=function(t,r,n){return this.request(i.merge(n||{},{method:e,url:t,data:r}))}}),e.exports=u},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(6);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="",u=0,a=n;o.charAt(0|u)||(a="=",u%1);s+=a.charAt(63&t>>8-u%1*8)){if((r=o.charCodeAt(u+=.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 u=[];u.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),n.isString(i)&&u.push("path="+i),n.isString(o)&&u.push("domain="+o),!0===s&&u.push("secure"),document.cookie=u.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(7),s=r(2),u=r(31),a=r(32);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return c(e),e.baseURL&&!u(e.url)&&(e.url=a(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(8);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(9),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);202==t.status&&new n.ArweaveError("TX_PENDING"),404==t.status&&new n.ArweaveError("TX_NOT_FOUND"),410==t.status&&new n.ArweaveError("TX_FAILED"),new n.ArweaveError("TX_INVALID")})}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],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,n,s)),a=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)],u[a++]=t>>16&255,u[a++]=t>>8&255,u[a++]=255&t;2===s&&(t=i[e.charCodeAt(l)]<<2|i[e.charCodeAt(l+1)]>>4,u[a++]=255&t);1===s&&(t=i[e.charCodeAt(l)]<<10|i[e.charCodeAt(l+1)]<<4|i[e.charCodeAt(l+2)]>>2,u[a++]=t>>8&255,u[a++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=0,u=r-i;s<u;s+=16383)o.push(f(e,s,s+16383>u?u: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+/",u=0,a=s.length;u<a;++u)n[u]=s[u],i[s.charCodeAt(u)]=u;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=[],u=t;u<r;u+=3)i=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(255&e[u+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});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}}}]);

@@ -5,3 +5,4 @@ import { JWKInterface } from "../Wallet";

sign(jwk: JWKInterface, data: Uint8Array): Promise<Uint8Array>;
verify(publicModulus: string, data: Uint8Array, signature: Uint8Array): Promise<boolean>;
hash(data: Uint8Array): Promise<Uint8Array>;
}

@@ -9,11 +9,7 @@ /// <reference types="node" />

generateJWK(): Promise<JWKInterface>;
/**
*
* @param jwk
* @param data
*/
sign(jwk: object, data: Uint8Array): Promise<Uint8Array>;
verify(publicModulus: string, data: Uint8Array, signature: Uint8Array): Promise<boolean>;
hash(data: Buffer): Promise<Uint8Array>;
private jwkToPem;
jwkToPem(jwk: object): string;
private pemToJWK;
}

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

import { pem2jwk, jwk2pem } from "./pem";
import { pemTojwk, jwkTopem } from "./pem";
const crypto = require('crypto');

@@ -10,4 +10,4 @@ export class NodeCryptoDriver {

generateJWK() {
if (typeof !crypto.generateKeyPair == 'function') {
throw new Error('Keypair generation not supported in this version of Node, only supported in versions 10.x+');
if (typeof crypto.generateKeyPair != "function") {
throw new Error('Keypair generation not supported in this version of Node, only supported in versions 10+');
}

@@ -35,7 +35,2 @@ return new Promise((resolve, reject) => {

}
/**
*
* @param jwk
* @param data
*/
sign(jwk, data) {

@@ -53,2 +48,20 @@ return new Promise((resolve, reject) => {

}
verify(publicModulus, data, signature) {
return new Promise((resolve, reject) => {
const publicKey = {
kty: 'RSA',
e: 'AQAB',
n: publicModulus,
};
const pem = this.jwkToPem(publicKey);
resolve(crypto
.createVerify(this.hashAlgorithm)
.update(data)
.verify({
key: pem,
padding: crypto.constants.RSA_PKCS1_PSS_PADDING,
saltLength: 0
}, signature));
});
}
hash(data) {

@@ -63,6 +76,6 @@ return new Promise((resolve, reject) => {

jwkToPem(jwk) {
return jwk2pem(jwk);
return jwkTopem(jwk);
}
pemToJWK(pem) {
let jwk = pem2jwk(pem);
let jwk = pemTojwk(pem);
return jwk;

@@ -69,0 +82,0 @@ }

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

export declare function pem2jwk(pem: any, extras?: any): any;
export declare function jwk2pem(json: any): any;
export declare function pemTojwk(pem: any, extras?: any): any;
export declare function jwkTopem(json: any): any;

@@ -118,3 +118,3 @@ // @ts-ignore

}
export function pem2jwk(pem, extras) {
export function pemTojwk(pem, extras) {
var text = pem.toString().split(/(\r\n|\r|\n)+/g);

@@ -128,3 +128,3 @@ text = text.filter(function (line) {

}
export function jwk2pem(json) {
export function jwkTopem(json) {
var jwk = parse(json);

@@ -131,0 +131,0 @@ var isPrivate = !!(jwk.d);

@@ -10,11 +10,8 @@ import { JWKInterface } from "../Wallet";

generateJWK(): Promise<JWKInterface>;
/**
*
* @param jwk
* @param data
*/
sign(jwk: JWKInterface, data: any): Promise<Uint8Array>;
sign(jwk: JWKInterface, data: Uint8Array): Promise<Uint8Array>;
hash(data: Uint8Array): Promise<Uint8Array>;
verify(publicModulus: string, data: Uint8Array, signature: Uint8Array): Promise<boolean>;
private jwkToCryptoKey;
private jwkToPublicCryptoKey;
private detectWebCrypto;
}

@@ -37,7 +37,2 @@ export class WebCryptoDriver {

}
/**
*
* @param jwk
* @param data
*/
async sign(jwk, data) {

@@ -58,2 +53,14 @@ let signature = await this

}
async verify(publicModulus, data, signature) {
const publicKey = {
kty: 'RSA',
e: 'AQAB',
n: publicModulus,
};
const key = await this.jwkToPublicCryptoKey(publicKey);
return this.driver.verify({
name: 'RSA-PSS',
saltLength: 0,
}, key, signature, data);
}
async jwkToCryptoKey(jwk) {

@@ -65,4 +72,12 @@ return this.driver.importKey('jwk', jwk, {

}
}, false, ['sign']);
}, false, ["sign"]);
}
async jwkToPublicCryptoKey(publicJwk) {
return this.driver.importKey('jwk', publicJwk, {
name: 'RSA-PSS',
hash: {
name: 'SHA-256',
}
}, false, ["verify"]);
}
detectWebCrypto() {

@@ -69,0 +84,0 @@ if (!window || !window.crypto || !window.crypto.subtle) {

@@ -5,3 +5,4 @@ import { AxiosResponse } from "axios";

TX_NOT_FOUND = "TX_NOT_FOUND",
TX_FAILED = "TX_FAILED"
TX_FAILED = "TX_FAILED",
TX_INVALID = "TX_INVALID"
}

@@ -8,0 +9,0 @@ export declare class ArweaveError extends Error {

@@ -12,1 +12,6 @@ export interface JWKInterface {

}
export interface JWKPublicInterface {
kty: string;
e: string;
n: string;
}

@@ -15,3 +15,4 @@ /// <reference types="node" />

sign(transaction: Transaction, jwk: JWKInterface): Promise<Transaction>;
verify(transaction: Transaction): Promise<boolean>;
post(transaction: Transaction | Buffer | string | object): Promise<AxiosResponse>;
}

@@ -30,3 +30,3 @@ import { ArweaveError } from './lib/error';

return this.api.get(`tx/${id}`).then(response => {
if (response.status == 200) {
if (response.status == 200 && response.data && response.data.id == id) {
return new Transaction(response.data);

@@ -43,2 +43,3 @@ }

}
new ArweaveError("TX_INVALID" /* TX_INVALID */);
});

@@ -61,2 +62,18 @@ }

}
async verify(transaction) {
const signaturePayload = transaction.getSignatureData();
/**
* The transaction ID should be a SHA-256 hash of the raw signature bytes, so this needs
* to be recalculated from the signature and checked against the transaction ID.
*/
const rawSignature = transaction.get('signature', { decode: true, string: false });
const expectedId = ArweaveUtils.bufferTob64Url(await this.crypto.hash(rawSignature));
if (transaction.id !== expectedId) {
throw new Error(`Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.`);
}
/**
* Now verify the signature is valid and signed by the owner wallet (owner field = originating wallet public key).
*/
return this.crypto.verify(transaction.owner, signaturePayload, rawSignature);
}
post(transaction) {

@@ -63,0 +80,0 @@ return this.api.post(`tx`, transaction).then(response => {

import { Arweave } from "./arweave/arweave";
import { WebCryptoDriver } from "./arweave/lib/crypto/webcrypto-driver";
window.arweave = {
window.Arweave = {
init(apiConfig) {

@@ -5,0 +5,0 @@ return new Arweave({

{
"name": "arweave",
"version": "0.1.0",
"version": "1.0.0",
"description": "Arweave JS client library",

@@ -9,9 +9,7 @@ "main": "index.js",

"compile:web": "tsc --declaration -project tsconfig.web.json",
"build:node": "npx webpack --config-name node",
"build:web": "npx webpack --config-name web",
"build:web-prod": "npx webpack --config-name web-prod",
"profile:node": "npx webpack --config-name node --json > ./node.profile.json && npx webpack-bundle-analyzer ./node.profile.json",
"bundle:web": "npx webpack --config-name web",
"bundle:web-prod": "npx webpack --config-name web-prod",
"profile:web": "npx webpack --config-name web --json > ./web.profile.json && npx webpack-bundle-analyzer ./web.profile.json",
"build": "npm run compile:node && npm run compile:web && npm run build:node && npm run build:web && npm run build:web-prod",
"test": "mocha"
"build": "npm run compile:node && npm run compile:web && npm run bundle:web && npm run bundle:web-prod",
"test": "mocha --require ts-node/register test/*.ts"
},

@@ -38,2 +36,4 @@ "repository": {

"devDependencies": {
"@types/chai": "^4.1.7",
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.10",

@@ -43,2 +43,3 @@ "chai": "^4.2.0",

"ts-loader": "^5.3.0",
"ts-node": "^7.0.1",
"typescript": "^3.1.6",

@@ -59,2 +60,2 @@ "webpack": "^4.25.1",

}
}
}

@@ -9,3 +9,5 @@ import { JWKInterface } from "../Wallet";

hash(data: Uint8Array): Promise<Uint8Array>
verify(publicModulus: string, data: Uint8Array, signature: Uint8Array): Promise<boolean>
hash(data: Uint8Array): Promise<Uint8Array>
}
import { JWKInterface } from "../Wallet";
import { CryptoInterface } from "./crypto-interface";
import {pem2jwk, jwk2pem} from "./pem";
import { pemTojwk, jwkTopem } from "./pem";

@@ -14,6 +14,5 @@ const crypto = require('crypto');

generateJWK(): Promise<JWKInterface> {
if (typeof !crypto.generateKeyPair == 'function') {
throw new Error('Keypair generation not supported in this version of Node, only supported in versions 10.x+');
public generateJWK(): Promise<JWKInterface> {
if (typeof crypto.generateKeyPair != "function") {
throw new Error('Keypair generation not supported in this version of Node, only supported in versions 10+');
}

@@ -43,8 +42,3 @@

/**
*
* @param jwk
* @param data
*/
sign(jwk: object, data: Uint8Array): Promise<Uint8Array>{
public sign(jwk: object, data: Uint8Array): Promise<Uint8Array> {
return new Promise((resolve, reject) => {

@@ -62,5 +56,28 @@ resolve(crypto

hash(data: Buffer): Promise<Uint8Array> {
public verify(publicModulus: string, data: Uint8Array, signature: Uint8Array): Promise<boolean> {
return new Promise((resolve, reject) => {
const publicKey = {
kty: 'RSA',
e: 'AQAB',
n: publicModulus,
};
const pem = this.jwkToPem(publicKey);
resolve(crypto
.createVerify(this.hashAlgorithm)
.update(data)
.verify({
key: pem,
padding: crypto.constants.RSA_PKCS1_PSS_PADDING,
saltLength: 0
}, signature)
);
});
}
public hash(data: Buffer): Promise<Uint8Array> {
return new Promise((resolve, reject) => {
resolve(crypto
.createHash(this.hashAlgorithm)

@@ -73,8 +90,8 @@ .update(data)

private jwkToPem(jwk: object): string{
return jwk2pem(jwk);
public jwkToPem(jwk: object): string {
return jwkTopem(jwk);
}
private pemToJWK(pem: string): JWKInterface{
let jwk = pem2jwk(pem);
private pemToJWK(pem: string): JWKInterface {
let jwk = pemTojwk(pem);
return jwk;

@@ -81,0 +98,0 @@ }

@@ -168,5 +168,5 @@ // @ts-ignore

export function pem2jwk(pem: any, extras?: any): any {
export function pemTojwk(pem: any, extras?: any): any {
var text = pem.toString().split(/(\r\n|\r|\n)+/g)
text = text.filter(function(line: string) {
text = text.filter(function (line: string) {
return line.trim().length !== 0

@@ -180,3 +180,3 @@ });

export function jwk2pem(json: any): any {
export function jwkTopem(json: any): any {
var jwk = parse(json)

@@ -183,0 +183,0 @@ var isPrivate = !!(jwk.d)

@@ -1,4 +0,3 @@

import { JWKInterface } from "../Wallet";
import { JWKInterface, JWKPublicInterface } from "../Wallet";
import { CryptoInterface } from "./crypto-interface";
import { ArweaveUtils } from "../utils";

@@ -13,3 +12,3 @@ export class WebCryptoDriver implements CryptoInterface {

constructor() {
constructor() {
if (!this.detectWebCrypto()) {

@@ -23,3 +22,3 @@ throw new Error('SubtleCrypto not available!');

async generateJWK(): Promise<JWKInterface> {
public async generateJWK(): Promise<JWKInterface> {

@@ -50,25 +49,20 @@ let cryptoKey = await this

'kty': jwk.kty,
'e' : jwk.e,
'n' : jwk.n,
'd' : jwk.d,
'p' : jwk.p,
'q' : jwk.q,
'dp' : jwk.dp,
'dq' : jwk.dq,
'qi' : jwk.qi,
'e': jwk.e,
'n': jwk.n,
'd': jwk.d,
'p': jwk.p,
'q': jwk.q,
'dp': jwk.dp,
'dq': jwk.dq,
'qi': jwk.qi,
};
}
/**
*
* @param jwk
* @param data
*/
async sign(jwk: JWKInterface, data: any): Promise<Uint8Array>{
public async sign(jwk: JWKInterface, data: Uint8Array): Promise<Uint8Array> {
let signature = await this
.driver
.sign({
name: 'RSA-PSS',
saltLength: 0,
},
name: 'RSA-PSS',
saltLength: 0,
},
(await this.jwkToCryptoKey(jwk)),

@@ -81,3 +75,3 @@ data

async hash(data: Uint8Array): Promise<Uint8Array> {
public async hash(data: Uint8Array): Promise<Uint8Array> {
let digest = await this

@@ -93,3 +87,19 @@ .driver

private async jwkToCryptoKey(jwk: JWKInterface): Promise<CryptoKey>{
public async verify(publicModulus: string, data: Uint8Array, signature: Uint8Array): Promise<boolean> {
const publicKey = {
kty: 'RSA',
e: 'AQAB',
n: publicModulus,
};
const key = await this.jwkToPublicCryptoKey(publicKey);
return this.driver.verify({
name: 'RSA-PSS',
saltLength: 0,
}, key, signature, data);
}
private async jwkToCryptoKey(jwk: JWKInterface): Promise<CryptoKey> {
return this.driver.importKey(

@@ -105,7 +115,22 @@ 'jwk',

false,
['sign']
["sign"]
);
}
private detectWebCrypto(){
private async jwkToPublicCryptoKey(publicJwk: JWKPublicInterface): Promise<CryptoKey> {
return this.driver.importKey(
'jwk',
publicJwk,
{
name: 'RSA-PSS',
hash: {
name: 'SHA-256',
}
},
false,
["verify"]
);
}
private detectWebCrypto() {
if (!window || !window.crypto || !window.crypto.subtle) {

@@ -112,0 +137,0 @@ return false;

@@ -7,5 +7,6 @@ import { AxiosResponse } from "axios";

TX_FAILED = 'TX_FAILED',
TX_INVALID = 'TX_INVALID',
};
export class ArweaveError extends Error{
export class ArweaveError extends Error {

@@ -15,3 +16,3 @@ public readonly type: ArweaveErrorType;

constructor(type: ArweaveErrorType, optional?: {
constructor(type: ArweaveErrorType, optional?: {
message?: string,

@@ -24,7 +25,7 @@ response?: AxiosResponse,

super(optional.message);
}else{
} else {
super();
}
this.type = type;

@@ -34,3 +35,3 @@ this.response = optional.response;

public getType(): ArweaveErrorType{
public getType(): ArweaveErrorType {
return this.type;

@@ -37,0 +38,0 @@ }

@@ -5,7 +5,7 @@ import { ArweaveUtils } from './utils';

[key:string]: any;
[key: string]: any;
public get(field: string): string;
public get(field: string, options: {decode: true, string: false}): Uint8Array;
public get(field: string, options: {decode: true, string: true}): string;
public get(field: string, options: { decode: true, string: false }): Uint8Array;
public get(field: string, options: { decode: true, string: true }): string;

@@ -15,19 +15,19 @@ public get(field: string, options?: {

decode?: boolean
}): string | Uint8Array | Tag[] {
}): string | Uint8Array | Tag[] {
if (!Object.getOwnPropertyNames(this).includes(field)) {
throw new Error(`Field "${field}" is not a property of the Arweave Transaction class.`);
}
if (options && options.decode == true) {
if (options && options.string) {
return ArweaveUtils.b64UrlToString(this[field]);
}
return ArweaveUtils.b64UrlToBuffer(this[field]);
}
return this[field];
}
}
}

@@ -40,3 +40,3 @@

public constructor(name: string, value: string, decode = false){
public constructor(name: string, value: string, decode = false) {
super();

@@ -51,3 +51,3 @@ this.name = name;

[key:string]: any
[key: string]: any

@@ -57,3 +57,3 @@ id: string,

owner: string,
tags: Tag[],
tags: Tag[],
target: string,

@@ -67,9 +67,9 @@ quantity: string,

export class Transaction extends BaseObject implements TransactionInterface {
export class Transaction extends BaseObject implements TransactionInterface {
[key:string]: any
[key: string]: any
public id: string;
public readonly last_tx:string = '';
public readonly owner:string = '';
public readonly last_tx: string = '';
public readonly owner: string = '';
public readonly tags: Tag[] = [];

@@ -85,5 +85,11 @@ public readonly target: string = '';

Object.assign(this, attributes);
if (attributes.tags) {
this.tags = attributes.tags.map((tag: { name: string, value: string }) => {
return new Tag(tag.name, tag.value);
});
}
}
public addTag(name: string, value: string){
public addTag(name: string, value: string) {
this.tags.push(new Tag(

@@ -95,3 +101,3 @@ ArweaveUtils.stringToB64Url(name),

public toJSON(){
public toJSON() {
return {

@@ -110,3 +116,3 @@ id: this.id,

public setSignature({signature, id}: {
public setSignature({ signature, id }: {
signature: string,

@@ -122,15 +128,15 @@ id: string,

let tagString = this.tags.reduce((accumulator: string, tag: Tag) => {
return accumulator + '' + tag.get('name', {decode: true, string: true}) + '' + tag.get('value', {decode: true, string: true})
return accumulator + tag.get('name', { decode: true, string: true }) + tag.get('value', { decode: true, string: true })
}, '');
return ArweaveUtils.concatBuffers([
this.get('owner', {decode: true, string: false}),
this.get('target', {decode: true, string: false}),
this.get('data', {decode: true, string: false}),
this.get('owner', { decode: true, string: false }),
this.get('target', { decode: true, string: false }),
this.get('data', { decode: true, string: false }),
ArweaveUtils.stringToBuffer(this.quantity),
ArweaveUtils.stringToBuffer(this.reward),
this.get('last_tx', {decode: true, string: false}),
this.get('last_tx', { decode: true, string: false }),
ArweaveUtils.stringToBuffer(tagString)
]);
}
}
}

@@ -12,1 +12,7 @@ export interface JWKInterface {

}
export interface JWKPublicInterface {
kty: string;
e: string;
n: string;
}

@@ -16,3 +16,3 @@ import { Api } from "./lib/api";

constructor(api: Api, crypto: CryptoInterface){
constructor(api: Api, crypto: CryptoInterface) {
this.api = api;

@@ -35,7 +35,7 @@ this.crypto = crypto;

*/
function(data): string {
return data;
}
function (data): string {
return data;
}
]
}).then( response => {
}).then(response => {
return response.data;

@@ -46,5 +46,5 @@ });

public get(id: string): Promise<Transaction> {
return this.api.get(`tx/${id}`).then( response => {
return this.api.get(`tx/${id}`).then(response => {
if (response.status == 200) {
if (response.status == 200 && response.data && response.data.id == id) {
return new Transaction(response.data);

@@ -65,2 +65,4 @@ }

new ArweaveError(ArweaveErrorType.TX_INVALID);
});

@@ -70,3 +72,3 @@ }

public getStatus(id: string): Promise<number> {
return this.api.get(`tx/${id}/id`).then( response => {
return this.api.get(`tx/${id}/id`).then(response => {
return response.status;

@@ -92,4 +94,30 @@ });

public post(transaction: Transaction|Buffer|string|object): Promise<AxiosResponse> {
return this.api.post(`tx`, transaction).then( response => {
public async verify(transaction: Transaction): Promise<boolean> {
const signaturePayload = transaction.getSignatureData();
/**
* The transaction ID should be a SHA-256 hash of the raw signature bytes, so this needs
* to be recalculated from the signature and checked against the transaction ID.
*/
const rawSignature = transaction.get('signature', { decode: true, string: false });
const expectedId = ArweaveUtils.bufferTob64Url(await this.crypto.hash(rawSignature));
if (transaction.id !== expectedId) {
throw new Error(`Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.`);
}
/**
* Now verify the signature is valid and signed by the owner wallet (owner field = originating wallet public key).
*/
return this.crypto.verify(
transaction.owner,
signaturePayload,
rawSignature
);
}
public post(transaction: Transaction | Buffer | string | object): Promise<AxiosResponse> {
return this.api.post(`tx`, transaction).then(response => {
return response;

@@ -96,0 +124,0 @@ });

@@ -5,3 +5,3 @@ import { Arweave } from "./arweave/arweave";

(<any>window).arweave = {
(<any>window).Arweave = {
init(apiConfig: object): Arweave {

@@ -8,0 +8,0 @@ return new Arweave({

const path = require('path');
const webpack = require("webpack");
const config = {};
config.node = {
name: 'node',
entry: './src/node.ts',
mode: 'development',
target: 'node',
module: {
rules: [
{
test: /\.ts?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
devtool: 'inline-source-map',
devServer: {
contentBase: './dist'
},
plugins: [],
output: {
filename: 'node.bundle.js',
path: path.resolve(__dirname, 'dist')
}
};
config.web = {

@@ -87,2 +58,2 @@ name: 'web',

module.exports = [config.node, config.web, config.webprod];
module.exports = [config.web, config.webprod];

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 not supported yet

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 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 not supported yet

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 not supported yet

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