@instadapp/vue-web3
Advanced tools
Comparing version 0.5.0 to 0.6.0
/*! | ||
* @instadapp/vue-web3 v0.5.0 | ||
* (c) 2021 | ||
* @instadapp/vue-web3 v0.6.0 | ||
* (c) 2022 | ||
* @license MIT | ||
@@ -77,3 +77,3 @@ */ | ||
const version$1 = "logger/5.5.0"; | ||
const version$1 = "logger/5.6.0"; | ||
@@ -257,2 +257,36 @@ let _permanentCensorErrors = false; | ||
const reason = message; | ||
let url = ""; | ||
switch (code) { | ||
case ErrorCode.NUMERIC_FAULT: { | ||
url = "NUMERIC_FAULT"; | ||
const fault = message; | ||
switch (fault) { | ||
case "overflow": | ||
case "underflow": | ||
case "division-by-zero": | ||
url += "-" + fault; | ||
break; | ||
case "negative-power": | ||
case "negative-width": | ||
url += "-unsupported"; | ||
break; | ||
case "unbound-bitwise-result": | ||
url += "-unbound-result"; | ||
break; | ||
} | ||
break; | ||
} | ||
case ErrorCode.CALL_EXCEPTION: | ||
case ErrorCode.INSUFFICIENT_FUNDS: | ||
case ErrorCode.MISSING_NEW: | ||
case ErrorCode.NONCE_EXPIRED: | ||
case ErrorCode.REPLACEMENT_UNDERPRICED: | ||
case ErrorCode.TRANSACTION_REPLACED: | ||
case ErrorCode.UNPREDICTABLE_GAS_LIMIT: | ||
url = code; | ||
break; | ||
} | ||
if (url) { | ||
message += " [ See: https:/\/links.ethers.org/v5-errors-" + url + " ]"; | ||
} | ||
if (messageDetails.length) { | ||
@@ -391,3 +425,3 @@ message += " (" + messageDetails.join(", ") + ")"; | ||
const version = "bytes/5.5.0"; | ||
const version = "bytes/5.6.1"; | ||
@@ -459,3 +493,3 @@ const logger = new Logger(version); | ||
if (options.hexPad === "left") { | ||
hex = "0x0" + hex.substring(2); | ||
hex = "0" + hex; | ||
} | ||
@@ -1165,3 +1199,5 @@ else if (options.hexPad === "right") { | ||
} | ||
throw new Error(prefix + ": " + (message || '')); | ||
var provided = typeof message === 'function' ? message() : message; | ||
var value = provided ? prefix + ": " + provided : prefix; | ||
throw new Error(value); | ||
} | ||
@@ -1176,7 +1212,7 @@ | ||
var parsedChainId = Number.parseInt(chainId, chainId.trim().substring(0, 2) === '0x' ? 16 : 10); | ||
invariant(!Number.isNaN(parsedChainId), "chainId " + chainId + " is not an integer"); | ||
invariant(!Number.isNaN(parsedChainId), "chainId ".concat(chainId, " is not an integer")); | ||
return parsedChainId; | ||
} | ||
else { | ||
invariant(Number.isInteger(chainId), "chainId " + chainId + " is not an integer"); | ||
invariant(Number.isInteger(chainId), "chainId ".concat(chainId, " is not an integer")); | ||
return chainId; | ||
@@ -1187,4 +1223,4 @@ } | ||
function normalizeAccount(_address) { | ||
invariant(typeof _address === 'string' && _address.match(/^(0x)?[0-9a-fA-F]{40}$/), "Invalid address " + _address); | ||
var address = _address.substring(0, 2) === '0x' ? _address : "0x" + _address; | ||
invariant(typeof _address === 'string' && _address.match(/^(0x)?[0-9a-fA-F]{40}$/), "Invalid address ".concat(_address)); | ||
var address = _address.substring(0, 2) === '0x' ? _address : "0x".concat(_address); | ||
var chars = address.toLowerCase().substring(2).split(''); | ||
@@ -1204,5 +1240,5 @@ var charsArray = new Uint8Array(40); | ||
} | ||
var addressChecksum = "0x" + chars.join(''); | ||
var addressChecksum = "0x".concat(chars.join('')); | ||
invariant(!(address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && | ||
address !== addressChecksum), "Bad address checksum " + address + " " + addressChecksum); | ||
address !== addressChecksum), "Bad address checksum ".concat(address, " ").concat(addressChecksum)); | ||
return addressChecksum; | ||
@@ -1223,4 +1259,4 @@ } | ||
var _this = _super.call(this) || this; | ||
_this.name = _this.constructor.name; | ||
_this.message = "Unsupported chain id: " + unsupportedChainId + ". Supported chain ids are: " + supportedChainIds + "."; | ||
_this.name = 'UnsupportedChainIdError'; | ||
_this.message = "Unsupported chain id: ".concat(unsupportedChainId, ". Supported chain ids are: ").concat(supportedChainIds, "."); | ||
return _this; | ||
@@ -1227,0 +1263,0 @@ } |
/*! | ||
* @instadapp/vue-web3 v0.5.0 | ||
* (c) 2021 | ||
* @instadapp/vue-web3 v0.6.0 | ||
* (c) 2022 | ||
* @license MIT | ||
@@ -78,3 +78,3 @@ */ | ||
const version$1 = "logger/5.5.0"; | ||
const version$1 = "logger/5.6.0"; | ||
@@ -258,2 +258,36 @@ let _permanentCensorErrors = false; | ||
const reason = message; | ||
let url = ""; | ||
switch (code) { | ||
case ErrorCode.NUMERIC_FAULT: { | ||
url = "NUMERIC_FAULT"; | ||
const fault = message; | ||
switch (fault) { | ||
case "overflow": | ||
case "underflow": | ||
case "division-by-zero": | ||
url += "-" + fault; | ||
break; | ||
case "negative-power": | ||
case "negative-width": | ||
url += "-unsupported"; | ||
break; | ||
case "unbound-bitwise-result": | ||
url += "-unbound-result"; | ||
break; | ||
} | ||
break; | ||
} | ||
case ErrorCode.CALL_EXCEPTION: | ||
case ErrorCode.INSUFFICIENT_FUNDS: | ||
case ErrorCode.MISSING_NEW: | ||
case ErrorCode.NONCE_EXPIRED: | ||
case ErrorCode.REPLACEMENT_UNDERPRICED: | ||
case ErrorCode.TRANSACTION_REPLACED: | ||
case ErrorCode.UNPREDICTABLE_GAS_LIMIT: | ||
url = code; | ||
break; | ||
} | ||
if (url) { | ||
message += " [ See: https:/\/links.ethers.org/v5-errors-" + url + " ]"; | ||
} | ||
if (messageDetails.length) { | ||
@@ -392,3 +426,3 @@ message += " (" + messageDetails.join(", ") + ")"; | ||
const version = "bytes/5.5.0"; | ||
const version = "bytes/5.6.1"; | ||
@@ -460,3 +494,3 @@ const logger = new Logger(version); | ||
if (options.hexPad === "left") { | ||
hex = "0x0" + hex.substring(2); | ||
hex = "0" + hex; | ||
} | ||
@@ -1166,3 +1200,5 @@ else if (options.hexPad === "right") { | ||
} | ||
throw new Error(prefix + ": " + (message || '')); | ||
var provided = typeof message === 'function' ? message() : message; | ||
var value = provided ? prefix + ": " + provided : prefix; | ||
throw new Error(value); | ||
} | ||
@@ -1177,7 +1213,7 @@ | ||
var parsedChainId = Number.parseInt(chainId, chainId.trim().substring(0, 2) === '0x' ? 16 : 10); | ||
invariant(!Number.isNaN(parsedChainId), "chainId " + chainId + " is not an integer"); | ||
invariant(!Number.isNaN(parsedChainId), "chainId ".concat(chainId, " is not an integer")); | ||
return parsedChainId; | ||
} | ||
else { | ||
invariant(Number.isInteger(chainId), "chainId " + chainId + " is not an integer"); | ||
invariant(Number.isInteger(chainId), "chainId ".concat(chainId, " is not an integer")); | ||
return chainId; | ||
@@ -1188,4 +1224,4 @@ } | ||
function normalizeAccount(_address) { | ||
invariant(typeof _address === 'string' && _address.match(/^(0x)?[0-9a-fA-F]{40}$/), "Invalid address " + _address); | ||
var address = _address.substring(0, 2) === '0x' ? _address : "0x" + _address; | ||
invariant(typeof _address === 'string' && _address.match(/^(0x)?[0-9a-fA-F]{40}$/), "Invalid address ".concat(_address)); | ||
var address = _address.substring(0, 2) === '0x' ? _address : "0x".concat(_address); | ||
var chars = address.toLowerCase().substring(2).split(''); | ||
@@ -1205,5 +1241,5 @@ var charsArray = new Uint8Array(40); | ||
} | ||
var addressChecksum = "0x" + chars.join(''); | ||
var addressChecksum = "0x".concat(chars.join('')); | ||
invariant(!(address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && | ||
address !== addressChecksum), "Bad address checksum " + address + " " + addressChecksum); | ||
address !== addressChecksum), "Bad address checksum ".concat(address, " ").concat(addressChecksum)); | ||
return addressChecksum; | ||
@@ -1224,4 +1260,4 @@ } | ||
var _this = _super.call(this) || this; | ||
_this.name = _this.constructor.name; | ||
_this.message = "Unsupported chain id: " + unsupportedChainId + ". Supported chain ids are: " + supportedChainIds + "."; | ||
_this.name = 'UnsupportedChainIdError'; | ||
_this.message = "Unsupported chain id: ".concat(unsupportedChainId, ". Supported chain ids are: ").concat(supportedChainIds, "."); | ||
return _this; | ||
@@ -1228,0 +1264,0 @@ } |
/*! | ||
* @instadapp/vue-web3 v0.5.0 | ||
* (c) 2021 | ||
* @instadapp/vue-web3 v0.6.0 | ||
* (c) 2022 | ||
* @license MIT | ||
*/ | ||
var InstadappVueWeb3=function(r,t){"use strict"; | ||
var InstadappVueWeb3=function(r,e){"use strict"; | ||
/*! ***************************************************************************** | ||
@@ -20,3 +20,3 @@ Copyright (c) Microsoft Corporation. | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])},e(r,t)};function n(r,t,e,n){return new(e||(e=Promise))((function(o,i){function a(r){try{s(n.next(r))}catch(r){i(r)}}function u(r){try{s(n.throw(r))}catch(r){i(r)}}function s(r){var t;r.done?o(r.value):(t=r.value,t instanceof e?t:new e((function(r){r(t)}))).then(a,u)}s((n=n.apply(r,t||[])).next())}))}function o(r,t){var e,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(r,a)}catch(r){i=[6,r],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}let i=!1,a=!1;const u={debug:1,default:2,info:2,warning:3,error:4,off:5};let s=u.default,c=null;const f=function(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(e){r.push(t)}})),r.length)throw new Error("missing "+r.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(r){return r.message}return null}();var l,h;!function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"}(l||(l={})),function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(h||(h={}));const p="0123456789abcdef";class d{constructor(r){Object.defineProperty(this,"version",{enumerable:!0,value:r,writable:!1})}_log(r,t){const e=r.toLowerCase();null==u[e]&&this.throwArgumentError("invalid log level name","logLevel",r),s>u[e]||console.log.apply(console,t)}debug(...r){this._log(d.levels.DEBUG,r)}info(...r){this._log(d.levels.INFO,r)}warn(...r){this._log(d.levels.WARNING,r)}makeError(r,t,e){if(a)return this.makeError("censored error",t,{});t||(t=d.errors.UNKNOWN_ERROR),e||(e={});const n=[];Object.keys(e).forEach((r=>{const t=e[r];try{if(t instanceof Uint8Array){let e="";for(let r=0;r<t.length;r++)e+=p[t[r]>>4],e+=p[15&t[r]];n.push(r+"=Uint8Array(0x"+e+")")}else n.push(r+"="+JSON.stringify(t))}catch(t){n.push(r+"="+JSON.stringify(e[r].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const o=r;n.length&&(r+=" ("+n.join(", ")+")");const i=new Error(r);return i.reason=o,i.code=t,Object.keys(e).forEach((function(r){i[r]=e[r]})),i}throwError(r,t,e){throw this.makeError(r,t,e)}throwArgumentError(r,t,e){return this.throwError(r,d.errors.INVALID_ARGUMENT,{argument:t,value:e})}assert(r,t,e,n){r||this.throwError(t,e,n)}assertArgument(r,t,e,n){r||this.throwArgumentError(t,e,n)}checkNormalize(r){f&&this.throwError("platform missing String.prototype.normalize",d.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f})}checkSafeUint53(r,t){"number"==typeof r&&(null==t&&(t="value not safe"),(r<0||r>=9007199254740991)&&this.throwError(t,d.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:r}),r%1&&this.throwError(t,d.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:r}))}checkArgumentCount(r,t,e){e=e?": "+e:"",r<t&&this.throwError("missing argument"+e,d.errors.MISSING_ARGUMENT,{count:r,expectedCount:t}),r>t&&this.throwError("too many arguments"+e,d.errors.UNEXPECTED_ARGUMENT,{count:r,expectedCount:t})}checkNew(r,t){r!==Object&&null!=r||this.throwError("missing new",d.errors.MISSING_NEW,{name:t.name})}checkAbstract(r,t){r===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",d.errors.UNSUPPORTED_OPERATION,{name:r.name,operation:"new"}):r!==Object&&null!=r||this.throwError("missing new",d.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return c||(c=new d("logger/5.5.0")),c}static setCensorship(r,t){if(!r&&t&&this.globalLogger().throwError("cannot permanently disable censorship",d.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),i){if(!r)return;this.globalLogger().throwError("error censorship permanent",d.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}a=!!r,i=!!t}static setLogLevel(r){const t=u[r.toLowerCase()];null!=t?s=t:d.globalLogger().warn("invalid log level - "+r)}static from(r){return new d(r)}}d.errors=h,d.levels=l;const v=new d("bytes/5.5.0");function E(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return E(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function y(r){return"number"==typeof r&&r==r&&r%1==0}function g(r,t){if(t||(t={}),"number"==typeof r){v.checkSafeUint53(r,"invalid arrayify value");const t=[];for(;r;)t.unshift(255&r),r=parseInt(String(r/256));return 0===t.length&&t.push(0),E(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof r&&"0x"!==r.substring(0,2)&&(r="0x"+r),function(r){return!!r.toHexString}(r)&&(r=r.toHexString()),function(r,t){if("string"!=typeof r||!r.match(/^0x[0-9A-Fa-f]*$/))return!1;if(t&&r.length!==2+2*t)return!1;return!0}(r)){let e=r.substring(2);e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":v.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let r=0;r<e.length;r+=2)n.push(parseInt(e.substring(r,r+2),16));return E(new Uint8Array(n))}return function(r){if(null==r)return!1;if(r.constructor===Uint8Array)return!0;if("string"==typeof r)return!1;if(!y(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!y(e)||e<0||e>=256)return!1}return!0}(r)?E(new Uint8Array(r)):v.throwArgumentError("invalid arrayify value","value",r)}var N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}; | ||
***************************************************************************** */var t=function(r,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,e){r.__proto__=e}||function(r,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])},t(r,e)};function n(r,e,t,n){return new(t||(t=Promise))((function(o,i){function a(r){try{u(n.next(r))}catch(r){i(r)}}function s(r){try{u(n.throw(r))}catch(r){i(r)}}function u(r){var e;r.done?o(r.value):(e=r.value,e instanceof t?e:new t((function(r){r(e)}))).then(a,s)}u((n=n.apply(r,e||[])).next())}))}function o(r,e){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(r,a)}catch(r){i=[6,r],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}let i=!1,a=!1;const s={debug:1,default:2,info:2,warning:3,error:4,off:5};let u=s.default,c=null;const f=function(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(t){r.push(e)}})),r.length)throw new Error("missing "+r.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(r){return r.message}return null}();var l,h;!function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"}(l||(l={})),function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(h||(h={}));const p="0123456789abcdef";class d{constructor(r){Object.defineProperty(this,"version",{enumerable:!0,value:r,writable:!1})}_log(r,e){const t=r.toLowerCase();null==s[t]&&this.throwArgumentError("invalid log level name","logLevel",r),u>s[t]||console.log.apply(console,e)}debug(...r){this._log(d.levels.DEBUG,r)}info(...r){this._log(d.levels.INFO,r)}warn(...r){this._log(d.levels.WARNING,r)}makeError(r,e,t){if(a)return this.makeError("censored error",e,{});e||(e=d.errors.UNKNOWN_ERROR),t||(t={});const n=[];Object.keys(t).forEach((r=>{const e=t[r];try{if(e instanceof Uint8Array){let t="";for(let r=0;r<e.length;r++)t+=p[e[r]>>4],t+=p[15&e[r]];n.push(r+"=Uint8Array(0x"+t+")")}else n.push(r+"="+JSON.stringify(e))}catch(e){n.push(r+"="+JSON.stringify(t[r].toString()))}})),n.push(`code=${e}`),n.push(`version=${this.version}`);const o=r;let i="";switch(e){case h.NUMERIC_FAULT:{i="NUMERIC_FAULT";const e=r;switch(e){case"overflow":case"underflow":case"division-by-zero":i+="-"+e;break;case"negative-power":case"negative-width":i+="-unsupported";break;case"unbound-bitwise-result":i+="-unbound-result"}break}case h.CALL_EXCEPTION:case h.INSUFFICIENT_FUNDS:case h.MISSING_NEW:case h.NONCE_EXPIRED:case h.REPLACEMENT_UNDERPRICED:case h.TRANSACTION_REPLACED:case h.UNPREDICTABLE_GAS_LIMIT:i=e}i&&(r+=" [ See: https://links.ethers.org/v5-errors-"+i+" ]"),n.length&&(r+=" ("+n.join(", ")+")");const s=new Error(r);return s.reason=o,s.code=e,Object.keys(t).forEach((function(r){s[r]=t[r]})),s}throwError(r,e,t){throw this.makeError(r,e,t)}throwArgumentError(r,e,t){return this.throwError(r,d.errors.INVALID_ARGUMENT,{argument:e,value:t})}assert(r,e,t,n){r||this.throwError(e,t,n)}assertArgument(r,e,t,n){r||this.throwArgumentError(e,t,n)}checkNormalize(r){f&&this.throwError("platform missing String.prototype.normalize",d.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f})}checkSafeUint53(r,e){"number"==typeof r&&(null==e&&(e="value not safe"),(r<0||r>=9007199254740991)&&this.throwError(e,d.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:r}),r%1&&this.throwError(e,d.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:r}))}checkArgumentCount(r,e,t){t=t?": "+t:"",r<e&&this.throwError("missing argument"+t,d.errors.MISSING_ARGUMENT,{count:r,expectedCount:e}),r>e&&this.throwError("too many arguments"+t,d.errors.UNEXPECTED_ARGUMENT,{count:r,expectedCount:e})}checkNew(r,e){r!==Object&&null!=r||this.throwError("missing new",d.errors.MISSING_NEW,{name:e.name})}checkAbstract(r,e){r===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",d.errors.UNSUPPORTED_OPERATION,{name:r.name,operation:"new"}):r!==Object&&null!=r||this.throwError("missing new",d.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return c||(c=new d("logger/5.6.0")),c}static setCensorship(r,e){if(!r&&e&&this.globalLogger().throwError("cannot permanently disable censorship",d.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),i){if(!r)return;this.globalLogger().throwError("error censorship permanent",d.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}a=!!r,i=!!e}static setLogLevel(r){const e=s[r.toLowerCase()];null!=e?u=e:d.globalLogger().warn("invalid log level - "+r)}static from(r){return new d(r)}}d.errors=h,d.levels=l;const v=new d("bytes/5.6.1");function E(r){return r.slice||(r.slice=function(){const e=Array.prototype.slice.call(arguments);return E(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}function y(r){return"number"==typeof r&&r==r&&r%1==0}function N(r,e){if(e||(e={}),"number"==typeof r){v.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(255&r),r=parseInt(String(r/256));return 0===e.length&&e.push(0),E(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof r&&"0x"!==r.substring(0,2)&&(r="0x"+r),function(r){return!!r.toHexString}(r)&&(r=r.toHexString()),function(r,e){if("string"!=typeof r||!r.match(/^0x[0-9A-Fa-f]*$/))return!1;if(e&&r.length!==2+2*e)return!1;return!0}(r)){let t=r.substring(2);t.length%2&&("left"===e.hexPad?t="0"+t:"right"===e.hexPad?t+="0":v.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let r=0;r<t.length;r+=2)n.push(parseInt(t.substring(r,r+2),16));return E(new Uint8Array(n))}return function(r){if(null==r)return!1;if(r.constructor===Uint8Array)return!0;if("string"==typeof r)return!1;if(!y(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){const t=r[e];if(!y(t)||t<0||t>=256)return!1}return!0}(r)?E(new Uint8Array(r)):v.throwArgumentError("invalid arrayify value","value",r)}var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}; | ||
/** | ||
@@ -30,2 +30,2 @@ * [js-sha3]{@link https://github.com/emn178/js-sha3} | ||
*/ | ||
var w,b,A=(w=function(r){!function(){var t="input is invalid type",e="object"==typeof window,n=e?window:{};n.JS_SHA3_NO_WINDOW&&(e=!1);var o=!e&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=N:o&&(n=self);var i=!n.JS_SHA3_NO_COMMON_JS&&r.exports,a=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),s=[4,1024,262144,67108864],c=[0,8,16,24],f=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],l=[224,256,384,512],h=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],d={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)}),!a||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(r){return"object"==typeof r&&r.buffer&&r.buffer.constructor===ArrayBuffer});for(var v=function(r,t,e){return function(n){return new T(r,t,r).update(n)[e]()}},E=function(r,t,e){return function(n,o){return new T(r,t,o).update(n)[e]()}},y=function(r,t,e){return function(t,n,o,i){return I["cshake"+r].update(t,n,o,i)[e]()}},g=function(r,t,e){return function(t,n,o,i){return I["kmac"+r].update(t,n,o,i)[e]()}},w=function(r,t,e,n){for(var o=0;o<p.length;++o){var i=p[o];r[i]=t(e,n,i)}return r},b=function(r,t){var e=v(r,t,"hex");return e.create=function(){return new T(r,t,r)},e.update=function(r){return e.create().update(r)},w(e,v,r,t)},A=[{name:"keccak",padding:[1,256,65536,16777216],bits:l,createMethod:b},{name:"sha3",padding:[6,1536,393216,100663296],bits:l,createMethod:b},{name:"shake",padding:[31,7936,2031616,520093696],bits:h,createMethod:function(r,t){var e=E(r,t,"hex");return e.create=function(e){return new T(r,t,e)},e.update=function(r,t){return e.create(t).update(r)},w(e,E,r,t)}},{name:"cshake",padding:s,bits:h,createMethod:function(r,t){var e=d[r],n=y(r,0,"hex");return n.create=function(n,o,i){return o||i?new T(r,t,n).bytepad([o,i],e):I["shake"+r].create(n)},n.update=function(r,t,e,o){return n.create(t,e,o).update(r)},w(n,y,r,t)}},{name:"kmac",padding:s,bits:h,createMethod:function(r,t){var e=d[r],n=g(r,0,"hex");return n.create=function(n,o,i){return new k(r,t,o).bytepad(["KMAC",i],e).bytepad([n],e)},n.update=function(r,t,e,o){return n.create(r,e,o).update(t)},w(n,g,r,t)}}],I={},R=[],_=0;_<A.length;++_)for(var m=A[_],O=m.bits,U=0;U<O.length;++U){var C=m.name+"_"+O[U];if(R.push(C),I[C]=m.createMethod(O[U],m.padding),"sha3"!==m.name){var S=m.name+O[U];R.push(S),I[S]=I[C]}}function T(r,t,e){this.blocks=[],this.s=[],this.padding=t,this.outputBits=e,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(r<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=e>>5,this.extraBytes=(31&e)>>3;for(var n=0;n<50;++n)this.s[n]=0}function k(r,t,e){T.call(this,r,t,e)}T.prototype.update=function(r){if(this.finalized)throw new Error("finalize already called");var e,n=typeof r;if("string"!==n){if("object"!==n)throw new Error(t);if(null===r)throw new Error(t);if(a&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!(Array.isArray(r)||a&&ArrayBuffer.isView(r)))throw new Error(t);e=!0}for(var o,i,u=this.blocks,s=this.byteCount,f=r.length,l=this.blockCount,h=0,p=this.s;h<f;){if(this.reset)for(this.reset=!1,u[0]=this.block,o=1;o<l+1;++o)u[o]=0;if(e)for(o=this.start;h<f&&o<s;++h)u[o>>2]|=r[h]<<c[3&o++];else for(o=this.start;h<f&&o<s;++h)(i=r.charCodeAt(h))<128?u[o>>2]|=i<<c[3&o++]:i<2048?(u[o>>2]|=(192|i>>6)<<c[3&o++],u[o>>2]|=(128|63&i)<<c[3&o++]):i<55296||i>=57344?(u[o>>2]|=(224|i>>12)<<c[3&o++],u[o>>2]|=(128|i>>6&63)<<c[3&o++],u[o>>2]|=(128|63&i)<<c[3&o++]):(i=65536+((1023&i)<<10|1023&r.charCodeAt(++h)),u[o>>2]|=(240|i>>18)<<c[3&o++],u[o>>2]|=(128|i>>12&63)<<c[3&o++],u[o>>2]|=(128|i>>6&63)<<c[3&o++],u[o>>2]|=(128|63&i)<<c[3&o++]);if(this.lastByteIndex=o,o>=s){for(this.start=o-s,this.block=u[l],o=0;o<l;++o)p[o]^=u[o];x(p),this.reset=!0}else this.start=o}return this},T.prototype.encode=function(r,t){var e=255&r,n=1,o=[e];for(e=255&(r>>=8);e>0;)o.unshift(e),e=255&(r>>=8),++n;return t?o.push(n):o.unshift(n),this.update(o),o.length},T.prototype.encodeString=function(r){var e,n=typeof r;if("string"!==n){if("object"!==n)throw new Error(t);if(null===r)throw new Error(t);if(a&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!(Array.isArray(r)||a&&ArrayBuffer.isView(r)))throw new Error(t);e=!0}var o=0;if(e)o=r.length;else for(var i=0;i<r.length;++i){var u=r.charCodeAt(i);u<128?o+=1:u<2048?o+=2:u<55296||u>=57344?o+=3:(u=65536+((1023&u)<<10|1023&r.charCodeAt(++i)),o+=4)}return o+=this.encode(8*o),this.update(r),o},T.prototype.bytepad=function(r,t){for(var e=this.encode(t),n=0;n<r.length;++n)e+=this.encodeString(r[n]);var o=[];return o.length=t-e%t,this.update(o),this},T.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var r=this.blocks,t=this.lastByteIndex,e=this.blockCount,n=this.s;if(r[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(r[0]=r[e],t=1;t<e+1;++t)r[t]=0;for(r[e-1]|=2147483648,t=0;t<e;++t)n[t]^=r[t];x(n)}},T.prototype.toString=T.prototype.hex=function(){this.finalize();for(var r,t=this.blockCount,e=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,a=0,s="";a<n;){for(i=0;i<t&&a<n;++i,++a)s+=u[(r=e[i])>>4&15]+u[15&r]+u[r>>12&15]+u[r>>8&15]+u[r>>20&15]+u[r>>16&15]+u[r>>28&15]+u[r>>24&15];a%t==0&&(x(e),i=0)}return o&&(s+=u[(r=e[i])>>4&15]+u[15&r],o>1&&(s+=u[r>>12&15]+u[r>>8&15]),o>2&&(s+=u[r>>20&15]+u[r>>16&15])),s},T.prototype.buffer=T.prototype.arrayBuffer=function(){this.finalize();var r,t=this.blockCount,e=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,a=0,u=this.outputBits>>3;r=o?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var s=new Uint32Array(r);a<n;){for(i=0;i<t&&a<n;++i,++a)s[a]=e[i];a%t==0&&x(e)}return o&&(s[i]=e[i],r=r.slice(0,u)),r},T.prototype.digest=T.prototype.array=function(){this.finalize();for(var r,t,e=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,a=0,u=0,s=[];u<o;){for(a=0;a<e&&u<o;++a,++u)s[r=u<<2]=255&(t=n[a]),s[r+1]=t>>8&255,s[r+2]=t>>16&255,s[r+3]=t>>24&255;u%e==0&&x(n)}return i&&(s[r=u<<2]=255&(t=n[a]),i>1&&(s[r+1]=t>>8&255),i>2&&(s[r+2]=t>>16&255)),s},(k.prototype=new T).finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var x=function(r){var t,e,n,o,i,a,u,s,c,l,h,p,d,v,E,y,g,N,w,b,A,I,R,_,m,O,U,C,S,T,k,x,P,D,M,B,F,L,G,W,j,z,V,J,H,K,X,$,Y,q,Q,Z,rr,tr,er,nr,or,ir,ar,ur,sr,cr,fr;for(n=0;n<48;n+=2)o=r[0]^r[10]^r[20]^r[30]^r[40],i=r[1]^r[11]^r[21]^r[31]^r[41],s=r[4]^r[14]^r[24]^r[34]^r[44],c=r[5]^r[15]^r[25]^r[35]^r[45],l=r[6]^r[16]^r[26]^r[36]^r[46],h=r[7]^r[17]^r[27]^r[37]^r[47],e=(d=r[9]^r[19]^r[29]^r[39]^r[49])^((u=r[3]^r[13]^r[23]^r[33]^r[43])<<1|(a=r[2]^r[12]^r[22]^r[32]^r[42])>>>31),r[0]^=t=(p=r[8]^r[18]^r[28]^r[38]^r[48])^(a<<1|u>>>31),r[1]^=e,r[10]^=t,r[11]^=e,r[20]^=t,r[21]^=e,r[30]^=t,r[31]^=e,r[40]^=t,r[41]^=e,e=i^(c<<1|s>>>31),r[2]^=t=o^(s<<1|c>>>31),r[3]^=e,r[12]^=t,r[13]^=e,r[22]^=t,r[23]^=e,r[32]^=t,r[33]^=e,r[42]^=t,r[43]^=e,e=u^(h<<1|l>>>31),r[4]^=t=a^(l<<1|h>>>31),r[5]^=e,r[14]^=t,r[15]^=e,r[24]^=t,r[25]^=e,r[34]^=t,r[35]^=e,r[44]^=t,r[45]^=e,e=c^(d<<1|p>>>31),r[6]^=t=s^(p<<1|d>>>31),r[7]^=e,r[16]^=t,r[17]^=e,r[26]^=t,r[27]^=e,r[36]^=t,r[37]^=e,r[46]^=t,r[47]^=e,e=h^(i<<1|o>>>31),r[8]^=t=l^(o<<1|i>>>31),r[9]^=e,r[18]^=t,r[19]^=e,r[28]^=t,r[29]^=e,r[38]^=t,r[39]^=e,r[48]^=t,r[49]^=e,E=r[1],K=r[11]<<4|r[10]>>>28,X=r[10]<<4|r[11]>>>28,C=r[20]<<3|r[21]>>>29,S=r[21]<<3|r[20]>>>29,ur=r[31]<<9|r[30]>>>23,sr=r[30]<<9|r[31]>>>23,z=r[40]<<18|r[41]>>>14,V=r[41]<<18|r[40]>>>14,D=r[2]<<1|r[3]>>>31,M=r[3]<<1|r[2]>>>31,g=r[12]<<12|r[13]>>>20,$=r[22]<<10|r[23]>>>22,Y=r[23]<<10|r[22]>>>22,T=r[33]<<13|r[32]>>>19,k=r[32]<<13|r[33]>>>19,cr=r[42]<<2|r[43]>>>30,fr=r[43]<<2|r[42]>>>30,tr=r[5]<<30|r[4]>>>2,er=r[4]<<30|r[5]>>>2,B=r[14]<<6|r[15]>>>26,F=r[15]<<6|r[14]>>>26,w=r[24]<<11|r[25]>>>21,q=r[34]<<15|r[35]>>>17,Q=r[35]<<15|r[34]>>>17,x=r[45]<<29|r[44]>>>3,P=r[44]<<29|r[45]>>>3,_=r[6]<<28|r[7]>>>4,m=r[7]<<28|r[6]>>>4,nr=r[17]<<23|r[16]>>>9,or=r[16]<<23|r[17]>>>9,L=r[26]<<25|r[27]>>>7,G=r[27]<<25|r[26]>>>7,b=r[36]<<21|r[37]>>>11,A=r[37]<<21|r[36]>>>11,Z=r[47]<<24|r[46]>>>8,rr=r[46]<<24|r[47]>>>8,J=r[8]<<27|r[9]>>>5,H=r[9]<<27|r[8]>>>5,O=r[18]<<20|r[19]>>>12,U=r[19]<<20|r[18]>>>12,ir=r[29]<<7|r[28]>>>25,ar=r[28]<<7|r[29]>>>25,W=r[38]<<8|r[39]>>>24,j=r[39]<<8|r[38]>>>24,I=r[48]<<14|r[49]>>>18,R=r[49]<<14|r[48]>>>18,r[0]=(v=r[0])^~(y=r[13]<<12|r[12]>>>20)&(N=r[25]<<11|r[24]>>>21),r[1]=E^~g&w,r[10]=_^~O&C,r[11]=m^~U&S,r[20]=D^~B&L,r[21]=M^~F&G,r[30]=J^~K&$,r[31]=H^~X&Y,r[40]=tr^~nr&ir,r[41]=er^~or&ar,r[2]=y^~N&b,r[3]=g^~w&A,r[12]=O^~C&T,r[13]=U^~S&k,r[22]=B^~L&W,r[23]=F^~G&j,r[32]=K^~$&q,r[33]=X^~Y&Q,r[42]=nr^~ir&ur,r[43]=or^~ar&sr,r[4]=N^~b&I,r[5]=w^~A&R,r[14]=C^~T&x,r[15]=S^~k&P,r[24]=L^~W&z,r[25]=G^~j&V,r[34]=$^~q&Z,r[35]=Y^~Q&rr,r[44]=ir^~ur&cr,r[45]=ar^~sr&fr,r[6]=b^~I&v,r[7]=A^~R&E,r[16]=T^~x&_,r[17]=k^~P&m,r[26]=W^~z&D,r[27]=j^~V&M,r[36]=q^~Z&J,r[37]=Q^~rr&H,r[46]=ur^~cr&tr,r[47]=sr^~fr&er,r[8]=I^~v&y,r[9]=R^~E&g,r[18]=x^~_&O,r[19]=P^~m&U,r[28]=z^~D&B,r[29]=V^~M&F,r[38]=Z^~J&K,r[39]=rr^~H&X,r[48]=cr^~tr&nr,r[49]=fr^~er&or,r[0]^=f[n],r[1]^=f[n+1]};if(i)r.exports=I;else for(_=0;_<R.length;++_)n[R[_]]=I[R[_]]}()},w(b={exports:{}},b.exports),b.exports),I=A;var R,_="production"===process.env.NODE_ENV,m="Invariant failed";function O(r,t){if(!r){if(_)throw new Error(m);throw new Error(m+": "+(t||""))}}function U(r){if("string"==typeof r){r=r.replace(/^Ox/,"0x");var t=Number.parseInt(r,"0x"===r.trim().substring(0,2)?16:10);return O(!Number.isNaN(t),"chainId "+r+" is not an integer"),t}return O(Number.isInteger(r),"chainId "+r+" is not an integer"),r}function C(r){O("string"==typeof r&&r.match(/^(0x)?[0-9a-fA-F]{40}$/),"Invalid address "+r);for(var t="0x"===r.substring(0,2)?r:"0x"+r,e=t.toLowerCase().substring(2).split(""),n=new Uint8Array(40),o=0;o<40;o++)n[o]=e[o].charCodeAt(0);var i=g("0x"+I.keccak_256(g(n)));for(o=0;o<40;o+=2)i[o>>1]>>4>=8&&(e[o]=e[o].toUpperCase()),(15&i[o>>1])>=8&&(e[o+1]=e[o+1].toUpperCase());var a="0x"+e.join("");return O(!(t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==a),"Bad address checksum "+t+" "+a),a}!function(r){r.Update="Web3ReactUpdate",r.Error="Web3ReactError",r.Deactivate="Web3ReactDeactivate"}(R||(R={}));var S=function(r){function t(t,e){var n=r.call(this)||this;return n.name=n.constructor.name,n.message="Unsupported chain id: "+t+". Supported chain ids are: "+e+".",n}return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,r),t}(Error),T=t.ref(),k=t.ref(),x=t.ref(),P=t.ref(),D=t.ref(),M=t.computed((function(){return void 0!==T.value&&void 0!==k.value&&void 0!==x.value&&!D.value})),B=t.ref(),F=function(r,t){return function(){return null}};function L(r,t){return n(this,void 0,void 0,(function(){var e,n,i,a,u,s;return o(this,(function(o){switch(o.label){case 0:return void 0!==t.provider?[3,2]:[4,r.getProvider()];case 1:return n=o.sent(),[3,3];case 2:n=t.provider,o.label=3;case 3:return e=n,[4,Promise.all([void 0===t.chainId?r.getChainId():t.chainId,void 0===t.account?r.getAccount():t.account])];case 4:if(i=o.sent(),a=i[1],u=U(i[0]),r.supportedChainIds&&!r.supportedChainIds.includes(u))throw new S(u,r.supportedChainIds);return s=null===a?a:C(a),[2,{provider:e,chainId:u,account:s}]}}))}))}return r.UnsupportedChainIdError=S,r.setWeb3LibraryCallback=function(r){F=r},r.useWeb3=function(){var r=t.ref(),e=function(t){return n(void 0,void 0,void 0,(function(){var e,n,u;return o(this,(function(o){return D.value?(D.value=void 0,[2]):T.value?void 0!==(e=void 0===t.chainId?void 0:U(t.chainId))&&T.value.supportedChainIds&&!T.value.supportedChainIds.includes(e)?(n=new S(e,T.value.supportedChainIds),r.value?r.value(n):i(n),[2]):(e&&(k.value=e),t.provider&&(P.value=t.provider),(u="string"==typeof t.account?C(t.account):t.account)&&(x.value=u),[2]):(a(),[2])}))}))},i=function(t){var e;D.value=t,r.value&&r.value(t),M&&(null===(e=T.value)||void 0===e||e.deactivate()),a()},a=function(){T.value=void 0,k.value=void 0,P.value=void 0,x.value=void 0,B.value=void 0};return t.watch([M,P,T,k],(function(){B.value=M.value&&void 0!==k.value&&Number.isInteger(k.value)&&T.value?F(P.value,T.value):void 0})),t.watch(T,(function(){T.value&&T.value.on(R.Update,e).on(R.Error,i).on(R.Deactivate,a)}),{immediate:!0}),t.onBeforeUnmount((function(){T.value&&T.value.off(R.Update,e).off(R.Error,i).off(R.Deactivate,a)})),{library:B,active:M,activate:function(t,e,i){return void 0===i&&(i=!1),n(void 0,void 0,void 0,(function(){var n,a,u,s;return o(this,(function(o){switch(o.label){case 0:n=!1,o.label=1;case 1:return o.trys.push([1,4,,5]),[4,t.activate().then((function(r){return n=!0,r}))];case 2:return a=o.sent(),[4,L(t,a)];case 3:return u=o.sent(),T.value=t,k.value=u.chainId,P.value=u.provider,x.value=u.account,D.value=void 0,r.value=e,[3,5];case 4:if(s=o.sent(),D.value=s,i)throw n&&t.deactivate(),s;return e&&(n&&t.deactivate(),e(s)),[3,5];case 5:return[2]}}))}))},deactivate:function(){var r;null===(r=T.value)||void 0===r||r.deactivate(),a()},connector:T,chainId:k,account:x,provider:P,error:D}},Object.defineProperty(r,"__esModule",{value:!0}),r}({},VueDemi); | ||
var w,b,A=(w=function(r){!function(){var e="input is invalid type",t="object"==typeof window,n=t?window:{};n.JS_SHA3_NO_WINDOW&&(t=!1);var o=!t&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=g:o&&(n=self);var i=!n.JS_SHA3_NO_COMMON_JS&&r.exports,a=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),u=[4,1024,262144,67108864],c=[0,8,16,24],f=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],l=[224,256,384,512],h=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],d={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)}),!a||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(r){return"object"==typeof r&&r.buffer&&r.buffer.constructor===ArrayBuffer});for(var v=function(r,e,t){return function(n){return new T(r,e,r).update(n)[t]()}},E=function(r,e,t){return function(n,o){return new T(r,e,o).update(n)[t]()}},y=function(r,e,t){return function(e,n,o,i){return I["cshake"+r].update(e,n,o,i)[t]()}},N=function(r,e,t){return function(e,n,o,i){return I["kmac"+r].update(e,n,o,i)[t]()}},w=function(r,e,t,n){for(var o=0;o<p.length;++o){var i=p[o];r[i]=e(t,n,i)}return r},b=function(r,e){var t=v(r,e,"hex");return t.create=function(){return new T(r,e,r)},t.update=function(r){return t.create().update(r)},w(t,v,r,e)},A=[{name:"keccak",padding:[1,256,65536,16777216],bits:l,createMethod:b},{name:"sha3",padding:[6,1536,393216,100663296],bits:l,createMethod:b},{name:"shake",padding:[31,7936,2031616,520093696],bits:h,createMethod:function(r,e){var t=E(r,e,"hex");return t.create=function(t){return new T(r,e,t)},t.update=function(r,e){return t.create(e).update(r)},w(t,E,r,e)}},{name:"cshake",padding:u,bits:h,createMethod:function(r,e){var t=d[r],n=y(r,0,"hex");return n.create=function(n,o,i){return o||i?new T(r,e,n).bytepad([o,i],t):I["shake"+r].create(n)},n.update=function(r,e,t,o){return n.create(e,t,o).update(r)},w(n,y,r,e)}},{name:"kmac",padding:u,bits:h,createMethod:function(r,e){var t=d[r],n=N(r,0,"hex");return n.create=function(n,o,i){return new k(r,e,o).bytepad(["KMAC",i],t).bytepad([n],t)},n.update=function(r,e,t,o){return n.create(r,t,o).update(e)},w(n,N,r,e)}}],I={},_=[],R=0;R<A.length;++R)for(var U=A[R],C=U.bits,O=0;O<C.length;++O){var m=U.name+"_"+C[O];if(_.push(m),I[m]=U.createMethod(C[O],U.padding),"sha3"!==U.name){var S=U.name+C[O];_.push(S),I[S]=I[m]}}function T(r,e,t){this.blocks=[],this.s=[],this.padding=e,this.outputBits=t,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(r<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=t>>5,this.extraBytes=(31&t)>>3;for(var n=0;n<50;++n)this.s[n]=0}function k(r,e,t){T.call(this,r,e,t)}T.prototype.update=function(r){if(this.finalized)throw new Error("finalize already called");var t,n=typeof r;if("string"!==n){if("object"!==n)throw new Error(e);if(null===r)throw new Error(e);if(a&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!(Array.isArray(r)||a&&ArrayBuffer.isView(r)))throw new Error(e);t=!0}for(var o,i,s=this.blocks,u=this.byteCount,f=r.length,l=this.blockCount,h=0,p=this.s;h<f;){if(this.reset)for(this.reset=!1,s[0]=this.block,o=1;o<l+1;++o)s[o]=0;if(t)for(o=this.start;h<f&&o<u;++h)s[o>>2]|=r[h]<<c[3&o++];else for(o=this.start;h<f&&o<u;++h)(i=r.charCodeAt(h))<128?s[o>>2]|=i<<c[3&o++]:i<2048?(s[o>>2]|=(192|i>>6)<<c[3&o++],s[o>>2]|=(128|63&i)<<c[3&o++]):i<55296||i>=57344?(s[o>>2]|=(224|i>>12)<<c[3&o++],s[o>>2]|=(128|i>>6&63)<<c[3&o++],s[o>>2]|=(128|63&i)<<c[3&o++]):(i=65536+((1023&i)<<10|1023&r.charCodeAt(++h)),s[o>>2]|=(240|i>>18)<<c[3&o++],s[o>>2]|=(128|i>>12&63)<<c[3&o++],s[o>>2]|=(128|i>>6&63)<<c[3&o++],s[o>>2]|=(128|63&i)<<c[3&o++]);if(this.lastByteIndex=o,o>=u){for(this.start=o-u,this.block=s[l],o=0;o<l;++o)p[o]^=s[o];P(p),this.reset=!0}else this.start=o}return this},T.prototype.encode=function(r,e){var t=255&r,n=1,o=[t];for(t=255&(r>>=8);t>0;)o.unshift(t),t=255&(r>>=8),++n;return e?o.push(n):o.unshift(n),this.update(o),o.length},T.prototype.encodeString=function(r){var t,n=typeof r;if("string"!==n){if("object"!==n)throw new Error(e);if(null===r)throw new Error(e);if(a&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!(Array.isArray(r)||a&&ArrayBuffer.isView(r)))throw new Error(e);t=!0}var o=0;if(t)o=r.length;else for(var i=0;i<r.length;++i){var s=r.charCodeAt(i);s<128?o+=1:s<2048?o+=2:s<55296||s>=57344?o+=3:(s=65536+((1023&s)<<10|1023&r.charCodeAt(++i)),o+=4)}return o+=this.encode(8*o),this.update(r),o},T.prototype.bytepad=function(r,e){for(var t=this.encode(e),n=0;n<r.length;++n)t+=this.encodeString(r[n]);var o=[];return o.length=e-t%e,this.update(o),this},T.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var r=this.blocks,e=this.lastByteIndex,t=this.blockCount,n=this.s;if(r[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(r[0]=r[t],e=1;e<t+1;++e)r[e]=0;for(r[t-1]|=2147483648,e=0;e<t;++e)n[e]^=r[e];P(n)}},T.prototype.toString=T.prototype.hex=function(){this.finalize();for(var r,e=this.blockCount,t=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,a=0,u="";a<n;){for(i=0;i<e&&a<n;++i,++a)u+=s[(r=t[i])>>4&15]+s[15&r]+s[r>>12&15]+s[r>>8&15]+s[r>>20&15]+s[r>>16&15]+s[r>>28&15]+s[r>>24&15];a%e==0&&(P(t),i=0)}return o&&(u+=s[(r=t[i])>>4&15]+s[15&r],o>1&&(u+=s[r>>12&15]+s[r>>8&15]),o>2&&(u+=s[r>>20&15]+s[r>>16&15])),u},T.prototype.buffer=T.prototype.arrayBuffer=function(){this.finalize();var r,e=this.blockCount,t=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,a=0,s=this.outputBits>>3;r=o?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(r);a<n;){for(i=0;i<e&&a<n;++i,++a)u[a]=t[i];a%e==0&&P(t)}return o&&(u[i]=t[i],r=r.slice(0,s)),r},T.prototype.digest=T.prototype.array=function(){this.finalize();for(var r,e,t=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,a=0,s=0,u=[];s<o;){for(a=0;a<t&&s<o;++a,++s)u[r=s<<2]=255&(e=n[a]),u[r+1]=e>>8&255,u[r+2]=e>>16&255,u[r+3]=e>>24&255;s%t==0&&P(n)}return i&&(u[r=s<<2]=255&(e=n[a]),i>1&&(u[r+1]=e>>8&255),i>2&&(u[r+2]=e>>16&255)),u},(k.prototype=new T).finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var P=function(r){var e,t,n,o,i,a,s,u,c,l,h,p,d,v,E,y,N,g,w,b,A,I,_,R,U,C,O,m,S,T,k,P,D,M,x,L,F,B,G,W,j,z,V,J,X,H,K,$,Y,q,Q,Z,rr,er,tr,nr,or,ir,ar,sr,ur,cr,fr;for(n=0;n<48;n+=2)o=r[0]^r[10]^r[20]^r[30]^r[40],i=r[1]^r[11]^r[21]^r[31]^r[41],u=r[4]^r[14]^r[24]^r[34]^r[44],c=r[5]^r[15]^r[25]^r[35]^r[45],l=r[6]^r[16]^r[26]^r[36]^r[46],h=r[7]^r[17]^r[27]^r[37]^r[47],t=(d=r[9]^r[19]^r[29]^r[39]^r[49])^((s=r[3]^r[13]^r[23]^r[33]^r[43])<<1|(a=r[2]^r[12]^r[22]^r[32]^r[42])>>>31),r[0]^=e=(p=r[8]^r[18]^r[28]^r[38]^r[48])^(a<<1|s>>>31),r[1]^=t,r[10]^=e,r[11]^=t,r[20]^=e,r[21]^=t,r[30]^=e,r[31]^=t,r[40]^=e,r[41]^=t,t=i^(c<<1|u>>>31),r[2]^=e=o^(u<<1|c>>>31),r[3]^=t,r[12]^=e,r[13]^=t,r[22]^=e,r[23]^=t,r[32]^=e,r[33]^=t,r[42]^=e,r[43]^=t,t=s^(h<<1|l>>>31),r[4]^=e=a^(l<<1|h>>>31),r[5]^=t,r[14]^=e,r[15]^=t,r[24]^=e,r[25]^=t,r[34]^=e,r[35]^=t,r[44]^=e,r[45]^=t,t=c^(d<<1|p>>>31),r[6]^=e=u^(p<<1|d>>>31),r[7]^=t,r[16]^=e,r[17]^=t,r[26]^=e,r[27]^=t,r[36]^=e,r[37]^=t,r[46]^=e,r[47]^=t,t=h^(i<<1|o>>>31),r[8]^=e=l^(o<<1|i>>>31),r[9]^=t,r[18]^=e,r[19]^=t,r[28]^=e,r[29]^=t,r[38]^=e,r[39]^=t,r[48]^=e,r[49]^=t,E=r[1],H=r[11]<<4|r[10]>>>28,K=r[10]<<4|r[11]>>>28,m=r[20]<<3|r[21]>>>29,S=r[21]<<3|r[20]>>>29,sr=r[31]<<9|r[30]>>>23,ur=r[30]<<9|r[31]>>>23,z=r[40]<<18|r[41]>>>14,V=r[41]<<18|r[40]>>>14,M=r[2]<<1|r[3]>>>31,x=r[3]<<1|r[2]>>>31,N=r[12]<<12|r[13]>>>20,$=r[22]<<10|r[23]>>>22,Y=r[23]<<10|r[22]>>>22,T=r[33]<<13|r[32]>>>19,k=r[32]<<13|r[33]>>>19,cr=r[42]<<2|r[43]>>>30,fr=r[43]<<2|r[42]>>>30,er=r[5]<<30|r[4]>>>2,tr=r[4]<<30|r[5]>>>2,L=r[14]<<6|r[15]>>>26,F=r[15]<<6|r[14]>>>26,w=r[24]<<11|r[25]>>>21,q=r[34]<<15|r[35]>>>17,Q=r[35]<<15|r[34]>>>17,P=r[45]<<29|r[44]>>>3,D=r[44]<<29|r[45]>>>3,R=r[6]<<28|r[7]>>>4,U=r[7]<<28|r[6]>>>4,nr=r[17]<<23|r[16]>>>9,or=r[16]<<23|r[17]>>>9,B=r[26]<<25|r[27]>>>7,G=r[27]<<25|r[26]>>>7,b=r[36]<<21|r[37]>>>11,A=r[37]<<21|r[36]>>>11,Z=r[47]<<24|r[46]>>>8,rr=r[46]<<24|r[47]>>>8,J=r[8]<<27|r[9]>>>5,X=r[9]<<27|r[8]>>>5,C=r[18]<<20|r[19]>>>12,O=r[19]<<20|r[18]>>>12,ir=r[29]<<7|r[28]>>>25,ar=r[28]<<7|r[29]>>>25,W=r[38]<<8|r[39]>>>24,j=r[39]<<8|r[38]>>>24,I=r[48]<<14|r[49]>>>18,_=r[49]<<14|r[48]>>>18,r[0]=(v=r[0])^~(y=r[13]<<12|r[12]>>>20)&(g=r[25]<<11|r[24]>>>21),r[1]=E^~N&w,r[10]=R^~C&m,r[11]=U^~O&S,r[20]=M^~L&B,r[21]=x^~F&G,r[30]=J^~H&$,r[31]=X^~K&Y,r[40]=er^~nr&ir,r[41]=tr^~or&ar,r[2]=y^~g&b,r[3]=N^~w&A,r[12]=C^~m&T,r[13]=O^~S&k,r[22]=L^~B&W,r[23]=F^~G&j,r[32]=H^~$&q,r[33]=K^~Y&Q,r[42]=nr^~ir&sr,r[43]=or^~ar&ur,r[4]=g^~b&I,r[5]=w^~A&_,r[14]=m^~T&P,r[15]=S^~k&D,r[24]=B^~W&z,r[25]=G^~j&V,r[34]=$^~q&Z,r[35]=Y^~Q&rr,r[44]=ir^~sr&cr,r[45]=ar^~ur&fr,r[6]=b^~I&v,r[7]=A^~_&E,r[16]=T^~P&R,r[17]=k^~D&U,r[26]=W^~z&M,r[27]=j^~V&x,r[36]=q^~Z&J,r[37]=Q^~rr&X,r[46]=sr^~cr&er,r[47]=ur^~fr&tr,r[8]=I^~v&y,r[9]=_^~E&N,r[18]=P^~R&C,r[19]=D^~U&O,r[28]=z^~M&L,r[29]=V^~x&F,r[38]=Z^~J&H,r[39]=rr^~X&K,r[48]=cr^~er&nr,r[49]=fr^~tr&or,r[0]^=f[n],r[1]^=f[n+1]};if(i)r.exports=I;else for(R=0;R<_.length;++R)n[_[R]]=I[_[R]]}()},w(b={exports:{}},b.exports),b.exports),I=A;var _,R="production"===process.env.NODE_ENV,U="Invariant failed";function C(r,e){if(!r){if(R)throw new Error(U);var t="function"==typeof e?e():e;throw new Error(t?U+": "+t:U)}}function O(r){if("string"==typeof r){r=r.replace(/^Ox/,"0x");var e=Number.parseInt(r,"0x"===r.trim().substring(0,2)?16:10);return C(!Number.isNaN(e),"chainId ".concat(r," is not an integer")),e}return C(Number.isInteger(r),"chainId ".concat(r," is not an integer")),r}function m(r){C("string"==typeof r&&r.match(/^(0x)?[0-9a-fA-F]{40}$/),"Invalid address ".concat(r));for(var e="0x"===r.substring(0,2)?r:"0x".concat(r),t=e.toLowerCase().substring(2).split(""),n=new Uint8Array(40),o=0;o<40;o++)n[o]=t[o].charCodeAt(0);var i=N("0x"+I.keccak_256(N(n)));for(o=0;o<40;o+=2)i[o>>1]>>4>=8&&(t[o]=t[o].toUpperCase()),(15&i[o>>1])>=8&&(t[o+1]=t[o+1].toUpperCase());var a="0x".concat(t.join(""));return C(!(e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==a),"Bad address checksum ".concat(e," ").concat(a)),a}!function(r){r.Update="Web3ReactUpdate",r.Error="Web3ReactError",r.Deactivate="Web3ReactDeactivate"}(_||(_={}));var S=function(r){function e(e,t){var n=r.call(this)||this;return n.name="UnsupportedChainIdError",n.message="Unsupported chain id: ".concat(e,". Supported chain ids are: ").concat(t,"."),n}return function(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,r),e}(Error),T=e.ref(),k=e.ref(),P=e.ref(),D=e.ref(),M=e.ref(),x=e.computed((function(){return void 0!==T.value&&void 0!==k.value&&void 0!==P.value&&!M.value})),L=e.ref(),F=function(r,e){return function(){return null}};function B(r,e){return n(this,void 0,void 0,(function(){var t,n,i,a,s,u;return o(this,(function(o){switch(o.label){case 0:return void 0!==e.provider?[3,2]:[4,r.getProvider()];case 1:return n=o.sent(),[3,3];case 2:n=e.provider,o.label=3;case 3:return t=n,[4,Promise.all([void 0===e.chainId?r.getChainId():e.chainId,void 0===e.account?r.getAccount():e.account])];case 4:if(i=o.sent(),a=i[1],s=O(i[0]),r.supportedChainIds&&!r.supportedChainIds.includes(s))throw new S(s,r.supportedChainIds);return u=null===a?a:m(a),[2,{provider:t,chainId:s,account:u}]}}))}))}return r.UnsupportedChainIdError=S,r.setWeb3LibraryCallback=function(r){F=r},r.useWeb3=function(){var r=e.ref(),t=function(e){return n(void 0,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){return M.value?(M.value=void 0,[2]):T.value?void 0!==(t=void 0===e.chainId?void 0:O(e.chainId))&&T.value.supportedChainIds&&!T.value.supportedChainIds.includes(t)?(n=new S(t,T.value.supportedChainIds),r.value?r.value(n):i(n),[2]):(t&&(k.value=t),e.provider&&(D.value=e.provider),(s="string"==typeof e.account?m(e.account):e.account)&&(P.value=s),[2]):(a(),[2])}))}))},i=function(e){var t;M.value=e,r.value&&r.value(e),x&&(null===(t=T.value)||void 0===t||t.deactivate()),a()},a=function(){T.value=void 0,k.value=void 0,D.value=void 0,P.value=void 0,L.value=void 0};return e.watch([x,D,T,k],(function(){L.value=x.value&&void 0!==k.value&&Number.isInteger(k.value)&&T.value?F(D.value,T.value):void 0})),e.watch(T,(function(){T.value&&T.value.on(_.Update,t).on(_.Error,i).on(_.Deactivate,a)}),{immediate:!0}),e.onBeforeUnmount((function(){T.value&&T.value.off(_.Update,t).off(_.Error,i).off(_.Deactivate,a)})),{library:L,active:x,activate:function(e,t,i){return void 0===i&&(i=!1),n(void 0,void 0,void 0,(function(){var n,a,s,u;return o(this,(function(o){switch(o.label){case 0:n=!1,o.label=1;case 1:return o.trys.push([1,4,,5]),[4,e.activate().then((function(r){return n=!0,r}))];case 2:return a=o.sent(),[4,B(e,a)];case 3:return s=o.sent(),T.value=e,k.value=s.chainId,D.value=s.provider,P.value=s.account,M.value=void 0,r.value=t,[3,5];case 4:if(u=o.sent(),M.value=u,i)throw n&&e.deactivate(),u;return t&&(n&&e.deactivate(),t(u)),[3,5];case 5:return[2]}}))}))},deactivate:function(){var r;null===(r=T.value)||void 0===r||r.deactivate(),a()},connector:T,chainId:k,account:P,provider:D,error:M}},Object.defineProperty(r,"__esModule",{value:!0}),r}({},VueDemi); |
{ | ||
"name": "@instadapp/vue-web3", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Vue web3 composition api", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
# @instadapp/vue-web3 | ||
Vue 2/3 wrapper for web3 built on top of [react-web3](https://github.com/NoahZinsmeister/web3-react). | ||
Vue 2/3 wrapper for web3 built on top of [react-web3@v6](https://github.com/NoahZinsmeister/web3-react/tree/v6). | ||
@@ -5,0 +5,0 @@ ## 🚀 Quick Start |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
292517
7077