gun-eth 1.4.28 → 1.4.29
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/gun-eth.cjs.js +25493 -2
- package/dist/gun-eth.cjs.js.map +1 -0
- package/dist/gun-eth.esm.js +1 -0
- package/dist/gun-eth.esm.js.map +1 -0
- package/dist/gun-eth.min.js +1 -0
- package/dist/gun-eth.min.js.map +1 -0
- package/dist/gun-eth.mjs +25489 -0
- package/dist/gun-eth.mjs.map +1 -0
- package/package.json +19 -5
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"gun-eth.min.js","sources":["../node_modules/bn.js/lib/bn.js","../node_modules/@ethersproject/logger/lib.esm/index.js","../node_modules/@ethersproject/logger/lib.esm/_version.js","../node_modules/@ethersproject/bytes/lib.esm/_version.js","../node_modules/@ethersproject/bytes/lib.esm/index.js","../node_modules/@ethersproject/bignumber/lib.esm/_version.js","../node_modules/@ethersproject/bignumber/lib.esm/bignumber.js","../node_modules/@ethersproject/bignumber/lib.esm/fixednumber.js","../node_modules/@ethersproject/properties/lib.esm/index.js","../node_modules/@ethersproject/properties/lib.esm/_version.js","../node_modules/@ethersproject/abi/lib.esm/_version.js","../node_modules/@ethersproject/abi/lib.esm/fragments.js","../node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js","../node_modules/js-sha3/src/sha3.js","../node_modules/@ethersproject/keccak256/lib.esm/index.js","../node_modules/@ethersproject/rlp/lib.esm/_version.js","../node_modules/@ethersproject/rlp/lib.esm/index.js","../node_modules/@ethersproject/address/lib.esm/_version.js","../node_modules/@ethersproject/address/lib.esm/index.js","../node_modules/@ethersproject/abi/lib.esm/coders/address.js","../node_modules/@ethersproject/abi/lib.esm/coders/anonymous.js","../node_modules/@ethersproject/abi/lib.esm/coders/array.js","../node_modules/@ethersproject/abi/lib.esm/coders/boolean.js","../node_modules/@ethersproject/abi/lib.esm/coders/bytes.js","../node_modules/@ethersproject/abi/lib.esm/coders/fixed-bytes.js","../node_modules/@ethersproject/abi/lib.esm/coders/null.js","../node_modules/@ethersproject/constants/lib.esm/addresses.js","../node_modules/@ethersproject/constants/lib.esm/bignumbers.js","../node_modules/@ethersproject/constants/lib.esm/hashes.js","../node_modules/@ethersproject/constants/lib.esm/strings.js","../node_modules/@ethersproject/abi/lib.esm/coders/number.js","../node_modules/@ethersproject/strings/lib.esm/_version.js","../node_modules/@ethersproject/strings/lib.esm/utf8.js","../node_modules/@ethersproject/strings/lib.esm/idna.js","../node_modules/@ethersproject/strings/lib.esm/bytes32.js","../node_modules/@ethersproject/abi/lib.esm/coders/string.js","../node_modules/@ethersproject/abi/lib.esm/coders/tuple.js","../node_modules/@ethersproject/abi/lib.esm/abi-coder.js","../node_modules/@ethersproject/hash/lib.esm/id.js","../node_modules/@ethersproject/hash/lib.esm/_version.js","../node_modules/@ethersproject/base64/lib.esm/base64.js","../node_modules/@ethersproject/hash/lib.esm/ens-normalize/decoder.js","../node_modules/@ethersproject/hash/lib.esm/ens-normalize/lib.js","../node_modules/@ethersproject/hash/lib.esm/ens-normalize/include.js","../node_modules/@ethersproject/hash/lib.esm/namehash.js","../node_modules/@ethersproject/hash/lib.esm/message.js","../node_modules/@ethersproject/hash/lib.esm/typed-data.js","../node_modules/@ethersproject/abi/lib.esm/interface.js","../node_modules/@ethersproject/abstract-provider/lib.esm/index.js","../node_modules/@ethersproject/abstract-provider/lib.esm/_version.js","../node_modules/@ethersproject/abstract-signer/lib.esm/index.js","../node_modules/@ethersproject/abstract-signer/lib.esm/_version.js","../node_modules/minimalistic-assert/index.js","../node_modules/inherits/inherits_browser.js","../node_modules/hash.js/lib/hash/utils.js","../node_modules/hash.js/lib/hash/common.js","../node_modules/hash.js/lib/hash/sha/common.js","../node_modules/hash.js/lib/hash/sha/1.js","../node_modules/hash.js/lib/hash/sha/256.js","../node_modules/hash.js/lib/hash/sha/224.js","../node_modules/hash.js/lib/hash/sha/512.js","../node_modules/hash.js/lib/hash/sha/384.js","../node_modules/hash.js/lib/hash/sha.js","../node_modules/hash.js/lib/hash/ripemd.js","../node_modules/hash.js/lib/hash/hmac.js","../node_modules/hash.js/lib/hash.js","../node_modules/@ethersproject/signing-key/lib.esm/elliptic.js","../node_modules/@ethersproject/signing-key/lib.esm/_version.js","../node_modules/@ethersproject/signing-key/lib.esm/index.js","../node_modules/@ethersproject/transactions/lib.esm/_version.js","../node_modules/@ethersproject/transactions/lib.esm/index.js","../node_modules/@ethersproject/contracts/lib.esm/index.js","../node_modules/@ethersproject/contracts/lib.esm/_version.js","../node_modules/@ethersproject/basex/lib.esm/index.js","../node_modules/@ethersproject/sha2/lib.esm/types.js","../node_modules/@ethersproject/sha2/lib.esm/_version.js","../node_modules/@ethersproject/sha2/lib.esm/sha2.js","../node_modules/@ethersproject/pbkdf2/lib.esm/pbkdf2.js","../node_modules/@ethersproject/wordlists/lib.esm/_version.js","../node_modules/@ethersproject/wordlists/lib.esm/wordlist.js","../node_modules/@ethersproject/wordlists/lib.esm/lang-en.js","../node_modules/@ethersproject/wordlists/lib.esm/wordlists.js","../node_modules/@ethersproject/hdnode/lib.esm/_version.js","../node_modules/@ethersproject/hdnode/lib.esm/index.js","../node_modules/@ethersproject/random/lib.esm/_version.js","../node_modules/@ethersproject/random/lib.esm/random.js","../node_modules/@ethersproject/random/lib.esm/shuffle.js","../node_modules/aes-js/index.js","../node_modules/@ethersproject/json-wallets/lib.esm/_version.js","../node_modules/@ethersproject/json-wallets/lib.esm/utils.js","../node_modules/@ethersproject/json-wallets/lib.esm/crowdsale.js","../node_modules/@ethersproject/json-wallets/lib.esm/inspect.js","../node_modules/scrypt-js/scrypt.js","../node_modules/@ethersproject/json-wallets/lib.esm/keystore.js","../node_modules/@ethersproject/json-wallets/lib.esm/index.js","../node_modules/@ethersproject/wallet/lib.esm/index.js","../node_modules/@ethersproject/wallet/lib.esm/_version.js","../node_modules/@ethersproject/networks/lib.esm/_version.js","../node_modules/@ethersproject/networks/lib.esm/index.js","../node_modules/@ethersproject/web/lib.esm/geturl.js","../node_modules/@ethersproject/web/lib.esm/index.js","../node_modules/@ethersproject/web/lib.esm/_version.js","../node_modules/bech32/index.js","../node_modules/@ethersproject/providers/lib.esm/_version.js","../node_modules/@ethersproject/providers/lib.esm/formatter.js","../node_modules/@ethersproject/providers/lib.esm/base-provider.js","../node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js","../node_modules/@ethersproject/providers/lib.esm/ws.js","../node_modules/@ethersproject/providers/lib.esm/websocket-provider.js","../node_modules/@ethersproject/providers/lib.esm/url-json-rpc-provider.js","../node_modules/@ethersproject/providers/lib.esm/alchemy-provider.js","../node_modules/@ethersproject/providers/lib.esm/ankr-provider.js","../node_modules/@ethersproject/providers/lib.esm/cloudflare-provider.js","../node_modules/@ethersproject/providers/lib.esm/etherscan-provider.js","../node_modules/@ethersproject/providers/lib.esm/fallback-provider.js","../node_modules/@ethersproject/providers/lib.esm/ipc-provider.js","../node_modules/@ethersproject/providers/lib.esm/infura-provider.js","../node_modules/@ethersproject/providers/lib.esm/nodesmith-provider.js","../node_modules/@ethersproject/providers/lib.esm/pocket-provider.js","../node_modules/@ethersproject/providers/lib.esm/web3-provider.js","../node_modules/@ethersproject/providers/lib.esm/index.js","../node_modules/@ethersproject/providers/lib.esm/json-rpc-batch-provider.js","../node_modules/@ethersproject/solidity/lib.esm/_version.js","../node_modules/@ethersproject/solidity/lib.esm/index.js","../node_modules/@ethersproject/units/lib.esm/_version.js","../node_modules/@ethersproject/units/lib.esm/index.js","../node_modules/ethers/lib/utils.js","../node_modules/ethers/lib/_version.js","../node_modules/ethers/lib/ethers.js","../src/config/local.js","../src/abis/abis.js","../src/index.js"],"sourcesContent":["(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = { debug: 1, \"default\": 2, info: 2, warning: 3, error: 4, off: 5 };\nlet _logLevel = LogLevels[\"default\"];\nimport { version } from \"./_version\";\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n ;\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !== String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Ethereum Network, such as an invalid chain ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + gasLimit * gasPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The gas limit could not be estimated\n // - transaction: the transaction passed to estimateGas\n ErrorCode[\"UNPREDICTABLE_GAS_LIMIT\"] = \"UNPREDICTABLE_GAS_LIMIT\";\n // The transaction was replaced by one with a higher gas price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n ///////////////////\n // Interaction Errors\n // The user rejected the action, such as signing a message or sending\n // a transaction\n ErrorCode[\"ACTION_REJECTED\"] = \"ACTION_REJECTED\";\n})(ErrorCode || (ErrorCode = {}));\n;\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n let url = \"\";\n switch (code) {\n case ErrorCode.NUMERIC_FAULT: {\n url = \"NUMERIC_FAULT\";\n const fault = message;\n switch (fault) {\n case \"overflow\":\n case \"underflow\":\n case \"division-by-zero\":\n url += \"-\" + fault;\n break;\n case \"negative-power\":\n case \"negative-width\":\n url += \"-unsupported\";\n break;\n case \"unbound-bitwise-result\":\n url += \"-unbound-result\";\n break;\n }\n break;\n }\n case ErrorCode.CALL_EXCEPTION:\n case ErrorCode.INSUFFICIENT_FUNDS:\n case ErrorCode.MISSING_NEW:\n case ErrorCode.NONCE_EXPIRED:\n case ErrorCode.REPLACEMENT_UNDERPRICED:\n case ErrorCode.TRANSACTION_REPLACED:\n case ErrorCode.UNPREDICTABLE_GAS_LIMIT:\n url = code;\n break;\n }\n if (url) {\n message += \" [ See: https:/\\/links.ethers.org/v5-errors-\" + url + \" ]\";\n }\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\", form: _normalizeError\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof (value) !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, { name: kind.name });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" + JSON.stringify(kind.name) + \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, { name: kind.name });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(version);\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\"\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\"\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\nLogger.errors = ErrorCode;\nLogger.levels = LogLevel;\n//# sourceMappingURL=index.js.map","export const version = \"logger/5.7.0\";\n//# sourceMappingURL=_version.js.map","export const version = \"bytes/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n///////////////////////////////\nfunction isHexable(value) {\n return !!(value.toHexString);\n}\nfunction addSlice(array) {\n if (array.slice) {\n return array;\n }\n array.slice = function () {\n const args = Array.prototype.slice.call(arguments);\n return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args)));\n };\n return array;\n}\nexport function isBytesLike(value) {\n return ((isHexString(value) && !(value.length % 2)) || isBytes(value));\n}\nfunction isInteger(value) {\n return (typeof (value) === \"number\" && value == value && (value % 1) === 0);\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof (value) === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof (value) === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return addSlice(new Uint8Array(result));\n }\n if (options.allowMissingPrefix && typeof (value) === \"string\" && value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0\" + hex;\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return addSlice(new Uint8Array(result));\n }\n if (isBytes(value)) {\n return addSlice(new Uint8Array(value));\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nexport function concat(items) {\n const objects = items.map(item => arrayify(item));\n const length = objects.reduce((accum, item) => (accum + item.length), 0);\n const result = new Uint8Array(length);\n objects.reduce((offset, object) => {\n result.set(object, offset);\n return offset + object.length;\n }, 0);\n return addSlice(result);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function zeroPad(value, length) {\n value = arrayify(value);\n if (value.length > length) {\n logger.throwArgumentError(\"value out of range\", \"value\", arguments[0]);\n }\n const result = new Uint8Array(length);\n result.set(value, length - value.length);\n return addSlice(result);\n}\nexport function isHexString(value, length) {\n if (typeof (value) !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (length && value.length !== 2 + 2 * length) {\n return false;\n }\n return true;\n}\nconst HexCharacters = \"0123456789abcdef\";\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof (value) === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof (value) === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return (\"0x0\" + value);\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix && typeof (value) === \"string\" && value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/*\nfunction unoddify(value: BytesLike | Hexable | number): BytesLike | Hexable | number {\n if (typeof(value) === \"string\" && value.length % 2 && value.substring(0, 2) === \"0x\") {\n return \"0x0\" + value.substring(2);\n }\n return value;\n}\n*/\nexport function hexDataLength(data) {\n if (typeof (data) !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || (data.length % 2)) {\n return null;\n }\n return (data.length - 2) / 2;\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof (data) !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || (data.length % 2)) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\nexport function hexValue(value) {\n const trimmed = hexStripZeros(hexlify(value, { hexPad: \"left\" }));\n if (trimmed === \"0x\") {\n return \"0x0\";\n }\n return trimmed;\n}\nexport function hexStripZeros(value) {\n if (typeof (value) !== \"string\") {\n value = hexlify(value);\n }\n if (!isHexString(value)) {\n logger.throwArgumentError(\"invalid hex string\", \"value\", value);\n }\n value = value.substring(2);\n let offset = 0;\n while (offset < value.length && value[offset] === \"0\") {\n offset++;\n }\n return \"0x\" + value.substring(offset);\n}\nexport function hexZeroPad(value, length) {\n if (typeof (value) !== \"string\") {\n value = hexlify(value);\n }\n else if (!isHexString(value)) {\n logger.throwArgumentError(\"invalid hex string\", \"value\", value);\n }\n if (value.length > 2 * length + 2) {\n logger.throwArgumentError(\"value out of range\", \"value\", arguments[1]);\n }\n while (value.length < 2 * length + 2) {\n value = \"0x0\" + value.substring(2);\n }\n return value;\n}\nexport function splitSignature(signature) {\n const result = {\n r: \"0x\",\n s: \"0x\",\n _vs: \"0x\",\n recoveryParam: 0,\n v: 0,\n yParityAndS: \"0x\",\n compact: \"0x\"\n };\n if (isBytesLike(signature)) {\n let bytes = arrayify(signature);\n // Get the r, s and v\n if (bytes.length === 64) {\n // EIP-2098; pull the v from the top bit of s and clear it\n result.v = 27 + (bytes[32] >> 7);\n bytes[32] &= 0x7f;\n result.r = hexlify(bytes.slice(0, 32));\n result.s = hexlify(bytes.slice(32, 64));\n }\n else if (bytes.length === 65) {\n result.r = hexlify(bytes.slice(0, 32));\n result.s = hexlify(bytes.slice(32, 64));\n result.v = bytes[64];\n }\n else {\n logger.throwArgumentError(\"invalid signature string\", \"signature\", signature);\n }\n // Allow a recid to be used as the v\n if (result.v < 27) {\n if (result.v === 0 || result.v === 1) {\n result.v += 27;\n }\n else {\n logger.throwArgumentError(\"signature invalid v byte\", \"signature\", signature);\n }\n }\n // Compute recoveryParam from v\n result.recoveryParam = 1 - (result.v % 2);\n // Compute _vs from recoveryParam and s\n if (result.recoveryParam) {\n bytes[32] |= 0x80;\n }\n result._vs = hexlify(bytes.slice(32, 64));\n }\n else {\n result.r = signature.r;\n result.s = signature.s;\n result.v = signature.v;\n result.recoveryParam = signature.recoveryParam;\n result._vs = signature._vs;\n // If the _vs is available, use it to populate missing s, v and recoveryParam\n // and verify non-missing s, v and recoveryParam\n if (result._vs != null) {\n const vs = zeroPad(arrayify(result._vs), 32);\n result._vs = hexlify(vs);\n // Set or check the recid\n const recoveryParam = ((vs[0] >= 128) ? 1 : 0);\n if (result.recoveryParam == null) {\n result.recoveryParam = recoveryParam;\n }\n else if (result.recoveryParam !== recoveryParam) {\n logger.throwArgumentError(\"signature recoveryParam mismatch _vs\", \"signature\", signature);\n }\n // Set or check the s\n vs[0] &= 0x7f;\n const s = hexlify(vs);\n if (result.s == null) {\n result.s = s;\n }\n else if (result.s !== s) {\n logger.throwArgumentError(\"signature v mismatch _vs\", \"signature\", signature);\n }\n }\n // Use recid and v to populate each other\n if (result.recoveryParam == null) {\n if (result.v == null) {\n logger.throwArgumentError(\"signature missing v and recoveryParam\", \"signature\", signature);\n }\n else if (result.v === 0 || result.v === 1) {\n result.recoveryParam = result.v;\n }\n else {\n result.recoveryParam = 1 - (result.v % 2);\n }\n }\n else {\n if (result.v == null) {\n result.v = 27 + result.recoveryParam;\n }\n else {\n const recId = (result.v === 0 || result.v === 1) ? result.v : (1 - (result.v % 2));\n if (result.recoveryParam !== recId) {\n logger.throwArgumentError(\"signature recoveryParam mismatch v\", \"signature\", signature);\n }\n }\n }\n if (result.r == null || !isHexString(result.r)) {\n logger.throwArgumentError(\"signature missing or invalid r\", \"signature\", signature);\n }\n else {\n result.r = hexZeroPad(result.r, 32);\n }\n if (result.s == null || !isHexString(result.s)) {\n logger.throwArgumentError(\"signature missing or invalid s\", \"signature\", signature);\n }\n else {\n result.s = hexZeroPad(result.s, 32);\n }\n const vs = arrayify(result.s);\n if (vs[0] >= 128) {\n logger.throwArgumentError(\"signature s out of range\", \"signature\", signature);\n }\n if (result.recoveryParam) {\n vs[0] |= 0x80;\n }\n const _vs = hexlify(vs);\n if (result._vs) {\n if (!isHexString(result._vs)) {\n logger.throwArgumentError(\"signature invalid _vs\", \"signature\", signature);\n }\n result._vs = hexZeroPad(result._vs, 32);\n }\n // Set or check the _vs\n if (result._vs == null) {\n result._vs = _vs;\n }\n else if (result._vs !== _vs) {\n logger.throwArgumentError(\"signature _vs mismatch v and s\", \"signature\", signature);\n }\n }\n result.yParityAndS = result._vs;\n result.compact = result.r + result.yParityAndS.substring(2);\n return result;\n}\nexport function joinSignature(signature) {\n signature = splitSignature(signature);\n return hexlify(concat([\n signature.r,\n signature.s,\n (signature.recoveryParam ? \"0x1c\" : \"0x1b\")\n ]));\n}\n//# sourceMappingURL=index.js.map","export const version = \"bignumber/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\nimport _BN from \"bn.js\";\nvar BN = _BN.BN;\nimport { hexlify, isBytes, isHexString } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nexport function isBigNumberish(value) {\n return (value != null) && (BigNumber.isBigNumber(value) ||\n (typeof (value) === \"number\" && (value % 1) === 0) ||\n (typeof (value) === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n isHexString(value) ||\n (typeof (value) === \"bigint\") ||\n isBytes(value));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nexport class BigNumber {\n constructor(constructorGuard, hex) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\"\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division-by-zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"division-by-zero\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"negative-power\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"unbound-bitwise-result\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"unbound-bitwise-result\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"unbound-bitwise-result\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"negative-width\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"negative-width\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"negative-width\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return (this._hex[0] === \"-\");\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString()\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof (value) === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof (value) === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof (anyValue) === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof (hex) === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof (hex) === \"string\") {\n if (isHexString(hex) || (hex[0] === \"-\" && isHexString(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof (value) !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return (new BN(\"-\" + hex.substring(3), 16));\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nexport function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}\n// value should have no prefix\nexport function _base16To36(value) {\n return (new BN(value, 16)).toString(36);\n}\n//# sourceMappingURL=bignumber.js.map","\"use strict\";\nimport { arrayify, hexZeroPad, isBytes } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { BigNumber, isBigNumberish } from \"./bignumber\";\nconst _constructorGuard = {};\nconst Zero = BigNumber.from(0);\nconst NegativeOne = BigNumber.from(-1);\nfunction throwFault(message, fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value !== undefined) {\n params.value = value;\n }\n return logger.throwError(message, Logger.errors.NUMERIC_FAULT, params);\n}\n// Constant to pull zeros from for multipliers\nlet zeros = \"0\";\nwhile (zeros.length < 256) {\n zeros += zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getMultiplier(decimals) {\n if (typeof (decimals) !== \"number\") {\n try {\n decimals = BigNumber.from(decimals).toNumber();\n }\n catch (e) { }\n }\n if (typeof (decimals) === \"number\" && decimals >= 0 && decimals <= 256 && !(decimals % 1)) {\n return (\"1\" + zeros.substring(0, decimals));\n }\n return logger.throwArgumentError(\"invalid decimal size\", \"decimals\", decimals);\n}\nexport function formatFixed(value, decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n const multiplier = getMultiplier(decimals);\n // Make sure wei is a big number (convert as necessary)\n value = BigNumber.from(value);\n const negative = value.lt(Zero);\n if (negative) {\n value = value.mul(NegativeOne);\n }\n let fraction = value.mod(multiplier).toString();\n while (fraction.length < multiplier.length - 1) {\n fraction = \"0\" + fraction;\n }\n // Strip training 0\n fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1];\n const whole = value.div(multiplier).toString();\n if (multiplier.length === 1) {\n value = whole;\n }\n else {\n value = whole + \".\" + fraction;\n }\n if (negative) {\n value = \"-\" + value;\n }\n return value;\n}\nexport function parseFixed(value, decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n const multiplier = getMultiplier(decimals);\n if (typeof (value) !== \"string\" || !value.match(/^-?[0-9.]+$/)) {\n logger.throwArgumentError(\"invalid decimal value\", \"value\", value);\n }\n // Is it negative?\n const negative = (value.substring(0, 1) === \"-\");\n if (negative) {\n value = value.substring(1);\n }\n if (value === \".\") {\n logger.throwArgumentError(\"missing value\", \"value\", value);\n }\n // Split it into a whole and fractional part\n const comps = value.split(\".\");\n if (comps.length > 2) {\n logger.throwArgumentError(\"too many decimal points\", \"value\", value);\n }\n let whole = comps[0], fraction = comps[1];\n if (!whole) {\n whole = \"0\";\n }\n if (!fraction) {\n fraction = \"0\";\n }\n // Trim trailing zeros\n while (fraction[fraction.length - 1] === \"0\") {\n fraction = fraction.substring(0, fraction.length - 1);\n }\n // Check the fraction doesn't exceed our decimals size\n if (fraction.length > multiplier.length - 1) {\n throwFault(\"fractional component exceeds decimals\", \"underflow\", \"parseFixed\");\n }\n // If decimals is 0, we have an empty string for fraction\n if (fraction === \"\") {\n fraction = \"0\";\n }\n // Fully pad the string with zeros to get to wei\n while (fraction.length < multiplier.length - 1) {\n fraction += \"0\";\n }\n const wholeValue = BigNumber.from(whole);\n const fractionValue = BigNumber.from(fraction);\n let wei = (wholeValue.mul(multiplier)).add(fractionValue);\n if (negative) {\n wei = wei.mul(NegativeOne);\n }\n return wei;\n}\nexport class FixedFormat {\n constructor(constructorGuard, signed, width, decimals) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot use FixedFormat constructor; use FixedFormat.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new FixedFormat\"\n });\n }\n this.signed = signed;\n this.width = width;\n this.decimals = decimals;\n this.name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n this._multiplier = getMultiplier(decimals);\n Object.freeze(this);\n }\n static from(value) {\n if (value instanceof FixedFormat) {\n return value;\n }\n if (typeof (value) === \"number\") {\n value = `fixed128x${value}`;\n }\n let signed = true;\n let width = 128;\n let decimals = 18;\n if (typeof (value) === \"string\") {\n if (value === \"fixed\") {\n // defaults...\n }\n else if (value === \"ufixed\") {\n signed = false;\n }\n else {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n if (!match) {\n logger.throwArgumentError(\"invalid fixed format\", \"format\", value);\n }\n signed = (match[1] !== \"u\");\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n }\n else if (value) {\n const check = (key, type, defaultValue) => {\n if (value[key] == null) {\n return defaultValue;\n }\n if (typeof (value[key]) !== type) {\n logger.throwArgumentError(\"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, value[key]);\n }\n return value[key];\n };\n signed = check(\"signed\", \"boolean\", signed);\n width = check(\"width\", \"number\", width);\n decimals = check(\"decimals\", \"number\", decimals);\n }\n if (width % 8) {\n logger.throwArgumentError(\"invalid fixed format width (not byte aligned)\", \"format.width\", width);\n }\n if (decimals > 80) {\n logger.throwArgumentError(\"invalid fixed format (decimals too large)\", \"format.decimals\", decimals);\n }\n return new FixedFormat(_constructorGuard, signed, width, decimals);\n }\n}\nexport class FixedNumber {\n constructor(constructorGuard, hex, value, format) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot use FixedNumber constructor; use FixedNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new FixedFormat\"\n });\n }\n this.format = format;\n this._hex = hex;\n this._value = value;\n this._isFixedNumber = true;\n Object.freeze(this);\n }\n _checkFormat(other) {\n if (this.format.name !== other.format.name) {\n logger.throwArgumentError(\"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n }\n addUnsafe(other) {\n this._checkFormat(other);\n const a = parseFixed(this._value, this.format.decimals);\n const b = parseFixed(other._value, other.format.decimals);\n return FixedNumber.fromValue(a.add(b), this.format.decimals, this.format);\n }\n subUnsafe(other) {\n this._checkFormat(other);\n const a = parseFixed(this._value, this.format.decimals);\n const b = parseFixed(other._value, other.format.decimals);\n return FixedNumber.fromValue(a.sub(b), this.format.decimals, this.format);\n }\n mulUnsafe(other) {\n this._checkFormat(other);\n const a = parseFixed(this._value, this.format.decimals);\n const b = parseFixed(other._value, other.format.decimals);\n return FixedNumber.fromValue(a.mul(b).div(this.format._multiplier), this.format.decimals, this.format);\n }\n divUnsafe(other) {\n this._checkFormat(other);\n const a = parseFixed(this._value, this.format.decimals);\n const b = parseFixed(other._value, other.format.decimals);\n return FixedNumber.fromValue(a.mul(this.format._multiplier).div(b), this.format.decimals, this.format);\n }\n floor() {\n const comps = this.toString().split(\".\");\n if (comps.length === 1) {\n comps.push(\"0\");\n }\n let result = FixedNumber.from(comps[0], this.format);\n const hasFraction = !comps[1].match(/^(0*)$/);\n if (this.isNegative() && hasFraction) {\n result = result.subUnsafe(ONE.toFormat(result.format));\n }\n return result;\n }\n ceiling() {\n const comps = this.toString().split(\".\");\n if (comps.length === 1) {\n comps.push(\"0\");\n }\n let result = FixedNumber.from(comps[0], this.format);\n const hasFraction = !comps[1].match(/^(0*)$/);\n if (!this.isNegative() && hasFraction) {\n result = result.addUnsafe(ONE.toFormat(result.format));\n }\n return result;\n }\n // @TODO: Support other rounding algorithms\n round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // If we are already in range, we're done\n const comps = this.toString().split(\".\");\n if (comps.length === 1) {\n comps.push(\"0\");\n }\n if (decimals < 0 || decimals > 80 || (decimals % 1)) {\n logger.throwArgumentError(\"invalid decimal count\", \"decimals\", decimals);\n }\n if (comps[1].length <= decimals) {\n return this;\n }\n const factor = FixedNumber.from(\"1\" + zeros.substring(0, decimals), this.format);\n const bump = BUMP.toFormat(this.format);\n return this.mulUnsafe(factor).addUnsafe(bump).floor().divUnsafe(factor);\n }\n isZero() {\n return (this._value === \"0.0\" || this._value === \"0\");\n }\n isNegative() {\n return (this._value[0] === \"-\");\n }\n toString() { return this._value; }\n toHexString(width) {\n if (width == null) {\n return this._hex;\n }\n if (width % 8) {\n logger.throwArgumentError(\"invalid byte width\", \"width\", width);\n }\n const hex = BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();\n return hexZeroPad(hex, width / 8);\n }\n toUnsafeFloat() { return parseFloat(this.toString()); }\n toFormat(format) {\n return FixedNumber.fromString(this._value, format);\n }\n static fromValue(value, decimals, format) {\n // If decimals looks more like a format, and there is no format, shift the parameters\n if (format == null && decimals != null && !isBigNumberish(decimals)) {\n format = decimals;\n decimals = null;\n }\n if (decimals == null) {\n decimals = 0;\n }\n if (format == null) {\n format = \"fixed\";\n }\n return FixedNumber.fromString(formatFixed(value, decimals), FixedFormat.from(format));\n }\n static fromString(value, format) {\n if (format == null) {\n format = \"fixed\";\n }\n const fixedFormat = FixedFormat.from(format);\n const numeric = parseFixed(value, fixedFormat.decimals);\n if (!fixedFormat.signed && numeric.lt(Zero)) {\n throwFault(\"unsigned value cannot be negative\", \"overflow\", \"value\", value);\n }\n let hex = null;\n if (fixedFormat.signed) {\n hex = numeric.toTwos(fixedFormat.width).toHexString();\n }\n else {\n hex = numeric.toHexString();\n hex = hexZeroPad(hex, fixedFormat.width / 8);\n }\n const decimal = formatFixed(numeric, fixedFormat.decimals);\n return new FixedNumber(_constructorGuard, hex, decimal, fixedFormat);\n }\n static fromBytes(value, format) {\n if (format == null) {\n format = \"fixed\";\n }\n const fixedFormat = FixedFormat.from(format);\n if (arrayify(value).length > fixedFormat.width / 8) {\n throw new Error(\"overflow\");\n }\n let numeric = BigNumber.from(value);\n if (fixedFormat.signed) {\n numeric = numeric.fromTwos(fixedFormat.width);\n }\n const hex = numeric.toTwos((fixedFormat.signed ? 0 : 1) + fixedFormat.width).toHexString();\n const decimal = formatFixed(numeric, fixedFormat.decimals);\n return new FixedNumber(_constructorGuard, hex, decimal, fixedFormat);\n }\n static from(value, format) {\n if (typeof (value) === \"string\") {\n return FixedNumber.fromString(value, format);\n }\n if (isBytes(value)) {\n return FixedNumber.fromBytes(value, format);\n }\n try {\n return FixedNumber.fromValue(value, 0, format);\n }\n catch (error) {\n // Allow NUMERIC_FAULT to bubble up\n if (error.code !== Logger.errors.INVALID_ARGUMENT) {\n throw error;\n }\n }\n return logger.throwArgumentError(\"invalid FixedNumber value\", \"value\", value);\n }\n static isFixedNumber(value) {\n return !!(value && value._isFixedNumber);\n }\n}\nconst ONE = FixedNumber.from(1);\nconst BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport function defineReadOnly(object, name, value) {\n Object.defineProperty(object, name, {\n enumerable: true,\n value: value,\n writable: false,\n });\n}\n// Crawl up the constructor chain to find a static method\nexport function getStatic(ctor, key) {\n for (let i = 0; i < 32; i++) {\n if (ctor[key]) {\n return ctor[key];\n }\n if (!ctor.prototype || typeof (ctor.prototype) !== \"object\") {\n break;\n }\n ctor = Object.getPrototypeOf(ctor.prototype).constructor;\n }\n return null;\n}\nexport function resolveProperties(object) {\n return __awaiter(this, void 0, void 0, function* () {\n const promises = Object.keys(object).map((key) => {\n const value = object[key];\n return Promise.resolve(value).then((v) => ({ key: key, value: v }));\n });\n const results = yield Promise.all(promises);\n return results.reduce((accum, result) => {\n accum[(result.key)] = result.value;\n return accum;\n }, {});\n });\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof (object) !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\nexport function shallowCopy(object) {\n const result = {};\n for (const key in object) {\n result[key] = object[key];\n }\n return result;\n}\nconst opaque = { bigint: true, boolean: true, \"function\": true, number: true, string: true };\nfunction _isFrozen(object) {\n // Opaque objects are not mutable, so safe to copy by assignment\n if (object === undefined || object === null || opaque[typeof (object)]) {\n return true;\n }\n if (Array.isArray(object) || typeof (object) === \"object\") {\n if (!Object.isFrozen(object)) {\n return false;\n }\n const keys = Object.keys(object);\n for (let i = 0; i < keys.length; i++) {\n let value = null;\n try {\n value = object[keys[i]];\n }\n catch (error) {\n // If accessing a value triggers an error, it is a getter\n // designed to do so (e.g. Result) and is therefore \"frozen\"\n continue;\n }\n if (!_isFrozen(value)) {\n return false;\n }\n }\n return true;\n }\n return logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}\n// Returns a new copy of object, such that no properties may be replaced.\n// New properties may be added only to objects.\nfunction _deepCopy(object) {\n if (_isFrozen(object)) {\n return object;\n }\n // Arrays are mutable, so we need to create a copy\n if (Array.isArray(object)) {\n return Object.freeze(object.map((item) => deepCopy(item)));\n }\n if (typeof (object) === \"object\") {\n const result = {};\n for (const key in object) {\n const value = object[key];\n if (value === undefined) {\n continue;\n }\n defineReadOnly(result, key, deepCopy(value));\n }\n return result;\n }\n return logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}\nexport function deepCopy(object) {\n return _deepCopy(object);\n}\nexport class Description {\n constructor(info) {\n for (const key in info) {\n this[key] = deepCopy(info[key]);\n }\n }\n}\n//# sourceMappingURL=index.js.map","export const version = \"properties/5.7.0\";\n//# sourceMappingURL=_version.js.map","export const version = \"abi/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n;\nconst _constructorGuard = {};\nlet ModifiersBytes = { calldata: true, memory: true, storage: true };\nlet ModifiersNest = { calldata: true, memory: true };\nfunction checkModifier(type, name) {\n if (type === \"bytes\" || type === \"string\") {\n if (ModifiersBytes[name]) {\n return true;\n }\n }\n else if (type === \"address\") {\n if (name === \"payable\") {\n return true;\n }\n }\n else if (type.indexOf(\"[\") >= 0 || type === \"tuple\") {\n if (ModifiersNest[name]) {\n return true;\n }\n }\n if (ModifiersBytes[name] || name === \"payable\") {\n logger.throwArgumentError(\"invalid modifier\", \"name\", name);\n }\n return false;\n}\n// @TODO: Make sure that children of an indexed tuple are marked with a null indexed\nfunction parseParamType(param, allowIndexed) {\n let originalParam = param;\n function throwError(i) {\n logger.throwArgumentError(`unexpected character at position ${i}`, \"param\", param);\n }\n param = param.replace(/\\s/g, \" \");\n function newNode(parent) {\n let node = { type: \"\", name: \"\", parent: parent, state: { allowType: true } };\n if (allowIndexed) {\n node.indexed = false;\n }\n return node;\n }\n let parent = { type: \"\", name: \"\", state: { allowType: true } };\n let node = parent;\n for (let i = 0; i < param.length; i++) {\n let c = param[i];\n switch (c) {\n case \"(\":\n if (node.state.allowType && node.type === \"\") {\n node.type = \"tuple\";\n }\n else if (!node.state.allowParams) {\n throwError(i);\n }\n node.state.allowType = false;\n node.type = verifyType(node.type);\n node.components = [newNode(node)];\n node = node.components[0];\n break;\n case \")\":\n delete node.state;\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(i);\n }\n node.indexed = true;\n node.name = \"\";\n }\n if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n node.type = verifyType(node.type);\n let child = node;\n node = node.parent;\n if (!node) {\n throwError(i);\n }\n delete child.parent;\n node.state.allowParams = false;\n node.state.allowName = true;\n node.state.allowArray = true;\n break;\n case \",\":\n delete node.state;\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(i);\n }\n node.indexed = true;\n node.name = \"\";\n }\n if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n node.type = verifyType(node.type);\n let sibling = newNode(node.parent);\n //{ type: \"\", name: \"\", parent: node.parent, state: { allowType: true } };\n node.parent.components.push(sibling);\n delete node.parent;\n node = sibling;\n break;\n // Hit a space...\n case \" \":\n // If reading type, the type is done and may read a param or name\n if (node.state.allowType) {\n if (node.type !== \"\") {\n node.type = verifyType(node.type);\n delete node.state.allowType;\n node.state.allowName = true;\n node.state.allowParams = true;\n }\n }\n // If reading name, the name is done\n if (node.state.allowName) {\n if (node.name !== \"\") {\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(i);\n }\n if (node.indexed) {\n throwError(i);\n }\n node.indexed = true;\n node.name = \"\";\n }\n else if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n else {\n node.state.allowName = false;\n }\n }\n }\n break;\n case \"[\":\n if (!node.state.allowArray) {\n throwError(i);\n }\n node.type += c;\n node.state.allowArray = false;\n node.state.allowName = false;\n node.state.readArray = true;\n break;\n case \"]\":\n if (!node.state.readArray) {\n throwError(i);\n }\n node.type += c;\n node.state.readArray = false;\n node.state.allowArray = true;\n node.state.allowName = true;\n break;\n default:\n if (node.state.allowType) {\n node.type += c;\n node.state.allowParams = true;\n node.state.allowArray = true;\n }\n else if (node.state.allowName) {\n node.name += c;\n delete node.state.allowArray;\n }\n else if (node.state.readArray) {\n node.type += c;\n }\n else {\n throwError(i);\n }\n }\n }\n if (node.parent) {\n logger.throwArgumentError(\"unexpected eof\", \"param\", param);\n }\n delete parent.state;\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(originalParam.length - 7);\n }\n if (node.indexed) {\n throwError(originalParam.length - 7);\n }\n node.indexed = true;\n node.name = \"\";\n }\n else if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n parent.type = verifyType(parent.type);\n return parent;\n}\nfunction populate(object, params) {\n for (let key in params) {\n defineReadOnly(object, key, params[key]);\n }\n}\nexport const FormatTypes = Object.freeze({\n // Bare formatting, as is needed for computing a sighash of an event or function\n sighash: \"sighash\",\n // Human-Readable with Minimal spacing and without names (compact human-readable)\n minimal: \"minimal\",\n // Human-Readable with nice spacing, including all names\n full: \"full\",\n // JSON-format a la Solidity\n json: \"json\"\n});\nconst paramTypeArray = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nexport class ParamType {\n constructor(constructorGuard, params) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"use fromString\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new ParamType()\"\n });\n }\n populate(this, params);\n let match = this.type.match(paramTypeArray);\n if (match) {\n populate(this, {\n arrayLength: parseInt(match[2] || \"-1\"),\n arrayChildren: ParamType.fromObject({\n type: match[1],\n components: this.components\n }),\n baseType: \"array\"\n });\n }\n else {\n populate(this, {\n arrayLength: null,\n arrayChildren: null,\n baseType: ((this.components != null) ? \"tuple\" : this.type)\n });\n }\n this._isParamType = true;\n Object.freeze(this);\n }\n // Format the parameter fragment\n // - sighash: \"(uint256,address)\"\n // - minimal: \"tuple(uint256,address) indexed\"\n // - full: \"tuple(uint256 foo, address bar) indexed baz\"\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n let result = {\n type: ((this.baseType === \"tuple\") ? \"tuple\" : this.type),\n name: (this.name || undefined)\n };\n if (typeof (this.indexed) === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.components) {\n result.components = this.components.map((comp) => JSON.parse(comp.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.baseType === \"array\") {\n result += this.arrayChildren.format(format);\n result += \"[\" + (this.arrayLength < 0 ? \"\" : String(this.arrayLength)) + \"]\";\n }\n else {\n if (this.baseType === \"tuple\") {\n if (format !== FormatTypes.sighash) {\n result += this.type;\n }\n result += \"(\" + this.components.map((comp) => comp.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== FormatTypes.sighash) {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === FormatTypes.full && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n static from(value, allowIndexed) {\n if (typeof (value) === \"string\") {\n return ParamType.fromString(value, allowIndexed);\n }\n return ParamType.fromObject(value);\n }\n static fromObject(value) {\n if (ParamType.isParamType(value)) {\n return value;\n }\n return new ParamType(_constructorGuard, {\n name: (value.name || null),\n type: verifyType(value.type),\n indexed: ((value.indexed == null) ? null : !!value.indexed),\n components: (value.components ? value.components.map(ParamType.fromObject) : null)\n });\n }\n static fromString(value, allowIndexed) {\n function ParamTypify(node) {\n return ParamType.fromObject({\n name: node.name,\n type: node.type,\n indexed: node.indexed,\n components: node.components\n });\n }\n return ParamTypify(parseParamType(value, !!allowIndexed));\n }\n static isParamType(value) {\n return !!(value != null && value._isParamType);\n }\n}\n;\nfunction parseParams(value, allowIndex) {\n return splitNesting(value).map((param) => ParamType.fromString(param, allowIndex));\n}\nexport class Fragment {\n constructor(constructorGuard, params) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"use a static from method\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new Fragment()\"\n });\n }\n populate(this, params);\n this._isFragment = true;\n Object.freeze(this);\n }\n static from(value) {\n if (Fragment.isFragment(value)) {\n return value;\n }\n if (typeof (value) === \"string\") {\n return Fragment.fromString(value);\n }\n return Fragment.fromObject(value);\n }\n static fromObject(value) {\n if (Fragment.isFragment(value)) {\n return value;\n }\n switch (value.type) {\n case \"function\":\n return FunctionFragment.fromObject(value);\n case \"event\":\n return EventFragment.fromObject(value);\n case \"constructor\":\n return ConstructorFragment.fromObject(value);\n case \"error\":\n return ErrorFragment.fromObject(value);\n case \"fallback\":\n case \"receive\":\n // @TODO: Something? Maybe return a FunctionFragment? A custom DefaultFunctionFragment?\n return null;\n }\n return logger.throwArgumentError(\"invalid fragment object\", \"value\", value);\n }\n static fromString(value) {\n // Make sure the \"returns\" is surrounded by a space and all whitespace is exactly one space\n value = value.replace(/\\s/g, \" \");\n value = value.replace(/\\(/g, \" (\").replace(/\\)/g, \") \").replace(/\\s+/g, \" \");\n value = value.trim();\n if (value.split(\" \")[0] === \"event\") {\n return EventFragment.fromString(value.substring(5).trim());\n }\n else if (value.split(\" \")[0] === \"function\") {\n return FunctionFragment.fromString(value.substring(8).trim());\n }\n else if (value.split(\"(\")[0].trim() === \"constructor\") {\n return ConstructorFragment.fromString(value.trim());\n }\n else if (value.split(\" \")[0] === \"error\") {\n return ErrorFragment.fromString(value.substring(5).trim());\n }\n return logger.throwArgumentError(\"unsupported fragment\", \"value\", value);\n }\n static isFragment(value) {\n return !!(value && value._isFragment);\n }\n}\nexport class EventFragment extends Fragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format)))\n });\n }\n let result = \"\";\n if (format !== FormatTypes.sighash) {\n result += \"event \";\n }\n result += this.name + \"(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n if (format !== FormatTypes.sighash) {\n if (this.anonymous) {\n result += \"anonymous \";\n }\n }\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return EventFragment.fromString(value);\n }\n return EventFragment.fromObject(value);\n }\n static fromObject(value) {\n if (EventFragment.isEventFragment(value)) {\n return value;\n }\n if (value.type !== \"event\") {\n logger.throwArgumentError(\"invalid event object\", \"value\", value);\n }\n const params = {\n name: verifyIdentifier(value.name),\n anonymous: value.anonymous,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n type: \"event\"\n };\n return new EventFragment(_constructorGuard, params);\n }\n static fromString(value) {\n let match = value.match(regexParen);\n if (!match) {\n logger.throwArgumentError(\"invalid event string\", \"value\", value);\n }\n let anonymous = false;\n match[3].split(\" \").forEach((modifier) => {\n switch (modifier.trim()) {\n case \"anonymous\":\n anonymous = true;\n break;\n case \"\":\n break;\n default:\n logger.warn(\"unknown modifier: \" + modifier);\n }\n });\n return EventFragment.fromObject({\n name: match[1].trim(),\n anonymous: anonymous,\n inputs: parseParams(match[2], true),\n type: \"event\"\n });\n }\n static isEventFragment(value) {\n return (value && value._isFragment && value.type === \"event\");\n }\n}\nfunction parseGas(value, params) {\n params.gas = null;\n let comps = value.split(\"@\");\n if (comps.length !== 1) {\n if (comps.length > 2) {\n logger.throwArgumentError(\"invalid human-readable ABI signature\", \"value\", value);\n }\n if (!comps[1].match(/^[0-9]+$/)) {\n logger.throwArgumentError(\"invalid human-readable ABI signature gas\", \"value\", value);\n }\n params.gas = BigNumber.from(comps[1]);\n return comps[0];\n }\n return value;\n}\nfunction parseModifiers(value, params) {\n params.constant = false;\n params.payable = false;\n params.stateMutability = \"nonpayable\";\n value.split(\" \").forEach((modifier) => {\n switch (modifier.trim()) {\n case \"constant\":\n params.constant = true;\n break;\n case \"payable\":\n params.payable = true;\n params.stateMutability = \"payable\";\n break;\n case \"nonpayable\":\n params.payable = false;\n params.stateMutability = \"nonpayable\";\n break;\n case \"pure\":\n params.constant = true;\n params.stateMutability = \"pure\";\n break;\n case \"view\":\n params.constant = true;\n params.stateMutability = \"view\";\n break;\n case \"external\":\n case \"public\":\n case \"\":\n break;\n default:\n console.log(\"unknown modifier: \" + modifier);\n }\n });\n}\nfunction verifyState(value) {\n let result = {\n constant: false,\n payable: true,\n stateMutability: \"payable\"\n };\n if (value.stateMutability != null) {\n result.stateMutability = value.stateMutability;\n // Set (and check things are consistent) the constant property\n result.constant = (result.stateMutability === \"view\" || result.stateMutability === \"pure\");\n if (value.constant != null) {\n if ((!!value.constant) !== result.constant) {\n logger.throwArgumentError(\"cannot have constant function with mutability \" + result.stateMutability, \"value\", value);\n }\n }\n // Set (and check things are consistent) the payable property\n result.payable = (result.stateMutability === \"payable\");\n if (value.payable != null) {\n if ((!!value.payable) !== result.payable) {\n logger.throwArgumentError(\"cannot have payable function with mutability \" + result.stateMutability, \"value\", value);\n }\n }\n }\n else if (value.payable != null) {\n result.payable = !!value.payable;\n // If payable we can assume non-constant; otherwise we can't assume\n if (value.constant == null && !result.payable && value.type !== \"constructor\") {\n logger.throwArgumentError(\"unable to determine stateMutability\", \"value\", value);\n }\n result.constant = !!value.constant;\n if (result.constant) {\n result.stateMutability = \"view\";\n }\n else {\n result.stateMutability = (result.payable ? \"payable\" : \"nonpayable\");\n }\n if (result.payable && result.constant) {\n logger.throwArgumentError(\"cannot have constant payable function\", \"value\", value);\n }\n }\n else if (value.constant != null) {\n result.constant = !!value.constant;\n result.payable = !result.constant;\n result.stateMutability = (result.constant ? \"view\" : \"payable\");\n }\n else if (value.type !== \"constructor\") {\n logger.throwArgumentError(\"unable to determine stateMutability\", \"value\", value);\n }\n return result;\n}\nexport class ConstructorFragment extends Fragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: ((this.stateMutability !== \"nonpayable\") ? this.stateMutability : undefined),\n payable: this.payable,\n gas: (this.gas ? this.gas.toNumber() : undefined),\n inputs: this.inputs.map((input) => JSON.parse(input.format(format)))\n });\n }\n if (format === FormatTypes.sighash) {\n logger.throwError(\"cannot format a constructor for sighash\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"format(sighash)\"\n });\n }\n let result = \"constructor(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n if (this.stateMutability && this.stateMutability !== \"nonpayable\") {\n result += this.stateMutability + \" \";\n }\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return ConstructorFragment.fromString(value);\n }\n return ConstructorFragment.fromObject(value);\n }\n static fromObject(value) {\n if (ConstructorFragment.isConstructorFragment(value)) {\n return value;\n }\n if (value.type !== \"constructor\") {\n logger.throwArgumentError(\"invalid constructor object\", \"value\", value);\n }\n let state = verifyState(value);\n if (state.constant) {\n logger.throwArgumentError(\"constructor cannot be constant\", \"value\", value);\n }\n const params = {\n name: null,\n type: value.type,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n payable: state.payable,\n stateMutability: state.stateMutability,\n gas: (value.gas ? BigNumber.from(value.gas) : null)\n };\n return new ConstructorFragment(_constructorGuard, params);\n }\n static fromString(value) {\n let params = { type: \"constructor\" };\n value = parseGas(value, params);\n let parens = value.match(regexParen);\n if (!parens || parens[1].trim() !== \"constructor\") {\n logger.throwArgumentError(\"invalid constructor string\", \"value\", value);\n }\n params.inputs = parseParams(parens[2].trim(), false);\n parseModifiers(parens[3].trim(), params);\n return ConstructorFragment.fromObject(params);\n }\n static isConstructorFragment(value) {\n return (value && value._isFragment && value.type === \"constructor\");\n }\n}\nexport class FunctionFragment extends ConstructorFragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: ((this.stateMutability !== \"nonpayable\") ? this.stateMutability : undefined),\n payable: this.payable,\n gas: (this.gas ? this.gas.toNumber() : undefined),\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n outputs: this.outputs.map((output) => JSON.parse(output.format(format))),\n });\n }\n let result = \"\";\n if (format !== FormatTypes.sighash) {\n result += \"function \";\n }\n result += this.name + \"(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n if (format !== FormatTypes.sighash) {\n if (this.stateMutability) {\n if (this.stateMutability !== \"nonpayable\") {\n result += (this.stateMutability + \" \");\n }\n }\n else if (this.constant) {\n result += \"view \";\n }\n if (this.outputs && this.outputs.length) {\n result += \"returns (\" + this.outputs.map((output) => output.format(format)).join(\", \") + \") \";\n }\n if (this.gas != null) {\n result += \"@\" + this.gas.toString() + \" \";\n }\n }\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return FunctionFragment.fromString(value);\n }\n return FunctionFragment.fromObject(value);\n }\n static fromObject(value) {\n if (FunctionFragment.isFunctionFragment(value)) {\n return value;\n }\n if (value.type !== \"function\") {\n logger.throwArgumentError(\"invalid function object\", \"value\", value);\n }\n let state = verifyState(value);\n const params = {\n type: value.type,\n name: verifyIdentifier(value.name),\n constant: state.constant,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n outputs: (value.outputs ? value.outputs.map(ParamType.fromObject) : []),\n payable: state.payable,\n stateMutability: state.stateMutability,\n gas: (value.gas ? BigNumber.from(value.gas) : null)\n };\n return new FunctionFragment(_constructorGuard, params);\n }\n static fromString(value) {\n let params = { type: \"function\" };\n value = parseGas(value, params);\n let comps = value.split(\" returns \");\n if (comps.length > 2) {\n logger.throwArgumentError(\"invalid function string\", \"value\", value);\n }\n let parens = comps[0].match(regexParen);\n if (!parens) {\n logger.throwArgumentError(\"invalid function signature\", \"value\", value);\n }\n params.name = parens[1].trim();\n if (params.name) {\n verifyIdentifier(params.name);\n }\n params.inputs = parseParams(parens[2], false);\n parseModifiers(parens[3].trim(), params);\n // We have outputs\n if (comps.length > 1) {\n let returns = comps[1].match(regexParen);\n if (returns[1].trim() != \"\" || returns[3].trim() != \"\") {\n logger.throwArgumentError(\"unexpected tokens\", \"value\", value);\n }\n params.outputs = parseParams(returns[2], false);\n }\n else {\n params.outputs = [];\n }\n return FunctionFragment.fromObject(params);\n }\n static isFunctionFragment(value) {\n return (value && value._isFragment && value.type === \"function\");\n }\n}\n//export class StructFragment extends Fragment {\n//}\nfunction checkForbidden(fragment) {\n const sig = fragment.format();\n if (sig === \"Error(string)\" || sig === \"Panic(uint256)\") {\n logger.throwArgumentError(`cannot specify user defined ${sig} error`, \"fragment\", fragment);\n }\n return fragment;\n}\nexport class ErrorFragment extends Fragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n let result = \"\";\n if (format !== FormatTypes.sighash) {\n result += \"error \";\n }\n result += this.name + \"(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return ErrorFragment.fromString(value);\n }\n return ErrorFragment.fromObject(value);\n }\n static fromObject(value) {\n if (ErrorFragment.isErrorFragment(value)) {\n return value;\n }\n if (value.type !== \"error\") {\n logger.throwArgumentError(\"invalid error object\", \"value\", value);\n }\n const params = {\n type: value.type,\n name: verifyIdentifier(value.name),\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : [])\n };\n return checkForbidden(new ErrorFragment(_constructorGuard, params));\n }\n static fromString(value) {\n let params = { type: \"error\" };\n let parens = value.match(regexParen);\n if (!parens) {\n logger.throwArgumentError(\"invalid error signature\", \"value\", value);\n }\n params.name = parens[1].trim();\n if (params.name) {\n verifyIdentifier(params.name);\n }\n params.inputs = parseParams(parens[2], false);\n return checkForbidden(ErrorFragment.fromObject(params));\n }\n static isErrorFragment(value) {\n return (value && value._isFragment && value.type === \"error\");\n }\n}\nfunction verifyType(type) {\n // These need to be transformed to their full description\n if (type.match(/^uint($|[^1-9])/)) {\n type = \"uint256\" + type.substring(4);\n }\n else if (type.match(/^int($|[^1-9])/)) {\n type = \"int256\" + type.substring(3);\n }\n // @TODO: more verification\n return type;\n}\n// See: https://github.com/ethereum/solidity/blob/1f8f1a3db93a548d0555e3e14cfc55a10e25b60e/docs/grammar/SolidityLexer.g4#L234\nconst regexIdentifier = new RegExp(\"^[a-zA-Z$_][a-zA-Z0-9$_]*$\");\nfunction verifyIdentifier(value) {\n if (!value || !value.match(regexIdentifier)) {\n logger.throwArgumentError(`invalid identifier \"${value}\"`, \"value\", value);\n }\n return value;\n}\nconst regexParen = new RegExp(\"^([^)(]*)\\\\((.*)\\\\)([^)(]*)$\");\nfunction splitNesting(value) {\n value = value.trim();\n let result = [];\n let accum = \"\";\n let depth = 0;\n for (let offset = 0; offset < value.length; offset++) {\n let c = value[offset];\n if (c === \",\" && depth === 0) {\n result.push(accum);\n accum = \"\";\n }\n else {\n accum += c;\n if (c === \"(\") {\n depth++;\n }\n else if (c === \")\") {\n depth--;\n if (depth === -1) {\n logger.throwArgumentError(\"unbalanced parenthesis\", \"value\", value);\n }\n }\n }\n }\n if (accum) {\n result.push(accum);\n }\n return result;\n}\n//# sourceMappingURL=fragments.js.map","\"use strict\";\nimport { arrayify, concat, hexConcat, hexlify } from \"@ethersproject/bytes\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"../_version\";\nconst logger = new Logger(version);\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nexport class Coder {\n constructor(name, type, localName, dynamic) {\n // @TODO: defineReadOnly these\n this.name = name;\n this.type = type;\n this.localName = localName;\n this.dynamic = dynamic;\n }\n _throwError(message, value) {\n logger.throwArgumentError(message, this.localName, value);\n }\n}\nexport class Writer {\n constructor(wordSize) {\n defineReadOnly(this, \"wordSize\", wordSize || 32);\n this._data = [];\n this._dataLength = 0;\n this._padding = new Uint8Array(wordSize);\n }\n get data() {\n return hexConcat(this._data);\n }\n get length() { return this._dataLength; }\n _writeData(data) {\n this._data.push(data);\n this._dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this._writeData(concat(writer._data));\n }\n // Arrayish items; padded on the right to wordSize\n writeBytes(value) {\n let bytes = arrayify(value);\n const paddingOffset = bytes.length % this.wordSize;\n if (paddingOffset) {\n bytes = concat([bytes, this._padding.slice(paddingOffset)]);\n }\n return this._writeData(bytes);\n }\n _getValue(value) {\n let bytes = arrayify(BigNumber.from(value));\n if (bytes.length > this.wordSize) {\n logger.throwError(\"value out-of-bounds\", Logger.errors.BUFFER_OVERRUN, {\n length: this.wordSize,\n offset: bytes.length\n });\n }\n if (bytes.length % this.wordSize) {\n bytes = concat([this._padding.slice(bytes.length % this.wordSize), bytes]);\n }\n return bytes;\n }\n // BigNumberish items; padded on the left to wordSize\n writeValue(value) {\n return this._writeData(this._getValue(value));\n }\n writeUpdatableValue() {\n const offset = this._data.length;\n this._data.push(this._padding);\n this._dataLength += this.wordSize;\n return (value) => {\n this._data[offset] = this._getValue(value);\n };\n }\n}\nexport class Reader {\n constructor(data, wordSize, coerceFunc, allowLoose) {\n defineReadOnly(this, \"_data\", arrayify(data));\n defineReadOnly(this, \"wordSize\", wordSize || 32);\n defineReadOnly(this, \"_coerceFunc\", coerceFunc);\n defineReadOnly(this, \"allowLoose\", allowLoose);\n this._offset = 0;\n }\n get data() { return hexlify(this._data); }\n get consumed() { return this._offset; }\n // The default Coerce function\n static coerce(name, value) {\n let match = name.match(\"^u?int([0-9]+)$\");\n if (match && parseInt(match[1]) <= 48) {\n value = value.toNumber();\n }\n return value;\n }\n coerce(name, value) {\n if (this._coerceFunc) {\n return this._coerceFunc(name, value);\n }\n return Reader.coerce(name, value);\n }\n _peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / this.wordSize) * this.wordSize;\n if (this._offset + alignedLength > this._data.length) {\n if (this.allowLoose && loose && this._offset + length <= this._data.length) {\n alignedLength = length;\n }\n else {\n logger.throwError(\"data out-of-bounds\", Logger.errors.BUFFER_OVERRUN, {\n length: this._data.length,\n offset: this._offset + alignedLength\n });\n }\n }\n return this._data.slice(this._offset, this._offset + alignedLength);\n }\n subReader(offset) {\n return new Reader(this._data.slice(this._offset + offset), this.wordSize, this._coerceFunc, this.allowLoose);\n }\n readBytes(length, loose) {\n let bytes = this._peekBytes(0, length, !!loose);\n this._offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n readValue() {\n return BigNumber.from(this.readBytes(this.wordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map","/**\n * [js-sha3]{@link https://github.com/emn178/js-sha3}\n *\n * @version 0.8.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2015-2018\n * @license MIT\n */\n/*jslint bitwise: true */\n(function () {\n 'use strict';\n\n var INPUT_ERROR = 'input is invalid type';\n var FINALIZE_ERROR = 'finalize already called';\n var WINDOW = typeof window === 'object';\n var root = WINDOW ? window : {};\n if (root.JS_SHA3_NO_WINDOW) {\n WINDOW = false;\n }\n var WEB_WORKER = !WINDOW && typeof self === 'object';\n var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n } else if (WEB_WORKER) {\n root = self;\n }\n var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = typeof define === 'function' && define.amd;\n var ARRAY_BUFFER = !root.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';\n var HEX_CHARS = '0123456789abcdef'.split('');\n var SHAKE_PADDING = [31, 7936, 2031616, 520093696];\n var CSHAKE_PADDING = [4, 1024, 262144, 67108864];\n var KECCAK_PADDING = [1, 256, 65536, 16777216];\n var PADDING = [6, 1536, 393216, 100663296];\n var SHIFT = [0, 8, 16, 24];\n var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,\n 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,\n 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,\n 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,\n 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\n var BITS = [224, 256, 384, 512];\n var SHAKE_BITS = [128, 256];\n var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array', 'digest'];\n var CSHAKE_BYTEPAD = {\n '128': 168,\n '256': 136\n };\n\n if (root.JS_SHA3_NO_NODE_JS || !Array.isArray) {\n Array.isArray = function (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n };\n }\n\n if (ARRAY_BUFFER && (root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {\n ArrayBuffer.isView = function (obj) {\n return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;\n };\n }\n\n var createOutputMethod = function (bits, padding, outputType) {\n return function (message) {\n return new Keccak(bits, padding, bits).update(message)[outputType]();\n };\n };\n\n var createShakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits) {\n return new Keccak(bits, padding, outputBits).update(message)[outputType]();\n };\n };\n\n var createCshakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits, n, s) {\n return methods['cshake' + bits].update(message, outputBits, n, s)[outputType]();\n };\n };\n\n var createKmacOutputMethod = function (bits, padding, outputType) {\n return function (key, message, outputBits, s) {\n return methods['kmac' + bits].update(key, message, outputBits, s)[outputType]();\n };\n };\n\n var createOutputMethods = function (method, createMethod, bits, padding) {\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createMethod(bits, padding, type);\n }\n return method;\n };\n\n var createMethod = function (bits, padding) {\n var method = createOutputMethod(bits, padding, 'hex');\n method.create = function () {\n return new Keccak(bits, padding, bits);\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n return createOutputMethods(method, createOutputMethod, bits, padding);\n };\n\n var createShakeMethod = function (bits, padding) {\n var method = createShakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits) {\n return new Keccak(bits, padding, outputBits);\n };\n method.update = function (message, outputBits) {\n return method.create(outputBits).update(message);\n };\n return createOutputMethods(method, createShakeOutputMethod, bits, padding);\n };\n\n var createCshakeMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createCshakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits, n, s) {\n if (!n && !s) {\n return methods['shake' + bits].create(outputBits);\n } else {\n return new Keccak(bits, padding, outputBits).bytepad([n, s], w);\n }\n };\n method.update = function (message, outputBits, n, s) {\n return method.create(outputBits, n, s).update(message);\n };\n return createOutputMethods(method, createCshakeOutputMethod, bits, padding);\n };\n\n var createKmacMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createKmacOutputMethod(bits, padding, 'hex');\n method.create = function (key, outputBits, s) {\n return new Kmac(bits, padding, outputBits).bytepad(['KMAC', s], w).bytepad([key], w);\n };\n method.update = function (key, message, outputBits, s) {\n return method.create(key, outputBits, s).update(message);\n };\n return createOutputMethods(method, createKmacOutputMethod, bits, padding);\n };\n\n var algorithms = [\n { name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod },\n { name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod },\n { name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod },\n { name: 'cshake', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createCshakeMethod },\n { name: 'kmac', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createKmacMethod }\n ];\n\n var methods = {}, methodNames = [];\n\n for (var i = 0; i < algorithms.length; ++i) {\n var algorithm = algorithms[i];\n var bits = algorithm.bits;\n for (var j = 0; j < bits.length; ++j) {\n var methodName = algorithm.name + '_' + bits[j];\n methodNames.push(methodName);\n methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);\n if (algorithm.name !== 'sha3') {\n var newMethodName = algorithm.name + bits[j];\n methodNames.push(newMethodName);\n methods[newMethodName] = methods[methodName];\n }\n }\n }\n\n function Keccak(bits, padding, outputBits) {\n this.blocks = [];\n this.s = [];\n this.padding = padding;\n this.outputBits = outputBits;\n this.reset = true;\n this.finalized = false;\n this.block = 0;\n this.start = 0;\n this.blockCount = (1600 - (bits << 1)) >> 5;\n this.byteCount = this.blockCount << 2;\n this.outputBlocks = outputBits >> 5;\n this.extraBytes = (outputBits & 31) >> 3;\n\n for (var i = 0; i < 50; ++i) {\n this.s[i] = 0;\n }\n }\n\n Keccak.prototype.update = function (message) {\n if (this.finalized) {\n throw new Error(FINALIZE_ERROR);\n }\n var notString, type = typeof message;\n if (type !== 'string') {\n if (type === 'object') {\n if (message === null) {\n throw new Error(INPUT_ERROR);\n } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (!Array.isArray(message)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {\n throw new Error(INPUT_ERROR);\n }\n }\n } else {\n throw new Error(INPUT_ERROR);\n }\n notString = true;\n }\n var blocks = this.blocks, byteCount = this.byteCount, length = message.length,\n blockCount = this.blockCount, index = 0, s = this.s, i, code;\n\n while (index < length) {\n if (this.reset) {\n this.reset = false;\n blocks[0] = this.block;\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n if (notString) {\n for (i = this.start; index < length && i < byteCount; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < byteCount; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n this.lastByteIndex = i;\n if (i >= byteCount) {\n this.start = i - byteCount;\n this.block = blocks[blockCount];\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n this.reset = true;\n } else {\n this.start = i;\n }\n }\n return this;\n };\n\n Keccak.prototype.encode = function (x, right) {\n var o = x & 255, n = 1;\n var bytes = [o];\n x = x >> 8;\n o = x & 255;\n while (o > 0) {\n bytes.unshift(o);\n x = x >> 8;\n o = x & 255;\n ++n;\n }\n if (right) {\n bytes.push(n);\n } else {\n bytes.unshift(n);\n }\n this.update(bytes);\n return bytes.length;\n };\n\n Keccak.prototype.encodeString = function (str) {\n var notString, type = typeof str;\n if (type !== 'string') {\n if (type === 'object') {\n if (str === null) {\n throw new Error(INPUT_ERROR);\n } else if (ARRAY_BUFFER && str.constructor === ArrayBuffer) {\n str = new Uint8Array(str);\n } else if (!Array.isArray(str)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(str)) {\n throw new Error(INPUT_ERROR);\n }\n }\n } else {\n throw new Error(INPUT_ERROR);\n }\n notString = true;\n }\n var bytes = 0, length = str.length;\n if (notString) {\n bytes = length;\n } else {\n for (var i = 0; i < str.length; ++i) {\n var code = str.charCodeAt(i);\n if (code < 0x80) {\n bytes += 1;\n } else if (code < 0x800) {\n bytes += 2;\n } else if (code < 0xd800 || code >= 0xe000) {\n bytes += 3;\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff));\n bytes += 4;\n }\n }\n }\n bytes += this.encode(bytes * 8);\n this.update(str);\n return bytes;\n };\n\n Keccak.prototype.bytepad = function (strs, w) {\n var bytes = this.encode(w);\n for (var i = 0; i < strs.length; ++i) {\n bytes += this.encodeString(strs[i]);\n }\n var paddingBytes = w - bytes % w;\n var zeros = [];\n zeros.length = paddingBytes;\n this.update(zeros);\n return this;\n };\n\n Keccak.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;\n blocks[i >> 2] |= this.padding[i & 3];\n if (this.lastByteIndex === this.byteCount) {\n blocks[0] = blocks[blockCount];\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n blocks[blockCount - 1] |= 0x80000000;\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n };\n\n Keccak.prototype.toString = Keccak.prototype.hex = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var hex = '', block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +\n HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +\n HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +\n HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];\n }\n if (j % blockCount === 0) {\n f(s);\n i = 0;\n }\n }\n if (extraBytes) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];\n if (extraBytes > 1) {\n hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];\n }\n if (extraBytes > 2) {\n hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];\n }\n }\n return hex;\n };\n\n Keccak.prototype.arrayBuffer = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var bytes = this.outputBits >> 3;\n var buffer;\n if (extraBytes) {\n buffer = new ArrayBuffer((outputBlocks + 1) << 2);\n } else {\n buffer = new ArrayBuffer(bytes);\n }\n var array = new Uint32Array(buffer);\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n array[j] = s[i];\n }\n if (j % blockCount === 0) {\n f(s);\n }\n }\n if (extraBytes) {\n array[i] = s[i];\n buffer = buffer.slice(0, bytes);\n }\n return buffer;\n };\n\n Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;\n\n Keccak.prototype.digest = Keccak.prototype.array = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var array = [], offset, block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n array[offset + 1] = (block >> 8) & 0xFF;\n array[offset + 2] = (block >> 16) & 0xFF;\n array[offset + 3] = (block >> 24) & 0xFF;\n }\n if (j % blockCount === 0) {\n f(s);\n }\n }\n if (extraBytes) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n if (extraBytes > 1) {\n array[offset + 1] = (block >> 8) & 0xFF;\n }\n if (extraBytes > 2) {\n array[offset + 2] = (block >> 16) & 0xFF;\n }\n }\n return array;\n };\n\n function Kmac(bits, padding, outputBits) {\n Keccak.call(this, bits, padding, outputBits);\n }\n\n Kmac.prototype = new Keccak();\n\n Kmac.prototype.finalize = function () {\n this.encode(this.outputBits, true);\n return Keccak.prototype.finalize.call(this);\n };\n\n var f = function (s) {\n var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,\n b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,\n b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,\n b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\n for (n = 0; n < 48; n += 2) {\n c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n h = c8 ^ ((c2 << 1) | (c3 >>> 31));\n l = c9 ^ ((c3 << 1) | (c2 >>> 31));\n s[0] ^= h;\n s[1] ^= l;\n s[10] ^= h;\n s[11] ^= l;\n s[20] ^= h;\n s[21] ^= l;\n s[30] ^= h;\n s[31] ^= l;\n s[40] ^= h;\n s[41] ^= l;\n h = c0 ^ ((c4 << 1) | (c5 >>> 31));\n l = c1 ^ ((c5 << 1) | (c4 >>> 31));\n s[2] ^= h;\n s[3] ^= l;\n s[12] ^= h;\n s[13] ^= l;\n s[22] ^= h;\n s[23] ^= l;\n s[32] ^= h;\n s[33] ^= l;\n s[42] ^= h;\n s[43] ^= l;\n h = c2 ^ ((c6 << 1) | (c7 >>> 31));\n l = c3 ^ ((c7 << 1) | (c6 >>> 31));\n s[4] ^= h;\n s[5] ^= l;\n s[14] ^= h;\n s[15] ^= l;\n s[24] ^= h;\n s[25] ^= l;\n s[34] ^= h;\n s[35] ^= l;\n s[44] ^= h;\n s[45] ^= l;\n h = c4 ^ ((c8 << 1) | (c9 >>> 31));\n l = c5 ^ ((c9 << 1) | (c8 >>> 31));\n s[6] ^= h;\n s[7] ^= l;\n s[16] ^= h;\n s[17] ^= l;\n s[26] ^= h;\n s[27] ^= l;\n s[36] ^= h;\n s[37] ^= l;\n s[46] ^= h;\n s[47] ^= l;\n h = c6 ^ ((c0 << 1) | (c1 >>> 31));\n l = c7 ^ ((c1 << 1) | (c0 >>> 31));\n s[8] ^= h;\n s[9] ^= l;\n s[18] ^= h;\n s[19] ^= l;\n s[28] ^= h;\n s[29] ^= l;\n s[38] ^= h;\n s[39] ^= l;\n s[48] ^= h;\n s[49] ^= l;\n\n b0 = s[0];\n b1 = s[1];\n b32 = (s[11] << 4) | (s[10] >>> 28);\n b33 = (s[10] << 4) | (s[11] >>> 28);\n b14 = (s[20] << 3) | (s[21] >>> 29);\n b15 = (s[21] << 3) | (s[20] >>> 29);\n b46 = (s[31] << 9) | (s[30] >>> 23);\n b47 = (s[30] << 9) | (s[31] >>> 23);\n b28 = (s[40] << 18) | (s[41] >>> 14);\n b29 = (s[41] << 18) | (s[40] >>> 14);\n b20 = (s[2] << 1) | (s[3] >>> 31);\n b21 = (s[3] << 1) | (s[2] >>> 31);\n b2 = (s[13] << 12) | (s[12] >>> 20);\n b3 = (s[12] << 12) | (s[13] >>> 20);\n b34 = (s[22] << 10) | (s[23] >>> 22);\n b35 = (s[23] << 10) | (s[22] >>> 22);\n b16 = (s[33] << 13) | (s[32] >>> 19);\n b17 = (s[32] << 13) | (s[33] >>> 19);\n b48 = (s[42] << 2) | (s[43] >>> 30);\n b49 = (s[43] << 2) | (s[42] >>> 30);\n b40 = (s[5] << 30) | (s[4] >>> 2);\n b41 = (s[4] << 30) | (s[5] >>> 2);\n b22 = (s[14] << 6) | (s[15] >>> 26);\n b23 = (s[15] << 6) | (s[14] >>> 26);\n b4 = (s[25] << 11) | (s[24] >>> 21);\n b5 = (s[24] << 11) | (s[25] >>> 21);\n b36 = (s[34] << 15) | (s[35] >>> 17);\n b37 = (s[35] << 15) | (s[34] >>> 17);\n b18 = (s[45] << 29) | (s[44] >>> 3);\n b19 = (s[44] << 29) | (s[45] >>> 3);\n b10 = (s[6] << 28) | (s[7] >>> 4);\n b11 = (s[7] << 28) | (s[6] >>> 4);\n b42 = (s[17] << 23) | (s[16] >>> 9);\n b43 = (s[16] << 23) | (s[17] >>> 9);\n b24 = (s[26] << 25) | (s[27] >>> 7);\n b25 = (s[27] << 25) | (s[26] >>> 7);\n b6 = (s[36] << 21) | (s[37] >>> 11);\n b7 = (s[37] << 21) | (s[36] >>> 11);\n b38 = (s[47] << 24) | (s[46] >>> 8);\n b39 = (s[46] << 24) | (s[47] >>> 8);\n b30 = (s[8] << 27) | (s[9] >>> 5);\n b31 = (s[9] << 27) | (s[8] >>> 5);\n b12 = (s[18] << 20) | (s[19] >>> 12);\n b13 = (s[19] << 20) | (s[18] >>> 12);\n b44 = (s[29] << 7) | (s[28] >>> 25);\n b45 = (s[28] << 7) | (s[29] >>> 25);\n b26 = (s[38] << 8) | (s[39] >>> 24);\n b27 = (s[39] << 8) | (s[38] >>> 24);\n b8 = (s[48] << 14) | (s[49] >>> 18);\n b9 = (s[49] << 14) | (s[48] >>> 18);\n\n s[0] = b0 ^ (~b2 & b4);\n s[1] = b1 ^ (~b3 & b5);\n s[10] = b10 ^ (~b12 & b14);\n s[11] = b11 ^ (~b13 & b15);\n s[20] = b20 ^ (~b22 & b24);\n s[21] = b21 ^ (~b23 & b25);\n s[30] = b30 ^ (~b32 & b34);\n s[31] = b31 ^ (~b33 & b35);\n s[40] = b40 ^ (~b42 & b44);\n s[41] = b41 ^ (~b43 & b45);\n s[2] = b2 ^ (~b4 & b6);\n s[3] = b3 ^ (~b5 & b7);\n s[12] = b12 ^ (~b14 & b16);\n s[13] = b13 ^ (~b15 & b17);\n s[22] = b22 ^ (~b24 & b26);\n s[23] = b23 ^ (~b25 & b27);\n s[32] = b32 ^ (~b34 & b36);\n s[33] = b33 ^ (~b35 & b37);\n s[42] = b42 ^ (~b44 & b46);\n s[43] = b43 ^ (~b45 & b47);\n s[4] = b4 ^ (~b6 & b8);\n s[5] = b5 ^ (~b7 & b9);\n s[14] = b14 ^ (~b16 & b18);\n s[15] = b15 ^ (~b17 & b19);\n s[24] = b24 ^ (~b26 & b28);\n s[25] = b25 ^ (~b27 & b29);\n s[34] = b34 ^ (~b36 & b38);\n s[35] = b35 ^ (~b37 & b39);\n s[44] = b44 ^ (~b46 & b48);\n s[45] = b45 ^ (~b47 & b49);\n s[6] = b6 ^ (~b8 & b0);\n s[7] = b7 ^ (~b9 & b1);\n s[16] = b16 ^ (~b18 & b10);\n s[17] = b17 ^ (~b19 & b11);\n s[26] = b26 ^ (~b28 & b20);\n s[27] = b27 ^ (~b29 & b21);\n s[36] = b36 ^ (~b38 & b30);\n s[37] = b37 ^ (~b39 & b31);\n s[46] = b46 ^ (~b48 & b40);\n s[47] = b47 ^ (~b49 & b41);\n s[8] = b8 ^ (~b0 & b2);\n s[9] = b9 ^ (~b1 & b3);\n s[18] = b18 ^ (~b10 & b12);\n s[19] = b19 ^ (~b11 & b13);\n s[28] = b28 ^ (~b20 & b22);\n s[29] = b29 ^ (~b21 & b23);\n s[38] = b38 ^ (~b30 & b32);\n s[39] = b39 ^ (~b31 & b33);\n s[48] = b48 ^ (~b40 & b42);\n s[49] = b49 ^ (~b41 & b43);\n\n s[0] ^= RC[n];\n s[1] ^= RC[n + 1];\n }\n };\n\n if (COMMON_JS) {\n module.exports = methods;\n } else {\n for (i = 0; i < methodNames.length; ++i) {\n root[methodNames[i]] = methods[methodNames[i]];\n }\n if (AMD) {\n define(function () {\n return methods;\n });\n }\n }\n})();\n","\"use strict\";\nimport sha3 from \"js-sha3\";\nimport { arrayify } from \"@ethersproject/bytes\";\nexport function keccak256(data) {\n return '0x' + sha3.keccak_256(arrayify(data));\n}\n//# sourceMappingURL=index.js.map","export const version = \"rlp/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\n//See: https://github.com/ethereum/wiki/wiki/RLP\nimport { arrayify, hexlify, isBytesLike } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return result;\n}\nfunction unarrayifyInteger(data, offset, length) {\n let result = 0;\n for (let i = 0; i < length; i++) {\n result = (result * 256) + data[offset + i];\n }\n return result;\n}\nfunction _encode(object) {\n if (Array.isArray(object)) {\n let payload = [];\n object.forEach(function (child) {\n payload = payload.concat(_encode(child));\n });\n if (payload.length <= 55) {\n payload.unshift(0xc0 + payload.length);\n return payload;\n }\n const length = arrayifyInteger(payload.length);\n length.unshift(0xf7 + length.length);\n return length.concat(payload);\n }\n if (!isBytesLike(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n const data = Array.prototype.slice.call(arrayify(object));\n if (data.length === 1 && data[0] <= 0x7f) {\n return data;\n }\n else if (data.length <= 55) {\n data.unshift(0x80 + data.length);\n return data;\n }\n const length = arrayifyInteger(data.length);\n length.unshift(0xb7 + length.length);\n return length.concat(data);\n}\nexport function encode(object) {\n return hexlify(_encode(object));\n}\nfunction _decodeChildren(data, offset, childOffset, length) {\n const result = [];\n while (childOffset < offset + 1 + length) {\n const decoded = _decode(data, childOffset);\n result.push(decoded.result);\n childOffset += decoded.consumed;\n if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n }\n return { consumed: (1 + length), result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n if (data.length === 0) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data short segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data long segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length));\n return { consumed: (1 + lengthLength + length), result: result };\n }\n else if (data[offset] >= 0x80) {\n const length = data[offset] - 0x80;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: (1 + length), result: result };\n }\n return { consumed: 1, result: hexlify(data[offset]) };\n}\nexport function decode(data) {\n const bytes = arrayify(data);\n const decoded = _decode(bytes, 0);\n if (decoded.consumed !== bytes.length) {\n logger.throwArgumentError(\"invalid rlp data\", \"data\", data);\n }\n return decoded.result;\n}\n//# sourceMappingURL=index.js.map","export const version = \"address/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { arrayify, concat, hexDataLength, hexDataSlice, isHexString, stripZeros } from \"@ethersproject/bytes\";\nimport { BigNumber, _base16To36, _base36To16 } from \"@ethersproject/bignumber\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { encode } from \"@ethersproject/rlp\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nfunction getChecksumAddress(address) {\n if (!isHexString(address, 20)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n address = address.toLowerCase();\n const chars = address.substring(2).split(\"\");\n const expanded = new Uint8Array(40);\n for (let i = 0; i < 40; i++) {\n expanded[i] = chars[i].charCodeAt(0);\n }\n const hashed = arrayify(keccak256(expanded));\n for (let i = 0; i < 40; i += 2) {\n if ((hashed[i >> 1] >> 4) >= 8) {\n chars[i] = chars[i].toUpperCase();\n }\n if ((hashed[i >> 1] & 0x0f) >= 8) {\n chars[i + 1] = chars[i + 1].toUpperCase();\n }\n }\n return \"0x\" + chars.join(\"\");\n}\n// Shims for environments that are missing some required constants and functions\nconst MAX_SAFE_INTEGER = 0x1fffffffffffff;\nfunction log10(x) {\n if (Math.log10) {\n return Math.log10(x);\n }\n return Math.log(x) / Math.LN10;\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\nconst safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address.split(\"\").map((c) => { return ibanLookup[c]; }).join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n;\nexport function getAddress(address) {\n let result = null;\n if (typeof (address) !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {\n // Missing the 0x prefix\n if (address.substring(0, 2) !== \"0x\") {\n address = \"0x\" + address;\n }\n result = getChecksumAddress(address);\n // It is a checksummed address with a bad checksum\n if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {\n logger.throwArgumentError(\"bad address checksum\", \"address\", address);\n }\n // Maybe ICAP? (we only support direct mode)\n }\n else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {\n // It is an ICAP address with a bad checksum\n if (address.substring(2, 4) !== ibanChecksum(address)) {\n logger.throwArgumentError(\"bad icap checksum\", \"address\", address);\n }\n result = _base36To16(address.substring(4));\n while (result.length < 40) {\n result = \"0\" + result;\n }\n result = getChecksumAddress(\"0x\" + result);\n }\n else {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n return result;\n}\nexport function isAddress(address) {\n try {\n getAddress(address);\n return true;\n }\n catch (error) { }\n return false;\n}\nexport function getIcapAddress(address) {\n let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\n// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed\nexport function getContractAddress(transaction) {\n let from = null;\n try {\n from = getAddress(transaction.from);\n }\n catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));\n return getAddress(hexDataSlice(keccak256(encode([from, nonce])), 12));\n}\nexport function getCreate2Address(from, salt, initCodeHash) {\n if (hexDataLength(salt) !== 32) {\n logger.throwArgumentError(\"salt must be 32 bytes\", \"salt\", salt);\n }\n if (hexDataLength(initCodeHash) !== 32) {\n logger.throwArgumentError(\"initCodeHash must be 32 bytes\", \"initCodeHash\", initCodeHash);\n }\n return getAddress(hexDataSlice(keccak256(concat([\"0xff\", getAddress(from), salt, initCodeHash])), 12));\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { hexZeroPad } from \"@ethersproject/bytes\";\nimport { Coder } from \"./abstract-coder\";\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, value) {\n try {\n value = getAddress(value);\n }\n catch (error) {\n this._throwError(error.message, value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(hexZeroPad(reader.readValue().toHexString(), 20));\n }\n}\n//# sourceMappingURL=address.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\n// Clones the functionality of an existing Coder, but without a localName\nexport class AnonymousCoder extends Coder {\n constructor(coder) {\n super(coder.name, coder.type, undefined, coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map","\"use strict\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"../_version\";\nconst logger = new Logger(version);\nimport { Coder, Writer } from \"./abstract-coder\";\nimport { AnonymousCoder } from \"./anonymous\";\nexport function pack(writer, coders, values) {\n let arrayValues = null;\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof (values) === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n if (!name) {\n logger.throwError(\"cannot encode object for signature with missing names\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"values\",\n coder: coder,\n value: values\n });\n }\n if (unique[name]) {\n logger.throwError(\"cannot encode object for signature with duplicate names\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"values\",\n coder: coder,\n value: values\n });\n }\n unique[name] = true;\n return values[name];\n });\n }\n else {\n logger.throwArgumentError(\"invalid tuple value\", \"tuple\", values);\n }\n if (coders.length !== arrayValues.length) {\n logger.throwArgumentError(\"types/value length mismatch\", \"tuple\", values);\n }\n let staticWriter = new Writer(writer.wordSize);\n let dynamicWriter = new Writer(writer.wordSize);\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => { func(staticWriter.length); });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\nexport function unpack(reader, coders) {\n let values = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readValue();\n let offsetReader = baseReader.subReader(offset.toNumber());\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (error.code === Logger.errors.BUFFER_OVERRUN) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (error.code === Logger.errors.BUFFER_OVERRUN) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value != undefined) {\n values.push(value);\n }\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add any named parameters (i.e. tuples)\n coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n const value = values[index];\n if (value instanceof Error) {\n Object.defineProperty(values, name, {\n enumerable: true,\n get: () => { throw value; }\n });\n }\n else {\n values[name] = value;\n }\n });\n for (let i = 0; i < values.length; i++) {\n const value = values[i];\n if (value instanceof Error) {\n Object.defineProperty(values, i, {\n enumerable: true,\n get: () => { throw value; }\n });\n }\n }\n return Object.freeze(values);\n}\nexport class ArrayCoder extends Coder {\n constructor(coder, length, localName) {\n const type = (coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\");\n const dynamic = (length === -1 || coder.dynamic);\n super(\"array\", type, localName, dynamic);\n this.coder = coder;\n this.length = length;\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, value) {\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n logger.checkArgumentCount(value.length, count, \"coder array\" + (this.localName ? (\" \" + this.localName) : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readValue().toNumber();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n if (count * 32 > reader._data.length) {\n logger.throwError(\"insufficient data length\", Logger.errors.BUFFER_OVERRUN, {\n length: reader._data.length,\n count: count\n });\n }\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return reader.coerce(this.name, unpack(reader, coders));\n }\n}\n//# sourceMappingURL=array.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, value) {\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return reader.coerce(this.type, !reader.readValue().isZero());\n }\n}\n//# sourceMappingURL=boolean.js.map","\"use strict\";\nimport { arrayify, hexlify } from \"@ethersproject/bytes\";\nimport { Coder } from \"./abstract-coder\";\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = arrayify(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readValue().toNumber(), true);\n }\n}\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return reader.coerce(this.name, hexlify(super.decode(reader)));\n }\n}\n//# sourceMappingURL=bytes.js.map","\"use strict\";\nimport { arrayify, hexlify } from \"@ethersproject/bytes\";\nimport { Coder } from \"./abstract-coder\";\n// @TODO: Merge this with bytes\nexport class FixedBytesCoder extends Coder {\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n this.size = size;\n }\n defaultValue() {\n return (\"0x0000000000000000000000000000000000000000000000000000000000000000\").substring(0, 2 + this.size * 2);\n }\n encode(writer, value) {\n let data = arrayify(value);\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return reader.coerce(this.name, hexlify(reader.readBytes(this.size)));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes([]);\n }\n decode(reader) {\n reader.readBytes(0);\n return reader.coerce(this.name, null);\n }\n}\n//# sourceMappingURL=null.js.map","export const AddressZero = \"0x0000000000000000000000000000000000000000\";\n//# sourceMappingURL=addresses.js.map","import { BigNumber } from \"@ethersproject/bignumber\";\nconst NegativeOne = ( /*#__PURE__*/BigNumber.from(-1));\nconst Zero = ( /*#__PURE__*/BigNumber.from(0));\nconst One = ( /*#__PURE__*/BigNumber.from(1));\nconst Two = ( /*#__PURE__*/BigNumber.from(2));\nconst WeiPerEther = ( /*#__PURE__*/BigNumber.from(\"1000000000000000000\"));\nconst MaxUint256 = ( /*#__PURE__*/BigNumber.from(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\nconst MinInt256 = ( /*#__PURE__*/BigNumber.from(\"-0x8000000000000000000000000000000000000000000000000000000000000000\"));\nconst MaxInt256 = ( /*#__PURE__*/BigNumber.from(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\nexport { NegativeOne, Zero, One, Two, WeiPerEther, MaxUint256, MinInt256, MaxInt256, };\n//# sourceMappingURL=bignumbers.js.map","export const HashZero = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map","// NFKC (composed) // (decomposed)\nexport const EtherSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n//# sourceMappingURL=strings.js.map","\"use strict\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { MaxUint256, NegativeOne, One, Zero } from \"@ethersproject/constants\";\nimport { Coder } from \"./abstract-coder\";\nexport class NumberCoder extends Coder {\n constructor(size, signed, localName) {\n const name = ((signed ? \"int\" : \"uint\") + (size * 8));\n super(name, name, localName, false);\n this.size = size;\n this.signed = signed;\n }\n defaultValue() {\n return 0;\n }\n encode(writer, value) {\n let v = BigNumber.from(value);\n // Check bounds are safe for encoding\n let maxUintValue = MaxUint256.mask(writer.wordSize * 8);\n if (this.signed) {\n let bounds = maxUintValue.mask(this.size * 8 - 1);\n if (v.gt(bounds) || v.lt(bounds.add(One).mul(NegativeOne))) {\n this._throwError(\"value out-of-bounds\", value);\n }\n }\n else if (v.lt(Zero) || v.gt(maxUintValue.mask(this.size * 8))) {\n this._throwError(\"value out-of-bounds\", value);\n }\n v = v.toTwos(this.size * 8).mask(this.size * 8);\n if (this.signed) {\n v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize);\n }\n return writer.writeValue(v);\n }\n decode(reader) {\n let value = reader.readValue().mask(this.size * 8);\n if (this.signed) {\n value = value.fromTwos(this.size * 8);\n }\n return reader.coerce(this.name, value);\n }\n}\n//# sourceMappingURL=number.js.map","export const version = \"strings/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n///////////////////////////////\nexport var UnicodeNormalizationForm;\n(function (UnicodeNormalizationForm) {\n UnicodeNormalizationForm[\"current\"] = \"\";\n UnicodeNormalizationForm[\"NFC\"] = \"NFC\";\n UnicodeNormalizationForm[\"NFD\"] = \"NFD\";\n UnicodeNormalizationForm[\"NFKC\"] = \"NFKC\";\n UnicodeNormalizationForm[\"NFKD\"] = \"NFKD\";\n})(UnicodeNormalizationForm || (UnicodeNormalizationForm = {}));\n;\nexport var Utf8ErrorReason;\n(function (Utf8ErrorReason) {\n // A continuation byte was present where there was nothing to continue\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"UNEXPECTED_CONTINUE\"] = \"unexpected continuation byte\";\n // An invalid (non-continuation) byte to start a UTF-8 codepoint was found\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"BAD_PREFIX\"] = \"bad codepoint prefix\";\n // The string is too short to process the expected codepoint\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"OVERRUN\"] = \"string overrun\";\n // A missing continuation byte was expected but not found\n // - offset = the index the continuation byte was expected at\n Utf8ErrorReason[\"MISSING_CONTINUE\"] = \"missing continuation byte\";\n // The computed code point is outside the range for UTF-8\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; outside the UTF-8 range\n Utf8ErrorReason[\"OUT_OF_RANGE\"] = \"out of UTF-8 range\";\n // UTF-8 strings may not contain UTF-16 surrogate pairs\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; inside the UTF-16 surrogate range\n Utf8ErrorReason[\"UTF16_SURROGATE\"] = \"UTF-16 surrogate\";\n // The string is an overlong representation\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; already bounds checked\n Utf8ErrorReason[\"OVERLONG\"] = \"overlong representation\";\n})(Utf8ErrorReason || (Utf8ErrorReason = {}));\n;\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n return logger.throwArgumentError(`invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === Utf8ErrorReason.BAD_PREFIX || reason === Utf8ErrorReason.UNEXPECTED_CONTINUE) {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === Utf8ErrorReason.OVERRUN) {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === Utf8ErrorReason.OVERLONG) {\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n// Common error handing strategies\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n bytes = arrayify(bytes);\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(Utf8ErrorReason.UNEXPECTED_CONTINUE, i - 1, bytes, result);\n }\n else {\n i += onError(Utf8ErrorReason.BAD_PREFIX, i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(Utf8ErrorReason.OVERRUN, i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(Utf8ErrorReason.MISSING_CONTINUE, i, bytes, result);\n res = null;\n break;\n }\n ;\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(Utf8ErrorReason.OUT_OF_RANGE, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(Utf8ErrorReason.UTF16_SURROGATE, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(Utf8ErrorReason.OVERLONG, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\nexport function toUtf8Bytes(str, form = UnicodeNormalizationForm.current) {\n if (form != UnicodeNormalizationForm.current) {\n logger.checkNormalize();\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n if (i >= str.length || (c2 & 0xfc00) !== 0xdc00) {\n throw new Error(\"invalid utf-8 string\");\n }\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return arrayify(result);\n}\n;\nfunction escapeChar(value) {\n const hex = (\"0000\" + value.toString(16));\n return \"\\\\u\" + hex.substring(hex.length - 4);\n}\nexport function _toEscapedUtf8String(bytes, onError) {\n return '\"' + getUtf8CodePoints(bytes, onError).map((codePoint) => {\n if (codePoint < 256) {\n switch (codePoint) {\n case 8: return \"\\\\b\";\n case 9: return \"\\\\t\";\n case 10: return \"\\\\n\";\n case 13: return \"\\\\r\";\n case 34: return \"\\\\\\\"\";\n case 92: return \"\\\\\\\\\";\n }\n if (codePoint >= 32 && codePoint < 127) {\n return String.fromCharCode(codePoint);\n }\n }\n if (codePoint <= 0xffff) {\n return escapeChar(codePoint);\n }\n codePoint -= 0x10000;\n return escapeChar(((codePoint >> 10) & 0x3ff) + 0xd800) + escapeChar((codePoint & 0x3ff) + 0xdc00);\n }).join(\"\") + '\"';\n}\nexport function _toUtf8String(codePoints) {\n return codePoints.map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00));\n }).join(\"\");\n}\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\nexport function toUtf8CodePoints(str, form = UnicodeNormalizationForm.current) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","\"use strict\";\nimport { toUtf8CodePoints, _toUtf8String, UnicodeNormalizationForm } from \"./utf8\";\nfunction bytes2(data) {\n if ((data.length % 4) !== 0) {\n throw new Error(\"bad data\");\n }\n let result = [];\n for (let i = 0; i < data.length; i += 4) {\n result.push(parseInt(data.substring(i, i + 4), 16));\n }\n return result;\n}\nfunction createTable(data, func) {\n if (!func) {\n func = function (value) { return [parseInt(value, 16)]; };\n }\n let lo = 0;\n let result = {};\n data.split(\",\").forEach((pair) => {\n let comps = pair.split(\":\");\n lo += parseInt(comps[0], 16);\n result[lo] = func(comps[1]);\n });\n return result;\n}\nfunction createRangeTable(data) {\n let hi = 0;\n return data.split(\",\").map((v) => {\n let comps = v.split(\"-\");\n if (comps.length === 1) {\n comps[1] = \"0\";\n }\n else if (comps[1] === \"\") {\n comps[1] = \"1\";\n }\n let lo = hi + parseInt(comps[0], 16);\n hi = parseInt(comps[1], 16);\n return { l: lo, h: hi };\n });\n}\nfunction matchMap(value, ranges) {\n let lo = 0;\n for (let i = 0; i < ranges.length; i++) {\n let range = ranges[i];\n lo += range.l;\n if (value >= lo && value <= lo + range.h && ((value - lo) % (range.d || 1)) === 0) {\n if (range.e && range.e.indexOf(value - lo) !== -1) {\n continue;\n }\n return range;\n }\n }\n return null;\n}\nconst Table_A_1_ranges = createRangeTable(\"221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d\");\n// @TODO: Make this relative...\nconst Table_B_1_flags = \"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff\".split(\",\").map((v) => parseInt(v, 16));\nconst Table_B_2_ranges = [\n { h: 25, s: 32, l: 65 },\n { h: 30, s: 32, e: [23], l: 127 },\n { h: 54, s: 1, e: [48], l: 64, d: 2 },\n { h: 14, s: 1, l: 57, d: 2 },\n { h: 44, s: 1, l: 17, d: 2 },\n { h: 10, s: 1, e: [2, 6, 8], l: 61, d: 2 },\n { h: 16, s: 1, l: 68, d: 2 },\n { h: 84, s: 1, e: [18, 24, 66], l: 19, d: 2 },\n { h: 26, s: 32, e: [17], l: 435 },\n { h: 22, s: 1, l: 71, d: 2 },\n { h: 15, s: 80, l: 40 },\n { h: 31, s: 32, l: 16 },\n { h: 32, s: 1, l: 80, d: 2 },\n { h: 52, s: 1, l: 42, d: 2 },\n { h: 12, s: 1, l: 55, d: 2 },\n { h: 40, s: 1, e: [38], l: 15, d: 2 },\n { h: 14, s: 1, l: 48, d: 2 },\n { h: 37, s: 48, l: 49 },\n { h: 148, s: 1, l: 6351, d: 2 },\n { h: 88, s: 1, l: 160, d: 2 },\n { h: 15, s: 16, l: 704 },\n { h: 25, s: 26, l: 854 },\n { h: 25, s: 32, l: 55915 },\n { h: 37, s: 40, l: 1247 },\n { h: 25, s: -119711, l: 53248 },\n { h: 25, s: -119763, l: 52 },\n { h: 25, s: -119815, l: 52 },\n { h: 25, s: -119867, e: [1, 4, 5, 7, 8, 11, 12, 17], l: 52 },\n { h: 25, s: -119919, l: 52 },\n { h: 24, s: -119971, e: [2, 7, 8, 17], l: 52 },\n { h: 24, s: -120023, e: [2, 7, 13, 15, 16, 17], l: 52 },\n { h: 25, s: -120075, l: 52 },\n { h: 25, s: -120127, l: 52 },\n { h: 25, s: -120179, l: 52 },\n { h: 25, s: -120231, l: 52 },\n { h: 25, s: -120283, l: 52 },\n { h: 25, s: -120335, l: 52 },\n { h: 24, s: -119543, e: [17], l: 56 },\n { h: 24, s: -119601, e: [17], l: 58 },\n { h: 24, s: -119659, e: [17], l: 58 },\n { h: 24, s: -119717, e: [17], l: 58 },\n { h: 24, s: -119775, e: [17], l: 58 }\n];\nconst Table_B_2_lut_abs = createTable(\"b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3\");\nconst Table_B_2_lut_rel = createTable(\"179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7\");\nconst Table_B_2_complex = createTable(\"df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D\", bytes2);\nconst Table_C_ranges = createRangeTable(\"80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001\");\nfunction flatten(values) {\n return values.reduce((accum, value) => {\n value.forEach((value) => { accum.push(value); });\n return accum;\n }, []);\n}\nexport function _nameprepTableA1(codepoint) {\n return !!matchMap(codepoint, Table_A_1_ranges);\n}\nexport function _nameprepTableB2(codepoint) {\n let range = matchMap(codepoint, Table_B_2_ranges);\n if (range) {\n return [codepoint + range.s];\n }\n let codes = Table_B_2_lut_abs[codepoint];\n if (codes) {\n return codes;\n }\n let shift = Table_B_2_lut_rel[codepoint];\n if (shift) {\n return [codepoint + shift[0]];\n }\n let complex = Table_B_2_complex[codepoint];\n if (complex) {\n return complex;\n }\n return null;\n}\nexport function _nameprepTableC(codepoint) {\n return !!matchMap(codepoint, Table_C_ranges);\n}\nexport function nameprep(value) {\n // This allows platforms with incomplete normalize to bypass\n // it for very basic names which the built-in toLowerCase\n // will certainly handle correctly\n if (value.match(/^[a-z0-9-]*$/i) && value.length <= 59) {\n return value.toLowerCase();\n }\n // Get the code points (keeping the current normalization)\n let codes = toUtf8CodePoints(value);\n codes = flatten(codes.map((code) => {\n // Substitute Table B.1 (Maps to Nothing)\n if (Table_B_1_flags.indexOf(code) >= 0) {\n return [];\n }\n if (code >= 0xfe00 && code <= 0xfe0f) {\n return [];\n }\n // Substitute Table B.2 (Case Folding)\n let codesTableB2 = _nameprepTableB2(code);\n if (codesTableB2) {\n return codesTableB2;\n }\n // No Substitution\n return [code];\n }));\n // Normalize using form KC\n codes = toUtf8CodePoints(_toUtf8String(codes), UnicodeNormalizationForm.NFKC);\n // Prohibit Tables C.1.2, C.2.2, C.3, C.4, C.5, C.6, C.7, C.8, C.9\n codes.forEach((code) => {\n if (_nameprepTableC(code)) {\n throw new Error(\"STRINGPREP_CONTAINS_PROHIBITED\");\n }\n });\n // Prohibit Unassigned Code Points (Table A.1)\n codes.forEach((code) => {\n if (_nameprepTableA1(code)) {\n throw new Error(\"STRINGPREP_CONTAINS_UNASSIGNED\");\n }\n });\n // IDNA extras\n let name = _toUtf8String(codes);\n // IDNA: 4.2.3.1\n if (name.substring(0, 1) === \"-\" || name.substring(2, 4) === \"--\" || name.substring(name.length - 1) === \"-\") {\n throw new Error(\"invalid hyphen\");\n }\n return name;\n}\n//# sourceMappingURL=idna.js.map","\"use strict\";\nimport { HashZero } from \"@ethersproject/constants\";\nimport { arrayify, concat, hexlify } from \"@ethersproject/bytes\";\nimport { toUtf8Bytes, toUtf8String } from \"./utf8\";\nexport function formatBytes32String(text) {\n // Get the bytes\n const bytes = toUtf8Bytes(text);\n // Check we have room for null-termination\n if (bytes.length > 31) {\n throw new Error(\"bytes32 string must be less than 32 bytes\");\n }\n // Zero-pad (implicitly null-terminates)\n return hexlify(concat([bytes, HashZero]).slice(0, 32));\n}\nexport function parseBytes32String(bytes) {\n const data = arrayify(bytes);\n // Must be 32 bytes with a null-termination\n if (data.length !== 32) {\n throw new Error(\"invalid bytes32 - not 32 bytes long\");\n }\n if (data[31] !== 0) {\n throw new Error(\"invalid bytes32 string - no null terminator\");\n }\n // Find the null termination\n let length = 31;\n while (data[length - 1] === 0) {\n length--;\n }\n // Determine the string value\n return toUtf8String(data.slice(0, length));\n}\n//# sourceMappingURL=bytes32.js.map","\"use strict\";\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\nimport { DynamicBytesCoder } from \"./bytes\";\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, value) {\n return super.encode(writer, toUtf8Bytes(value));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\nimport { pack, unpack } from \"./array\";\nexport class TupleCoder extends Coder {\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = (\"tuple(\" + types.join(\",\") + \")\");\n super(\"tuple\", type, localName, dynamic);\n this.coders = coders;\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, value) {\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return reader.coerce(this.name, unpack(reader, this.coders));\n }\n}\n//# sourceMappingURL=tuple.js.map","\"use strict\";\n// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { Reader, Writer } from \"./coders/abstract-coder\";\nimport { AddressCoder } from \"./coders/address\";\nimport { ArrayCoder } from \"./coders/array\";\nimport { BooleanCoder } from \"./coders/boolean\";\nimport { BytesCoder } from \"./coders/bytes\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes\";\nimport { NullCoder } from \"./coders/null\";\nimport { NumberCoder } from \"./coders/number\";\nimport { StringCoder } from \"./coders/string\";\nimport { TupleCoder } from \"./coders/tuple\";\nimport { ParamType } from \"./fragments\";\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nexport class AbiCoder {\n constructor(coerceFunc) {\n defineReadOnly(this, \"coerceFunc\", coerceFunc || null);\n }\n _getCoder(param) {\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"array\":\n return new ArrayCoder(this._getCoder(param.arrayChildren), param.arrayLength, param.name);\n case \"tuple\":\n return new TupleCoder((param.components || []).map((component) => {\n return this._getCoder(component);\n }), param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n if (size === 0 || size > 256 || (size % 8) !== 0) {\n logger.throwArgumentError(\"invalid \" + match[1] + \" bit length\", \"param\", param);\n }\n return new NumberCoder(size / 8, (match[1] === \"int\"), param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n if (size === 0 || size > 32) {\n logger.throwArgumentError(\"invalid bytes length\", \"param\", param);\n }\n return new FixedBytesCoder(size, param.name);\n }\n return logger.throwArgumentError(\"invalid type\", \"type\", param.type);\n }\n _getWordSize() { return 32; }\n _getReader(data, allowLoose) {\n return new Reader(data, this._getWordSize(), this.coerceFunc, allowLoose);\n }\n _getWriter() {\n return new Writer(this._getWordSize());\n }\n getDefaultValue(types) {\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n encode(types, values) {\n if (types.length !== values.length) {\n logger.throwError(\"types/values length mismatch\", Logger.errors.INVALID_ARGUMENT, {\n count: { types: types.length, values: values.length },\n value: { types: types, values: values }\n });\n }\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = (new TupleCoder(coders, \"_\"));\n const writer = this._getWriter();\n coder.encode(writer, values);\n return writer.data;\n }\n decode(types, data, loose) {\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(this._getReader(arrayify(data), loose));\n }\n}\nexport const defaultAbiCoder = new AbiCoder();\n//# sourceMappingURL=abi-coder.js.map","import { keccak256 } from \"@ethersproject/keccak256\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nexport function id(text) {\n return keccak256(toUtf8Bytes(text));\n}\n//# sourceMappingURL=id.js.map","export const version = \"hash/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { arrayify } from \"@ethersproject/bytes\";\nexport function decode(textData) {\n textData = atob(textData);\n const data = [];\n for (let i = 0; i < textData.length; i++) {\n data.push(textData.charCodeAt(i));\n }\n return arrayify(data);\n}\nexport function encode(data) {\n data = arrayify(data);\n let textData = \"\";\n for (let i = 0; i < data.length; i++) {\n textData += String.fromCharCode(data[i]);\n }\n return btoa(textData);\n}\n//# sourceMappingURL=base64.js.map","/**\n * MIT License\n *\n * Copyright (c) 2021 Andrew Raffensperger\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * This is a near carbon-copy of the original source (link below) with the\n * TypeScript typings added and a few tweaks to make it ES3-compatible.\n *\n * See: https://github.com/adraffy/ens-normalize.js\n */\n// https://github.com/behnammodi/polyfill/blob/master/array.polyfill.js\nfunction flat(array, depth) {\n if (depth == null) {\n depth = 1;\n }\n const result = [];\n const forEach = result.forEach;\n const flatDeep = function (arr, depth) {\n forEach.call(arr, function (val) {\n if (depth > 0 && Array.isArray(val)) {\n flatDeep(val, depth - 1);\n }\n else {\n result.push(val);\n }\n });\n };\n flatDeep(array, depth);\n return result;\n}\nfunction fromEntries(array) {\n const result = {};\n for (let i = 0; i < array.length; i++) {\n const value = array[i];\n result[value[0]] = value[1];\n }\n return result;\n}\nexport function decode_arithmetic(bytes) {\n let pos = 0;\n function u16() { return (bytes[pos++] << 8) | bytes[pos++]; }\n // decode the frequency table\n let symbol_count = u16();\n let total = 1;\n let acc = [0, 1]; // first symbol has frequency 1\n for (let i = 1; i < symbol_count; i++) {\n acc.push(total += u16());\n }\n // skip the sized-payload that the last 3 symbols index into\n let skip = u16();\n let pos_payload = pos;\n pos += skip;\n let read_width = 0;\n let read_buffer = 0;\n function read_bit() {\n if (read_width == 0) {\n // this will read beyond end of buffer\n // but (undefined|0) => zero pad\n read_buffer = (read_buffer << 8) | bytes[pos++];\n read_width = 8;\n }\n return (read_buffer >> --read_width) & 1;\n }\n const N = 31;\n const FULL = Math.pow(2, N);\n const HALF = FULL >>> 1;\n const QRTR = HALF >> 1;\n const MASK = FULL - 1;\n // fill register\n let register = 0;\n for (let i = 0; i < N; i++)\n register = (register << 1) | read_bit();\n let symbols = [];\n let low = 0;\n let range = FULL; // treat like a float\n while (true) {\n let value = Math.floor((((register - low + 1) * total) - 1) / range);\n let start = 0;\n let end = symbol_count;\n while (end - start > 1) { // binary search\n let mid = (start + end) >>> 1;\n if (value < acc[mid]) {\n end = mid;\n }\n else {\n start = mid;\n }\n }\n if (start == 0)\n break; // first symbol is end mark\n symbols.push(start);\n let a = low + Math.floor(range * acc[start] / total);\n let b = low + Math.floor(range * acc[start + 1] / total) - 1;\n while (((a ^ b) & HALF) == 0) {\n register = (register << 1) & MASK | read_bit();\n a = (a << 1) & MASK;\n b = (b << 1) & MASK | 1;\n }\n while (a & ~b & QRTR) {\n register = (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit();\n a = (a << 1) ^ HALF;\n b = ((b ^ HALF) << 1) | HALF | 1;\n }\n low = a;\n range = 1 + b - a;\n }\n let offset = symbol_count - 4;\n return symbols.map(x => {\n switch (x - offset) {\n case 3: return offset + 0x10100 + ((bytes[pos_payload++] << 16) | (bytes[pos_payload++] << 8) | bytes[pos_payload++]);\n case 2: return offset + 0x100 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]);\n case 1: return offset + bytes[pos_payload++];\n default: return x - 1;\n }\n });\n}\n// returns an iterator which returns the next symbol\nexport function read_payload(v) {\n let pos = 0;\n return () => v[pos++];\n}\nexport function read_compressed_payload(bytes) {\n return read_payload(decode_arithmetic(bytes));\n}\n// eg. [0,1,2,3...] => [0,-1,1,-2,...]\nexport function signed(i) {\n return (i & 1) ? (~i >> 1) : (i >> 1);\n}\nfunction read_counts(n, next) {\n let v = Array(n);\n for (let i = 0; i < n; i++)\n v[i] = 1 + next();\n return v;\n}\nfunction read_ascending(n, next) {\n let v = Array(n);\n for (let i = 0, x = -1; i < n; i++)\n v[i] = x += 1 + next();\n return v;\n}\nfunction read_deltas(n, next) {\n let v = Array(n);\n for (let i = 0, x = 0; i < n; i++)\n v[i] = x += signed(next());\n return v;\n}\nexport function read_member_array(next, lookup) {\n let v = read_ascending(next(), next);\n let n = next();\n let vX = read_ascending(n, next);\n let vN = read_counts(n, next);\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < vN[i]; j++) {\n v.push(vX[i] + j);\n }\n }\n return lookup ? v.map(x => lookup[x]) : v;\n}\n// returns array of \n// [x, ys] => single replacement rule\n// [x, ys, n, dx, dx] => linear map\nexport function read_mapped_map(next) {\n let ret = [];\n while (true) {\n let w = next();\n if (w == 0)\n break;\n ret.push(read_linear_table(w, next));\n }\n while (true) {\n let w = next() - 1;\n if (w < 0)\n break;\n ret.push(read_replacement_table(w, next));\n }\n return fromEntries(flat(ret));\n}\nexport function read_zero_terminated_array(next) {\n let v = [];\n while (true) {\n let i = next();\n if (i == 0)\n break;\n v.push(i);\n }\n return v;\n}\nfunction read_transposed(n, w, next) {\n let m = Array(n).fill(undefined).map(() => []);\n for (let i = 0; i < w; i++) {\n read_deltas(n, next).forEach((x, j) => m[j].push(x));\n }\n return m;\n}\nfunction read_linear_table(w, next) {\n let dx = 1 + next();\n let dy = next();\n let vN = read_zero_terminated_array(next);\n let m = read_transposed(vN.length, 1 + w, next);\n return flat(m.map((v, i) => {\n const x = v[0], ys = v.slice(1);\n //let [x, ...ys] = v;\n //return Array(vN[i]).fill().map((_, j) => {\n return Array(vN[i]).fill(undefined).map((_, j) => {\n let j_dy = j * dy;\n return [x + j * dx, ys.map(y => y + j_dy)];\n });\n }));\n}\nfunction read_replacement_table(w, next) {\n let n = 1 + next();\n let m = read_transposed(n, 1 + w, next);\n return m.map(v => [v[0], v.slice(1)]);\n}\nexport function read_emoji_trie(next) {\n let sorted = read_member_array(next).sort((a, b) => a - b);\n return read();\n function read() {\n let branches = [];\n while (true) {\n let keys = read_member_array(next, sorted);\n if (keys.length == 0)\n break;\n branches.push({ set: new Set(keys), node: read() });\n }\n branches.sort((a, b) => b.set.size - a.set.size); // sort by likelihood\n let temp = next();\n let valid = temp % 3;\n temp = (temp / 3) | 0;\n let fe0f = !!(temp & 1);\n temp >>= 1;\n let save = temp == 1;\n let check = temp == 2;\n return { branches, valid, fe0f, save, check };\n }\n}\n//# sourceMappingURL=decoder.js.map","/**\n * MIT License\n *\n * Copyright (c) 2021 Andrew Raffensperger\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * This is a near carbon-copy of the original source (link below) with the\n * TypeScript typings added and a few tweaks to make it ES3-compatible.\n *\n * See: https://github.com/adraffy/ens-normalize.js\n */\nimport { toUtf8CodePoints } from \"@ethersproject/strings\";\nimport { getData } from './include.js';\nconst r = getData();\nimport { read_member_array, read_mapped_map, read_emoji_trie } from './decoder.js';\n// @TODO: This should be lazily loaded\nconst VALID = new Set(read_member_array(r));\nconst IGNORED = new Set(read_member_array(r));\nconst MAPPED = read_mapped_map(r);\nconst EMOJI_ROOT = read_emoji_trie(r);\n//const NFC_CHECK = new Set(read_member_array(r, Array.from(VALID.values()).sort((a, b) => a - b)));\n//const STOP = 0x2E;\nconst HYPHEN = 0x2D;\nconst UNDERSCORE = 0x5F;\nfunction explode_cp(name) {\n return toUtf8CodePoints(name);\n}\nfunction filter_fe0f(cps) {\n return cps.filter(cp => cp != 0xFE0F);\n}\nexport function ens_normalize_post_check(name) {\n for (let label of name.split('.')) {\n let cps = explode_cp(label);\n try {\n for (let i = cps.lastIndexOf(UNDERSCORE) - 1; i >= 0; i--) {\n if (cps[i] !== UNDERSCORE) {\n throw new Error(`underscore only allowed at start`);\n }\n }\n if (cps.length >= 4 && cps.every(cp => cp < 0x80) && cps[2] === HYPHEN && cps[3] === HYPHEN) {\n throw new Error(`invalid label extension`);\n }\n }\n catch (err) {\n throw new Error(`Invalid label \"${label}\": ${err.message}`);\n }\n }\n return name;\n}\nexport function ens_normalize(name) {\n return ens_normalize_post_check(normalize(name, filter_fe0f));\n}\nfunction normalize(name, emoji_filter) {\n let input = explode_cp(name).reverse(); // flip for pop\n let output = [];\n while (input.length) {\n let emoji = consume_emoji_reversed(input);\n if (emoji) {\n output.push(...emoji_filter(emoji));\n continue;\n }\n let cp = input.pop();\n if (VALID.has(cp)) {\n output.push(cp);\n continue;\n }\n if (IGNORED.has(cp)) {\n continue;\n }\n let cps = MAPPED[cp];\n if (cps) {\n output.push(...cps);\n continue;\n }\n throw new Error(`Disallowed codepoint: 0x${cp.toString(16).toUpperCase()}`);\n }\n return ens_normalize_post_check(nfc(String.fromCodePoint(...output)));\n}\nfunction nfc(s) {\n return s.normalize('NFC');\n}\nfunction consume_emoji_reversed(cps, eaten) {\n var _a;\n let node = EMOJI_ROOT;\n let emoji;\n let saved;\n let stack = [];\n let pos = cps.length;\n if (eaten)\n eaten.length = 0; // clear input buffer (if needed)\n while (pos) {\n let cp = cps[--pos];\n node = (_a = node.branches.find(x => x.set.has(cp))) === null || _a === void 0 ? void 0 : _a.node;\n if (!node)\n break;\n if (node.save) { // remember\n saved = cp;\n }\n else if (node.check) { // check exclusion\n if (cp === saved)\n break;\n }\n stack.push(cp);\n if (node.fe0f) {\n stack.push(0xFE0F);\n if (pos > 0 && cps[pos - 1] == 0xFE0F)\n pos--; // consume optional FE0F\n }\n if (node.valid) { // this is a valid emoji (so far)\n emoji = stack.slice(); // copy stack\n if (node.valid == 2)\n emoji.splice(1, 1); // delete FE0F at position 1 (RGI ZWJ don't follow spec!)\n if (eaten)\n eaten.push(...cps.slice(pos).reverse()); // copy input (if needed)\n cps.length = pos; // truncate\n }\n }\n return emoji;\n}\n//# sourceMappingURL=lib.js.map","/**\n * MIT License\n *\n * Copyright (c) 2021 Andrew Raffensperger\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * This is a near carbon-copy of the original source (link below) with the\n * TypeScript typings added and a few tweaks to make it ES3-compatible.\n *\n * See: https://github.com/adraffy/ens-normalize.js\n */\nimport { decode } from \"@ethersproject/base64\";\nimport { read_compressed_payload } from './decoder.js';\nexport function getData() {\n return read_compressed_payload(decode('AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7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PFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=='));\n}\n//# sourceMappingURL=include.js.map","import { concat, hexlify } from \"@ethersproject/bytes\";\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { ens_normalize } from \"./ens-normalize/lib\";\nconst Zeros = new Uint8Array(32);\nZeros.fill(0);\nfunction checkComponent(comp) {\n if (comp.length === 0) {\n throw new Error(\"invalid ENS name; empty component\");\n }\n return comp;\n}\nfunction ensNameSplit(name) {\n const bytes = toUtf8Bytes(ens_normalize(name));\n const comps = [];\n if (name.length === 0) {\n return comps;\n }\n let last = 0;\n for (let i = 0; i < bytes.length; i++) {\n const d = bytes[i];\n // A separator (i.e. \".\"); copy this component\n if (d === 0x2e) {\n comps.push(checkComponent(bytes.slice(last, i)));\n last = i + 1;\n }\n }\n // There was a stray separator at the end of the name\n if (last >= bytes.length) {\n throw new Error(\"invalid ENS name; empty component\");\n }\n comps.push(checkComponent(bytes.slice(last)));\n return comps;\n}\nexport function ensNormalize(name) {\n return ensNameSplit(name).map((comp) => toUtf8String(comp)).join(\".\");\n}\nexport function isValidName(name) {\n try {\n return (ensNameSplit(name).length !== 0);\n }\n catch (error) { }\n return false;\n}\nexport function namehash(name) {\n /* istanbul ignore if */\n if (typeof (name) !== \"string\") {\n logger.throwArgumentError(\"invalid ENS name; not a string\", \"name\", name);\n }\n let result = Zeros;\n const comps = ensNameSplit(name);\n while (comps.length) {\n result = keccak256(concat([result, keccak256(comps.pop())]));\n }\n return hexlify(result);\n}\nexport function dnsEncode(name) {\n return hexlify(concat(ensNameSplit(name).map((comp) => {\n // DNS does not allow components over 63 bytes in length\n if (comp.length > 63) {\n throw new Error(\"invalid DNS encoded entry; length exceeds 63 bytes\");\n }\n const bytes = new Uint8Array(comp.length + 1);\n bytes.set(comp, 1);\n bytes[0] = bytes.length - 1;\n return bytes;\n }))) + \"00\";\n}\n//# sourceMappingURL=namehash.js.map","import { concat } from \"@ethersproject/bytes\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nexport const messagePrefix = \"\\x19Ethereum Signed Message:\\n\";\nexport function hashMessage(message) {\n if (typeof (message) === \"string\") {\n message = toUtf8Bytes(message);\n }\n return keccak256(concat([\n toUtf8Bytes(messagePrefix),\n toUtf8Bytes(String(message.length)),\n message\n ]));\n}\n//# sourceMappingURL=message.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { getAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, hexConcat, hexlify, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { deepCopy, defineReadOnly, shallowCopy } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { id } from \"./id\";\nconst padding = new Uint8Array(32);\npadding.fill(0);\nconst NegativeOne = BigNumber.from(-1);\nconst Zero = BigNumber.from(0);\nconst One = BigNumber.from(1);\nconst MaxUint256 = BigNumber.from(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nfunction hexPadRight(value) {\n const bytes = arrayify(value);\n const padOffset = bytes.length % 32;\n if (padOffset) {\n return hexConcat([bytes, padding.slice(padOffset)]);\n }\n return hexlify(bytes);\n}\nconst hexTrue = hexZeroPad(One.toHexString(), 32);\nconst hexFalse = hexZeroPad(Zero.toHexString(), 32);\nconst domainFieldTypes = {\n name: \"string\",\n version: \"string\",\n chainId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\"\n};\nconst domainFieldNames = [\n \"name\", \"version\", \"chainId\", \"verifyingContract\", \"salt\"\n];\nfunction checkString(key) {\n return function (value) {\n if (typeof (value) !== \"string\") {\n logger.throwArgumentError(`invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);\n }\n return value;\n };\n}\nconst domainChecks = {\n name: checkString(\"name\"),\n version: checkString(\"version\"),\n chainId: function (value) {\n try {\n return BigNumber.from(value).toString();\n }\n catch (error) { }\n return logger.throwArgumentError(`invalid domain value for \"chainId\"`, \"domain.chainId\", value);\n },\n verifyingContract: function (value) {\n try {\n return getAddress(value).toLowerCase();\n }\n catch (error) { }\n return logger.throwArgumentError(`invalid domain value \"verifyingContract\"`, \"domain.verifyingContract\", value);\n },\n salt: function (value) {\n try {\n const bytes = arrayify(value);\n if (bytes.length !== 32) {\n throw new Error(\"bad length\");\n }\n return hexlify(bytes);\n }\n catch (error) { }\n return logger.throwArgumentError(`invalid domain value \"salt\"`, \"domain.salt\", value);\n }\n};\nfunction getBaseEncoder(type) {\n // intXX and uintXX\n {\n const match = type.match(/^(u?)int(\\d*)$/);\n if (match) {\n const signed = (match[1] === \"\");\n const width = parseInt(match[2] || \"256\");\n if (width % 8 !== 0 || width > 256 || (match[2] && match[2] !== String(width))) {\n logger.throwArgumentError(\"invalid numeric width\", \"type\", type);\n }\n const boundsUpper = MaxUint256.mask(signed ? (width - 1) : width);\n const boundsLower = signed ? boundsUpper.add(One).mul(NegativeOne) : Zero;\n return function (value) {\n const v = BigNumber.from(value);\n if (v.lt(boundsLower) || v.gt(boundsUpper)) {\n logger.throwArgumentError(`value out-of-bounds for ${type}`, \"value\", value);\n }\n return hexZeroPad(v.toTwos(256).toHexString(), 32);\n };\n }\n }\n // bytesXX\n {\n const match = type.match(/^bytes(\\d+)$/);\n if (match) {\n const width = parseInt(match[1]);\n if (width === 0 || width > 32 || match[1] !== String(width)) {\n logger.throwArgumentError(\"invalid bytes width\", \"type\", type);\n }\n return function (value) {\n const bytes = arrayify(value);\n if (bytes.length !== width) {\n logger.throwArgumentError(`invalid length for ${type}`, \"value\", value);\n }\n return hexPadRight(value);\n };\n }\n }\n switch (type) {\n case \"address\": return function (value) {\n return hexZeroPad(getAddress(value), 32);\n };\n case \"bool\": return function (value) {\n return ((!value) ? hexFalse : hexTrue);\n };\n case \"bytes\": return function (value) {\n return keccak256(value);\n };\n case \"string\": return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields.map(({ name, type }) => (type + \" \" + name)).join(\",\")})`;\n}\nexport class TypedDataEncoder {\n constructor(types) {\n defineReadOnly(this, \"types\", Object.freeze(deepCopy(types)));\n defineReadOnly(this, \"_encoderCache\", {});\n defineReadOnly(this, \"_types\", {});\n // Link struct types to their direct child structs\n const links = {};\n // Link structs to structs which contain them as a child\n const parents = {};\n // Link all subtypes within a given struct\n const subtypes = {};\n Object.keys(types).forEach((type) => {\n links[type] = {};\n parents[type] = [];\n subtypes[type] = {};\n });\n for (const name in types) {\n const uniqueNames = {};\n types[name].forEach((field) => {\n // Check each field has a unique name\n if (uniqueNames[field.name]) {\n logger.throwArgumentError(`duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, \"types\", types);\n }\n uniqueNames[field.name] = true;\n // Get the base type (drop any array specifiers)\n const baseType = field.type.match(/^([^\\x5b]*)(\\x5b|$)/)[1];\n if (baseType === name) {\n logger.throwArgumentError(`circular type reference to ${JSON.stringify(baseType)}`, \"types\", types);\n }\n // Is this a base encoding type?\n const encoder = getBaseEncoder(baseType);\n if (encoder) {\n return;\n }\n if (!parents[baseType]) {\n logger.throwArgumentError(`unknown type ${JSON.stringify(baseType)}`, \"types\", types);\n }\n // Add linkage\n parents[baseType].push(name);\n links[name][baseType] = true;\n });\n }\n // Deduce the primary type\n const primaryTypes = Object.keys(parents).filter((n) => (parents[n].length === 0));\n if (primaryTypes.length === 0) {\n logger.throwArgumentError(\"missing primary type\", \"types\", types);\n }\n else if (primaryTypes.length > 1) {\n logger.throwArgumentError(`ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(\", \")}`, \"types\", types);\n }\n defineReadOnly(this, \"primaryType\", primaryTypes[0]);\n // Check for circular type references\n function checkCircular(type, found) {\n if (found[type]) {\n logger.throwArgumentError(`circular type reference to ${JSON.stringify(type)}`, \"types\", types);\n }\n found[type] = true;\n Object.keys(links[type]).forEach((child) => {\n if (!parents[child]) {\n return;\n }\n // Recursively check children\n checkCircular(child, found);\n // Mark all ancestors as having this decendant\n Object.keys(found).forEach((subtype) => {\n subtypes[subtype][child] = true;\n });\n });\n delete found[type];\n }\n checkCircular(this.primaryType, {});\n // Compute each fully describe type\n for (const name in subtypes) {\n const st = Object.keys(subtypes[name]);\n st.sort();\n this._types[name] = encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join(\"\");\n }\n }\n getEncoder(type) {\n let encoder = this._encoderCache[type];\n if (!encoder) {\n encoder = this._encoderCache[type] = this._getEncoder(type);\n }\n return encoder;\n }\n _getEncoder(type) {\n // Basic encoder type (address, bool, uint256, etc)\n {\n const encoder = getBaseEncoder(type);\n if (encoder) {\n return encoder;\n }\n }\n // Array\n const match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n const subtype = match[1];\n const subEncoder = this.getEncoder(subtype);\n const length = parseInt(match[3]);\n return (value) => {\n if (length >= 0 && value.length !== length) {\n logger.throwArgumentError(\"array length mismatch; expected length ${ arrayLength }\", \"value\", value);\n }\n let result = value.map(subEncoder);\n if (this._types[subtype]) {\n result = result.map(keccak256);\n }\n return keccak256(hexConcat(result));\n };\n }\n // Struct\n const fields = this.types[type];\n if (fields) {\n const encodedType = id(this._types[type]);\n return (value) => {\n const values = fields.map(({ name, type }) => {\n const result = this.getEncoder(type)(value[name]);\n if (this._types[type]) {\n return keccak256(result);\n }\n return result;\n });\n values.unshift(encodedType);\n return hexConcat(values);\n };\n }\n return logger.throwArgumentError(`unknown type: ${type}`, \"type\", type);\n }\n encodeType(name) {\n const result = this._types[name];\n if (!result) {\n logger.throwArgumentError(`unknown type: ${JSON.stringify(name)}`, \"name\", name);\n }\n return result;\n }\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n hashStruct(name, value) {\n return keccak256(this.encodeData(name, value));\n }\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n hash(value) {\n return this.hashStruct(this.primaryType, value);\n }\n _visit(type, value, callback) {\n // Basic encoder type (address, bool, uint256, etc)\n {\n const encoder = getBaseEncoder(type);\n if (encoder) {\n return callback(type, value);\n }\n }\n // Array\n const match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n const subtype = match[1];\n const length = parseInt(match[3]);\n if (length >= 0 && value.length !== length) {\n logger.throwArgumentError(\"array length mismatch; expected length ${ arrayLength }\", \"value\", value);\n }\n return value.map((v) => this._visit(subtype, v, callback));\n }\n // Struct\n const fields = this.types[type];\n if (fields) {\n return fields.reduce((accum, { name, type }) => {\n accum[name] = this._visit(type, value[name], callback);\n return accum;\n }, {});\n }\n return logger.throwArgumentError(`unknown type: ${type}`, \"type\", type);\n }\n visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n static from(types) {\n return new TypedDataEncoder(types);\n }\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\n }\n static hashDomain(domain) {\n const domainFields = [];\n for (const name in domain) {\n const type = domainFieldTypes[name];\n if (!type) {\n logger.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(name)}`, \"domain\", domain);\n }\n domainFields.push({ name, type });\n }\n domainFields.sort((a, b) => {\n return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name);\n });\n return TypedDataEncoder.hashStruct(\"EIP712Domain\", { EIP712Domain: domainFields }, domain);\n }\n static encode(domain, types, value) {\n return hexConcat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value)\n ]);\n }\n static hash(domain, types, value) {\n return keccak256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\n static resolveNames(domain, types, value, resolveName) {\n return __awaiter(this, void 0, void 0, function* () {\n // Make a copy to isolate it from the object passed in\n domain = shallowCopy(domain);\n // Look up all ENS names\n const ensCache = {};\n // Do we need to look up the domain's verifyingContract?\n if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) {\n ensCache[domain.verifyingContract] = \"0x\";\n }\n // We are going to use the encoder to visit all the base values\n const encoder = TypedDataEncoder.from(types);\n // Get a list of all the addresses\n encoder.visit(value, (type, value) => {\n if (type === \"address\" && !isHexString(value, 20)) {\n ensCache[value] = \"0x\";\n }\n return value;\n });\n // Lookup each name\n for (const name in ensCache) {\n ensCache[name] = yield resolveName(name);\n }\n // Replace the domain verifyingContract if needed\n if (domain.verifyingContract && ensCache[domain.verifyingContract]) {\n domain.verifyingContract = ensCache[domain.verifyingContract];\n }\n // Replace all ENS names with their address\n value = encoder.visit(value, (type, value) => {\n if (type === \"address\" && ensCache[value]) {\n return ensCache[value];\n }\n return value;\n });\n return { domain, value };\n });\n }\n static getPayload(domain, types, value) {\n // Validate the domain fields\n TypedDataEncoder.hashDomain(domain);\n // Derive the EIP712Domain Struct reference type\n const domainValues = {};\n const domainTypes = [];\n domainFieldNames.forEach((name) => {\n const value = domain[name];\n if (value == null) {\n return;\n }\n domainValues[name] = domainChecks[name](value);\n domainTypes.push({ name, type: domainFieldTypes[name] });\n });\n const encoder = TypedDataEncoder.from(types);\n const typesWithDomain = shallowCopy(types);\n if (typesWithDomain.EIP712Domain) {\n logger.throwArgumentError(\"types must not contain EIP712Domain type\", \"types.EIP712Domain\", types);\n }\n else {\n typesWithDomain.EIP712Domain = domainTypes;\n }\n // Validate the data structures and types\n encoder.encode(value);\n return {\n types: typesWithDomain,\n domain: domainValues,\n primaryType: encoder.primaryType,\n message: encoder.visit(value, (type, value) => {\n // bytes\n if (type.match(/^bytes(\\d*)/)) {\n return hexlify(arrayify(value));\n }\n // uint or int\n if (type.match(/^u?int/)) {\n return BigNumber.from(value).toString();\n }\n switch (type) {\n case \"address\":\n return value.toLowerCase();\n case \"bool\":\n return !!value;\n case \"string\":\n if (typeof (value) !== \"string\") {\n logger.throwArgumentError(`invalid string`, \"value\", value);\n }\n return value;\n }\n return logger.throwArgumentError(\"unsupported type\", \"type\", type);\n })\n };\n }\n}\n//# sourceMappingURL=typed-data.js.map","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, concat, hexDataSlice, hexlify, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { id } from \"@ethersproject/hash\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { defineReadOnly, Description, getStatic } from \"@ethersproject/properties\";\nimport { defaultAbiCoder } from \"./abi-coder\";\nimport { checkResultErrors } from \"./coders/abstract-coder\";\nimport { ConstructorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, ParamType } from \"./fragments\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport { checkResultErrors };\nexport class LogDescription extends Description {\n}\nexport class TransactionDescription extends Description {\n}\nexport class ErrorDescription extends Description {\n}\nexport class Indexed extends Description {\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n}\nconst BuiltinErrors = {\n \"0x08c379a0\": { signature: \"Error(string)\", name: \"Error\", inputs: [\"string\"], reason: true },\n \"0x4e487b71\": { signature: \"Panic(uint256)\", name: \"Panic\", inputs: [\"uint256\"] }\n};\nfunction wrapAccessError(property, error) {\n const wrap = new Error(`deferred error during ABI decoding triggered accessing ${property}`);\n wrap.error = error;\n return wrap;\n}\n/*\nfunction checkNames(fragment: Fragment, type: \"input\" | \"output\", params: Array<ParamType>): void {\n params.reduce((accum, param) => {\n if (param.name) {\n if (accum[param.name]) {\n logger.throwArgumentError(`duplicate ${ type } parameter ${ JSON.stringify(param.name) } in ${ fragment.format(\"full\") }`, \"fragment\", fragment);\n }\n accum[param.name] = true;\n }\n return accum;\n }, <{ [ name: string ]: boolean }>{ });\n}\n*/\nexport class Interface {\n constructor(fragments) {\n let abi = [];\n if (typeof (fragments) === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n defineReadOnly(this, \"fragments\", abi.map((fragment) => {\n return Fragment.from(fragment);\n }).filter((fragment) => (fragment != null)));\n defineReadOnly(this, \"_abiCoder\", getStatic(new.target, \"getAbiCoder\")());\n defineReadOnly(this, \"functions\", {});\n defineReadOnly(this, \"errors\", {});\n defineReadOnly(this, \"events\", {});\n defineReadOnly(this, \"structs\", {});\n // Add all fragments by their signature\n this.fragments.forEach((fragment) => {\n let bucket = null;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n logger.warn(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineReadOnly(this, \"deploy\", fragment);\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (<FunctionFragment>fragment).outputs);\n bucket = this.functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.events;\n break;\n case \"error\":\n bucket = this.errors;\n break;\n default:\n return;\n }\n let signature = fragment.format();\n if (bucket[signature]) {\n logger.warn(\"duplicate definition - \" + signature);\n return;\n }\n bucket[signature] = fragment;\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineReadOnly(this, \"deploy\", ConstructorFragment.from({\n payable: false,\n type: \"constructor\"\n }));\n }\n defineReadOnly(this, \"_isInterface\", true);\n }\n format(format) {\n if (!format) {\n format = FormatTypes.full;\n }\n if (format === FormatTypes.sighash) {\n logger.throwArgumentError(\"interface does not support formatting sighash\", \"format\", format);\n }\n const abi = this.fragments.map((fragment) => fragment.format(format));\n // We need to re-bundle the JSON fragments a bit\n if (format === FormatTypes.json) {\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n return abi;\n }\n // Sub-classes can override these to handle other blockchains\n static getAbiCoder() {\n return defaultAbiCoder;\n }\n static getAddress(address) {\n return getAddress(address);\n }\n static getSighash(fragment) {\n return hexDataSlice(id(fragment.format()), 0, 4);\n }\n static getEventTopic(eventFragment) {\n return id(eventFragment.format());\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n getFunction(nameOrSignatureOrSighash) {\n if (isHexString(nameOrSignatureOrSighash)) {\n for (const name in this.functions) {\n if (nameOrSignatureOrSighash === this.getSighash(name)) {\n return this.functions[name];\n }\n }\n logger.throwArgumentError(\"no matching function\", \"sighash\", nameOrSignatureOrSighash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrSighash.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrSighash.trim();\n const matching = Object.keys(this.functions).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching function\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching functions\", \"name\", name);\n }\n return this.functions[matching[0]];\n }\n // Normalize the signature and lookup the function\n const result = this.functions[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching function\", \"signature\", nameOrSignatureOrSighash);\n }\n return result;\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n getEvent(nameOrSignatureOrTopic) {\n if (isHexString(nameOrSignatureOrTopic)) {\n const topichash = nameOrSignatureOrTopic.toLowerCase();\n for (const name in this.events) {\n if (topichash === this.getEventTopic(name)) {\n return this.events[name];\n }\n }\n logger.throwArgumentError(\"no matching event\", \"topichash\", topichash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrTopic.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrTopic.trim();\n const matching = Object.keys(this.events).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching event\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching events\", \"name\", name);\n }\n return this.events[matching[0]];\n }\n // Normalize the signature and lookup the function\n const result = this.events[EventFragment.fromString(nameOrSignatureOrTopic).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching event\", \"signature\", nameOrSignatureOrTopic);\n }\n return result;\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n getError(nameOrSignatureOrSighash) {\n if (isHexString(nameOrSignatureOrSighash)) {\n const getSighash = getStatic(this.constructor, \"getSighash\");\n for (const name in this.errors) {\n const error = this.errors[name];\n if (nameOrSignatureOrSighash === getSighash(error)) {\n return this.errors[name];\n }\n }\n logger.throwArgumentError(\"no matching error\", \"sighash\", nameOrSignatureOrSighash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrSighash.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrSighash.trim();\n const matching = Object.keys(this.errors).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching error\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching errors\", \"name\", name);\n }\n return this.errors[matching[0]];\n }\n // Normalize the signature and lookup the function\n const result = this.errors[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching error\", \"signature\", nameOrSignatureOrSighash);\n }\n return result;\n }\n // Get the sighash (the bytes4 selector) used by Solidity to identify a function\n getSighash(fragment) {\n if (typeof (fragment) === \"string\") {\n try {\n fragment = this.getFunction(fragment);\n }\n catch (error) {\n try {\n fragment = this.getError(fragment);\n }\n catch (_) {\n throw error;\n }\n }\n }\n return getStatic(this.constructor, \"getSighash\")(fragment);\n }\n // Get the topic (the bytes32 hash) used by Solidity to identify an event\n getEventTopic(eventFragment) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n return getStatic(this.constructor, \"getEventTopic\")(eventFragment);\n }\n _decodeParams(params, data) {\n return this._abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this._abiCoder.encode(params, values);\n }\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n decodeErrorResult(fragment, data) {\n if (typeof (fragment) === \"string\") {\n fragment = this.getError(fragment);\n }\n const bytes = arrayify(data);\n if (hexlify(bytes.slice(0, 4)) !== this.getSighash(fragment)) {\n logger.throwArgumentError(`data signature does not match error ${fragment.name}.`, \"data\", hexlify(bytes));\n }\n return this._decodeParams(fragment.inputs, bytes.slice(4));\n }\n encodeErrorResult(fragment, values) {\n if (typeof (fragment) === \"string\") {\n fragment = this.getError(fragment);\n }\n return hexlify(concat([\n this.getSighash(fragment),\n this._encodeParams(fragment.inputs, values || [])\n ]));\n }\n // Decode the data for a function call (e.g. tx.data)\n decodeFunctionData(functionFragment, data) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n const bytes = arrayify(data);\n if (hexlify(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) {\n logger.throwArgumentError(`data signature does not match function ${functionFragment.name}.`, \"data\", hexlify(bytes));\n }\n return this._decodeParams(functionFragment.inputs, bytes.slice(4));\n }\n // Encode the data for a function call (e.g. tx.data)\n encodeFunctionData(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return hexlify(concat([\n this.getSighash(functionFragment),\n this._encodeParams(functionFragment.inputs, values || [])\n ]));\n }\n // Decode the result from a function call (e.g. from eth_call)\n decodeFunctionResult(functionFragment, data) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n let bytes = arrayify(data);\n let reason = null;\n let message = \"\";\n let errorArgs = null;\n let errorName = null;\n let errorSignature = null;\n switch (bytes.length % this._abiCoder._getWordSize()) {\n case 0:\n try {\n return this._abiCoder.decode(functionFragment.outputs, bytes);\n }\n catch (error) { }\n break;\n case 4: {\n const selector = hexlify(bytes.slice(0, 4));\n const builtin = BuiltinErrors[selector];\n if (builtin) {\n errorArgs = this._abiCoder.decode(builtin.inputs, bytes.slice(4));\n errorName = builtin.name;\n errorSignature = builtin.signature;\n if (builtin.reason) {\n reason = errorArgs[0];\n }\n if (errorName === \"Error\") {\n message = `; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(errorArgs[0])}`;\n }\n else if (errorName === \"Panic\") {\n message = `; VM Exception while processing transaction: reverted with panic code ${errorArgs[0]}`;\n }\n }\n else {\n try {\n const error = this.getError(selector);\n errorArgs = this._abiCoder.decode(error.inputs, bytes.slice(4));\n errorName = error.name;\n errorSignature = error.format();\n }\n catch (error) { }\n }\n break;\n }\n }\n return logger.throwError(\"call revert exception\" + message, Logger.errors.CALL_EXCEPTION, {\n method: functionFragment.format(),\n data: hexlify(data), errorArgs, errorName, errorSignature, reason\n });\n }\n // Encode the result for a function call (e.g. for eth_call)\n encodeFunctionResult(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return hexlify(this._abiCoder.encode(functionFragment.outputs, values || []));\n }\n // Create the filter for the event with search criteria (e.g. for eth_filterLog)\n encodeFilterTopics(eventFragment, values) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n if (values.length > eventFragment.inputs.length) {\n logger.throwError(\"too many arguments for \" + eventFragment.format(), Logger.errors.UNEXPECTED_ARGUMENT, {\n argument: \"values\",\n value: values\n });\n }\n let topics = [];\n if (!eventFragment.anonymous) {\n topics.push(this.getEventTopic(eventFragment));\n }\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return keccak256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof (value) === \"boolean\") {\n value = (value ? \"0x01\" : \"0x00\");\n }\n if (param.type.match(/^u?int/)) {\n value = BigNumber.from(value).toHexString();\n }\n // Check addresses are valid\n if (param.type === \"address\") {\n this._abiCoder.encode([\"address\"], [value]);\n }\n return hexZeroPad(hexlify(value), 32);\n };\n values.forEach((value, index) => {\n let param = eventFragment.inputs[index];\n if (!param.indexed) {\n if (value != null) {\n logger.throwArgumentError(\"cannot filter non-indexed parameters; must be null\", (\"contract.\" + param.name), value);\n }\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(eventFragment, values) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!eventFragment.anonymous) {\n topics.push(this.getEventTopic(eventFragment));\n }\n if (values.length !== eventFragment.inputs.length) {\n logger.throwArgumentError(\"event arguments/values mismatch\", \"values\", values);\n }\n eventFragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(keccak256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this._abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this._abiCoder.encode(dataTypes, dataValues),\n topics: topics\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(eventFragment, data, topics) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n if (topics != null && !eventFragment.anonymous) {\n let topicHash = this.getEventTopic(eventFragment);\n if (!isHexString(topics[0], 32) || topics[0].toLowerCase() !== topicHash) {\n logger.throwError(\"fragment/topic mismatch\", Logger.errors.INVALID_ARGUMENT, { argument: \"topics[0]\", expected: topicHash, value: topics[0] });\n }\n topics = topics.slice(1);\n }\n let indexed = [];\n let nonIndexed = [];\n let dynamic = [];\n eventFragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" || param.type === \"bytes\" || param.baseType === \"tuple\" || param.baseType === \"array\") {\n indexed.push(ParamType.fromObject({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n let resultIndexed = (topics != null) ? this._abiCoder.decode(indexed, concat(topics)) : null;\n let resultNonIndexed = this._abiCoder.decode(nonIndexed, data, true);\n let result = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n eventFragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (resultIndexed == null) {\n result[index] = new Indexed({ _isIndexed: true, hash: null });\n }\n else if (dynamic[index]) {\n result[index] = new Indexed({ _isIndexed: true, hash: resultIndexed[indexedIndex++] });\n }\n else {\n try {\n result[index] = resultIndexed[indexedIndex++];\n }\n catch (error) {\n result[index] = error;\n }\n }\n }\n else {\n try {\n result[index] = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n result[index] = error;\n }\n }\n // Add the keyword argument if named and safe\n if (param.name && result[param.name] == null) {\n const value = result[index];\n // Make error named values throw on access\n if (value instanceof Error) {\n Object.defineProperty(result, param.name, {\n enumerable: true,\n get: () => { throw wrapAccessError(`property ${JSON.stringify(param.name)}`, value); }\n });\n }\n else {\n result[param.name] = value;\n }\n }\n });\n // Make all error indexed values throw on access\n for (let i = 0; i < result.length; i++) {\n const value = result[i];\n if (value instanceof Error) {\n Object.defineProperty(result, i, {\n enumerable: true,\n get: () => { throw wrapAccessError(`index ${i}`, value); }\n });\n }\n }\n return Object.freeze(result);\n }\n // Given a transaction, find the matching function fragment (if any) and\n // determine all its properties and call parameters\n parseTransaction(tx) {\n let fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase());\n if (!fragment) {\n return null;\n }\n return new TransactionDescription({\n args: this._abiCoder.decode(fragment.inputs, \"0x\" + tx.data.substring(10)),\n functionFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n sighash: this.getSighash(fragment),\n value: BigNumber.from(tx.value || \"0\"),\n });\n }\n // @TODO\n //parseCallResult(data: BytesLike): ??\n // Given an event log, find the matching event fragment (if any) and\n // determine all its properties and values\n parseLog(log) {\n let fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription({\n eventFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n topic: this.getEventTopic(fragment),\n args: this.decodeEventLog(fragment, log.data, log.topics)\n });\n }\n parseError(data) {\n const hexData = hexlify(data);\n let fragment = this.getError(hexData.substring(0, 10).toLowerCase());\n if (!fragment) {\n return null;\n }\n return new ErrorDescription({\n args: this._abiCoder.decode(fragment.inputs, \"0x\" + hexData.substring(10)),\n errorFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n sighash: this.getSighash(fragment),\n });\n }\n /*\n static from(value: Array<Fragment | string | JsonAbi> | string | Interface) {\n if (Interface.isInterface(value)) {\n return value;\n }\n if (typeof(value) === \"string\") {\n return new Interface(JSON.parse(value));\n }\n return new Interface(value);\n }\n */\n static isInterface(value) {\n return !!(value && value._isInterface);\n }\n}\n//# sourceMappingURL=interface.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { isHexString } from \"@ethersproject/bytes\";\nimport { Description, defineReadOnly, resolveProperties } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n;\n;\n//export type CallTransactionable = {\n// call(transaction: TransactionRequest): Promise<TransactionResponse>;\n//};\nexport class ForkEvent extends Description {\n static isForkEvent(value) {\n return !!(value && value._isForkEvent);\n }\n}\nexport class BlockForkEvent extends ForkEvent {\n constructor(blockHash, expiry) {\n if (!isHexString(blockHash, 32)) {\n logger.throwArgumentError(\"invalid blockHash\", \"blockHash\", blockHash);\n }\n super({\n _isForkEvent: true,\n _isBlockForkEvent: true,\n expiry: (expiry || 0),\n blockHash: blockHash\n });\n }\n}\nexport class TransactionForkEvent extends ForkEvent {\n constructor(hash, expiry) {\n if (!isHexString(hash, 32)) {\n logger.throwArgumentError(\"invalid transaction hash\", \"hash\", hash);\n }\n super({\n _isForkEvent: true,\n _isTransactionForkEvent: true,\n expiry: (expiry || 0),\n hash: hash\n });\n }\n}\nexport class TransactionOrderForkEvent extends ForkEvent {\n constructor(beforeHash, afterHash, expiry) {\n if (!isHexString(beforeHash, 32)) {\n logger.throwArgumentError(\"invalid transaction hash\", \"beforeHash\", beforeHash);\n }\n if (!isHexString(afterHash, 32)) {\n logger.throwArgumentError(\"invalid transaction hash\", \"afterHash\", afterHash);\n }\n super({\n _isForkEvent: true,\n _isTransactionOrderForkEvent: true,\n expiry: (expiry || 0),\n beforeHash: beforeHash,\n afterHash: afterHash\n });\n }\n}\n///////////////////////////////\n// Exported Abstracts\nexport class Provider {\n constructor() {\n logger.checkAbstract(new.target, Provider);\n defineReadOnly(this, \"_isProvider\", true);\n }\n getFeeData() {\n return __awaiter(this, void 0, void 0, function* () {\n const { block, gasPrice } = yield resolveProperties({\n block: this.getBlock(\"latest\"),\n gasPrice: this.getGasPrice().catch((error) => {\n // @TODO: Why is this now failing on Calaveras?\n //console.log(error);\n return null;\n })\n });\n let lastBaseFeePerGas = null, maxFeePerGas = null, maxPriorityFeePerGas = null;\n if (block && block.baseFeePerGas) {\n // We may want to compute this more accurately in the future,\n // using the formula \"check if the base fee is correct\".\n // See: https://eips.ethereum.org/EIPS/eip-1559\n lastBaseFeePerGas = block.baseFeePerGas;\n maxPriorityFeePerGas = BigNumber.from(\"1500000000\");\n maxFeePerGas = block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas);\n }\n return { lastBaseFeePerGas, maxFeePerGas, maxPriorityFeePerGas, gasPrice };\n });\n }\n // Alias for \"on\"\n addListener(eventName, listener) {\n return this.on(eventName, listener);\n }\n // Alias for \"off\"\n removeListener(eventName, listener) {\n return this.off(eventName, listener);\n }\n static isProvider(value) {\n return !!(value && value._isProvider);\n }\n}\n//# sourceMappingURL=index.js.map","export const version = \"abstract-provider/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { defineReadOnly, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nconst allowedTransactionKeys = [\n \"accessList\", \"ccipReadEnabled\", \"chainId\", \"customData\", \"data\", \"from\", \"gasLimit\", \"gasPrice\", \"maxFeePerGas\", \"maxPriorityFeePerGas\", \"nonce\", \"to\", \"type\", \"value\"\n];\nconst forwardErrors = [\n Logger.errors.INSUFFICIENT_FUNDS,\n Logger.errors.NONCE_EXPIRED,\n Logger.errors.REPLACEMENT_UNDERPRICED,\n];\n;\n;\nexport class Signer {\n ///////////////////\n // Sub-classes MUST call super\n constructor() {\n logger.checkAbstract(new.target, Signer);\n defineReadOnly(this, \"_isSigner\", true);\n }\n ///////////////////\n // Sub-classes MAY override these\n getBalance(blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getBalance\");\n return yield this.provider.getBalance(this.getAddress(), blockTag);\n });\n }\n getTransactionCount(blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getTransactionCount\");\n return yield this.provider.getTransactionCount(this.getAddress(), blockTag);\n });\n }\n // Populates \"from\" if unspecified, and estimates the gas for the transaction\n estimateGas(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"estimateGas\");\n const tx = yield resolveProperties(this.checkTransaction(transaction));\n return yield this.provider.estimateGas(tx);\n });\n }\n // Populates \"from\" if unspecified, and calls with the transaction\n call(transaction, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"call\");\n const tx = yield resolveProperties(this.checkTransaction(transaction));\n return yield this.provider.call(tx, blockTag);\n });\n }\n // Populates all fields in a transaction, signs it and sends it to the network\n sendTransaction(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"sendTransaction\");\n const tx = yield this.populateTransaction(transaction);\n const signedTx = yield this.signTransaction(tx);\n return yield this.provider.sendTransaction(signedTx);\n });\n }\n getChainId() {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getChainId\");\n const network = yield this.provider.getNetwork();\n return network.chainId;\n });\n }\n getGasPrice() {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getGasPrice\");\n return yield this.provider.getGasPrice();\n });\n }\n getFeeData() {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getFeeData\");\n return yield this.provider.getFeeData();\n });\n }\n resolveName(name) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"resolveName\");\n return yield this.provider.resolveName(name);\n });\n }\n // Checks a transaction does not contain invalid keys and if\n // no \"from\" is provided, populates it.\n // - does NOT require a provider\n // - adds \"from\" is not present\n // - returns a COPY (safe to mutate the result)\n // By default called from: (overriding these prevents it)\n // - call\n // - estimateGas\n // - populateTransaction (and therefor sendTransaction)\n checkTransaction(transaction) {\n for (const key in transaction) {\n if (allowedTransactionKeys.indexOf(key) === -1) {\n logger.throwArgumentError(\"invalid transaction key: \" + key, \"transaction\", transaction);\n }\n }\n const tx = shallowCopy(transaction);\n if (tx.from == null) {\n tx.from = this.getAddress();\n }\n else {\n // Make sure any provided address matches this signer\n tx.from = Promise.all([\n Promise.resolve(tx.from),\n this.getAddress()\n ]).then((result) => {\n if (result[0].toLowerCase() !== result[1].toLowerCase()) {\n logger.throwArgumentError(\"from address mismatch\", \"transaction\", transaction);\n }\n return result[0];\n });\n }\n return tx;\n }\n // Populates ALL keys for a transaction and checks that \"from\" matches\n // this Signer. Should be used by sendTransaction but NOT by signTransaction.\n // By default called from: (overriding these prevents it)\n // - sendTransaction\n //\n // Notes:\n // - We allow gasPrice for EIP-1559 as long as it matches maxFeePerGas\n populateTransaction(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n const tx = yield resolveProperties(this.checkTransaction(transaction));\n if (tx.to != null) {\n tx.to = Promise.resolve(tx.to).then((to) => __awaiter(this, void 0, void 0, function* () {\n if (to == null) {\n return null;\n }\n const address = yield this.resolveName(to);\n if (address == null) {\n logger.throwArgumentError(\"provided ENS name resolves to null\", \"tx.to\", to);\n }\n return address;\n }));\n // Prevent this error from causing an UnhandledPromiseException\n tx.to.catch((error) => { });\n }\n // Do not allow mixing pre-eip-1559 and eip-1559 properties\n const hasEip1559 = (tx.maxFeePerGas != null || tx.maxPriorityFeePerGas != null);\n if (tx.gasPrice != null && (tx.type === 2 || hasEip1559)) {\n logger.throwArgumentError(\"eip-1559 transaction do not support gasPrice\", \"transaction\", transaction);\n }\n else if ((tx.type === 0 || tx.type === 1) && hasEip1559) {\n logger.throwArgumentError(\"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas\", \"transaction\", transaction);\n }\n if ((tx.type === 2 || tx.type == null) && (tx.maxFeePerGas != null && tx.maxPriorityFeePerGas != null)) {\n // Fully-formed EIP-1559 transaction (skip getFeeData)\n tx.type = 2;\n }\n else if (tx.type === 0 || tx.type === 1) {\n // Explicit Legacy or EIP-2930 transaction\n // Populate missing gasPrice\n if (tx.gasPrice == null) {\n tx.gasPrice = this.getGasPrice();\n }\n }\n else {\n // We need to get fee data to determine things\n const feeData = yield this.getFeeData();\n if (tx.type == null) {\n // We need to auto-detect the intended type of this transaction...\n if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) {\n // The network supports EIP-1559!\n // Upgrade transaction from null to eip-1559\n tx.type = 2;\n if (tx.gasPrice != null) {\n // Using legacy gasPrice property on an eip-1559 network,\n // so use gasPrice as both fee properties\n const gasPrice = tx.gasPrice;\n delete tx.gasPrice;\n tx.maxFeePerGas = gasPrice;\n tx.maxPriorityFeePerGas = gasPrice;\n }\n else {\n // Populate missing fee data\n if (tx.maxFeePerGas == null) {\n tx.maxFeePerGas = feeData.maxFeePerGas;\n }\n if (tx.maxPriorityFeePerGas == null) {\n tx.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n }\n }\n }\n else if (feeData.gasPrice != null) {\n // Network doesn't support EIP-1559...\n // ...but they are trying to use EIP-1559 properties\n if (hasEip1559) {\n logger.throwError(\"network does not support EIP-1559\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"populateTransaction\"\n });\n }\n // Populate missing fee data\n if (tx.gasPrice == null) {\n tx.gasPrice = feeData.gasPrice;\n }\n // Explicitly set untyped transaction to legacy\n tx.type = 0;\n }\n else {\n // getFeeData has failed us.\n logger.throwError(\"failed to get consistent fee data\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"signer.getFeeData\"\n });\n }\n }\n else if (tx.type === 2) {\n // Explicitly using EIP-1559\n // Populate missing fee data\n if (tx.maxFeePerGas == null) {\n tx.maxFeePerGas = feeData.maxFeePerGas;\n }\n if (tx.maxPriorityFeePerGas == null) {\n tx.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n }\n }\n }\n if (tx.nonce == null) {\n tx.nonce = this.getTransactionCount(\"pending\");\n }\n if (tx.gasLimit == null) {\n tx.gasLimit = this.estimateGas(tx).catch((error) => {\n if (forwardErrors.indexOf(error.code) >= 0) {\n throw error;\n }\n return logger.throwError(\"cannot estimate gas; transaction may fail or may require manual gas limit\", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {\n error: error,\n tx: tx\n });\n });\n }\n if (tx.chainId == null) {\n tx.chainId = this.getChainId();\n }\n else {\n tx.chainId = Promise.all([\n Promise.resolve(tx.chainId),\n this.getChainId()\n ]).then((results) => {\n if (results[1] !== 0 && results[0] !== results[1]) {\n logger.throwArgumentError(\"chainId address mismatch\", \"transaction\", transaction);\n }\n return results[0];\n });\n }\n return yield resolveProperties(tx);\n });\n }\n ///////////////////\n // Sub-classes SHOULD leave these alone\n _checkProvider(operation) {\n if (!this.provider) {\n logger.throwError(\"missing provider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: (operation || \"_checkProvider\")\n });\n }\n }\n static isSigner(value) {\n return !!(value && value._isSigner);\n }\n}\nexport class VoidSigner extends Signer {\n constructor(address, provider) {\n super();\n defineReadOnly(this, \"address\", address);\n defineReadOnly(this, \"provider\", provider || null);\n }\n getAddress() {\n return Promise.resolve(this.address);\n }\n _fail(message, operation) {\n return Promise.resolve().then(() => {\n logger.throwError(message, Logger.errors.UNSUPPORTED_OPERATION, { operation: operation });\n });\n }\n signMessage(message) {\n return this._fail(\"VoidSigner cannot sign messages\", \"signMessage\");\n }\n signTransaction(transaction) {\n return this._fail(\"VoidSigner cannot sign transactions\", \"signTransaction\");\n }\n _signTypedData(domain, types, value) {\n return this._fail(\"VoidSigner cannot sign typed data\", \"signTypedData\");\n }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n}\n//# sourceMappingURL=index.js.map","export const version = \"abstract-signer/5.7.0\";\n//# sourceMappingURL=_version.js.map","module.exports = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","'use strict';\n\nvar assert = require('minimalistic-assert');\nvar inherits = require('inherits');\n\nexports.inherits = inherits;\n\nfunction isSurrogatePair(msg, i) {\n if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {\n return false;\n }\n if (i < 0 || i + 1 >= msg.length) {\n return false;\n }\n return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;\n}\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg === 'string') {\n if (!enc) {\n // Inspired by stringToUtf8ByteArray() in closure-library by Google\n // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143\n // Apache License 2.0\n // https://github.com/google/closure-library/blob/master/LICENSE\n var p = 0;\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n if (c < 128) {\n res[p++] = c;\n } else if (c < 2048) {\n res[p++] = (c >> 6) | 192;\n res[p++] = (c & 63) | 128;\n } else if (isSurrogatePair(msg, i)) {\n c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);\n res[p++] = (c >> 18) | 240;\n res[p++] = ((c >> 12) & 63) | 128;\n res[p++] = ((c >> 6) & 63) | 128;\n res[p++] = (c & 63) | 128;\n } else {\n res[p++] = (c >> 12) | 224;\n res[p++] = ((c >> 6) & 63) | 128;\n res[p++] = (c & 63) | 128;\n }\n }\n } else if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n }\n } else {\n for (i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n }\n return res;\n}\nexports.toArray = toArray;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nexports.toHex = toHex;\n\nfunction htonl(w) {\n var res = (w >>> 24) |\n ((w >>> 8) & 0xff00) |\n ((w << 8) & 0xff0000) |\n ((w & 0xff) << 24);\n return res >>> 0;\n}\nexports.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n var res = '';\n for (var i = 0; i < msg.length; i++) {\n var w = msg[i];\n if (endian === 'little')\n w = htonl(w);\n res += zero8(w.toString(16));\n }\n return res;\n}\nexports.toHex32 = toHex32;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nexports.zero2 = zero2;\n\nfunction zero8(word) {\n if (word.length === 7)\n return '0' + word;\n else if (word.length === 6)\n return '00' + word;\n else if (word.length === 5)\n return '000' + word;\n else if (word.length === 4)\n return '0000' + word;\n else if (word.length === 3)\n return '00000' + word;\n else if (word.length === 2)\n return '000000' + word;\n else if (word.length === 1)\n return '0000000' + word;\n else\n return word;\n}\nexports.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n var res = new Array(len / 4);\n for (var i = 0, k = start; i < res.length; i++, k += 4) {\n var w;\n if (endian === 'big')\n w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n else\n w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n res[i] = w >>> 0;\n }\n return res;\n}\nexports.join32 = join32;\n\nfunction split32(msg, endian) {\n var res = new Array(msg.length * 4);\n for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n var m = msg[i];\n if (endian === 'big') {\n res[k] = m >>> 24;\n res[k + 1] = (m >>> 16) & 0xff;\n res[k + 2] = (m >>> 8) & 0xff;\n res[k + 3] = m & 0xff;\n } else {\n res[k + 3] = m >>> 24;\n res[k + 2] = (m >>> 16) & 0xff;\n res[k + 1] = (m >>> 8) & 0xff;\n res[k] = m & 0xff;\n }\n }\n return res;\n}\nexports.split32 = split32;\n\nfunction rotr32(w, b) {\n return (w >>> b) | (w << (32 - b));\n}\nexports.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n return (w << b) | (w >>> (32 - b));\n}\nexports.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n return (a + b) >>> 0;\n}\nexports.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n return (a + b + c) >>> 0;\n}\nexports.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n return (a + b + c + d) >>> 0;\n}\nexports.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n return (a + b + c + d + e) >>> 0;\n}\nexports.sum32_5 = sum32_5;\n\nfunction sum64(buf, pos, ah, al) {\n var bh = buf[pos];\n var bl = buf[pos + 1];\n\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0;\n buf[pos + 1] = lo;\n}\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n return hi >>> 0;\n}\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n}\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n}\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n}\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n lo = (lo + el) >>> 0;\n carry += lo < el ? 1 : 0;\n\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n}\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n\n return lo >>> 0;\n}\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n var r = (al << (32 - num)) | (ah >>> num);\n return r >>> 0;\n}\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n return ah >>> num;\n}\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.shr64_lo = shr64_lo;\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction BlockHash() {\n this.pending = null;\n this.pendingTotal = 0;\n this.blockSize = this.constructor.blockSize;\n this.outSize = this.constructor.outSize;\n this.hmacStrength = this.constructor.hmacStrength;\n this.padLength = this.constructor.padLength / 8;\n this.endian = 'big';\n\n this._delta8 = this.blockSize / 8;\n this._delta32 = this.blockSize / 32;\n}\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n // Convert message to array, pad it, and join into 32bit blocks\n msg = utils.toArray(msg, enc);\n if (!this.pending)\n this.pending = msg;\n else\n this.pending = this.pending.concat(msg);\n this.pendingTotal += msg.length;\n\n // Enough data, try updating\n if (this.pending.length >= this._delta8) {\n msg = this.pending;\n\n // Process pending data in blocks\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length);\n if (this.pending.length === 0)\n this.pending = null;\n\n msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0; i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n\n return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n this.update(this._pad());\n assert(this.pending === null);\n\n return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n var len = this.pendingTotal;\n var bytes = this._delta8;\n var k = bytes - ((len + this.padLength) % bytes);\n var res = new Array(k + this.padLength);\n res[0] = 0x80;\n for (var i = 1; i < k; i++)\n res[i] = 0;\n\n // Append length\n len <<= 3;\n if (this.endian === 'big') {\n for (var t = 8; t < this.padLength; t++)\n res[i++] = 0;\n\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = len & 0xff;\n } else {\n res[i++] = len & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n\n for (t = 8; t < this.padLength; t++)\n res[i++] = 0;\n }\n\n return res;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar rotr32 = utils.rotr32;\n\nfunction ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n}\nexports.ft_1 = ft_1;\n\nfunction ch32(x, y, z) {\n return (x & y) ^ ((~x) & z);\n}\nexports.ch32 = ch32;\n\nfunction maj32(x, y, z) {\n return (x & y) ^ (x & z) ^ (y & z);\n}\nexports.maj32 = maj32;\n\nfunction p32(x, y, z) {\n return x ^ y ^ z;\n}\nexports.p32 = p32;\n\nfunction s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\nexports.s0_256 = s0_256;\n\nfunction s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\nexports.s1_256 = s1_256;\n\nfunction g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n}\nexports.g0_256 = g0_256;\n\nfunction g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n}\nexports.g1_256 = g1_256;\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_5 = utils.sum32_5;\nvar ft_1 = shaCommon.ft_1;\nvar BlockHash = common.BlockHash;\n\nvar sha1_K = [\n 0x5A827999, 0x6ED9EBA1,\n 0x8F1BBCDC, 0xCA62C1D6\n];\n\nfunction SHA1() {\n if (!(this instanceof SHA1))\n return new SHA1();\n\n BlockHash.call(this);\n this.h = [\n 0x67452301, 0xefcdab89, 0x98badcfe,\n 0x10325476, 0xc3d2e1f0 ];\n this.W = new Array(80);\n}\n\nutils.inherits(SHA1, BlockHash);\nmodule.exports = SHA1;\n\nSHA1.blockSize = 512;\nSHA1.outSize = 160;\nSHA1.hmacStrength = 80;\nSHA1.padLength = 64;\n\nSHA1.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n\n for(; i < W.length; i++)\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n\n for (i = 0; i < W.length; i++) {\n var s = ~~(i / 20);\n var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d;\n d = c;\n c = rotl32(b, 30);\n b = a;\n a = t;\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n};\n\nSHA1.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\nvar assert = require('minimalistic-assert');\n\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar ch32 = shaCommon.ch32;\nvar maj32 = shaCommon.maj32;\nvar s0_256 = shaCommon.s0_256;\nvar s1_256 = shaCommon.s1_256;\nvar g0_256 = shaCommon.g0_256;\nvar g1_256 = shaCommon.g1_256;\n\nvar BlockHash = common.BlockHash;\n\nvar sha256_K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n];\n\nfunction SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n ];\n this.k = sha256_K;\n this.W = new Array(64);\n}\nutils.inherits(SHA256, BlockHash);\nmodule.exports = SHA256;\n\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n var f = this.h[5];\n var g = this.h[6];\n var h = this.h[7];\n\n assert(this.k.length === W.length);\n for (i = 0; i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n var T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = sum32(d, T1);\n d = c;\n c = b;\n b = a;\n a = sum32(T1, T2);\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n this.h[5] = sum32(this.h[5], f);\n this.h[6] = sum32(this.h[6], g);\n this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar SHA256 = require('./256');\n\nfunction SHA224() {\n if (!(this instanceof SHA224))\n return new SHA224();\n\n SHA256.call(this);\n this.h = [\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\n 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];\n}\nutils.inherits(SHA224, SHA256);\nmodule.exports = SHA224;\n\nSHA224.blockSize = 512;\nSHA224.outSize = 224;\nSHA224.hmacStrength = 192;\nSHA224.padLength = 64;\n\nSHA224.prototype._digest = function digest(enc) {\n // Just truncate output\n if (enc === 'hex')\n return utils.toHex32(this.h.slice(0, 7), 'big');\n else\n return utils.split32(this.h.slice(0, 7), 'big');\n};\n\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar assert = require('minimalistic-assert');\n\nvar rotr64_hi = utils.rotr64_hi;\nvar rotr64_lo = utils.rotr64_lo;\nvar shr64_hi = utils.shr64_hi;\nvar shr64_lo = utils.shr64_lo;\nvar sum64 = utils.sum64;\nvar sum64_hi = utils.sum64_hi;\nvar sum64_lo = utils.sum64_lo;\nvar sum64_4_hi = utils.sum64_4_hi;\nvar sum64_4_lo = utils.sum64_4_lo;\nvar sum64_5_hi = utils.sum64_5_hi;\nvar sum64_5_lo = utils.sum64_5_lo;\n\nvar BlockHash = common.BlockHash;\n\nvar sha512_K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction SHA512() {\n if (!(this instanceof SHA512))\n return new SHA512();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xf3bcc908,\n 0xbb67ae85, 0x84caa73b,\n 0x3c6ef372, 0xfe94f82b,\n 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1,\n 0x9b05688c, 0x2b3e6c1f,\n 0x1f83d9ab, 0xfb41bd6b,\n 0x5be0cd19, 0x137e2179 ];\n this.k = sha512_K;\n this.W = new Array(160);\n}\nutils.inherits(SHA512, BlockHash);\nmodule.exports = SHA512;\n\nSHA512.blockSize = 1024;\nSHA512.outSize = 512;\nSHA512.hmacStrength = 192;\nSHA512.padLength = 128;\n\nSHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\n var W = this.W;\n\n // 32 x 32bit words\n for (var i = 0; i < 32; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2\n var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\n var c1_hi = W[i - 14]; // i - 7\n var c1_lo = W[i - 13];\n var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15\n var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\n var c3_hi = W[i - 32]; // i - 16\n var c3_lo = W[i - 31];\n\n W[i] = sum64_4_hi(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo);\n W[i + 1] = sum64_4_lo(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo);\n }\n};\n\nSHA512.prototype._update = function _update(msg, start) {\n this._prepareBlock(msg, start);\n\n var W = this.W;\n\n var ah = this.h[0];\n var al = this.h[1];\n var bh = this.h[2];\n var bl = this.h[3];\n var ch = this.h[4];\n var cl = this.h[5];\n var dh = this.h[6];\n var dl = this.h[7];\n var eh = this.h[8];\n var el = this.h[9];\n var fh = this.h[10];\n var fl = this.h[11];\n var gh = this.h[12];\n var gl = this.h[13];\n var hh = this.h[14];\n var hl = this.h[15];\n\n assert(this.k.length === W.length);\n for (var i = 0; i < W.length; i += 2) {\n var c0_hi = hh;\n var c0_lo = hl;\n var c1_hi = s1_512_hi(eh, el);\n var c1_lo = s1_512_lo(eh, el);\n var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\n var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\n var c3_hi = this.k[i];\n var c3_lo = this.k[i + 1];\n var c4_hi = W[i];\n var c4_lo = W[i + 1];\n\n var T1_hi = sum64_5_hi(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo,\n c4_hi, c4_lo);\n var T1_lo = sum64_5_lo(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo,\n c4_hi, c4_lo);\n\n c0_hi = s0_512_hi(ah, al);\n c0_lo = s0_512_lo(ah, al);\n c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\n c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\n var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n\n hh = gh;\n hl = gl;\n\n gh = fh;\n gl = fl;\n\n fh = eh;\n fl = el;\n\n eh = sum64_hi(dh, dl, T1_hi, T1_lo);\n el = sum64_lo(dl, dl, T1_hi, T1_lo);\n\n dh = ch;\n dl = cl;\n\n ch = bh;\n cl = bl;\n\n bh = ah;\n bl = al;\n\n ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\n al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n\n sum64(this.h, 0, ah, al);\n sum64(this.h, 2, bh, bl);\n sum64(this.h, 4, ch, cl);\n sum64(this.h, 6, dh, dl);\n sum64(this.h, 8, eh, el);\n sum64(this.h, 10, fh, fl);\n sum64(this.h, 12, gh, gl);\n sum64(this.h, 14, hh, hl);\n};\n\nSHA512.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n\nfunction ch64_hi(xh, xl, yh, yl, zh) {\n var r = (xh & yh) ^ ((~xh) & zh);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = (xl & yl) ^ ((~xl) & zl);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction maj64_hi(xh, xl, yh, yl, zh) {\n var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28);\n var c1_hi = rotr64_hi(xl, xh, 2); // 34\n var c2_hi = rotr64_hi(xl, xh, 7); // 39\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28);\n var c1_lo = rotr64_lo(xl, xh, 2); // 34\n var c2_lo = rotr64_lo(xl, xh, 7); // 39\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14);\n var c1_hi = rotr64_hi(xh, xl, 18);\n var c2_hi = rotr64_hi(xl, xh, 9); // 41\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14);\n var c1_lo = rotr64_lo(xh, xl, 18);\n var c2_lo = rotr64_lo(xl, xh, 9); // 41\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1);\n var c1_hi = rotr64_hi(xh, xl, 8);\n var c2_hi = shr64_hi(xh, xl, 7);\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1);\n var c1_lo = rotr64_lo(xh, xl, 8);\n var c2_lo = shr64_lo(xh, xl, 7);\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19);\n var c1_hi = rotr64_hi(xl, xh, 29); // 61\n var c2_hi = shr64_hi(xh, xl, 6);\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19);\n var c1_lo = rotr64_lo(xl, xh, 29); // 61\n var c2_lo = shr64_lo(xh, xl, 6);\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n","'use strict';\n\nvar utils = require('../utils');\n\nvar SHA512 = require('./512');\n\nfunction SHA384() {\n if (!(this instanceof SHA384))\n return new SHA384();\n\n SHA512.call(this);\n this.h = [\n 0xcbbb9d5d, 0xc1059ed8,\n 0x629a292a, 0x367cd507,\n 0x9159015a, 0x3070dd17,\n 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31,\n 0x8eb44a87, 0x68581511,\n 0xdb0c2e0d, 0x64f98fa7,\n 0x47b5481d, 0xbefa4fa4 ];\n}\nutils.inherits(SHA384, SHA512);\nmodule.exports = SHA384;\n\nSHA384.blockSize = 1024;\nSHA384.outSize = 384;\nSHA384.hmacStrength = 192;\nSHA384.padLength = 128;\n\nSHA384.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h.slice(0, 12), 'big');\n else\n return utils.split32(this.h.slice(0, 12), 'big');\n};\n","'use strict';\n\nexports.sha1 = require('./sha/1');\nexports.sha224 = require('./sha/224');\nexports.sha256 = require('./sha/256');\nexports.sha384 = require('./sha/384');\nexports.sha512 = require('./sha/512');\n","'use strict';\n\nvar utils = require('./utils');\nvar common = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_3 = utils.sum32_3;\nvar sum32_4 = utils.sum32_4;\nvar BlockHash = common.BlockHash;\n\nfunction RIPEMD160() {\n if (!(this instanceof RIPEMD160))\n return new RIPEMD160();\n\n BlockHash.call(this);\n\n this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];\n this.endian = 'little';\n}\nutils.inherits(RIPEMD160, BlockHash);\nexports.ripemd160 = RIPEMD160;\n\nRIPEMD160.blockSize = 512;\nRIPEMD160.outSize = 160;\nRIPEMD160.hmacStrength = 192;\nRIPEMD160.padLength = 64;\n\nRIPEMD160.prototype._update = function update(msg, start) {\n var A = this.h[0];\n var B = this.h[1];\n var C = this.h[2];\n var D = this.h[3];\n var E = this.h[4];\n var Ah = A;\n var Bh = B;\n var Ch = C;\n var Dh = D;\n var Eh = E;\n for (var j = 0; j < 80; j++) {\n var T = sum32(\n rotl32(\n sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),\n s[j]),\n E);\n A = E;\n E = D;\n D = rotl32(C, 10);\n C = B;\n B = T;\n T = sum32(\n rotl32(\n sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),\n sh[j]),\n Eh);\n Ah = Eh;\n Eh = Dh;\n Dh = rotl32(Ch, 10);\n Ch = Bh;\n Bh = T;\n }\n T = sum32_3(this.h[1], C, Dh);\n this.h[1] = sum32_3(this.h[2], D, Eh);\n this.h[2] = sum32_3(this.h[3], E, Ah);\n this.h[3] = sum32_3(this.h[4], A, Bh);\n this.h[4] = sum32_3(this.h[0], B, Ch);\n this.h[0] = T;\n};\n\nRIPEMD160.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'little');\n else\n return utils.split32(this.h, 'little');\n};\n\nfunction f(j, x, y, z) {\n if (j <= 15)\n return x ^ y ^ z;\n else if (j <= 31)\n return (x & y) | ((~x) & z);\n else if (j <= 47)\n return (x | (~y)) ^ z;\n else if (j <= 63)\n return (x & z) | (y & (~z));\n else\n return x ^ (y | (~z));\n}\n\nfunction K(j) {\n if (j <= 15)\n return 0x00000000;\n else if (j <= 31)\n return 0x5a827999;\n else if (j <= 47)\n return 0x6ed9eba1;\n else if (j <= 63)\n return 0x8f1bbcdc;\n else\n return 0xa953fd4e;\n}\n\nfunction Kh(j) {\n if (j <= 15)\n return 0x50a28be6;\n else if (j <= 31)\n return 0x5c4dd124;\n else if (j <= 47)\n return 0x6d703ef3;\n else if (j <= 63)\n return 0x7a6d76e9;\n else\n return 0x00000000;\n}\n\nvar r = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n];\n\nvar rh = [\n 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n];\n\nvar s = [\n 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n];\n\nvar sh = [\n 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n];\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction Hmac(hash, key, enc) {\n if (!(this instanceof Hmac))\n return new Hmac(hash, key, enc);\n this.Hash = hash;\n this.blockSize = hash.blockSize / 8;\n this.outSize = hash.outSize / 8;\n this.inner = null;\n this.outer = null;\n\n this._init(utils.toArray(key, enc));\n}\nmodule.exports = Hmac;\n\nHmac.prototype._init = function init(key) {\n // Shorten key, if needed\n if (key.length > this.blockSize)\n key = new this.Hash().update(key).digest();\n assert(key.length <= this.blockSize);\n\n // Add padding to key\n for (var i = key.length; i < this.blockSize; i++)\n key.push(0);\n\n for (i = 0; i < key.length; i++)\n key[i] ^= 0x36;\n this.inner = new this.Hash().update(key);\n\n // 0x36 ^ 0x5c = 0x6a\n for (i = 0; i < key.length; i++)\n key[i] ^= 0x6a;\n this.outer = new this.Hash().update(key);\n};\n\nHmac.prototype.update = function update(msg, enc) {\n this.inner.update(msg, enc);\n return this;\n};\n\nHmac.prototype.digest = function digest(enc) {\n this.outer.update(this.inner.digest());\n return this.outer.digest(enc);\n};\n","var hash = exports;\n\nhash.utils = require('./hash/utils');\nhash.common = require('./hash/common');\nhash.sha = require('./hash/sha');\nhash.ripemd = require('./hash/ripemd');\nhash.hmac = require('./hash/hmac');\n\n// Proxy hash functions to the main object\nhash.sha1 = hash.sha.sha1;\nhash.sha256 = hash.sha.sha256;\nhash.sha224 = hash.sha.sha224;\nhash.sha384 = hash.sha.sha384;\nhash.sha512 = hash.sha.sha512;\nhash.ripemd160 = hash.ripemd.ripemd160;\n","import BN from 'bn.js';\nimport hash from 'hash.js';\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction createCommonjsModule(fn, basedir, module) {\n\treturn module = {\n\t\tpath: basedir,\n\t\texports: {},\n\t\trequire: function (path, base) {\n\t\t\treturn commonjsRequire(path, (base === undefined || base === null) ? module.path : base);\n\t\t}\n\t}, fn(module, module.exports), module.exports;\n}\n\nfunction getDefaultExportFromNamespaceIfPresent (n) {\n\treturn n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;\n}\n\nfunction getDefaultExportFromNamespaceIfNotNamed (n) {\n\treturn n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;\n}\n\nfunction getAugmentedNamespace(n) {\n\tif (n.__esModule) return n;\n\tvar a = Object.defineProperty({}, '__esModule', {value: true});\n\tObject.keys(n).forEach(function (k) {\n\t\tvar d = Object.getOwnPropertyDescriptor(n, k);\n\t\tObject.defineProperty(a, k, d.get ? d : {\n\t\t\tenumerable: true,\n\t\t\tget: function () {\n\t\t\t\treturn n[k];\n\t\t\t}\n\t\t});\n\t});\n\treturn a;\n}\n\nfunction commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');\n}\n\nvar minimalisticAssert = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n\nvar utils_1 = createCommonjsModule(function (module, exports) {\n'use strict';\n\nvar utils = exports;\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg !== 'string') {\n for (var i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (var i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else {\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n var hi = c >> 8;\n var lo = c & 0xff;\n if (hi)\n res.push(hi, lo);\n else\n res.push(lo);\n }\n }\n return res;\n}\nutils.toArray = toArray;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nutils.zero2 = zero2;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nutils.toHex = toHex;\n\nutils.encode = function encode(arr, enc) {\n if (enc === 'hex')\n return toHex(arr);\n else\n return arr;\n};\n});\n\nvar utils_1$1 = createCommonjsModule(function (module, exports) {\n'use strict';\n\nvar utils = exports;\n\n\n\n\nutils.assert = minimalisticAssert;\nutils.toArray = utils_1.toArray;\nutils.zero2 = utils_1.zero2;\nutils.toHex = utils_1.toHex;\nutils.encode = utils_1.encode;\n\n// Represent num in a w-NAF form\nfunction getNAF(num, w, bits) {\n var naf = new Array(Math.max(num.bitLength(), bits) + 1);\n naf.fill(0);\n\n var ws = 1 << (w + 1);\n var k = num.clone();\n\n for (var i = 0; i < naf.length; i++) {\n var z;\n var mod = k.andln(ws - 1);\n if (k.isOdd()) {\n if (mod > (ws >> 1) - 1)\n z = (ws >> 1) - mod;\n else\n z = mod;\n k.isubn(z);\n } else {\n z = 0;\n }\n\n naf[i] = z;\n k.iushrn(1);\n }\n\n return naf;\n}\nutils.getNAF = getNAF;\n\n// Represent k1, k2 in a Joint Sparse Form\nfunction getJSF(k1, k2) {\n var jsf = [\n [],\n [],\n ];\n\n k1 = k1.clone();\n k2 = k2.clone();\n var d1 = 0;\n var d2 = 0;\n var m8;\n while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n // First phase\n var m14 = (k1.andln(3) + d1) & 3;\n var m24 = (k2.andln(3) + d2) & 3;\n if (m14 === 3)\n m14 = -1;\n if (m24 === 3)\n m24 = -1;\n var u1;\n if ((m14 & 1) === 0) {\n u1 = 0;\n } else {\n m8 = (k1.andln(7) + d1) & 7;\n if ((m8 === 3 || m8 === 5) && m24 === 2)\n u1 = -m14;\n else\n u1 = m14;\n }\n jsf[0].push(u1);\n\n var u2;\n if ((m24 & 1) === 0) {\n u2 = 0;\n } else {\n m8 = (k2.andln(7) + d2) & 7;\n if ((m8 === 3 || m8 === 5) && m14 === 2)\n u2 = -m24;\n else\n u2 = m24;\n }\n jsf[1].push(u2);\n\n // Second phase\n if (2 * d1 === u1 + 1)\n d1 = 1 - d1;\n if (2 * d2 === u2 + 1)\n d2 = 1 - d2;\n k1.iushrn(1);\n k2.iushrn(1);\n }\n\n return jsf;\n}\nutils.getJSF = getJSF;\n\nfunction cachedProperty(obj, name, computer) {\n var key = '_' + name;\n obj.prototype[name] = function cachedProperty() {\n return this[key] !== undefined ? this[key] :\n this[key] = computer.call(this);\n };\n}\nutils.cachedProperty = cachedProperty;\n\nfunction parseBytes(bytes) {\n return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :\n bytes;\n}\nutils.parseBytes = parseBytes;\n\nfunction intFromLE(bytes) {\n return new BN(bytes, 'hex', 'le');\n}\nutils.intFromLE = intFromLE;\n});\n\n'use strict';\n\n\n\nvar getNAF = utils_1$1.getNAF;\nvar getJSF = utils_1$1.getJSF;\nvar assert$1 = utils_1$1.assert;\n\nfunction BaseCurve(type, conf) {\n this.type = type;\n this.p = new BN(conf.p, 16);\n\n // Use Montgomery, when there is no fast reduction for the prime\n this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n\n // Useful for many curves\n this.zero = new BN(0).toRed(this.red);\n this.one = new BN(1).toRed(this.red);\n this.two = new BN(2).toRed(this.red);\n\n // Curve configuration, optional\n this.n = conf.n && new BN(conf.n, 16);\n this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);\n\n // Temporary arrays\n this._wnafT1 = new Array(4);\n this._wnafT2 = new Array(4);\n this._wnafT3 = new Array(4);\n this._wnafT4 = new Array(4);\n\n this._bitLength = this.n ? this.n.bitLength() : 0;\n\n // Generalized Greg Maxwell's trick\n var adjustCount = this.n && this.p.div(this.n);\n if (!adjustCount || adjustCount.cmpn(100) > 0) {\n this.redN = null;\n } else {\n this._maxwellTrick = true;\n this.redN = this.n.toRed(this.red);\n }\n}\nvar base = BaseCurve;\n\nBaseCurve.prototype.point = function point() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype.validate = function validate() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\n assert$1(p.precomputed);\n var doubles = p._getDoubles();\n\n var naf = getNAF(k, 1, this._bitLength);\n var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);\n I /= 3;\n\n // Translate into more windowed form\n var repr = [];\n var j;\n var nafW;\n for (j = 0; j < naf.length; j += doubles.step) {\n nafW = 0;\n for (var l = j + doubles.step - 1; l >= j; l--)\n nafW = (nafW << 1) + naf[l];\n repr.push(nafW);\n }\n\n var a = this.jpoint(null, null, null);\n var b = this.jpoint(null, null, null);\n for (var i = I; i > 0; i--) {\n for (j = 0; j < repr.length; j++) {\n nafW = repr[j];\n if (nafW === i)\n b = b.mixedAdd(doubles.points[j]);\n else if (nafW === -i)\n b = b.mixedAdd(doubles.points[j].neg());\n }\n a = a.add(b);\n }\n return a.toP();\n};\n\nBaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\n var w = 4;\n\n // Precompute window\n var nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n var wnd = nafPoints.points;\n\n // Get NAF form\n var naf = getNAF(k, w, this._bitLength);\n\n // Add `this`*(N+1) for every w-NAF index\n var acc = this.jpoint(null, null, null);\n for (var i = naf.length - 1; i >= 0; i--) {\n // Count zeroes\n for (var l = 0; i >= 0 && naf[i] === 0; i--)\n l++;\n if (i >= 0)\n l++;\n acc = acc.dblp(l);\n\n if (i < 0)\n break;\n var z = naf[i];\n assert$1(z !== 0);\n if (p.type === 'affine') {\n // J +- P\n if (z > 0)\n acc = acc.mixedAdd(wnd[(z - 1) >> 1]);\n else\n acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());\n } else {\n // J +- J\n if (z > 0)\n acc = acc.add(wnd[(z - 1) >> 1]);\n else\n acc = acc.add(wnd[(-z - 1) >> 1].neg());\n }\n }\n return p.type === 'affine' ? acc.toP() : acc;\n};\n\nBaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,\n points,\n coeffs,\n len,\n jacobianResult) {\n var wndWidth = this._wnafT1;\n var wnd = this._wnafT2;\n var naf = this._wnafT3;\n\n // Fill all arrays\n var max = 0;\n var i;\n var j;\n var p;\n for (i = 0; i < len; i++) {\n p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd;\n wnd[i] = nafPoints.points;\n }\n\n // Comb small window NAFs\n for (i = len - 1; i >= 1; i -= 2) {\n var a = i - 1;\n var b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);\n naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);\n max = Math.max(naf[a].length, max);\n max = Math.max(naf[b].length, max);\n continue;\n }\n\n var comb = [\n points[a], /* 1 */\n null, /* 3 */\n null, /* 5 */\n points[b], /* 7 */\n ];\n\n // Try to avoid Projective points, if possible\n if (points[a].y.cmp(points[b].y) === 0) {\n comb[1] = points[a].add(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].add(points[b].neg());\n } else {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n }\n\n var index = [\n -3, /* -1 -1 */\n -1, /* -1 0 */\n -5, /* -1 1 */\n -7, /* 0 -1 */\n 0, /* 0 0 */\n 7, /* 0 1 */\n 5, /* 1 -1 */\n 1, /* 1 0 */\n 3, /* 1 1 */\n ];\n\n var jsf = getJSF(coeffs[a], coeffs[b]);\n max = Math.max(jsf[0].length, max);\n naf[a] = new Array(max);\n naf[b] = new Array(max);\n for (j = 0; j < max; j++) {\n var ja = jsf[0][j] | 0;\n var jb = jsf[1][j] | 0;\n\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\n naf[b][j] = 0;\n wnd[a] = comb;\n }\n }\n\n var acc = this.jpoint(null, null, null);\n var tmp = this._wnafT4;\n for (i = max; i >= 0; i--) {\n var k = 0;\n\n while (i >= 0) {\n var zero = true;\n for (j = 0; j < len; j++) {\n tmp[j] = naf[j][i] | 0;\n if (tmp[j] !== 0)\n zero = false;\n }\n if (!zero)\n break;\n k++;\n i--;\n }\n if (i >= 0)\n k++;\n acc = acc.dblp(k);\n if (i < 0)\n break;\n\n for (j = 0; j < len; j++) {\n var z = tmp[j];\n p;\n if (z === 0)\n continue;\n else if (z > 0)\n p = wnd[j][(z - 1) >> 1];\n else if (z < 0)\n p = wnd[j][(-z - 1) >> 1].neg();\n\n if (p.type === 'affine')\n acc = acc.mixedAdd(p);\n else\n acc = acc.add(p);\n }\n }\n // Zeroify references\n for (i = 0; i < len; i++)\n wnd[i] = null;\n\n if (jacobianResult)\n return acc;\n else\n return acc.toP();\n};\n\nfunction BasePoint(curve, type) {\n this.curve = curve;\n this.type = type;\n this.precomputed = null;\n}\nBaseCurve.BasePoint = BasePoint;\n\nBasePoint.prototype.eq = function eq(/*other*/) {\n throw new Error('Not implemented');\n};\n\nBasePoint.prototype.validate = function validate() {\n return this.curve.validate(this);\n};\n\nBaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n bytes = utils_1$1.toArray(bytes, enc);\n\n var len = this.p.byteLength();\n\n // uncompressed, hybrid-odd, hybrid-even\n if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&\n bytes.length - 1 === 2 * len) {\n if (bytes[0] === 0x06)\n assert$1(bytes[bytes.length - 1] % 2 === 0);\n else if (bytes[0] === 0x07)\n assert$1(bytes[bytes.length - 1] % 2 === 1);\n\n var res = this.point(bytes.slice(1, 1 + len),\n bytes.slice(1 + len, 1 + 2 * len));\n\n return res;\n } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&\n bytes.length - 1 === len) {\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);\n }\n throw new Error('Unknown point format');\n};\n\nBasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {\n return this.encode(enc, true);\n};\n\nBasePoint.prototype._encode = function _encode(compact) {\n var len = this.curve.p.byteLength();\n var x = this.getX().toArray('be', len);\n\n if (compact)\n return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);\n\n return [ 0x04 ].concat(x, this.getY().toArray('be', len));\n};\n\nBasePoint.prototype.encode = function encode(enc, compact) {\n return utils_1$1.encode(this._encode(compact), enc);\n};\n\nBasePoint.prototype.precompute = function precompute(power) {\n if (this.precomputed)\n return this;\n\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null,\n };\n precomputed.naf = this._getNAFPoints(8);\n precomputed.doubles = this._getDoubles(4, power);\n precomputed.beta = this._getBeta();\n this.precomputed = precomputed;\n\n return this;\n};\n\nBasePoint.prototype._hasDoubles = function _hasDoubles(k) {\n if (!this.precomputed)\n return false;\n\n var doubles = this.precomputed.doubles;\n if (!doubles)\n return false;\n\n return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);\n};\n\nBasePoint.prototype._getDoubles = function _getDoubles(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n\n var doubles = [ this ];\n var acc = this;\n for (var i = 0; i < power; i += step) {\n for (var j = 0; j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step: step,\n points: doubles,\n };\n};\n\nBasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n\n var res = [ this ];\n var max = (1 << wnd) - 1;\n var dbl = max === 1 ? null : this.dbl();\n for (var i = 1; i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd: wnd,\n points: res,\n };\n};\n\nBasePoint.prototype._getBeta = function _getBeta() {\n return null;\n};\n\nBasePoint.prototype.dblp = function dblp(k) {\n var r = this;\n for (var i = 0; i < k; i++)\n r = r.dbl();\n return r;\n};\n\nvar inherits_browser = createCommonjsModule(function (module) {\nif (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n };\n}\n});\n\n'use strict';\n\n\n\n\n\n\nvar assert$2 = utils_1$1.assert;\n\nfunction ShortCurve(conf) {\n base.call(this, 'short', conf);\n\n this.a = new BN(conf.a, 16).toRed(this.red);\n this.b = new BN(conf.b, 16).toRed(this.red);\n this.tinv = this.two.redInvm();\n\n this.zeroA = this.a.fromRed().cmpn(0) === 0;\n this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;\n\n // If the curve is endomorphic, precalculate beta and lambda\n this.endo = this._getEndomorphism(conf);\n this._endoWnafT1 = new Array(4);\n this._endoWnafT2 = new Array(4);\n}\ninherits_browser(ShortCurve, base);\nvar short_1 = ShortCurve;\n\nShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {\n // No efficient endomorphism\n if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)\n return;\n\n // Compute beta and lambda, that lambda * P = (beta * Px; Py)\n var beta;\n var lambda;\n if (conf.beta) {\n beta = new BN(conf.beta, 16).toRed(this.red);\n } else {\n var betas = this._getEndoRoots(this.p);\n // Choose the smallest beta\n beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];\n beta = beta.toRed(this.red);\n }\n if (conf.lambda) {\n lambda = new BN(conf.lambda, 16);\n } else {\n // Choose the lambda that is matching selected beta\n var lambdas = this._getEndoRoots(this.n);\n if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {\n lambda = lambdas[0];\n } else {\n lambda = lambdas[1];\n assert$2(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);\n }\n }\n\n // Get basis vectors, used for balanced length-two representation\n var basis;\n if (conf.basis) {\n basis = conf.basis.map(function(vec) {\n return {\n a: new BN(vec.a, 16),\n b: new BN(vec.b, 16),\n };\n });\n } else {\n basis = this._getEndoBasis(lambda);\n }\n\n return {\n beta: beta,\n lambda: lambda,\n basis: basis,\n };\n};\n\nShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {\n // Find roots of for x^2 + x + 1 in F\n // Root = (-1 +- Sqrt(-3)) / 2\n //\n var red = num === this.p ? this.red : BN.mont(num);\n var tinv = new BN(2).toRed(red).redInvm();\n var ntinv = tinv.redNeg();\n\n var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);\n\n var l1 = ntinv.redAdd(s).fromRed();\n var l2 = ntinv.redSub(s).fromRed();\n return [ l1, l2 ];\n};\n\nShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {\n // aprxSqrt >= sqrt(this.n)\n var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));\n\n // 3.74\n // Run EGCD, until r(L + 1) < aprxSqrt\n var u = lambda;\n var v = this.n.clone();\n var x1 = new BN(1);\n var y1 = new BN(0);\n var x2 = new BN(0);\n var y2 = new BN(1);\n\n // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)\n var a0;\n var b0;\n // First vector\n var a1;\n var b1;\n // Second vector\n var a2;\n var b2;\n\n var prevR;\n var i = 0;\n var r;\n var x;\n while (u.cmpn(0) !== 0) {\n var q = v.div(u);\n r = v.sub(q.mul(u));\n x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n\n if (!a1 && r.cmp(aprxSqrt) < 0) {\n a0 = prevR.neg();\n b0 = x1;\n a1 = r.neg();\n b1 = x;\n } else if (a1 && ++i === 2) {\n break;\n }\n prevR = r;\n\n v = u;\n u = r;\n x2 = x1;\n x1 = x;\n y2 = y1;\n y1 = y;\n }\n a2 = r.neg();\n b2 = x;\n\n var len1 = a1.sqr().add(b1.sqr());\n var len2 = a2.sqr().add(b2.sqr());\n if (len2.cmp(len1) >= 0) {\n a2 = a0;\n b2 = b0;\n }\n\n // Normalize signs\n if (a1.negative) {\n a1 = a1.neg();\n b1 = b1.neg();\n }\n if (a2.negative) {\n a2 = a2.neg();\n b2 = b2.neg();\n }\n\n return [\n { a: a1, b: b1 },\n { a: a2, b: b2 },\n ];\n};\n\nShortCurve.prototype._endoSplit = function _endoSplit(k) {\n var basis = this.endo.basis;\n var v1 = basis[0];\n var v2 = basis[1];\n\n var c1 = v2.b.mul(k).divRound(this.n);\n var c2 = v1.b.neg().mul(k).divRound(this.n);\n\n var p1 = c1.mul(v1.a);\n var p2 = c2.mul(v2.a);\n var q1 = c1.mul(v1.b);\n var q2 = c2.mul(v2.b);\n\n // Calculate answer\n var k1 = k.sub(p1).sub(p2);\n var k2 = q1.add(q2).neg();\n return { k1: k1, k2: k2 };\n};\n\nShortCurve.prototype.pointFromX = function pointFromX(x, odd) {\n x = new BN(x, 16);\n if (!x.red)\n x = x.toRed(this.red);\n\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);\n var y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error('invalid point');\n\n // XXX Is there any way to tell if the number is odd without converting it\n // to non-red form?\n var isOdd = y.fromRed().isOdd();\n if (odd && !isOdd || !odd && isOdd)\n y = y.redNeg();\n\n return this.point(x, y);\n};\n\nShortCurve.prototype.validate = function validate(point) {\n if (point.inf)\n return true;\n\n var x = point.x;\n var y = point.y;\n\n var ax = this.a.redMul(x);\n var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n};\n\nShortCurve.prototype._endoWnafMulAdd =\n function _endoWnafMulAdd(points, coeffs, jacobianResult) {\n var npoints = this._endoWnafT1;\n var ncoeffs = this._endoWnafT2;\n for (var i = 0; i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]);\n var p = points[i];\n var beta = p._getBeta();\n\n if (split.k1.negative) {\n split.k1.ineg();\n p = p.neg(true);\n }\n if (split.k2.negative) {\n split.k2.ineg();\n beta = beta.neg(true);\n }\n\n npoints[i * 2] = p;\n npoints[i * 2 + 1] = beta;\n ncoeffs[i * 2] = split.k1;\n ncoeffs[i * 2 + 1] = split.k2;\n }\n var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);\n\n // Clean-up references to points and coefficients\n for (var j = 0; j < i * 2; j++) {\n npoints[j] = null;\n ncoeffs[j] = null;\n }\n return res;\n };\n\nfunction Point(curve, x, y, isRed) {\n base.BasePoint.call(this, curve, 'affine');\n if (x === null && y === null) {\n this.x = null;\n this.y = null;\n this.inf = true;\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n // Force redgomery representation when loading from JSON\n if (isRed) {\n this.x.forceRed(this.curve.red);\n this.y.forceRed(this.curve.red);\n }\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n this.inf = false;\n }\n}\ninherits_browser(Point, base.BasePoint);\n\nShortCurve.prototype.point = function point(x, y, isRed) {\n return new Point(this, x, y, isRed);\n};\n\nShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {\n return Point.fromJSON(this, obj, red);\n};\n\nPoint.prototype._getBeta = function _getBeta() {\n if (!this.curve.endo)\n return;\n\n var pre = this.precomputed;\n if (pre && pre.beta)\n return pre.beta;\n\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n if (pre) {\n var curve = this.curve;\n var endoMul = function(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n pre.beta = beta;\n beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul),\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul),\n },\n };\n }\n return beta;\n};\n\nPoint.prototype.toJSON = function toJSON() {\n if (!this.precomputed)\n return [ this.x, this.y ];\n\n return [ this.x, this.y, this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1),\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1),\n },\n } ];\n};\n\nPoint.fromJSON = function fromJSON(curve, obj, red) {\n if (typeof obj === 'string')\n obj = JSON.parse(obj);\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2])\n return res;\n\n function obj2point(obj) {\n return curve.point(obj[0], obj[1], red);\n }\n\n var pre = obj[2];\n res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [ res ].concat(pre.doubles.points.map(obj2point)),\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [ res ].concat(pre.naf.points.map(obj2point)),\n },\n };\n return res;\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '<EC Point Infinity>';\n return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n ' y: ' + this.y.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n return this.inf;\n};\n\nPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P = 2P\n if (this.eq(p))\n return this.dbl();\n\n // P + (-P) = O\n if (this.neg().eq(p))\n return this.curve.point(null, null);\n\n // P + Q = O\n if (this.x.cmp(p.x) === 0)\n return this.curve.point(null, null);\n\n var c = this.y.redSub(p.y);\n if (c.cmpn(0) !== 0)\n c = c.redMul(this.x.redSub(p.x).redInvm());\n var nx = c.redSqr().redISub(this.x).redISub(p.x);\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.dbl = function dbl() {\n if (this.inf)\n return this;\n\n // 2P = O\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0)\n return this.curve.point(null, null);\n\n var a = this.curve.a;\n\n var x2 = this.x.redSqr();\n var dyinv = ys1.redInvm();\n var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);\n\n var nx = c.redSqr().redISub(this.x.redAdd(this.x));\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.getX = function getX() {\n return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n return this.y.fromRed();\n};\n\nPoint.prototype.mul = function mul(k) {\n k = new BN(k, 16);\n if (this.isInfinity())\n return this;\n else if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n else if (this.curve.endo)\n return this.curve._endoWnafMulAdd([ this ], [ k ]);\n else\n return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p2, k2) {\n var points = [ this, p2 ];\n var coeffs = [ k1, k2 ];\n if (this.curve.endo)\n return this.curve._endoWnafMulAdd(points, coeffs);\n else\n return this.curve._wnafMulAdd(1, points, coeffs, 2);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {\n var points = [ this, p2 ];\n var coeffs = [ k1, k2 ];\n if (this.curve.endo)\n return this.curve._endoWnafMulAdd(points, coeffs, true);\n else\n return this.curve._wnafMulAdd(1, points, coeffs, 2, true);\n};\n\nPoint.prototype.eq = function eq(p) {\n return this === p ||\n this.inf === p.inf &&\n (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n};\n\nPoint.prototype.neg = function neg(_precompute) {\n if (this.inf)\n return this;\n\n var res = this.curve.point(this.x, this.y.redNeg());\n if (_precompute && this.precomputed) {\n var pre = this.precomputed;\n var negate = function(p) {\n return p.neg();\n };\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate),\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate),\n },\n };\n }\n return res;\n};\n\nPoint.prototype.toJ = function toJ() {\n if (this.inf)\n return this.curve.jpoint(null, null, null);\n\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n};\n\nfunction JPoint(curve, x, y, z) {\n base.BasePoint.call(this, curve, 'jacobian');\n if (x === null && y === null && z === null) {\n this.x = this.curve.one;\n this.y = this.curve.one;\n this.z = new BN(0);\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n this.z = new BN(z, 16);\n }\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n this.zOne = this.z === this.curve.one;\n}\ninherits_browser(JPoint, base.BasePoint);\n\nShortCurve.prototype.jpoint = function jpoint(x, y, z) {\n return new JPoint(this, x, y, z);\n};\n\nJPoint.prototype.toP = function toP() {\n if (this.isInfinity())\n return this.curve.point(null, null);\n\n var zinv = this.z.redInvm();\n var zinv2 = zinv.redSqr();\n var ax = this.x.redMul(zinv2);\n var ay = this.y.redMul(zinv2).redMul(zinv);\n\n return this.curve.point(ax, ay);\n};\n\nJPoint.prototype.neg = function neg() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n};\n\nJPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.isInfinity())\n return p;\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // 12M + 4S + 7A\n var pz2 = p.z.redSqr();\n var z2 = this.z.redSqr();\n var u1 = this.x.redMul(pz2);\n var u2 = p.x.redMul(z2);\n var s1 = this.y.redMul(pz2.redMul(p.z));\n var s2 = p.y.redMul(z2.redMul(this.z));\n\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0)\n return this.curve.jpoint(null, null, null);\n else\n return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(p.z).redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mixedAdd = function mixedAdd(p) {\n // O + P = P\n if (this.isInfinity())\n return p.toJ();\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // 8M + 3S + 7A\n var z2 = this.z.redSqr();\n var u1 = this.x;\n var u2 = p.x.redMul(z2);\n var s1 = this.y;\n var s2 = p.y.redMul(z2).redMul(this.z);\n\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0)\n return this.curve.jpoint(null, null, null);\n else\n return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.dblp = function dblp(pow) {\n if (pow === 0)\n return this;\n if (this.isInfinity())\n return this;\n if (!pow)\n return this.dbl();\n\n var i;\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (i = 0; i < pow; i++)\n r = r.dbl();\n return r;\n }\n\n // 1M + 2S + 1A + N * (4S + 5M + 8A)\n // N = 1 => 6M + 6S + 9A\n var a = this.curve.a;\n var tinv = this.curve.tinv;\n\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n\n // Reuse results\n var jyd = jy.redAdd(jy);\n for (i = 0; i < pow; i++) {\n var jx2 = jx.redSqr();\n var jyd2 = jyd.redSqr();\n var jyd4 = jyd2.redSqr();\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n var t1 = jx.redMul(jyd2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n var dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n if (i + 1 < pow)\n jz4 = jz4.redMul(jyd4);\n\n jx = nx;\n jz = nz;\n jyd = dny;\n }\n\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n};\n\nJPoint.prototype.dbl = function dbl() {\n if (this.isInfinity())\n return this;\n\n if (this.curve.zeroA)\n return this._zeroDbl();\n else if (this.curve.threeA)\n return this._threeDbl();\n else\n return this._dbl();\n};\n\nJPoint.prototype._zeroDbl = function _zeroDbl() {\n var nx;\n var ny;\n var nz;\n // Z = 1\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 14A\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n // M = 3 * XX + a; a = 0\n var m = xx.redAdd(xx).redIAdd(xx);\n // T = M ^ 2 - 2*S\n var t = m.redSqr().redISub(s).redISub(s);\n\n // 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n\n // X3 = T\n nx = t;\n // Y3 = M * (S - T) - 8 * YYYY\n ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n // Z3 = 2*Y1\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-dbl-2009-l\n // 2M + 5S + 13A\n\n // A = X1^2\n var a = this.x.redSqr();\n // B = Y1^2\n var b = this.y.redSqr();\n // C = B^2\n var c = b.redSqr();\n // D = 2 * ((X1 + B)^2 - A - C)\n var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d);\n // E = 3 * A\n var e = a.redAdd(a).redIAdd(a);\n // F = E^2\n var f = e.redSqr();\n\n // 8 * C\n var c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8);\n c8 = c8.redIAdd(c8);\n\n // X3 = F - 2 * D\n nx = f.redISub(d).redISub(d);\n // Y3 = E * (D - X3) - 8 * C\n ny = e.redMul(d.redISub(nx)).redISub(c8);\n // Z3 = 2 * Y1 * Z1\n nz = this.y.redMul(this.z);\n nz = nz.redIAdd(nz);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._threeDbl = function _threeDbl() {\n var nx;\n var ny;\n var nz;\n // Z = 1\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 15A\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n // M = 3 * XX + a\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);\n // T = M^2 - 2 * S\n var t = m.redSqr().redISub(s).redISub(s);\n // X3 = T\n nx = t;\n // Y3 = M * (S - T) - 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n // Z3 = 2 * Y1\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n // 3M + 5S\n\n // delta = Z1^2\n var delta = this.z.redSqr();\n // gamma = Y1^2\n var gamma = this.y.redSqr();\n // beta = X1 * gamma\n var beta = this.x.redMul(gamma);\n // alpha = 3 * (X1 - delta) * (X1 + delta)\n var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha);\n // X3 = alpha^2 - 8 * beta\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8);\n // Z3 = (Y1 + Z1)^2 - gamma - delta\n nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._dbl = function _dbl() {\n var a = this.curve.a;\n\n // 4M + 6S + 10A\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n\n var jx2 = jx.redSqr();\n var jy2 = jy.redSqr();\n\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n var jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n\n var jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8);\n var nz = jy.redAdd(jy).redMul(jz);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.trpl = function trpl() {\n if (!this.curve.zeroA)\n return this.dbl().add(this);\n\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl\n // 5M + 10S + ...\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // ZZ = Z1^2\n var zz = this.z.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // M = 3 * XX + a * ZZ2; a = 0\n var m = xx.redAdd(xx).redIAdd(xx);\n // MM = M^2\n var mm = m.redSqr();\n // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM\n var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e);\n e = e.redAdd(e).redIAdd(e);\n e = e.redISub(mm);\n // EE = E^2\n var ee = e.redSqr();\n // T = 16*YYYY\n var t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n // U = (M + E)^2 - MM - EE - T\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);\n // X3 = 4 * (X1 * EE - 4 * YY * U)\n var yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4);\n yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx);\n nx = nx.redIAdd(nx);\n // Y3 = 8 * Y1 * (U * (T - U) - E * EE)\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n // Z3 = (Z1 + E)^2 - ZZ - EE\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mul = function mul(k, kbase) {\n k = new BN(k, kbase);\n\n return this.curve._wnafMul(this, k);\n};\n\nJPoint.prototype.eq = function eq(p) {\n if (p.type === 'affine')\n return this.eq(p.toJ());\n\n if (this === p)\n return true;\n\n // x1 * z2^2 == x2 * z1^2\n var z2 = this.z.redSqr();\n var pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n return false;\n\n // y1 * z2^3 == y2 * z1^3\n var z3 = z2.redMul(this.z);\n var pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n};\n\nJPoint.prototype.eqXToP = function eqXToP(x) {\n var zs = this.z.redSqr();\n var rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0)\n return true;\n\n var xc = x.clone();\n var t = this.curve.redN.redMul(zs);\n for (;;) {\n xc.iadd(this.curve.n);\n if (xc.cmp(this.curve.p) >= 0)\n return false;\n\n rx.redIAdd(t);\n if (this.x.cmp(rx) === 0)\n return true;\n }\n};\n\nJPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '<EC JPoint Infinity>';\n return '<EC JPoint x: ' + this.x.toString(16, 2) +\n ' y: ' + this.y.toString(16, 2) +\n ' z: ' + this.z.toString(16, 2) + '>';\n};\n\nJPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.z.cmpn(0) === 0;\n};\n\nvar curve_1 = createCommonjsModule(function (module, exports) {\n'use strict';\n\nvar curve = exports;\n\ncurve.base = base;\ncurve.short = short_1;\ncurve.mont = /*RicMoo:ethers:require(./mont)*/(null);\ncurve.edwards = /*RicMoo:ethers:require(./edwards)*/(null);\n});\n\nvar curves_1 = createCommonjsModule(function (module, exports) {\n'use strict';\n\nvar curves = exports;\n\n\n\n\n\nvar assert = utils_1$1.assert;\n\nfunction PresetCurve(options) {\n if (options.type === 'short')\n this.curve = new curve_1.short(options);\n else if (options.type === 'edwards')\n this.curve = new curve_1.edwards(options);\n else\n this.curve = new curve_1.mont(options);\n this.g = this.curve.g;\n this.n = this.curve.n;\n this.hash = options.hash;\n\n assert(this.g.validate(), 'Invalid curve');\n assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');\n}\ncurves.PresetCurve = PresetCurve;\n\nfunction defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n get: function() {\n var curve = new PresetCurve(options);\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n value: curve,\n });\n return curve;\n },\n });\n}\n\ndefineCurve('p192', {\n type: 'short',\n prime: 'p192',\n p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',\n b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',\n n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',\n hash: hash.sha256,\n gRed: false,\n g: [\n '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',\n '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811',\n ],\n});\n\ndefineCurve('p224', {\n type: 'short',\n prime: 'p224',\n p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',\n b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',\n n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',\n hash: hash.sha256,\n gRed: false,\n g: [\n 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',\n 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34',\n ],\n});\n\ndefineCurve('p256', {\n type: 'short',\n prime: null,\n p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',\n a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',\n b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',\n n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',\n hash: hash.sha256,\n gRed: false,\n g: [\n '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',\n '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5',\n ],\n});\n\ndefineCurve('p384', {\n type: 'short',\n prime: null,\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 ffffffff',\n a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 fffffffc',\n b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +\n '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',\n n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +\n 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',\n hash: hash.sha384,\n gRed: false,\n g: [\n 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +\n '5502f25d bf55296c 3a545e38 72760ab7',\n '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +\n '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f',\n ],\n});\n\ndefineCurve('p521', {\n type: 'short',\n prime: null,\n p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff',\n a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff fffffffc',\n b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +\n '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +\n '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',\n n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +\n 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',\n hash: hash.sha512,\n gRed: false,\n g: [\n '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +\n '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +\n 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',\n '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +\n '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +\n '3fad0761 353c7086 a272c240 88be9476 9fd16650',\n ],\n});\n\ndefineCurve('curve25519', {\n type: 'mont',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '76d06',\n b: '1',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: hash.sha256,\n gRed: false,\n g: [\n '9',\n ],\n});\n\ndefineCurve('ed25519', {\n type: 'edwards',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '-1',\n c: '1',\n // -121665 * (121666^(-1)) (mod P)\n d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: hash.sha256,\n gRed: false,\n g: [\n '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',\n\n // 4/5\n '6666666666666666666666666666666666666666666666666666666666666658',\n ],\n});\n\nvar pre;\ntry {\n pre = /*RicMoo:ethers:require(./precomputed/secp256k1)*/(null).crash();\n} catch (e) {\n pre = undefined;\n}\n\ndefineCurve('secp256k1', {\n type: 'short',\n prime: 'k256',\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',\n a: '0',\n b: '7',\n n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',\n h: '1',\n hash: hash.sha256,\n\n // Precomputed endomorphism\n beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',\n lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',\n basis: [\n {\n a: '3086d221a7d46bcde86c90e49284eb15',\n b: '-e4437ed6010e88286f547fa90abfe4c3',\n },\n {\n a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n b: '3086d221a7d46bcde86c90e49284eb15',\n },\n ],\n\n gRed: false,\n g: [\n '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',\n '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n pre,\n ],\n});\n});\n\n'use strict';\n\n\n\n\n\nfunction HmacDRBG(options) {\n if (!(this instanceof HmacDRBG))\n return new HmacDRBG(options);\n this.hash = options.hash;\n this.predResist = !!options.predResist;\n\n this.outLen = this.hash.outSize;\n this.minEntropy = options.minEntropy || this.hash.hmacStrength;\n\n this._reseed = null;\n this.reseedInterval = null;\n this.K = null;\n this.V = null;\n\n var entropy = utils_1.toArray(options.entropy, options.entropyEnc || 'hex');\n var nonce = utils_1.toArray(options.nonce, options.nonceEnc || 'hex');\n var pers = utils_1.toArray(options.pers, options.persEnc || 'hex');\n minimalisticAssert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n this._init(entropy, nonce, pers);\n}\nvar hmacDrbg = HmacDRBG;\n\nHmacDRBG.prototype._init = function init(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n\n this.K = new Array(this.outLen / 8);\n this.V = new Array(this.outLen / 8);\n for (var i = 0; i < this.V.length; i++) {\n this.K[i] = 0x00;\n this.V[i] = 0x01;\n }\n\n this._update(seed);\n this._reseed = 1;\n this.reseedInterval = 0x1000000000000; // 2^48\n};\n\nHmacDRBG.prototype._hmac = function hmac() {\n return new hash.hmac(this.hash, this.K);\n};\n\nHmacDRBG.prototype._update = function update(seed) {\n var kmac = this._hmac()\n .update(this.V)\n .update([ 0x00 ]);\n if (seed)\n kmac = kmac.update(seed);\n this.K = kmac.digest();\n this.V = this._hmac().update(this.V).digest();\n if (!seed)\n return;\n\n this.K = this._hmac()\n .update(this.V)\n .update([ 0x01 ])\n .update(seed)\n .digest();\n this.V = this._hmac().update(this.V).digest();\n};\n\nHmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {\n // Optional entropy enc\n if (typeof entropyEnc !== 'string') {\n addEnc = add;\n add = entropyEnc;\n entropyEnc = null;\n }\n\n entropy = utils_1.toArray(entropy, entropyEnc);\n add = utils_1.toArray(add, addEnc);\n\n minimalisticAssert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n\n this._update(entropy.concat(add || []));\n this._reseed = 1;\n};\n\nHmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval)\n throw new Error('Reseed is required');\n\n // Optional encoding\n if (typeof enc !== 'string') {\n addEnc = add;\n add = enc;\n enc = null;\n }\n\n // Optional additional data\n if (add) {\n add = utils_1.toArray(add, addEnc || 'hex');\n this._update(add);\n }\n\n var temp = [];\n while (temp.length < len) {\n this.V = this._hmac().update(this.V).digest();\n temp = temp.concat(this.V);\n }\n\n var res = temp.slice(0, len);\n this._update(add);\n this._reseed++;\n return utils_1.encode(res, enc);\n};\n\n'use strict';\n\n\n\nvar assert$3 = utils_1$1.assert;\n\nfunction KeyPair(ec, options) {\n this.ec = ec;\n this.priv = null;\n this.pub = null;\n\n // KeyPair(ec, { priv: ..., pub: ... })\n if (options.priv)\n this._importPrivate(options.priv, options.privEnc);\n if (options.pub)\n this._importPublic(options.pub, options.pubEnc);\n}\nvar key = KeyPair;\n\nKeyPair.fromPublic = function fromPublic(ec, pub, enc) {\n if (pub instanceof KeyPair)\n return pub;\n\n return new KeyPair(ec, {\n pub: pub,\n pubEnc: enc,\n });\n};\n\nKeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {\n if (priv instanceof KeyPair)\n return priv;\n\n return new KeyPair(ec, {\n priv: priv,\n privEnc: enc,\n });\n};\n\nKeyPair.prototype.validate = function validate() {\n var pub = this.getPublic();\n\n if (pub.isInfinity())\n return { result: false, reason: 'Invalid public key' };\n if (!pub.validate())\n return { result: false, reason: 'Public key is not a point' };\n if (!pub.mul(this.ec.curve.n).isInfinity())\n return { result: false, reason: 'Public key * N != O' };\n\n return { result: true, reason: null };\n};\n\nKeyPair.prototype.getPublic = function getPublic(compact, enc) {\n // compact is optional argument\n if (typeof compact === 'string') {\n enc = compact;\n compact = null;\n }\n\n if (!this.pub)\n this.pub = this.ec.g.mul(this.priv);\n\n if (!enc)\n return this.pub;\n\n return this.pub.encode(enc, compact);\n};\n\nKeyPair.prototype.getPrivate = function getPrivate(enc) {\n if (enc === 'hex')\n return this.priv.toString(16, 2);\n else\n return this.priv;\n};\n\nKeyPair.prototype._importPrivate = function _importPrivate(key, enc) {\n this.priv = new BN(key, enc || 16);\n\n // Ensure that the priv won't be bigger than n, otherwise we may fail\n // in fixed multiplication method\n this.priv = this.priv.umod(this.ec.curve.n);\n};\n\nKeyPair.prototype._importPublic = function _importPublic(key, enc) {\n if (key.x || key.y) {\n // Montgomery points only have an `x` coordinate.\n // Weierstrass/Edwards points on the other hand have both `x` and\n // `y` coordinates.\n if (this.ec.curve.type === 'mont') {\n assert$3(key.x, 'Need x coordinate');\n } else if (this.ec.curve.type === 'short' ||\n this.ec.curve.type === 'edwards') {\n assert$3(key.x && key.y, 'Need both x and y coordinate');\n }\n this.pub = this.ec.curve.point(key.x, key.y);\n return;\n }\n this.pub = this.ec.curve.decodePoint(key, enc);\n};\n\n// ECDH\nKeyPair.prototype.derive = function derive(pub) {\n if(!pub.validate()) {\n assert$3(pub.validate(), 'public point not validated');\n }\n return pub.mul(this.priv).getX();\n};\n\n// ECDSA\nKeyPair.prototype.sign = function sign(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n};\n\nKeyPair.prototype.verify = function verify(msg, signature) {\n return this.ec.verify(msg, signature, this);\n};\n\nKeyPair.prototype.inspect = function inspect() {\n return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +\n ' pub: ' + (this.pub && this.pub.inspect()) + ' >';\n};\n\n'use strict';\n\n\n\n\nvar assert$4 = utils_1$1.assert;\n\nfunction Signature(options, enc) {\n if (options instanceof Signature)\n return options;\n\n if (this._importDER(options, enc))\n return;\n\n assert$4(options.r && options.s, 'Signature without r or s');\n this.r = new BN(options.r, 16);\n this.s = new BN(options.s, 16);\n if (options.recoveryParam === undefined)\n this.recoveryParam = null;\n else\n this.recoveryParam = options.recoveryParam;\n}\nvar signature = Signature;\n\nfunction Position() {\n this.place = 0;\n}\n\nfunction getLength(buf, p) {\n var initial = buf[p.place++];\n if (!(initial & 0x80)) {\n return initial;\n }\n var octetLen = initial & 0xf;\n\n // Indefinite length or overflow\n if (octetLen === 0 || octetLen > 4) {\n return false;\n }\n\n var val = 0;\n for (var i = 0, off = p.place; i < octetLen; i++, off++) {\n val <<= 8;\n val |= buf[off];\n val >>>= 0;\n }\n\n // Leading zeroes\n if (val <= 0x7f) {\n return false;\n }\n\n p.place = off;\n return val;\n}\n\nfunction rmPadding(buf) {\n var i = 0;\n var len = buf.length - 1;\n while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {\n i++;\n }\n if (i === 0) {\n return buf;\n }\n return buf.slice(i);\n}\n\nSignature.prototype._importDER = function _importDER(data, enc) {\n data = utils_1$1.toArray(data, enc);\n var p = new Position();\n if (data[p.place++] !== 0x30) {\n return false;\n }\n var len = getLength(data, p);\n if (len === false) {\n return false;\n }\n if ((len + p.place) !== data.length) {\n return false;\n }\n if (data[p.place++] !== 0x02) {\n return false;\n }\n var rlen = getLength(data, p);\n if (rlen === false) {\n return false;\n }\n var r = data.slice(p.place, rlen + p.place);\n p.place += rlen;\n if (data[p.place++] !== 0x02) {\n return false;\n }\n var slen = getLength(data, p);\n if (slen === false) {\n return false;\n }\n if (data.length !== slen + p.place) {\n return false;\n }\n var s = data.slice(p.place, slen + p.place);\n if (r[0] === 0) {\n if (r[1] & 0x80) {\n r = r.slice(1);\n } else {\n // Leading zeroes\n return false;\n }\n }\n if (s[0] === 0) {\n if (s[1] & 0x80) {\n s = s.slice(1);\n } else {\n // Leading zeroes\n return false;\n }\n }\n\n this.r = new BN(r);\n this.s = new BN(s);\n this.recoveryParam = null;\n\n return true;\n};\n\nfunction constructLength(arr, len) {\n if (len < 0x80) {\n arr.push(len);\n return;\n }\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n arr.push(octets | 0x80);\n while (--octets) {\n arr.push((len >>> (octets << 3)) & 0xff);\n }\n arr.push(len);\n}\n\nSignature.prototype.toDER = function toDER(enc) {\n var r = this.r.toArray();\n var s = this.s.toArray();\n\n // Pad values\n if (r[0] & 0x80)\n r = [ 0 ].concat(r);\n // Pad values\n if (s[0] & 0x80)\n s = [ 0 ].concat(s);\n\n r = rmPadding(r);\n s = rmPadding(s);\n\n while (!s[0] && !(s[1] & 0x80)) {\n s = s.slice(1);\n }\n var arr = [ 0x02 ];\n constructLength(arr, r.length);\n arr = arr.concat(r);\n arr.push(0x02);\n constructLength(arr, s.length);\n var backHalf = arr.concat(s);\n var res = [ 0x30 ];\n constructLength(res, backHalf.length);\n res = res.concat(backHalf);\n return utils_1$1.encode(res, enc);\n};\n\n'use strict';\n\n\n\n\n\nvar rand = /*RicMoo:ethers:require(brorand)*/(function() { throw new Error('unsupported'); });\nvar assert$5 = utils_1$1.assert;\n\n\n\n\nfunction EC(options) {\n if (!(this instanceof EC))\n return new EC(options);\n\n // Shortcut `elliptic.ec(curve-name)`\n if (typeof options === 'string') {\n assert$5(Object.prototype.hasOwnProperty.call(curves_1, options),\n 'Unknown curve ' + options);\n\n options = curves_1[options];\n }\n\n // Shortcut for `elliptic.ec(elliptic.curves.curveName)`\n if (options instanceof curves_1.PresetCurve)\n options = { curve: options };\n\n this.curve = options.curve.curve;\n this.n = this.curve.n;\n this.nh = this.n.ushrn(1);\n this.g = this.curve.g;\n\n // Point on curve\n this.g = options.curve.g;\n this.g.precompute(options.curve.n.bitLength() + 1);\n\n // Hash for function for DRBG\n this.hash = options.hash || options.curve.hash;\n}\nvar ec = EC;\n\nEC.prototype.keyPair = function keyPair(options) {\n return new key(this, options);\n};\n\nEC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\n return key.fromPrivate(this, priv, enc);\n};\n\nEC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\n return key.fromPublic(this, pub, enc);\n};\n\nEC.prototype.genKeyPair = function genKeyPair(options) {\n if (!options)\n options = {};\n\n // Instantiate Hmac_DRBG\n var drbg = new hmacDrbg({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8',\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || 'utf8',\n nonce: this.n.toArray(),\n });\n\n var bytes = this.n.byteLength();\n var ns2 = this.n.sub(new BN(2));\n for (;;) {\n var priv = new BN(drbg.generate(bytes));\n if (priv.cmp(ns2) > 0)\n continue;\n\n priv.iaddn(1);\n return this.keyFromPrivate(priv);\n }\n};\n\nEC.prototype._truncateToN = function _truncateToN(msg, truncOnly) {\n var delta = msg.byteLength() * 8 - this.n.bitLength();\n if (delta > 0)\n msg = msg.ushrn(delta);\n if (!truncOnly && msg.cmp(this.n) >= 0)\n return msg.sub(this.n);\n else\n return msg;\n};\n\nEC.prototype.sign = function sign(msg, key, enc, options) {\n if (typeof enc === 'object') {\n options = enc;\n enc = null;\n }\n if (!options)\n options = {};\n\n key = this.keyFromPrivate(key, enc);\n msg = this._truncateToN(new BN(msg, 16));\n\n // Zero-extend key to provide enough entropy\n var bytes = this.n.byteLength();\n var bkey = key.getPrivate().toArray('be', bytes);\n\n // Zero-extend nonce to have the same byte size as N\n var nonce = msg.toArray('be', bytes);\n\n // Instantiate Hmac_DRBG\n var drbg = new hmacDrbg({\n hash: this.hash,\n entropy: bkey,\n nonce: nonce,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8',\n });\n\n // Number of bytes to generate\n var ns1 = this.n.sub(new BN(1));\n\n for (var iter = 0; ; iter++) {\n var k = options.k ?\n options.k(iter) :\n new BN(drbg.generate(this.n.byteLength()));\n k = this._truncateToN(k, true);\n if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)\n continue;\n\n var kp = this.g.mul(k);\n if (kp.isInfinity())\n continue;\n\n var kpX = kp.getX();\n var r = kpX.umod(this.n);\n if (r.cmpn(0) === 0)\n continue;\n\n var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n s = s.umod(this.n);\n if (s.cmpn(0) === 0)\n continue;\n\n var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |\n (kpX.cmp(r) !== 0 ? 2 : 0);\n\n // Use complement of `s`, if it is > `n / 2`\n if (options.canonical && s.cmp(this.nh) > 0) {\n s = this.n.sub(s);\n recoveryParam ^= 1;\n }\n\n return new signature({ r: r, s: s, recoveryParam: recoveryParam });\n }\n};\n\nEC.prototype.verify = function verify(msg, signature$1, key, enc) {\n msg = this._truncateToN(new BN(msg, 16));\n key = this.keyFromPublic(key, enc);\n signature$1 = new signature(signature$1, 'hex');\n\n // Perform primitive values validation\n var r = signature$1.r;\n var s = signature$1.s;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)\n return false;\n if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n return false;\n\n // Validate signature\n var sinv = s.invm(this.n);\n var u1 = sinv.mul(msg).umod(this.n);\n var u2 = sinv.mul(r).umod(this.n);\n var p;\n\n if (!this.curve._maxwellTrick) {\n p = this.g.mulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity())\n return false;\n\n return p.getX().umod(this.n).cmp(r) === 0;\n }\n\n // NOTE: Greg Maxwell's trick, inspired by:\n // https://git.io/vad3K\n\n p = this.g.jmulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity())\n return false;\n\n // Compare `p.x` of Jacobian point with `r`,\n // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the\n // inverse of `p.z^2`\n return p.eqXToP(r);\n};\n\nEC.prototype.recoverPubKey = function(msg, signature$1, j, enc) {\n assert$5((3 & j) === j, 'The recovery param is more than two bits');\n signature$1 = new signature(signature$1, enc);\n\n var n = this.n;\n var e = new BN(msg);\n var r = signature$1.r;\n var s = signature$1.s;\n\n // A set LSB signifies that the y-coordinate is odd\n var isYOdd = j & 1;\n var isSecondKey = j >> 1;\n if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n throw new Error('Unable to find sencond key candinate');\n\n // 1.1. Let x = r + jn.\n if (isSecondKey)\n r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);\n else\n r = this.curve.pointFromX(r, isYOdd);\n\n var rInv = signature$1.r.invm(n);\n var s1 = n.sub(e).mul(rInv).umod(n);\n var s2 = s.mul(rInv).umod(n);\n\n // 1.6.1 Compute Q = r^-1 (sR - eG)\n // Q = r^-1 (sR + -eG)\n return this.g.mulAdd(s1, r, s2);\n};\n\nEC.prototype.getKeyRecoveryParam = function(e, signature$1, Q, enc) {\n signature$1 = new signature(signature$1, enc);\n if (signature$1.recoveryParam !== null)\n return signature$1.recoveryParam;\n\n for (var i = 0; i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature$1, i);\n } catch (e) {\n continue;\n }\n\n if (Qprime.eq(Q))\n return i;\n }\n throw new Error('Unable to find valid recovery factor');\n};\n\nvar elliptic_1 = createCommonjsModule(function (module, exports) {\n'use strict';\n\nvar elliptic = exports;\n\nelliptic.version = /*RicMoo:ethers*/{ version: \"6.5.4\" }.version;\nelliptic.utils = utils_1$1;\nelliptic.rand = /*RicMoo:ethers:require(brorand)*/(function() { throw new Error('unsupported'); });\nelliptic.curve = curve_1;\nelliptic.curves = curves_1;\n\n// Protocols\nelliptic.ec = ec;\nelliptic.eddsa = /*RicMoo:ethers:require(./elliptic/eddsa)*/(null);\n});\n\nvar EC$1 = elliptic_1.ec;\n\nexport { EC$1 as EC };\n//# sourceMappingURL=elliptic.js.map\n","export const version = \"signing-key/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { EC } from \"./elliptic\";\nimport { arrayify, hexDataLength, hexlify, hexZeroPad, splitSignature } from \"@ethersproject/bytes\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nlet _curve = null;\nfunction getCurve() {\n if (!_curve) {\n _curve = new EC(\"secp256k1\");\n }\n return _curve;\n}\nexport class SigningKey {\n constructor(privateKey) {\n defineReadOnly(this, \"curve\", \"secp256k1\");\n defineReadOnly(this, \"privateKey\", hexlify(privateKey));\n if (hexDataLength(this.privateKey) !== 32) {\n logger.throwArgumentError(\"invalid private key\", \"privateKey\", \"[[ REDACTED ]]\");\n }\n const keyPair = getCurve().keyFromPrivate(arrayify(this.privateKey));\n defineReadOnly(this, \"publicKey\", \"0x\" + keyPair.getPublic(false, \"hex\"));\n defineReadOnly(this, \"compressedPublicKey\", \"0x\" + keyPair.getPublic(true, \"hex\"));\n defineReadOnly(this, \"_isSigningKey\", true);\n }\n _addPoint(other) {\n const p0 = getCurve().keyFromPublic(arrayify(this.publicKey));\n const p1 = getCurve().keyFromPublic(arrayify(other));\n return \"0x\" + p0.pub.add(p1.pub).encodeCompressed(\"hex\");\n }\n signDigest(digest) {\n const keyPair = getCurve().keyFromPrivate(arrayify(this.privateKey));\n const digestBytes = arrayify(digest);\n if (digestBytes.length !== 32) {\n logger.throwArgumentError(\"bad digest length\", \"digest\", digest);\n }\n const signature = keyPair.sign(digestBytes, { canonical: true });\n return splitSignature({\n recoveryParam: signature.recoveryParam,\n r: hexZeroPad(\"0x\" + signature.r.toString(16), 32),\n s: hexZeroPad(\"0x\" + signature.s.toString(16), 32),\n });\n }\n computeSharedSecret(otherKey) {\n const keyPair = getCurve().keyFromPrivate(arrayify(this.privateKey));\n const otherKeyPair = getCurve().keyFromPublic(arrayify(computePublicKey(otherKey)));\n return hexZeroPad(\"0x\" + keyPair.derive(otherKeyPair.getPublic()).toString(16), 32);\n }\n static isSigningKey(value) {\n return !!(value && value._isSigningKey);\n }\n}\nexport function recoverPublicKey(digest, signature) {\n const sig = splitSignature(signature);\n const rs = { r: arrayify(sig.r), s: arrayify(sig.s) };\n return \"0x\" + getCurve().recoverPubKey(arrayify(digest), rs, sig.recoveryParam).encode(\"hex\", false);\n}\nexport function computePublicKey(key, compressed) {\n const bytes = arrayify(key);\n if (bytes.length === 32) {\n const signingKey = new SigningKey(bytes);\n if (compressed) {\n return \"0x\" + getCurve().keyFromPrivate(bytes).getPublic(true, \"hex\");\n }\n return signingKey.publicKey;\n }\n else if (bytes.length === 33) {\n if (compressed) {\n return hexlify(bytes);\n }\n return \"0x\" + getCurve().keyFromPublic(bytes).getPublic(false, \"hex\");\n }\n else if (bytes.length === 65) {\n if (!compressed) {\n return hexlify(bytes);\n }\n return \"0x\" + getCurve().keyFromPublic(bytes).getPublic(true, \"hex\");\n }\n return logger.throwArgumentError(\"invalid public or private key\", \"key\", \"[REDACTED]\");\n}\n//# sourceMappingURL=index.js.map","export const version = \"transactions/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, hexConcat, hexDataLength, hexDataSlice, hexlify, hexZeroPad, isBytesLike, splitSignature, stripZeros, } from \"@ethersproject/bytes\";\nimport { Zero } from \"@ethersproject/constants\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { checkProperties } from \"@ethersproject/properties\";\nimport * as RLP from \"@ethersproject/rlp\";\nimport { computePublicKey, recoverPublicKey } from \"@ethersproject/signing-key\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport var TransactionTypes;\n(function (TransactionTypes) {\n TransactionTypes[TransactionTypes[\"legacy\"] = 0] = \"legacy\";\n TransactionTypes[TransactionTypes[\"eip2930\"] = 1] = \"eip2930\";\n TransactionTypes[TransactionTypes[\"eip1559\"] = 2] = \"eip1559\";\n})(TransactionTypes || (TransactionTypes = {}));\n;\n///////////////////////////////\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction handleNumber(value) {\n if (value === \"0x\") {\n return Zero;\n }\n return BigNumber.from(value);\n}\n// Legacy Transaction Fields\nconst transactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"gasPrice\", maxLength: 32, numeric: true },\n { name: \"gasLimit\", maxLength: 32, numeric: true },\n { name: \"to\", length: 20 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n];\nconst allowedTransactionKeys = {\n chainId: true, data: true, gasLimit: true, gasPrice: true, nonce: true, to: true, type: true, value: true\n};\nexport function computeAddress(key) {\n const publicKey = computePublicKey(key);\n return getAddress(hexDataSlice(keccak256(hexDataSlice(publicKey, 1)), 12));\n}\nexport function recoverAddress(digest, signature) {\n return computeAddress(recoverPublicKey(arrayify(digest), signature));\n}\nfunction formatNumber(value, name) {\n const result = stripZeros(BigNumber.from(value).toHexString());\n if (result.length > 32) {\n logger.throwArgumentError(\"invalid length for \" + name, (\"transaction:\" + name), value);\n }\n return result;\n}\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: (storageKeys || []).map((storageKey, index) => {\n if (hexDataLength(storageKey) !== 32) {\n logger.throwArgumentError(\"invalid access list storageKey\", `accessList[${addr}:${index}]`, storageKey);\n }\n return storageKey.toLowerCase();\n })\n };\n}\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n if (set.length > 2) {\n logger.throwArgumentError(\"access list expected to be [ address, storageKeys[] ]\", `value[${index}]`, set);\n }\n return accessSetify(set[0], set[1]);\n }\n return accessSetify(set.address, set.storageKeys);\n });\n }\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => (a.address.localeCompare(b.address)));\n return result;\n}\nfunction formatAccessList(value) {\n return accessListify(value).map((set) => [set.address, set.storageKeys]);\n}\nfunction _serializeEip1559(transaction, signature) {\n // If there is an explicit gasPrice, make sure it matches the\n // EIP-1559 fees; otherwise they may not understand what they\n // think they are setting in terms of fee.\n if (transaction.gasPrice != null) {\n const gasPrice = BigNumber.from(transaction.gasPrice);\n const maxFeePerGas = BigNumber.from(transaction.maxFeePerGas || 0);\n if (!gasPrice.eq(maxFeePerGas)) {\n logger.throwArgumentError(\"mismatch EIP-1559 gasPrice != maxFeePerGas\", \"tx\", {\n gasPrice, maxFeePerGas\n });\n }\n }\n const fields = [\n formatNumber(transaction.chainId || 0, \"chainId\"),\n formatNumber(transaction.nonce || 0, \"nonce\"),\n formatNumber(transaction.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(transaction.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(transaction.gasLimit || 0, \"gasLimit\"),\n ((transaction.to != null) ? getAddress(transaction.to) : \"0x\"),\n formatNumber(transaction.value || 0, \"value\"),\n (transaction.data || \"0x\"),\n (formatAccessList(transaction.accessList || []))\n ];\n if (signature) {\n const sig = splitSignature(signature);\n fields.push(formatNumber(sig.recoveryParam, \"recoveryParam\"));\n fields.push(stripZeros(sig.r));\n fields.push(stripZeros(sig.s));\n }\n return hexConcat([\"0x02\", RLP.encode(fields)]);\n}\nfunction _serializeEip2930(transaction, signature) {\n const fields = [\n formatNumber(transaction.chainId || 0, \"chainId\"),\n formatNumber(transaction.nonce || 0, \"nonce\"),\n formatNumber(transaction.gasPrice || 0, \"gasPrice\"),\n formatNumber(transaction.gasLimit || 0, \"gasLimit\"),\n ((transaction.to != null) ? getAddress(transaction.to) : \"0x\"),\n formatNumber(transaction.value || 0, \"value\"),\n (transaction.data || \"0x\"),\n (formatAccessList(transaction.accessList || []))\n ];\n if (signature) {\n const sig = splitSignature(signature);\n fields.push(formatNumber(sig.recoveryParam, \"recoveryParam\"));\n fields.push(stripZeros(sig.r));\n fields.push(stripZeros(sig.s));\n }\n return hexConcat([\"0x01\", RLP.encode(fields)]);\n}\n// Legacy Transactions and EIP-155\nfunction _serialize(transaction, signature) {\n checkProperties(transaction, allowedTransactionKeys);\n const raw = [];\n transactionFields.forEach(function (fieldInfo) {\n let value = transaction[fieldInfo.name] || ([]);\n const options = {};\n if (fieldInfo.numeric) {\n options.hexPad = \"left\";\n }\n value = arrayify(hexlify(value, options));\n // Fixed-width field\n if (fieldInfo.length && value.length !== fieldInfo.length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n // Variable-width (with a maximum)\n if (fieldInfo.maxLength) {\n value = stripZeros(value);\n if (value.length > fieldInfo.maxLength) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n }\n raw.push(hexlify(value));\n });\n let chainId = 0;\n if (transaction.chainId != null) {\n // A chainId was provided; if non-zero we'll use EIP-155\n chainId = transaction.chainId;\n if (typeof (chainId) !== \"number\") {\n logger.throwArgumentError(\"invalid transaction.chainId\", \"transaction\", transaction);\n }\n }\n else if (signature && !isBytesLike(signature) && signature.v > 28) {\n // No chainId provided, but the signature is signing with EIP-155; derive chainId\n chainId = Math.floor((signature.v - 35) / 2);\n }\n // We have an EIP-155 transaction (chainId was specified and non-zero)\n if (chainId !== 0) {\n raw.push(hexlify(chainId)); // @TODO: hexValue?\n raw.push(\"0x\");\n raw.push(\"0x\");\n }\n // Requesting an unsigned transaction\n if (!signature) {\n return RLP.encode(raw);\n }\n // The splitSignature will ensure the transaction has a recoveryParam in the\n // case that the signTransaction function only adds a v.\n const sig = splitSignature(signature);\n // We pushed a chainId and null r, s on for hashing only; remove those\n let v = 27 + sig.recoveryParam;\n if (chainId !== 0) {\n raw.pop();\n raw.pop();\n raw.pop();\n v += chainId * 2 + 8;\n // If an EIP-155 v (directly or indirectly; maybe _vs) was provided, check it!\n if (sig.v > 28 && sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n }\n else if (sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n raw.push(hexlify(v));\n raw.push(stripZeros(arrayify(sig.r)));\n raw.push(stripZeros(arrayify(sig.s)));\n return RLP.encode(raw);\n}\nexport function serialize(transaction, signature) {\n // Legacy and EIP-155 Transactions\n if (transaction.type == null || transaction.type === 0) {\n if (transaction.accessList != null) {\n logger.throwArgumentError(\"untyped transactions do not support accessList; include type: 1\", \"transaction\", transaction);\n }\n return _serialize(transaction, signature);\n }\n // Typed Transactions (EIP-2718)\n switch (transaction.type) {\n case 1:\n return _serializeEip2930(transaction, signature);\n case 2:\n return _serializeEip1559(transaction, signature);\n default:\n break;\n }\n return logger.throwError(`unsupported transaction type: ${transaction.type}`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"serializeTransaction\",\n transactionType: transaction.type\n });\n}\nfunction _parseEipSignature(tx, fields, serialize) {\n try {\n const recid = handleNumber(fields[0]).toNumber();\n if (recid !== 0 && recid !== 1) {\n throw new Error(\"bad recid\");\n }\n tx.v = recid;\n }\n catch (error) {\n logger.throwArgumentError(\"invalid v for transaction type: 1\", \"v\", fields[0]);\n }\n tx.r = hexZeroPad(fields[1], 32);\n tx.s = hexZeroPad(fields[2], 32);\n try {\n const digest = keccak256(serialize(tx));\n tx.from = recoverAddress(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });\n }\n catch (error) { }\n}\nfunction _parseEip1559(payload) {\n const transaction = RLP.decode(payload.slice(1));\n if (transaction.length !== 9 && transaction.length !== 12) {\n logger.throwArgumentError(\"invalid component count for transaction type: 2\", \"payload\", hexlify(payload));\n }\n const maxPriorityFeePerGas = handleNumber(transaction[2]);\n const maxFeePerGas = handleNumber(transaction[3]);\n const tx = {\n type: 2,\n chainId: handleNumber(transaction[0]).toNumber(),\n nonce: handleNumber(transaction[1]).toNumber(),\n maxPriorityFeePerGas: maxPriorityFeePerGas,\n maxFeePerGas: maxFeePerGas,\n gasPrice: null,\n gasLimit: handleNumber(transaction[4]),\n to: handleAddress(transaction[5]),\n value: handleNumber(transaction[6]),\n data: transaction[7],\n accessList: accessListify(transaction[8]),\n };\n // Unsigned EIP-1559 Transaction\n if (transaction.length === 9) {\n return tx;\n }\n tx.hash = keccak256(payload);\n _parseEipSignature(tx, transaction.slice(9), _serializeEip1559);\n return tx;\n}\nfunction _parseEip2930(payload) {\n const transaction = RLP.decode(payload.slice(1));\n if (transaction.length !== 8 && transaction.length !== 11) {\n logger.throwArgumentError(\"invalid component count for transaction type: 1\", \"payload\", hexlify(payload));\n }\n const tx = {\n type: 1,\n chainId: handleNumber(transaction[0]).toNumber(),\n nonce: handleNumber(transaction[1]).toNumber(),\n gasPrice: handleNumber(transaction[2]),\n gasLimit: handleNumber(transaction[3]),\n to: handleAddress(transaction[4]),\n value: handleNumber(transaction[5]),\n data: transaction[6],\n accessList: accessListify(transaction[7])\n };\n // Unsigned EIP-2930 Transaction\n if (transaction.length === 8) {\n return tx;\n }\n tx.hash = keccak256(payload);\n _parseEipSignature(tx, transaction.slice(8), _serializeEip2930);\n return tx;\n}\n// Legacy Transactions and EIP-155\nfunction _parse(rawTransaction) {\n const transaction = RLP.decode(rawTransaction);\n if (transaction.length !== 9 && transaction.length !== 6) {\n logger.throwArgumentError(\"invalid raw transaction\", \"rawTransaction\", rawTransaction);\n }\n const tx = {\n nonce: handleNumber(transaction[0]).toNumber(),\n gasPrice: handleNumber(transaction[1]),\n gasLimit: handleNumber(transaction[2]),\n to: handleAddress(transaction[3]),\n value: handleNumber(transaction[4]),\n data: transaction[5],\n chainId: 0\n };\n // Legacy unsigned transaction\n if (transaction.length === 6) {\n return tx;\n }\n try {\n tx.v = BigNumber.from(transaction[6]).toNumber();\n }\n catch (error) {\n // @TODO: What makes snese to do? The v is too big\n return tx;\n }\n tx.r = hexZeroPad(transaction[7], 32);\n tx.s = hexZeroPad(transaction[8], 32);\n if (BigNumber.from(tx.r).isZero() && BigNumber.from(tx.s).isZero()) {\n // EIP-155 unsigned transaction\n tx.chainId = tx.v;\n tx.v = 0;\n }\n else {\n // Signed Transaction\n tx.chainId = Math.floor((tx.v - 35) / 2);\n if (tx.chainId < 0) {\n tx.chainId = 0;\n }\n let recoveryParam = tx.v - 27;\n const raw = transaction.slice(0, 6);\n if (tx.chainId !== 0) {\n raw.push(hexlify(tx.chainId));\n raw.push(\"0x\");\n raw.push(\"0x\");\n recoveryParam -= tx.chainId * 2 + 8;\n }\n const digest = keccak256(RLP.encode(raw));\n try {\n tx.from = recoverAddress(digest, { r: hexlify(tx.r), s: hexlify(tx.s), recoveryParam: recoveryParam });\n }\n catch (error) { }\n tx.hash = keccak256(rawTransaction);\n }\n tx.type = null;\n return tx;\n}\nexport function parse(rawTransaction) {\n const payload = arrayify(rawTransaction);\n // Legacy and EIP-155 Transactions\n if (payload[0] > 0x7f) {\n return _parse(payload);\n }\n // Typed Transaction (EIP-2718)\n switch (payload[0]) {\n case 1:\n return _parseEip2930(payload);\n case 2:\n return _parseEip1559(payload);\n default:\n break;\n }\n return logger.throwError(`unsupported transaction type: ${payload[0]}`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"parseTransaction\",\n transactionType: payload[0]\n });\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { checkResultErrors, Indexed, Interface } from \"@ethersproject/abi\";\nimport { Provider } from \"@ethersproject/abstract-provider\";\nimport { Signer, VoidSigner } from \"@ethersproject/abstract-signer\";\nimport { getAddress, getContractAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, concat, hexlify, isBytes, isHexString } from \"@ethersproject/bytes\";\nimport { defineReadOnly, deepCopy, getStatic, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\nimport { accessListify } from \"@ethersproject/transactions\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n;\n;\n///////////////////////////////\nconst allowedTransactionKeys = {\n chainId: true, data: true, from: true, gasLimit: true, gasPrice: true, nonce: true, to: true, value: true,\n type: true, accessList: true,\n maxFeePerGas: true, maxPriorityFeePerGas: true,\n customData: true,\n ccipReadEnabled: true\n};\nfunction resolveName(resolver, nameOrPromise) {\n return __awaiter(this, void 0, void 0, function* () {\n const name = yield nameOrPromise;\n if (typeof (name) !== \"string\") {\n logger.throwArgumentError(\"invalid address or ENS name\", \"name\", name);\n }\n // If it is already an address, just use it (after adding checksum)\n try {\n return getAddress(name);\n }\n catch (error) { }\n if (!resolver) {\n logger.throwError(\"a provider or signer is needed to resolve ENS names\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"resolveName\"\n });\n }\n const address = yield resolver.resolveName(name);\n if (address == null) {\n logger.throwArgumentError(\"resolver or addr is not configured for ENS name\", \"name\", name);\n }\n return address;\n });\n}\n// Recursively replaces ENS names with promises to resolve the name and resolves all properties\nfunction resolveAddresses(resolver, value, paramType) {\n return __awaiter(this, void 0, void 0, function* () {\n if (Array.isArray(paramType)) {\n return yield Promise.all(paramType.map((paramType, index) => {\n return resolveAddresses(resolver, ((Array.isArray(value)) ? value[index] : value[paramType.name]), paramType);\n }));\n }\n if (paramType.type === \"address\") {\n return yield resolveName(resolver, value);\n }\n if (paramType.type === \"tuple\") {\n return yield resolveAddresses(resolver, value, paramType.components);\n }\n if (paramType.baseType === \"array\") {\n if (!Array.isArray(value)) {\n return Promise.reject(logger.makeError(\"invalid value for array\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"value\",\n value\n }));\n }\n return yield Promise.all(value.map((v) => resolveAddresses(resolver, v, paramType.arrayChildren)));\n }\n return value;\n });\n}\nfunction populateTransaction(contract, fragment, args) {\n return __awaiter(this, void 0, void 0, function* () {\n // If an extra argument is given, it is overrides\n let overrides = {};\n if (args.length === fragment.inputs.length + 1 && typeof (args[args.length - 1]) === \"object\") {\n overrides = shallowCopy(args.pop());\n }\n // Make sure the parameter count matches\n logger.checkArgumentCount(args.length, fragment.inputs.length, \"passed to contract\");\n // Populate \"from\" override (allow promises)\n if (contract.signer) {\n if (overrides.from) {\n // Contracts with a Signer are from the Signer's frame-of-reference;\n // but we allow overriding \"from\" if it matches the signer\n overrides.from = resolveProperties({\n override: resolveName(contract.signer, overrides.from),\n signer: contract.signer.getAddress()\n }).then((check) => __awaiter(this, void 0, void 0, function* () {\n if (getAddress(check.signer) !== check.override) {\n logger.throwError(\"Contract with a Signer cannot override from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"overrides.from\"\n });\n }\n return check.override;\n }));\n }\n else {\n overrides.from = contract.signer.getAddress();\n }\n }\n else if (overrides.from) {\n overrides.from = resolveName(contract.provider, overrides.from);\n //} else {\n // Contracts without a signer can override \"from\", and if\n // unspecified the zero address is used\n //overrides.from = AddressZero;\n }\n // Wait for all dependencies to be resolved (prefer the signer over the provider)\n const resolved = yield resolveProperties({\n args: resolveAddresses(contract.signer || contract.provider, args, fragment.inputs),\n address: contract.resolvedAddress,\n overrides: (resolveProperties(overrides) || {})\n });\n // The ABI coded transaction\n const data = contract.interface.encodeFunctionData(fragment, resolved.args);\n const tx = {\n data: data,\n to: resolved.address\n };\n // Resolved Overrides\n const ro = resolved.overrides;\n // Populate simple overrides\n if (ro.nonce != null) {\n tx.nonce = BigNumber.from(ro.nonce).toNumber();\n }\n if (ro.gasLimit != null) {\n tx.gasLimit = BigNumber.from(ro.gasLimit);\n }\n if (ro.gasPrice != null) {\n tx.gasPrice = BigNumber.from(ro.gasPrice);\n }\n if (ro.maxFeePerGas != null) {\n tx.maxFeePerGas = BigNumber.from(ro.maxFeePerGas);\n }\n if (ro.maxPriorityFeePerGas != null) {\n tx.maxPriorityFeePerGas = BigNumber.from(ro.maxPriorityFeePerGas);\n }\n if (ro.from != null) {\n tx.from = ro.from;\n }\n if (ro.type != null) {\n tx.type = ro.type;\n }\n if (ro.accessList != null) {\n tx.accessList = accessListify(ro.accessList);\n }\n // If there was no \"gasLimit\" override, but the ABI specifies a default, use it\n if (tx.gasLimit == null && fragment.gas != null) {\n // Compute the intrinsic gas cost for this transaction\n // @TODO: This is based on the yellow paper as of Petersburg; this is something\n // we may wish to parameterize in v6 as part of the Network object. Since this\n // is always a non-nil to address, we can ignore G_create, but may wish to add\n // similar logic to the ContractFactory.\n let intrinsic = 21000;\n const bytes = arrayify(data);\n for (let i = 0; i < bytes.length; i++) {\n intrinsic += 4;\n if (bytes[i]) {\n intrinsic += 64;\n }\n }\n tx.gasLimit = BigNumber.from(fragment.gas).add(intrinsic);\n }\n // Populate \"value\" override\n if (ro.value) {\n const roValue = BigNumber.from(ro.value);\n if (!roValue.isZero() && !fragment.payable) {\n logger.throwError(\"non-payable method cannot override value\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"overrides.value\",\n value: overrides.value\n });\n }\n tx.value = roValue;\n }\n if (ro.customData) {\n tx.customData = shallowCopy(ro.customData);\n }\n if (ro.ccipReadEnabled) {\n tx.ccipReadEnabled = !!ro.ccipReadEnabled;\n }\n // Remove the overrides\n delete overrides.nonce;\n delete overrides.gasLimit;\n delete overrides.gasPrice;\n delete overrides.from;\n delete overrides.value;\n delete overrides.type;\n delete overrides.accessList;\n delete overrides.maxFeePerGas;\n delete overrides.maxPriorityFeePerGas;\n delete overrides.customData;\n delete overrides.ccipReadEnabled;\n // Make sure there are no stray overrides, which may indicate a\n // typo or using an unsupported key.\n const leftovers = Object.keys(overrides).filter((key) => (overrides[key] != null));\n if (leftovers.length) {\n logger.throwError(`cannot override ${leftovers.map((l) => JSON.stringify(l)).join(\",\")}`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"overrides\",\n overrides: leftovers\n });\n }\n return tx;\n });\n}\nfunction buildPopulate(contract, fragment) {\n return function (...args) {\n return populateTransaction(contract, fragment, args);\n };\n}\nfunction buildEstimate(contract, fragment) {\n const signerOrProvider = (contract.signer || contract.provider);\n return function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!signerOrProvider) {\n logger.throwError(\"estimate require a provider or signer\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"estimateGas\"\n });\n }\n const tx = yield populateTransaction(contract, fragment, args);\n return yield signerOrProvider.estimateGas(tx);\n });\n };\n}\nfunction addContractWait(contract, tx) {\n const wait = tx.wait.bind(tx);\n tx.wait = (confirmations) => {\n return wait(confirmations).then((receipt) => {\n receipt.events = receipt.logs.map((log) => {\n let event = deepCopy(log);\n let parsed = null;\n try {\n parsed = contract.interface.parseLog(log);\n }\n catch (e) { }\n // Successfully parsed the event log; include it\n if (parsed) {\n event.args = parsed.args;\n event.decode = (data, topics) => {\n return contract.interface.decodeEventLog(parsed.eventFragment, data, topics);\n };\n event.event = parsed.name;\n event.eventSignature = parsed.signature;\n }\n // Useful operations\n event.removeListener = () => { return contract.provider; };\n event.getBlock = () => {\n return contract.provider.getBlock(receipt.blockHash);\n };\n event.getTransaction = () => {\n return contract.provider.getTransaction(receipt.transactionHash);\n };\n event.getTransactionReceipt = () => {\n return Promise.resolve(receipt);\n };\n return event;\n });\n return receipt;\n });\n };\n}\nfunction buildCall(contract, fragment, collapseSimple) {\n const signerOrProvider = (contract.signer || contract.provider);\n return function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n // Extract the \"blockTag\" override if present\n let blockTag = undefined;\n if (args.length === fragment.inputs.length + 1 && typeof (args[args.length - 1]) === \"object\") {\n const overrides = shallowCopy(args.pop());\n if (overrides.blockTag != null) {\n blockTag = yield overrides.blockTag;\n }\n delete overrides.blockTag;\n args.push(overrides);\n }\n // If the contract was just deployed, wait until it is mined\n if (contract.deployTransaction != null) {\n yield contract._deployed(blockTag);\n }\n // Call a node and get the result\n const tx = yield populateTransaction(contract, fragment, args);\n const result = yield signerOrProvider.call(tx, blockTag);\n try {\n let value = contract.interface.decodeFunctionResult(fragment, result);\n if (collapseSimple && fragment.outputs.length === 1) {\n value = value[0];\n }\n return value;\n }\n catch (error) {\n if (error.code === Logger.errors.CALL_EXCEPTION) {\n error.address = contract.address;\n error.args = args;\n error.transaction = tx;\n }\n throw error;\n }\n });\n };\n}\nfunction buildSend(contract, fragment) {\n return function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!contract.signer) {\n logger.throwError(\"sending a transaction requires a signer\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"sendTransaction\"\n });\n }\n // If the contract was just deployed, wait until it is mined\n if (contract.deployTransaction != null) {\n yield contract._deployed();\n }\n const txRequest = yield populateTransaction(contract, fragment, args);\n const tx = yield contract.signer.sendTransaction(txRequest);\n // Tweak the tx.wait so the receipt has extra properties\n addContractWait(contract, tx);\n return tx;\n });\n };\n}\nfunction buildDefault(contract, fragment, collapseSimple) {\n if (fragment.constant) {\n return buildCall(contract, fragment, collapseSimple);\n }\n return buildSend(contract, fragment);\n}\nfunction getEventTag(filter) {\n if (filter.address && (filter.topics == null || filter.topics.length === 0)) {\n return \"*\";\n }\n return (filter.address || \"*\") + \"@\" + (filter.topics ? filter.topics.map((topic) => {\n if (Array.isArray(topic)) {\n return topic.join(\"|\");\n }\n return topic;\n }).join(\":\") : \"\");\n}\nclass RunningEvent {\n constructor(tag, filter) {\n defineReadOnly(this, \"tag\", tag);\n defineReadOnly(this, \"filter\", filter);\n this._listeners = [];\n }\n addListener(listener, once) {\n this._listeners.push({ listener: listener, once: once });\n }\n removeListener(listener) {\n let done = false;\n this._listeners = this._listeners.filter((item) => {\n if (done || item.listener !== listener) {\n return true;\n }\n done = true;\n return false;\n });\n }\n removeAllListeners() {\n this._listeners = [];\n }\n listeners() {\n return this._listeners.map((i) => i.listener);\n }\n listenerCount() {\n return this._listeners.length;\n }\n run(args) {\n const listenerCount = this.listenerCount();\n this._listeners = this._listeners.filter((item) => {\n const argsCopy = args.slice();\n // Call the callback in the next event loop\n setTimeout(() => {\n item.listener.apply(this, argsCopy);\n }, 0);\n // Reschedule it if it not \"once\"\n return !(item.once);\n });\n return listenerCount;\n }\n prepareEvent(event) {\n }\n // Returns the array that will be applied to an emit\n getEmit(event) {\n return [event];\n }\n}\nclass ErrorRunningEvent extends RunningEvent {\n constructor() {\n super(\"error\", null);\n }\n}\n// @TODO Fragment should inherit Wildcard? and just override getEmit?\n// or have a common abstract super class, with enough constructor\n// options to configure both.\n// A Fragment Event will populate all the properties that Wildcard\n// will, and additionally dereference the arguments when emitting\nclass FragmentRunningEvent extends RunningEvent {\n constructor(address, contractInterface, fragment, topics) {\n const filter = {\n address: address\n };\n let topic = contractInterface.getEventTopic(fragment);\n if (topics) {\n if (topic !== topics[0]) {\n logger.throwArgumentError(\"topic mismatch\", \"topics\", topics);\n }\n filter.topics = topics.slice();\n }\n else {\n filter.topics = [topic];\n }\n super(getEventTag(filter), filter);\n defineReadOnly(this, \"address\", address);\n defineReadOnly(this, \"interface\", contractInterface);\n defineReadOnly(this, \"fragment\", fragment);\n }\n prepareEvent(event) {\n super.prepareEvent(event);\n event.event = this.fragment.name;\n event.eventSignature = this.fragment.format();\n event.decode = (data, topics) => {\n return this.interface.decodeEventLog(this.fragment, data, topics);\n };\n try {\n event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);\n }\n catch (error) {\n event.args = null;\n event.decodeError = error;\n }\n }\n getEmit(event) {\n const errors = checkResultErrors(event.args);\n if (errors.length) {\n throw errors[0].error;\n }\n const args = (event.args || []).slice();\n args.push(event);\n return args;\n }\n}\n// A Wildcard Event will attempt to populate:\n// - event The name of the event name\n// - eventSignature The full signature of the event\n// - decode A function to decode data and topics\n// - args The decoded data and topics\nclass WildcardRunningEvent extends RunningEvent {\n constructor(address, contractInterface) {\n super(\"*\", { address: address });\n defineReadOnly(this, \"address\", address);\n defineReadOnly(this, \"interface\", contractInterface);\n }\n prepareEvent(event) {\n super.prepareEvent(event);\n try {\n const parsed = this.interface.parseLog(event);\n event.event = parsed.name;\n event.eventSignature = parsed.signature;\n event.decode = (data, topics) => {\n return this.interface.decodeEventLog(parsed.eventFragment, data, topics);\n };\n event.args = parsed.args;\n }\n catch (error) {\n // No matching event\n }\n }\n}\nexport class BaseContract {\n constructor(addressOrName, contractInterface, signerOrProvider) {\n // @TODO: Maybe still check the addressOrName looks like a valid address or name?\n //address = getAddress(address);\n defineReadOnly(this, \"interface\", getStatic(new.target, \"getInterface\")(contractInterface));\n if (signerOrProvider == null) {\n defineReadOnly(this, \"provider\", null);\n defineReadOnly(this, \"signer\", null);\n }\n else if (Signer.isSigner(signerOrProvider)) {\n defineReadOnly(this, \"provider\", signerOrProvider.provider || null);\n defineReadOnly(this, \"signer\", signerOrProvider);\n }\n else if (Provider.isProvider(signerOrProvider)) {\n defineReadOnly(this, \"provider\", signerOrProvider);\n defineReadOnly(this, \"signer\", null);\n }\n else {\n logger.throwArgumentError(\"invalid signer or provider\", \"signerOrProvider\", signerOrProvider);\n }\n defineReadOnly(this, \"callStatic\", {});\n defineReadOnly(this, \"estimateGas\", {});\n defineReadOnly(this, \"functions\", {});\n defineReadOnly(this, \"populateTransaction\", {});\n defineReadOnly(this, \"filters\", {});\n {\n const uniqueFilters = {};\n Object.keys(this.interface.events).forEach((eventSignature) => {\n const event = this.interface.events[eventSignature];\n defineReadOnly(this.filters, eventSignature, (...args) => {\n return {\n address: this.address,\n topics: this.interface.encodeFilterTopics(event, args)\n };\n });\n if (!uniqueFilters[event.name]) {\n uniqueFilters[event.name] = [];\n }\n uniqueFilters[event.name].push(eventSignature);\n });\n Object.keys(uniqueFilters).forEach((name) => {\n const filters = uniqueFilters[name];\n if (filters.length === 1) {\n defineReadOnly(this.filters, name, this.filters[filters[0]]);\n }\n else {\n logger.warn(`Duplicate definition of ${name} (${filters.join(\", \")})`);\n }\n });\n }\n defineReadOnly(this, \"_runningEvents\", {});\n defineReadOnly(this, \"_wrappedEmits\", {});\n if (addressOrName == null) {\n logger.throwArgumentError(\"invalid contract address or ENS name\", \"addressOrName\", addressOrName);\n }\n defineReadOnly(this, \"address\", addressOrName);\n if (this.provider) {\n defineReadOnly(this, \"resolvedAddress\", resolveName(this.provider, addressOrName));\n }\n else {\n try {\n defineReadOnly(this, \"resolvedAddress\", Promise.resolve(getAddress(addressOrName)));\n }\n catch (error) {\n // Without a provider, we cannot use ENS names\n logger.throwError(\"provider is required to use ENS name as contract address\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new Contract\"\n });\n }\n }\n // Swallow bad ENS names to prevent Unhandled Exceptions\n this.resolvedAddress.catch((e) => { });\n const uniqueNames = {};\n const uniqueSignatures = {};\n Object.keys(this.interface.functions).forEach((signature) => {\n const fragment = this.interface.functions[signature];\n // Check that the signature is unique; if not the ABI generation has\n // not been cleaned or may be incorrectly generated\n if (uniqueSignatures[signature]) {\n logger.warn(`Duplicate ABI entry for ${JSON.stringify(signature)}`);\n return;\n }\n uniqueSignatures[signature] = true;\n // Track unique names; we only expose bare named functions if they\n // are ambiguous\n {\n const name = fragment.name;\n if (!uniqueNames[`%${name}`]) {\n uniqueNames[`%${name}`] = [];\n }\n uniqueNames[`%${name}`].push(signature);\n }\n if (this[signature] == null) {\n defineReadOnly(this, signature, buildDefault(this, fragment, true));\n }\n // We do not collapse simple calls on this bucket, which allows\n // frameworks to safely use this without introspection as well as\n // allows decoding error recovery.\n if (this.functions[signature] == null) {\n defineReadOnly(this.functions, signature, buildDefault(this, fragment, false));\n }\n if (this.callStatic[signature] == null) {\n defineReadOnly(this.callStatic, signature, buildCall(this, fragment, true));\n }\n if (this.populateTransaction[signature] == null) {\n defineReadOnly(this.populateTransaction, signature, buildPopulate(this, fragment));\n }\n if (this.estimateGas[signature] == null) {\n defineReadOnly(this.estimateGas, signature, buildEstimate(this, fragment));\n }\n });\n Object.keys(uniqueNames).forEach((name) => {\n // Ambiguous names to not get attached as bare names\n const signatures = uniqueNames[name];\n if (signatures.length > 1) {\n return;\n }\n // Strip off the leading \"%\" used for prototype protection\n name = name.substring(1);\n const signature = signatures[0];\n // If overwriting a member property that is null, swallow the error\n try {\n if (this[name] == null) {\n defineReadOnly(this, name, this[signature]);\n }\n }\n catch (e) { }\n if (this.functions[name] == null) {\n defineReadOnly(this.functions, name, this.functions[signature]);\n }\n if (this.callStatic[name] == null) {\n defineReadOnly(this.callStatic, name, this.callStatic[signature]);\n }\n if (this.populateTransaction[name] == null) {\n defineReadOnly(this.populateTransaction, name, this.populateTransaction[signature]);\n }\n if (this.estimateGas[name] == null) {\n defineReadOnly(this.estimateGas, name, this.estimateGas[signature]);\n }\n });\n }\n static getContractAddress(transaction) {\n return getContractAddress(transaction);\n }\n static getInterface(contractInterface) {\n if (Interface.isInterface(contractInterface)) {\n return contractInterface;\n }\n return new Interface(contractInterface);\n }\n // @TODO: Allow timeout?\n deployed() {\n return this._deployed();\n }\n _deployed(blockTag) {\n if (!this._deployedPromise) {\n // If we were just deployed, we know the transaction we should occur in\n if (this.deployTransaction) {\n this._deployedPromise = this.deployTransaction.wait().then(() => {\n return this;\n });\n }\n else {\n // @TODO: Once we allow a timeout to be passed in, we will wait\n // up to that many blocks for getCode\n // Otherwise, poll for our code to be deployed\n this._deployedPromise = this.provider.getCode(this.address, blockTag).then((code) => {\n if (code === \"0x\") {\n logger.throwError(\"contract not deployed\", Logger.errors.UNSUPPORTED_OPERATION, {\n contractAddress: this.address,\n operation: \"getDeployed\"\n });\n }\n return this;\n });\n }\n }\n return this._deployedPromise;\n }\n // @TODO:\n // estimateFallback(overrides?: TransactionRequest): Promise<BigNumber>\n // @TODO:\n // estimateDeploy(bytecode: string, ...args): Promise<BigNumber>\n fallback(overrides) {\n if (!this.signer) {\n logger.throwError(\"sending a transactions require a signer\", Logger.errors.UNSUPPORTED_OPERATION, { operation: \"sendTransaction(fallback)\" });\n }\n const tx = shallowCopy(overrides || {});\n [\"from\", \"to\"].forEach(function (key) {\n if (tx[key] == null) {\n return;\n }\n logger.throwError(\"cannot override \" + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });\n });\n tx.to = this.resolvedAddress;\n return this.deployed().then(() => {\n return this.signer.sendTransaction(tx);\n });\n }\n // Reconnect to a different signer or provider\n connect(signerOrProvider) {\n if (typeof (signerOrProvider) === \"string\") {\n signerOrProvider = new VoidSigner(signerOrProvider, this.provider);\n }\n const contract = new (this.constructor)(this.address, this.interface, signerOrProvider);\n if (this.deployTransaction) {\n defineReadOnly(contract, \"deployTransaction\", this.deployTransaction);\n }\n return contract;\n }\n // Re-attach to a different on-chain instance of this contract\n attach(addressOrName) {\n return new (this.constructor)(addressOrName, this.interface, this.signer || this.provider);\n }\n static isIndexed(value) {\n return Indexed.isIndexed(value);\n }\n _normalizeRunningEvent(runningEvent) {\n // Already have an instance of this event running; we can re-use it\n if (this._runningEvents[runningEvent.tag]) {\n return this._runningEvents[runningEvent.tag];\n }\n return runningEvent;\n }\n _getRunningEvent(eventName) {\n if (typeof (eventName) === \"string\") {\n // Listen for \"error\" events (if your contract has an error event, include\n // the full signature to bypass this special event keyword)\n if (eventName === \"error\") {\n return this._normalizeRunningEvent(new ErrorRunningEvent());\n }\n // Listen for any event that is registered\n if (eventName === \"event\") {\n return this._normalizeRunningEvent(new RunningEvent(\"event\", null));\n }\n // Listen for any event\n if (eventName === \"*\") {\n return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));\n }\n // Get the event Fragment (throws if ambiguous/unknown event)\n const fragment = this.interface.getEvent(eventName);\n return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));\n }\n // We have topics to filter by...\n if (eventName.topics && eventName.topics.length > 0) {\n // Is it a known topichash? (throws if no matching topichash)\n try {\n const topic = eventName.topics[0];\n if (typeof (topic) !== \"string\") {\n throw new Error(\"invalid topic\"); // @TODO: May happen for anonymous events\n }\n const fragment = this.interface.getEvent(topic);\n return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));\n }\n catch (error) { }\n // Filter by the unknown topichash\n const filter = {\n address: this.address,\n topics: eventName.topics\n };\n return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));\n }\n return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));\n }\n _checkRunningEvents(runningEvent) {\n if (runningEvent.listenerCount() === 0) {\n delete this._runningEvents[runningEvent.tag];\n // If we have a poller for this, remove it\n const emit = this._wrappedEmits[runningEvent.tag];\n if (emit && runningEvent.filter) {\n this.provider.off(runningEvent.filter, emit);\n delete this._wrappedEmits[runningEvent.tag];\n }\n }\n }\n // Subclasses can override this to gracefully recover\n // from parse errors if they wish\n _wrapEvent(runningEvent, log, listener) {\n const event = deepCopy(log);\n event.removeListener = () => {\n if (!listener) {\n return;\n }\n runningEvent.removeListener(listener);\n this._checkRunningEvents(runningEvent);\n };\n event.getBlock = () => { return this.provider.getBlock(log.blockHash); };\n event.getTransaction = () => { return this.provider.getTransaction(log.transactionHash); };\n event.getTransactionReceipt = () => { return this.provider.getTransactionReceipt(log.transactionHash); };\n // This may throw if the topics and data mismatch the signature\n runningEvent.prepareEvent(event);\n return event;\n }\n _addEventListener(runningEvent, listener, once) {\n if (!this.provider) {\n logger.throwError(\"events require a provider or a signer with a provider\", Logger.errors.UNSUPPORTED_OPERATION, { operation: \"once\" });\n }\n runningEvent.addListener(listener, once);\n // Track this running event and its listeners (may already be there; but no hard in updating)\n this._runningEvents[runningEvent.tag] = runningEvent;\n // If we are not polling the provider, start polling\n if (!this._wrappedEmits[runningEvent.tag]) {\n const wrappedEmit = (log) => {\n let event = this._wrapEvent(runningEvent, log, listener);\n // Try to emit the result for the parameterized event...\n if (event.decodeError == null) {\n try {\n const args = runningEvent.getEmit(event);\n this.emit(runningEvent.filter, ...args);\n }\n catch (error) {\n event.decodeError = error.error;\n }\n }\n // Always emit \"event\" for fragment-base events\n if (runningEvent.filter != null) {\n this.emit(\"event\", event);\n }\n // Emit \"error\" if there was an error\n if (event.decodeError != null) {\n this.emit(\"error\", event.decodeError, event);\n }\n };\n this._wrappedEmits[runningEvent.tag] = wrappedEmit;\n // Special events, like \"error\" do not have a filter\n if (runningEvent.filter != null) {\n this.provider.on(runningEvent.filter, wrappedEmit);\n }\n }\n }\n queryFilter(event, fromBlockOrBlockhash, toBlock) {\n const runningEvent = this._getRunningEvent(event);\n const filter = shallowCopy(runningEvent.filter);\n if (typeof (fromBlockOrBlockhash) === \"string\" && isHexString(fromBlockOrBlockhash, 32)) {\n if (toBlock != null) {\n logger.throwArgumentError(\"cannot specify toBlock with blockhash\", \"toBlock\", toBlock);\n }\n filter.blockHash = fromBlockOrBlockhash;\n }\n else {\n filter.fromBlock = ((fromBlockOrBlockhash != null) ? fromBlockOrBlockhash : 0);\n filter.toBlock = ((toBlock != null) ? toBlock : \"latest\");\n }\n return this.provider.getLogs(filter).then((logs) => {\n return logs.map((log) => this._wrapEvent(runningEvent, log, null));\n });\n }\n on(event, listener) {\n this._addEventListener(this._getRunningEvent(event), listener, false);\n return this;\n }\n once(event, listener) {\n this._addEventListener(this._getRunningEvent(event), listener, true);\n return this;\n }\n emit(eventName, ...args) {\n if (!this.provider) {\n return false;\n }\n const runningEvent = this._getRunningEvent(eventName);\n const result = (runningEvent.run(args) > 0);\n // May have drained all the \"once\" events; check for living events\n this._checkRunningEvents(runningEvent);\n return result;\n }\n listenerCount(eventName) {\n if (!this.provider) {\n return 0;\n }\n if (eventName == null) {\n return Object.keys(this._runningEvents).reduce((accum, key) => {\n return accum + this._runningEvents[key].listenerCount();\n }, 0);\n }\n return this._getRunningEvent(eventName).listenerCount();\n }\n listeners(eventName) {\n if (!this.provider) {\n return [];\n }\n if (eventName == null) {\n const result = [];\n for (let tag in this._runningEvents) {\n this._runningEvents[tag].listeners().forEach((listener) => {\n result.push(listener);\n });\n }\n return result;\n }\n return this._getRunningEvent(eventName).listeners();\n }\n removeAllListeners(eventName) {\n if (!this.provider) {\n return this;\n }\n if (eventName == null) {\n for (const tag in this._runningEvents) {\n const runningEvent = this._runningEvents[tag];\n runningEvent.removeAllListeners();\n this._checkRunningEvents(runningEvent);\n }\n return this;\n }\n // Delete any listeners\n const runningEvent = this._getRunningEvent(eventName);\n runningEvent.removeAllListeners();\n this._checkRunningEvents(runningEvent);\n return this;\n }\n off(eventName, listener) {\n if (!this.provider) {\n return this;\n }\n const runningEvent = this._getRunningEvent(eventName);\n runningEvent.removeListener(listener);\n this._checkRunningEvents(runningEvent);\n return this;\n }\n removeListener(eventName, listener) {\n return this.off(eventName, listener);\n }\n}\nexport class Contract extends BaseContract {\n}\nexport class ContractFactory {\n constructor(contractInterface, bytecode, signer) {\n let bytecodeHex = null;\n if (typeof (bytecode) === \"string\") {\n bytecodeHex = bytecode;\n }\n else if (isBytes(bytecode)) {\n bytecodeHex = hexlify(bytecode);\n }\n else if (bytecode && typeof (bytecode.object) === \"string\") {\n // Allow the bytecode object from the Solidity compiler\n bytecodeHex = bytecode.object;\n }\n else {\n // Crash in the next verification step\n bytecodeHex = \"!\";\n }\n // Make sure it is 0x prefixed\n if (bytecodeHex.substring(0, 2) !== \"0x\") {\n bytecodeHex = \"0x\" + bytecodeHex;\n }\n // Make sure the final result is valid bytecode\n if (!isHexString(bytecodeHex) || (bytecodeHex.length % 2)) {\n logger.throwArgumentError(\"invalid bytecode\", \"bytecode\", bytecode);\n }\n // If we have a signer, make sure it is valid\n if (signer && !Signer.isSigner(signer)) {\n logger.throwArgumentError(\"invalid signer\", \"signer\", signer);\n }\n defineReadOnly(this, \"bytecode\", bytecodeHex);\n defineReadOnly(this, \"interface\", getStatic(new.target, \"getInterface\")(contractInterface));\n defineReadOnly(this, \"signer\", signer || null);\n }\n // @TODO: Future; rename to populateTransaction?\n getDeployTransaction(...args) {\n let tx = {};\n // If we have 1 additional argument, we allow transaction overrides\n if (args.length === this.interface.deploy.inputs.length + 1 && typeof (args[args.length - 1]) === \"object\") {\n tx = shallowCopy(args.pop());\n for (const key in tx) {\n if (!allowedTransactionKeys[key]) {\n throw new Error(\"unknown transaction override \" + key);\n }\n }\n }\n // Do not allow these to be overridden in a deployment transaction\n [\"data\", \"from\", \"to\"].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n logger.throwError(\"cannot override \" + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });\n });\n if (tx.value) {\n const value = BigNumber.from(tx.value);\n if (!value.isZero() && !this.interface.deploy.payable) {\n logger.throwError(\"non-payable constructor cannot override value\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"overrides.value\",\n value: tx.value\n });\n }\n }\n // Make sure the call matches the constructor signature\n logger.checkArgumentCount(args.length, this.interface.deploy.inputs.length, \" in Contract constructor\");\n // Set the data to the bytecode + the encoded constructor arguments\n tx.data = hexlify(concat([\n this.bytecode,\n this.interface.encodeDeploy(args)\n ]));\n return tx;\n }\n deploy(...args) {\n return __awaiter(this, void 0, void 0, function* () {\n let overrides = {};\n // If 1 extra parameter was passed in, it contains overrides\n if (args.length === this.interface.deploy.inputs.length + 1) {\n overrides = args.pop();\n }\n // Make sure the call matches the constructor signature\n logger.checkArgumentCount(args.length, this.interface.deploy.inputs.length, \" in Contract constructor\");\n // Resolve ENS names and promises in the arguments\n const params = yield resolveAddresses(this.signer, args, this.interface.deploy.inputs);\n params.push(overrides);\n // Get the deployment transaction (with optional overrides)\n const unsignedTx = this.getDeployTransaction(...params);\n // Send the deployment transaction\n const tx = yield this.signer.sendTransaction(unsignedTx);\n const address = getStatic(this.constructor, \"getContractAddress\")(tx);\n const contract = getStatic(this.constructor, \"getContract\")(address, this.interface, this.signer);\n // Add the modified wait that wraps events\n addContractWait(contract, tx);\n defineReadOnly(contract, \"deployTransaction\", tx);\n return contract;\n });\n }\n attach(address) {\n return (this.constructor).getContract(address, this.interface, this.signer);\n }\n connect(signer) {\n return new (this.constructor)(this.interface, this.bytecode, signer);\n }\n static fromSolidity(compilerOutput, signer) {\n if (compilerOutput == null) {\n logger.throwError(\"missing compiler output\", Logger.errors.MISSING_ARGUMENT, { argument: \"compilerOutput\" });\n }\n if (typeof (compilerOutput) === \"string\") {\n compilerOutput = JSON.parse(compilerOutput);\n }\n const abi = compilerOutput.abi;\n let bytecode = null;\n if (compilerOutput.bytecode) {\n bytecode = compilerOutput.bytecode;\n }\n else if (compilerOutput.evm && compilerOutput.evm.bytecode) {\n bytecode = compilerOutput.evm.bytecode;\n }\n return new this(abi, bytecode, signer);\n }\n static getInterface(contractInterface) {\n return Contract.getInterface(contractInterface);\n }\n static getContractAddress(tx) {\n return getContractAddress(tx);\n }\n static getContract(address, contractInterface, signer) {\n return new Contract(address, contractInterface, signer);\n }\n}\n//# sourceMappingURL=index.js.map","export const version = \"contracts/5.7.0\";\n//# sourceMappingURL=_version.js.map","/**\n * var basex = require(\"base-x\");\n *\n * This implementation is heavily based on base-x. The main reason to\n * deviate was to prevent the dependency of Buffer.\n *\n * Contributors:\n *\n * base-x encoding\n * Forked from https://github.com/cryptocoinjs/bs58\n * Originally written by Mike Hearn for BitcoinJ\n * Copyright (c) 2011 Google Inc\n * Ported to JavaScript by Stefan Thomas\n * Merged Buffer refactorings from base58-native by Stephen Pair\n * Copyright (c) 2013 BitPay Inc\n *\n * The MIT License (MIT)\n *\n * Copyright base-x contributors (c) 2016\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n *\n */\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nexport class BaseX {\n constructor(alphabet) {\n defineReadOnly(this, \"alphabet\", alphabet);\n defineReadOnly(this, \"base\", alphabet.length);\n defineReadOnly(this, \"_alphabetMap\", {});\n defineReadOnly(this, \"_leader\", alphabet.charAt(0));\n // pre-compute lookup table\n for (let i = 0; i < alphabet.length; i++) {\n this._alphabetMap[alphabet.charAt(i)] = i;\n }\n }\n encode(value) {\n let source = arrayify(value);\n if (source.length === 0) {\n return \"\";\n }\n let digits = [0];\n for (let i = 0; i < source.length; ++i) {\n let carry = source[i];\n for (let j = 0; j < digits.length; ++j) {\n carry += digits[j] << 8;\n digits[j] = carry % this.base;\n carry = (carry / this.base) | 0;\n }\n while (carry > 0) {\n digits.push(carry % this.base);\n carry = (carry / this.base) | 0;\n }\n }\n let string = \"\";\n // deal with leading zeros\n for (let k = 0; source[k] === 0 && k < source.length - 1; ++k) {\n string += this._leader;\n }\n // convert digits to a string\n for (let q = digits.length - 1; q >= 0; --q) {\n string += this.alphabet[digits[q]];\n }\n return string;\n }\n decode(value) {\n if (typeof (value) !== \"string\") {\n throw new TypeError(\"Expected String\");\n }\n let bytes = [];\n if (value.length === 0) {\n return new Uint8Array(bytes);\n }\n bytes.push(0);\n for (let i = 0; i < value.length; i++) {\n let byte = this._alphabetMap[value[i]];\n if (byte === undefined) {\n throw new Error(\"Non-base\" + this.base + \" character\");\n }\n let carry = byte;\n for (let j = 0; j < bytes.length; ++j) {\n carry += bytes[j] * this.base;\n bytes[j] = carry & 0xff;\n carry >>= 8;\n }\n while (carry > 0) {\n bytes.push(carry & 0xff);\n carry >>= 8;\n }\n }\n // deal with leading zeros\n for (let k = 0; value[k] === this._leader && k < value.length - 1; ++k) {\n bytes.push(0);\n }\n return arrayify(new Uint8Array(bytes.reverse()));\n }\n}\nconst Base32 = new BaseX(\"abcdefghijklmnopqrstuvwxyz234567\");\nconst Base58 = new BaseX(\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\");\nexport { Base32, Base58 };\n//console.log(Base58.decode(\"Qmd2V777o5XvJbYMeMb8k2nU5f8d3ciUQ5YpYuWhzv8iDj\"))\n//console.log(Base58.encode(Base58.decode(\"Qmd2V777o5XvJbYMeMb8k2nU5f8d3ciUQ5YpYuWhzv8iDj\")))\n//# sourceMappingURL=index.js.map","export var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\n;\n//# sourceMappingURL=types.js.map","export const version = \"sha2/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport hash from \"hash.js\";\n//const _ripemd160 = _hash.ripemd160;\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { SupportedAlgorithm } from \"./types\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport function ripemd160(data) {\n return \"0x\" + (hash.ripemd160().update(arrayify(data)).digest(\"hex\"));\n}\nexport function sha256(data) {\n return \"0x\" + (hash.sha256().update(arrayify(data)).digest(\"hex\"));\n}\nexport function sha512(data) {\n return \"0x\" + (hash.sha512().update(arrayify(data)).digest(\"hex\"));\n}\nexport function computeHmac(algorithm, key, data) {\n if (!SupportedAlgorithm[algorithm]) {\n logger.throwError(\"unsupported algorithm \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"hmac\",\n algorithm: algorithm\n });\n }\n return \"0x\" + hash.hmac(hash[algorithm], arrayify(key)).update(arrayify(data)).digest(\"hex\");\n}\n//# sourceMappingURL=sha2.js.map","\"use strict\";\nimport { arrayify, hexlify } from \"@ethersproject/bytes\";\nimport { computeHmac } from \"@ethersproject/sha2\";\nexport function pbkdf2(password, salt, iterations, keylen, hashAlgorithm) {\n password = arrayify(password);\n salt = arrayify(salt);\n let hLen;\n let l = 1;\n const DK = new Uint8Array(keylen);\n const block1 = new Uint8Array(salt.length + 4);\n block1.set(salt);\n //salt.copy(block1, 0, 0, salt.length)\n let r;\n let T;\n for (let i = 1; i <= l; i++) {\n //block1.writeUInt32BE(i, salt.length)\n block1[salt.length] = (i >> 24) & 0xff;\n block1[salt.length + 1] = (i >> 16) & 0xff;\n block1[salt.length + 2] = (i >> 8) & 0xff;\n block1[salt.length + 3] = i & 0xff;\n //let U = createHmac(password).update(block1).digest();\n let U = arrayify(computeHmac(hashAlgorithm, password, block1));\n if (!hLen) {\n hLen = U.length;\n T = new Uint8Array(hLen);\n l = Math.ceil(keylen / hLen);\n r = keylen - (l - 1) * hLen;\n }\n //U.copy(T, 0, 0, hLen)\n T.set(U);\n for (let j = 1; j < iterations; j++) {\n //U = createHmac(password).update(U).digest();\n U = arrayify(computeHmac(hashAlgorithm, password, U));\n for (let k = 0; k < hLen; k++)\n T[k] ^= U[k];\n }\n const destPos = (i - 1) * hLen;\n const len = (i === l ? r : hLen);\n //T.copy(DK, destPos, 0, len)\n DK.set(arrayify(T).slice(0, len), destPos);\n }\n return hexlify(DK);\n}\n//# sourceMappingURL=pbkdf2.js.map","export const version = \"wordlists/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\n// This gets overridden by rollup\nconst exportWordlist = false;\nimport { id } from \"@ethersproject/hash\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nexport const logger = new Logger(version);\nexport class Wordlist {\n constructor(locale) {\n logger.checkAbstract(new.target, Wordlist);\n defineReadOnly(this, \"locale\", locale);\n }\n // Subclasses may override this\n split(mnemonic) {\n return mnemonic.toLowerCase().split(/ +/g);\n }\n // Subclasses may override this\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n static register(lang, name) {\n if (!name) {\n name = lang.locale;\n }\n /* istanbul ignore if */\n if (exportWordlist) {\n try {\n const anyGlobal = window;\n if (anyGlobal._ethers && anyGlobal._ethers.wordlists) {\n if (!anyGlobal._ethers.wordlists[name]) {\n defineReadOnly(anyGlobal._ethers.wordlists, name, lang);\n }\n }\n }\n catch (error) { }\n }\n }\n}\n//# sourceMappingURL=wordlist.js.map","\"use strict\";\nimport { Wordlist } from \"./wordlist\";\nconst words = \"AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo\";\nlet wordlist = null;\nfunction loadWords(lang) {\n if (wordlist != null) {\n return;\n }\n wordlist = words.replace(/([A-Z])/g, \" $1\").toLowerCase().substring(1).split(\" \");\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n if (Wordlist.check(lang) !== \"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60\") {\n wordlist = null;\n throw new Error(\"BIP39 Wordlist for en (English) FAILED\");\n }\n}\nclass LangEn extends Wordlist {\n constructor() {\n super(\"en\");\n }\n getWord(index) {\n loadWords(this);\n return wordlist[index];\n }\n getWordIndex(word) {\n loadWords(this);\n return wordlist.indexOf(word);\n }\n}\nconst langEn = new LangEn();\nWordlist.register(langEn);\nexport { langEn };\n//# sourceMappingURL=lang-en.js.map","\"use strict\";\nimport { langEn as en } from \"./lang-en\";\nexport const wordlists = {\n en: en\n};\n//# sourceMappingURL=wordlists.js.map","export const version = \"hdnode/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { Base58 } from \"@ethersproject/basex\";\nimport { arrayify, concat, hexDataSlice, hexZeroPad, hexlify } from \"@ethersproject/bytes\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { toUtf8Bytes, UnicodeNormalizationForm } from \"@ethersproject/strings\";\nimport { pbkdf2 } from \"@ethersproject/pbkdf2\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { SigningKey } from \"@ethersproject/signing-key\";\nimport { computeHmac, ripemd160, sha256, SupportedAlgorithm } from \"@ethersproject/sha2\";\nimport { computeAddress } from \"@ethersproject/transactions\";\nimport { wordlists } from \"@ethersproject/wordlists\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nconst N = BigNumber.from(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n// \"Bitcoin seed\"\nconst MasterSecret = toUtf8Bytes(\"Bitcoin seed\");\nconst HardenedBit = 0x80000000;\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits) {\n return ((1 << bits) - 1) << (8 - bits);\n}\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits) {\n return (1 << bits) - 1;\n}\nfunction bytes32(value) {\n return hexZeroPad(hexlify(value), 32);\n}\nfunction base58check(data) {\n return Base58.encode(concat([data, hexDataSlice(sha256(sha256(data)), 0, 4)]));\n}\nfunction getWordlist(wordlist) {\n if (wordlist == null) {\n return wordlists[\"en\"];\n }\n if (typeof (wordlist) === \"string\") {\n const words = wordlists[wordlist];\n if (words == null) {\n logger.throwArgumentError(\"unknown locale\", \"wordlist\", wordlist);\n }\n return words;\n }\n return wordlist;\n}\nconst _constructorGuard = {};\nexport const defaultPath = \"m/44'/60'/0'/0/0\";\n;\nexport class HDNode {\n /**\n * This constructor should not be called directly.\n *\n * Please use:\n * - fromMnemonic\n * - fromSeed\n */\n constructor(constructorGuard, privateKey, publicKey, parentFingerprint, chainCode, index, depth, mnemonicOrPath) {\n /* istanbul ignore if */\n if (constructorGuard !== _constructorGuard) {\n throw new Error(\"HDNode constructor cannot be called directly\");\n }\n if (privateKey) {\n const signingKey = new SigningKey(privateKey);\n defineReadOnly(this, \"privateKey\", signingKey.privateKey);\n defineReadOnly(this, \"publicKey\", signingKey.compressedPublicKey);\n }\n else {\n defineReadOnly(this, \"privateKey\", null);\n defineReadOnly(this, \"publicKey\", hexlify(publicKey));\n }\n defineReadOnly(this, \"parentFingerprint\", parentFingerprint);\n defineReadOnly(this, \"fingerprint\", hexDataSlice(ripemd160(sha256(this.publicKey)), 0, 4));\n defineReadOnly(this, \"address\", computeAddress(this.publicKey));\n defineReadOnly(this, \"chainCode\", chainCode);\n defineReadOnly(this, \"index\", index);\n defineReadOnly(this, \"depth\", depth);\n if (mnemonicOrPath == null) {\n // From a source that does not preserve the path (e.g. extended keys)\n defineReadOnly(this, \"mnemonic\", null);\n defineReadOnly(this, \"path\", null);\n }\n else if (typeof (mnemonicOrPath) === \"string\") {\n // From a source that does not preserve the mnemonic (e.g. neutered)\n defineReadOnly(this, \"mnemonic\", null);\n defineReadOnly(this, \"path\", mnemonicOrPath);\n }\n else {\n // From a fully qualified source\n defineReadOnly(this, \"mnemonic\", mnemonicOrPath);\n defineReadOnly(this, \"path\", mnemonicOrPath.path);\n }\n }\n get extendedKey() {\n // We only support the mainnet values for now, but if anyone needs\n // testnet values, let me know. I believe current sentiment is that\n // we should always use mainnet, and use BIP-44 to derive the network\n // - Mainnet: public=0x0488B21E, private=0x0488ADE4\n // - Testnet: public=0x043587CF, private=0x04358394\n if (this.depth >= 256) {\n throw new Error(\"Depth too large!\");\n }\n return base58check(concat([\n ((this.privateKey != null) ? \"0x0488ADE4\" : \"0x0488B21E\"),\n hexlify(this.depth),\n this.parentFingerprint,\n hexZeroPad(hexlify(this.index), 4),\n this.chainCode,\n ((this.privateKey != null) ? concat([\"0x00\", this.privateKey]) : this.publicKey),\n ]));\n }\n neuter() {\n return new HDNode(_constructorGuard, null, this.publicKey, this.parentFingerprint, this.chainCode, this.index, this.depth, this.path);\n }\n _derive(index) {\n if (index > 0xffffffff) {\n throw new Error(\"invalid index - \" + String(index));\n }\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (index & ~HardenedBit);\n }\n const data = new Uint8Array(37);\n if (index & HardenedBit) {\n if (!this.privateKey) {\n throw new Error(\"cannot derive child of neutered node\");\n }\n // Data = 0x00 || ser_256(k_par)\n data.set(arrayify(this.privateKey), 1);\n // Hardened path\n if (path) {\n path += \"'\";\n }\n }\n else {\n // Data = ser_p(point(k_par))\n data.set(arrayify(this.publicKey));\n }\n // Data += ser_32(i)\n for (let i = 24; i >= 0; i -= 8) {\n data[33 + (i >> 3)] = ((index >> (24 - i)) & 0xff);\n }\n const I = arrayify(computeHmac(SupportedAlgorithm.sha512, this.chainCode, data));\n const IL = I.slice(0, 32);\n const IR = I.slice(32);\n // The private key\n let ki = null;\n // The public key\n let Ki = null;\n if (this.privateKey) {\n ki = bytes32(BigNumber.from(IL).add(this.privateKey).mod(N));\n }\n else {\n const ek = new SigningKey(hexlify(IL));\n Ki = ek._addPoint(this.publicKey);\n }\n let mnemonicOrPath = path;\n const srcMnemonic = this.mnemonic;\n if (srcMnemonic) {\n mnemonicOrPath = Object.freeze({\n phrase: srcMnemonic.phrase,\n path: path,\n locale: (srcMnemonic.locale || \"en\")\n });\n }\n return new HDNode(_constructorGuard, ki, Ki, this.fingerprint, bytes32(IR), index, this.depth + 1, mnemonicOrPath);\n }\n derivePath(path) {\n const components = path.split(\"/\");\n if (components.length === 0 || (components[0] === \"m\" && this.depth !== 0)) {\n throw new Error(\"invalid path - \" + path);\n }\n if (components[0] === \"m\") {\n components.shift();\n }\n let result = this;\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n if (component.match(/^[0-9]+'$/)) {\n const index = parseInt(component.substring(0, component.length - 1));\n if (index >= HardenedBit) {\n throw new Error(\"invalid path index - \" + component);\n }\n result = result._derive(HardenedBit + index);\n }\n else if (component.match(/^[0-9]+$/)) {\n const index = parseInt(component);\n if (index >= HardenedBit) {\n throw new Error(\"invalid path index - \" + component);\n }\n result = result._derive(index);\n }\n else {\n throw new Error(\"invalid path component - \" + component);\n }\n }\n return result;\n }\n static _fromSeed(seed, mnemonic) {\n const seedArray = arrayify(seed);\n if (seedArray.length < 16 || seedArray.length > 64) {\n throw new Error(\"invalid seed\");\n }\n const I = arrayify(computeHmac(SupportedAlgorithm.sha512, MasterSecret, seedArray));\n return new HDNode(_constructorGuard, bytes32(I.slice(0, 32)), null, \"0x00000000\", bytes32(I.slice(32)), 0, 0, mnemonic);\n }\n static fromMnemonic(mnemonic, password, wordlist) {\n // If a locale name was passed in, find the associated wordlist\n wordlist = getWordlist(wordlist);\n // Normalize the case and spacing in the mnemonic (throws if the mnemonic is invalid)\n mnemonic = entropyToMnemonic(mnemonicToEntropy(mnemonic, wordlist), wordlist);\n return HDNode._fromSeed(mnemonicToSeed(mnemonic, password), {\n phrase: mnemonic,\n path: \"m\",\n locale: wordlist.locale\n });\n }\n static fromSeed(seed) {\n return HDNode._fromSeed(seed, null);\n }\n static fromExtendedKey(extendedKey) {\n const bytes = Base58.decode(extendedKey);\n if (bytes.length !== 82 || base58check(bytes.slice(0, 78)) !== extendedKey) {\n logger.throwArgumentError(\"invalid extended key\", \"extendedKey\", \"[REDACTED]\");\n }\n const depth = bytes[4];\n const parentFingerprint = hexlify(bytes.slice(5, 9));\n const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16);\n const chainCode = hexlify(bytes.slice(13, 45));\n const key = bytes.slice(45, 78);\n switch (hexlify(bytes.slice(0, 4))) {\n // Public Key\n case \"0x0488b21e\":\n case \"0x043587cf\":\n return new HDNode(_constructorGuard, null, hexlify(key), parentFingerprint, chainCode, index, depth, null);\n // Private Key\n case \"0x0488ade4\":\n case \"0x04358394 \":\n if (key[0] !== 0) {\n break;\n }\n return new HDNode(_constructorGuard, hexlify(key.slice(1)), null, parentFingerprint, chainCode, index, depth, null);\n }\n return logger.throwArgumentError(\"invalid extended key\", \"extendedKey\", \"[REDACTED]\");\n }\n}\nexport function mnemonicToSeed(mnemonic, password) {\n if (!password) {\n password = \"\";\n }\n const salt = toUtf8Bytes(\"mnemonic\" + password, UnicodeNormalizationForm.NFKD);\n return pbkdf2(toUtf8Bytes(mnemonic, UnicodeNormalizationForm.NFKD), salt, 2048, 64, \"sha512\");\n}\nexport function mnemonicToEntropy(mnemonic, wordlist) {\n wordlist = getWordlist(wordlist);\n logger.checkNormalize();\n const words = wordlist.split(mnemonic);\n if ((words.length % 3) !== 0) {\n throw new Error(\"invalid mnemonic\");\n }\n const entropy = arrayify(new Uint8Array(Math.ceil(11 * words.length / 8)));\n let offset = 0;\n for (let i = 0; i < words.length; i++) {\n let index = wordlist.getWordIndex(words[i].normalize(\"NFKD\"));\n if (index === -1) {\n throw new Error(\"invalid mnemonic\");\n }\n for (let bit = 0; bit < 11; bit++) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= (1 << (7 - (offset % 8)));\n }\n offset++;\n }\n }\n const entropyBits = 32 * words.length / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = arrayify(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n if (checksum !== (entropy[entropy.length - 1] & checksumMask)) {\n throw new Error(\"invalid checksum\");\n }\n return hexlify(entropy.slice(0, entropyBits / 8));\n}\nexport function entropyToMnemonic(entropy, wordlist) {\n wordlist = getWordlist(wordlist);\n entropy = arrayify(entropy);\n if ((entropy.length % 4) !== 0 || entropy.length < 16 || entropy.length > 32) {\n throw new Error(\"invalid entropy\");\n }\n const indices = [0];\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i++) {\n // Consume the whole byte (with still more to go)\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n }\n else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n remainingBits += 3;\n }\n }\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = arrayify(sha256(entropy))[0] & getUpperMask(checksumBits);\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= (checksum >> (8 - checksumBits));\n return wordlist.join(indices.map((index) => wordlist.getWord(index)));\n}\nexport function isValidMnemonic(mnemonic, wordlist) {\n try {\n mnemonicToEntropy(mnemonic, wordlist);\n return true;\n }\n catch (error) { }\n return false;\n}\nexport function getAccountPath(index) {\n if (typeof (index) !== \"number\" || index < 0 || index >= HardenedBit || index % 1) {\n logger.throwArgumentError(\"invalid account index\", \"index\", index);\n }\n return `m/44'/60'/${index}'/0/0`;\n}\n//# sourceMappingURL=index.js.map","export const version = \"random/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n// Debugging line for testing browser lib in node\n//const window = { crypto: { getRandomValues: () => { } } };\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis\nfunction getGlobal() {\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n throw new Error('unable to locate global object');\n}\n;\nconst anyGlobal = getGlobal();\nlet crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nif (!crypto || !crypto.getRandomValues) {\n logger.warn(\"WARNING: Missing strong random number source\");\n crypto = {\n getRandomValues: function (buffer) {\n return logger.throwError(\"no secure random source avaialble\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"crypto.getRandomValues\"\n });\n }\n };\n}\nexport function randomBytes(length) {\n if (length <= 0 || length > 1024 || (length % 1) || length != length) {\n logger.throwArgumentError(\"invalid length\", \"length\", length);\n }\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return arrayify(result);\n}\n;\n//# sourceMappingURL=random.js.map","\"use strict\";\nexport function shuffled(array) {\n array = array.slice();\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n return array;\n}\n//# sourceMappingURL=shuffle.js.map","\"use strict\";\n\n(function(root) {\n\n function checkInt(value) {\n return (parseInt(value) === value);\n }\n\n function checkInts(arrayish) {\n if (!checkInt(arrayish.length)) { return false; }\n\n for (var i = 0; i < arrayish.length; i++) {\n if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) {\n return false;\n }\n }\n\n return true;\n }\n\n function coerceArray(arg, copy) {\n\n // ArrayBuffer view\n if (arg.buffer && ArrayBuffer.isView(arg) && arg.name === 'Uint8Array') {\n\n if (copy) {\n if (arg.slice) {\n arg = arg.slice();\n } else {\n arg = Array.prototype.slice.call(arg);\n }\n }\n\n return arg;\n }\n\n // It's an array; check it is a valid representation of a byte\n if (Array.isArray(arg)) {\n if (!checkInts(arg)) {\n throw new Error('Array contains invalid value: ' + arg);\n }\n\n return new Uint8Array(arg);\n }\n\n // Something else, but behaves like an array (maybe a Buffer? Arguments?)\n if (checkInt(arg.length) && checkInts(arg)) {\n return new Uint8Array(arg);\n }\n\n throw new Error('unsupported array-like object');\n }\n\n function createArray(length) {\n return new Uint8Array(length);\n }\n\n function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {\n if (sourceStart != null || sourceEnd != null) {\n if (sourceArray.slice) {\n sourceArray = sourceArray.slice(sourceStart, sourceEnd);\n } else {\n sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);\n }\n }\n targetArray.set(sourceArray, targetStart);\n }\n\n\n\n var convertUtf8 = (function() {\n function toBytes(text) {\n var result = [], i = 0;\n text = encodeURI(text);\n while (i < text.length) {\n var c = text.charCodeAt(i++);\n\n // if it is a % sign, encode the following 2 bytes as a hex value\n if (c === 37) {\n result.push(parseInt(text.substr(i, 2), 16))\n i += 2;\n\n // otherwise, just the actual byte\n } else {\n result.push(c)\n }\n }\n\n return coerceArray(result);\n }\n\n function fromBytes(bytes) {\n var result = [], i = 0;\n\n while (i < bytes.length) {\n var c = bytes[i];\n\n if (c < 128) {\n result.push(String.fromCharCode(c));\n i++;\n } else if (c > 191 && c < 224) {\n result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f)));\n i += 2;\n } else {\n result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f)));\n i += 3;\n }\n }\n\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n var convertHex = (function() {\n function toBytes(text) {\n var result = [];\n for (var i = 0; i < text.length; i += 2) {\n result.push(parseInt(text.substr(i, 2), 16));\n }\n\n return result;\n }\n\n // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html\n var Hex = '0123456789abcdef';\n\n function fromBytes(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i++) {\n var v = bytes[i];\n result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]);\n }\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n\n // Number of rounds by keysize\n var numberOfRounds = {16: 10, 24: 12, 32: 14}\n\n // Round constant words\n var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91];\n\n // S-box and Inverse S-box (S is for Substitution)\n var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc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cc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d];\n\n // Transformations for encryption\n var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a];\n var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616];\n var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16];\n var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c];\n\n // Transformations for decryption\n var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742];\n var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857];\n var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8];\n var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0];\n\n // Transformations for decryption key expansion\n var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3];\n var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697];\n var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46];\n var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d];\n\n function convertToInt32(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i += 4) {\n result.push(\n (bytes[i ] << 24) |\n (bytes[i + 1] << 16) |\n (bytes[i + 2] << 8) |\n bytes[i + 3]\n );\n }\n return result;\n }\n\n var AES = function(key) {\n if (!(this instanceof AES)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n Object.defineProperty(this, 'key', {\n value: coerceArray(key, true)\n });\n\n this._prepare();\n }\n\n\n AES.prototype._prepare = function() {\n\n var rounds = numberOfRounds[this.key.length];\n if (rounds == null) {\n throw new Error('invalid key size (must be 16, 24 or 32 bytes)');\n }\n\n // encryption round keys\n this._Ke = [];\n\n // decryption round keys\n this._Kd = [];\n\n for (var i = 0; i <= rounds; i++) {\n this._Ke.push([0, 0, 0, 0]);\n this._Kd.push([0, 0, 0, 0]);\n }\n\n var roundKeyCount = (rounds + 1) * 4;\n var KC = this.key.length / 4;\n\n // convert the key into ints\n var tk = convertToInt32(this.key);\n\n // copy values into round key arrays\n var index;\n for (var i = 0; i < KC; i++) {\n index = i >> 2;\n this._Ke[index][i % 4] = tk[i];\n this._Kd[rounds - index][i % 4] = tk[i];\n }\n\n // key expansion (fips-197 section 5.2)\n var rconpointer = 0;\n var t = KC, tt;\n while (t < roundKeyCount) {\n tt = tk[KC - 1];\n tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^\n (S[(tt >> 8) & 0xFF] << 16) ^\n (S[ tt & 0xFF] << 8) ^\n S[(tt >> 24) & 0xFF] ^\n (rcon[rconpointer] << 24));\n rconpointer += 1;\n\n // key expansion (for non-256 bit)\n if (KC != 8) {\n for (var i = 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n\n // key expansion for 256-bit keys is \"slightly different\" (fips-197)\n } else {\n for (var i = 1; i < (KC / 2); i++) {\n tk[i] ^= tk[i - 1];\n }\n tt = tk[(KC / 2) - 1];\n\n tk[KC / 2] ^= (S[ tt & 0xFF] ^\n (S[(tt >> 8) & 0xFF] << 8) ^\n (S[(tt >> 16) & 0xFF] << 16) ^\n (S[(tt >> 24) & 0xFF] << 24));\n\n for (var i = (KC / 2) + 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n }\n\n // copy values into round key arrays\n var i = 0, r, c;\n while (i < KC && t < roundKeyCount) {\n r = t >> 2;\n c = t % 4;\n this._Ke[r][c] = tk[i];\n this._Kd[rounds - r][c] = tk[i++];\n t++;\n }\n }\n\n // inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n for (var r = 1; r < rounds; r++) {\n for (var c = 0; c < 4; c++) {\n tt = this._Kd[r][c];\n this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^\n U2[(tt >> 16) & 0xFF] ^\n U3[(tt >> 8) & 0xFF] ^\n U4[ tt & 0xFF]);\n }\n }\n }\n\n AES.prototype.encrypt = function(plaintext) {\n if (plaintext.length != 16) {\n throw new Error('invalid plaintext size (must be 16 bytes)');\n }\n\n var rounds = this._Ke.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(plaintext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Ke[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T1[(t[ i ] >> 24) & 0xff] ^\n T2[(t[(i + 1) % 4] >> 16) & 0xff] ^\n T3[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T4[ t[(i + 3) % 4] & 0xff] ^\n this._Ke[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Ke[rounds][i];\n result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n AES.prototype.decrypt = function(ciphertext) {\n if (ciphertext.length != 16) {\n throw new Error('invalid ciphertext size (must be 16 bytes)');\n }\n\n var rounds = this._Kd.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(ciphertext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Kd[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T5[(t[ i ] >> 24) & 0xff] ^\n T6[(t[(i + 3) % 4] >> 16) & 0xff] ^\n T7[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T8[ t[(i + 1) % 4] & 0xff] ^\n this._Kd[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Kd[rounds][i];\n result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n\n /**\n * Mode Of Operation - Electonic Codebook (ECB)\n */\n var ModeOfOperationECB = function(key) {\n if (!(this instanceof ModeOfOperationECB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Electronic Code Block\";\n this.name = \"ecb\";\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationECB.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n block = this._aes.encrypt(block);\n copyArray(block, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationECB.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n copyArray(block, plaintext, i);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Block Chaining (CBC)\n */\n var ModeOfOperationCBC = function(key, iv) {\n if (!(this instanceof ModeOfOperationCBC)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Block Chaining\";\n this.name = \"cbc\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastCipherblock = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCBC.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n\n for (var j = 0; j < 16; j++) {\n block[j] ^= this._lastCipherblock[j];\n }\n\n this._lastCipherblock = this._aes.encrypt(block);\n copyArray(this._lastCipherblock, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationCBC.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n\n for (var j = 0; j < 16; j++) {\n plaintext[i + j] = block[j] ^ this._lastCipherblock[j];\n }\n\n copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Feedback (CFB)\n */\n var ModeOfOperationCFB = function(key, iv, segmentSize) {\n if (!(this instanceof ModeOfOperationCFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Feedback\";\n this.name = \"cfb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 size)');\n }\n\n if (!segmentSize) { segmentSize = 1; }\n\n this.segmentSize = segmentSize;\n\n this._shiftRegister = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCFB.prototype.encrypt = function(plaintext) {\n if ((plaintext.length % this.segmentSize) != 0) {\n throw new Error('invalid plaintext size (must be segmentSize bytes)');\n }\n\n var encrypted = coerceArray(plaintext, true);\n\n var xorSegment;\n for (var i = 0; i < encrypted.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n for (var j = 0; j < this.segmentSize; j++) {\n encrypted[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return encrypted;\n }\n\n ModeOfOperationCFB.prototype.decrypt = function(ciphertext) {\n if ((ciphertext.length % this.segmentSize) != 0) {\n throw new Error('invalid ciphertext size (must be segmentSize bytes)');\n }\n\n var plaintext = coerceArray(ciphertext, true);\n\n var xorSegment;\n for (var i = 0; i < plaintext.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n\n for (var j = 0; j < this.segmentSize; j++) {\n plaintext[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return plaintext;\n }\n\n /**\n * Mode Of Operation - Output Feedback (OFB)\n */\n var ModeOfOperationOFB = function(key, iv) {\n if (!(this instanceof ModeOfOperationOFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Output Feedback\";\n this.name = \"ofb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastPrecipher = coerceArray(iv, true);\n this._lastPrecipherIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationOFB.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._lastPrecipherIndex === 16) {\n this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);\n this._lastPrecipherIndex = 0;\n }\n encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;\n\n\n /**\n * Counter object for CTR common mode of operation\n */\n var Counter = function(initialValue) {\n if (!(this instanceof Counter)) {\n throw Error('Counter must be instanitated with `new`');\n }\n\n // We allow 0, but anything false-ish uses the default 1\n if (initialValue !== 0 && !initialValue) { initialValue = 1; }\n\n if (typeof(initialValue) === 'number') {\n this._counter = createArray(16);\n this.setValue(initialValue);\n\n } else {\n this.setBytes(initialValue);\n }\n }\n\n Counter.prototype.setValue = function(value) {\n if (typeof(value) !== 'number' || parseInt(value) != value) {\n throw new Error('invalid counter value (must be an integer)');\n }\n\n for (var index = 15; index >= 0; --index) {\n this._counter[index] = value % 256;\n value = value >> 8;\n }\n }\n\n Counter.prototype.setBytes = function(bytes) {\n bytes = coerceArray(bytes, true);\n\n if (bytes.length != 16) {\n throw new Error('invalid counter bytes size (must be 16 bytes)');\n }\n\n this._counter = bytes;\n };\n\n Counter.prototype.increment = function() {\n for (var i = 15; i >= 0; i--) {\n if (this._counter[i] === 255) {\n this._counter[i] = 0;\n } else {\n this._counter[i]++;\n break;\n }\n }\n }\n\n\n /**\n * Mode Of Operation - Counter (CTR)\n */\n var ModeOfOperationCTR = function(key, counter) {\n if (!(this instanceof ModeOfOperationCTR)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Counter\";\n this.name = \"ctr\";\n\n if (!(counter instanceof Counter)) {\n counter = new Counter(counter)\n }\n\n this._counter = counter;\n\n this._remainingCounter = null;\n this._remainingCounterIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCTR.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._remainingCounterIndex === 16) {\n this._remainingCounter = this._aes.encrypt(this._counter._counter);\n this._remainingCounterIndex = 0;\n this._counter.increment();\n }\n encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt;\n\n\n ///////////////////////\n // Padding\n\n // See:https://tools.ietf.org/html/rfc2315\n function pkcs7pad(data) {\n data = coerceArray(data, true);\n var padder = 16 - (data.length % 16);\n var result = createArray(data.length + padder);\n copyArray(data, result);\n for (var i = data.length; i < result.length; i++) {\n result[i] = padder;\n }\n return result;\n }\n\n function pkcs7strip(data) {\n data = coerceArray(data, true);\n if (data.length < 16) { throw new Error('PKCS#7 invalid length'); }\n\n var padder = data[data.length - 1];\n if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); }\n\n var length = data.length - padder;\n for (var i = 0; i < padder; i++) {\n if (data[length + i] !== padder) {\n throw new Error('PKCS#7 invalid padding byte');\n }\n }\n\n var result = createArray(length);\n copyArray(data, result, 0, 0, length);\n return result;\n }\n\n ///////////////////////\n // Exporting\n\n\n // The block cipher\n var aesjs = {\n AES: AES,\n Counter: Counter,\n\n ModeOfOperation: {\n ecb: ModeOfOperationECB,\n cbc: ModeOfOperationCBC,\n cfb: ModeOfOperationCFB,\n ofb: ModeOfOperationOFB,\n ctr: ModeOfOperationCTR\n },\n\n utils: {\n hex: convertHex,\n utf8: convertUtf8\n },\n\n padding: {\n pkcs7: {\n pad: pkcs7pad,\n strip: pkcs7strip\n }\n },\n\n _arrayTest: {\n coerceArray: coerceArray,\n createArray: createArray,\n copyArray: copyArray,\n }\n };\n\n\n // node.js\n if (typeof exports !== 'undefined') {\n module.exports = aesjs\n\n // RequireJS/AMD\n // http://www.requirejs.org/docs/api.html\n // https://github.com/amdjs/amdjs-api/wiki/AMD\n } else if (typeof(define) === 'function' && define.amd) {\n define(aesjs);\n\n // Web Browsers\n } else {\n\n // If there was an existing library at \"aesjs\" make sure it's still available\n if (root.aesjs) {\n aesjs._aesjs = root.aesjs;\n }\n\n root.aesjs = aesjs;\n }\n\n\n})(this);\n","export const version = \"json-wallets/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { arrayify, hexlify } from \"@ethersproject/bytes\";\nimport { toUtf8Bytes, UnicodeNormalizationForm } from '@ethersproject/strings';\nexport function looseArrayify(hexString) {\n if (typeof (hexString) === 'string' && hexString.substring(0, 2) !== '0x') {\n hexString = '0x' + hexString;\n }\n return arrayify(hexString);\n}\nexport function zpad(value, length) {\n value = String(value);\n while (value.length < length) {\n value = '0' + value;\n }\n return value;\n}\nexport function getPassword(password) {\n if (typeof (password) === 'string') {\n return toUtf8Bytes(password, UnicodeNormalizationForm.NFKC);\n }\n return arrayify(password);\n}\nexport function searchPath(object, path) {\n let currentChild = object;\n const comps = path.toLowerCase().split('/');\n for (let i = 0; i < comps.length; i++) {\n // Search for a child object with a case-insensitive matching key\n let matchingChild = null;\n for (const key in currentChild) {\n if (key.toLowerCase() === comps[i]) {\n matchingChild = currentChild[key];\n break;\n }\n }\n // Didn't find one. :'(\n if (matchingChild === null) {\n return null;\n }\n // Now check this child...\n currentChild = matchingChild;\n }\n return currentChild;\n}\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\nexport function uuidV4(randomBytes) {\n const bytes = arrayify(randomBytes);\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n const value = hexlify(bytes);\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n//# sourceMappingURL=utils.js.map","\"use strict\";\nimport aes from \"aes-js\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { pbkdf2 } from \"@ethersproject/pbkdf2\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nimport { Description } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { getPassword, looseArrayify, searchPath } from \"./utils\";\nexport class CrowdsaleAccount extends Description {\n isCrowdsaleAccount(value) {\n return !!(value && value._isCrowdsaleAccount);\n }\n}\n// See: https://github.com/ethereum/pyethsaletool\nexport function decrypt(json, password) {\n const data = JSON.parse(json);\n password = getPassword(password);\n // Ethereum Address\n const ethaddr = getAddress(searchPath(data, \"ethaddr\"));\n // Encrypted Seed\n const encseed = looseArrayify(searchPath(data, \"encseed\"));\n if (!encseed || (encseed.length % 16) !== 0) {\n logger.throwArgumentError(\"invalid encseed\", \"json\", json);\n }\n const key = arrayify(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n // Decrypt the seed\n const aesCbc = new aes.ModeOfOperation.cbc(key, iv);\n const seed = aes.padding.pkcs7.strip(arrayify(aesCbc.decrypt(encryptedSeed)));\n // This wallet format is weird... Convert the binary encoded hex to a string.\n let seedHex = \"\";\n for (let i = 0; i < seed.length; i++) {\n seedHex += String.fromCharCode(seed[i]);\n }\n const seedHexBytes = toUtf8Bytes(seedHex);\n const privateKey = keccak256(seedHexBytes);\n return new CrowdsaleAccount({\n _isCrowdsaleAccount: true,\n address: ethaddr,\n privateKey: privateKey\n });\n}\n//# sourceMappingURL=crowdsale.js.map","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nexport function isCrowdsaleWallet(json) {\n let data = null;\n try {\n data = JSON.parse(json);\n }\n catch (error) {\n return false;\n }\n return (data.encseed && data.ethaddr);\n}\nexport function isKeystoreWallet(json) {\n let data = null;\n try {\n data = JSON.parse(json);\n }\n catch (error) {\n return false;\n }\n if (!data.version || parseInt(data.version) !== data.version || parseInt(data.version) !== 3) {\n return false;\n }\n // @TODO: Put more checks to make sure it has kdf, iv and all that good stuff\n return true;\n}\n//export function isJsonWallet(json: string): boolean {\n// return (isSecretStorageWallet(json) || isCrowdsaleWallet(json));\n//}\nexport function getJsonWalletAddress(json) {\n if (isCrowdsaleWallet(json)) {\n try {\n return getAddress(JSON.parse(json).ethaddr);\n }\n catch (error) {\n return null;\n }\n }\n if (isKeystoreWallet(json)) {\n try {\n return getAddress(JSON.parse(json).address);\n }\n catch (error) {\n return null;\n }\n }\n return null;\n}\n//# sourceMappingURL=inspect.js.map","\"use strict\";\n\n(function(root) {\n const MAX_VALUE = 0x7fffffff;\n\n // The SHA256 and PBKDF2 implementation are from scrypt-async-js:\n // See: https://github.com/dchest/scrypt-async-js\n function SHA256(m) {\n const K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ]);\n\n let h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n let h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n const w = new Uint32Array(64);\n\n function blocks(p) {\n let off = 0, len = p.length;\n while (len >= 64) {\n let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n for (i = 0; i < 16; i++) {\n j = off + i*4;\n w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n }\n\n for (i = 16; i < 64; i++) {\n u = w[i-2];\n t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n u = w[i-15];\n t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n }\n\n for (i = 0; i < 64; i++) {\n t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n\n off += 64;\n len -= 64;\n }\n }\n\n blocks(m);\n\n let i, bytesLeft = m.length % 64,\n bitLenHi = (m.length / 0x20000000) | 0,\n bitLenLo = m.length << 3,\n numZeros = (bytesLeft < 56) ? 56 : 120,\n p = m.slice(m.length - bytesLeft, m.length);\n\n p.push(0x80);\n for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n p.push((bitLenHi >>> 24) & 0xff);\n p.push((bitLenHi >>> 16) & 0xff);\n p.push((bitLenHi >>> 8) & 0xff);\n p.push((bitLenHi >>> 0) & 0xff);\n p.push((bitLenLo >>> 24) & 0xff);\n p.push((bitLenLo >>> 16) & 0xff);\n p.push((bitLenLo >>> 8) & 0xff);\n p.push((bitLenLo >>> 0) & 0xff);\n\n blocks(p);\n\n return [\n (h0 >>> 24) & 0xff, (h0 >>> 16) & 0xff, (h0 >>> 8) & 0xff, (h0 >>> 0) & 0xff,\n (h1 >>> 24) & 0xff, (h1 >>> 16) & 0xff, (h1 >>> 8) & 0xff, (h1 >>> 0) & 0xff,\n (h2 >>> 24) & 0xff, (h2 >>> 16) & 0xff, (h2 >>> 8) & 0xff, (h2 >>> 0) & 0xff,\n (h3 >>> 24) & 0xff, (h3 >>> 16) & 0xff, (h3 >>> 8) & 0xff, (h3 >>> 0) & 0xff,\n (h4 >>> 24) & 0xff, (h4 >>> 16) & 0xff, (h4 >>> 8) & 0xff, (h4 >>> 0) & 0xff,\n (h5 >>> 24) & 0xff, (h5 >>> 16) & 0xff, (h5 >>> 8) & 0xff, (h5 >>> 0) & 0xff,\n (h6 >>> 24) & 0xff, (h6 >>> 16) & 0xff, (h6 >>> 8) & 0xff, (h6 >>> 0) & 0xff,\n (h7 >>> 24) & 0xff, (h7 >>> 16) & 0xff, (h7 >>> 8) & 0xff, (h7 >>> 0) & 0xff\n ];\n }\n\n function PBKDF2_HMAC_SHA256_OneIter(password, salt, dkLen) {\n // compress password if it's longer than hash block length\n password = (password.length <= 64) ? password : SHA256(password);\n\n const innerLen = 64 + salt.length + 4;\n const inner = new Array(innerLen);\n const outerKey = new Array(64);\n\n let i;\n let dk = [];\n\n // inner = (password ^ ipad) || salt || counter\n for (i = 0; i < 64; i++) { inner[i] = 0x36; }\n for (i = 0; i < password.length; i++) { inner[i] ^= password[i]; }\n for (i = 0; i < salt.length; i++) { inner[64 + i] = salt[i]; }\n for (i = innerLen - 4; i < innerLen; i++) { inner[i] = 0; }\n\n // outerKey = password ^ opad\n for (i = 0; i < 64; i++) outerKey[i] = 0x5c;\n for (i = 0; i < password.length; i++) outerKey[i] ^= password[i];\n\n // increments counter inside inner\n function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }\n\n // output blocks = SHA256(outerKey || SHA256(inner)) ...\n while (dkLen >= 32) {\n incrementCounter();\n dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))));\n dkLen -= 32;\n }\n if (dkLen > 0) {\n incrementCounter();\n dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))).slice(0, dkLen));\n }\n\n return dk;\n }\n\n // The following is an adaptation of scryptsy\n // See: https://www.npmjs.com/package/scryptsy\n function blockmix_salsa8(BY, Yi, r, x, _X) {\n let i;\n\n arraycopy(BY, (2 * r - 1) * 16, _X, 0, 16);\n for (i = 0; i < 2 * r; i++) {\n blockxor(BY, i * 16, _X, 16);\n salsa20_8(_X, x);\n arraycopy(_X, 0, BY, Yi + (i * 16), 16);\n }\n\n for (i = 0; i < r; i++) {\n arraycopy(BY, Yi + (i * 2) * 16, BY, (i * 16), 16);\n }\n\n for (i = 0; i < r; i++) {\n arraycopy(BY, Yi + (i * 2 + 1) * 16, BY, (i + r) * 16, 16);\n }\n }\n\n function R(a, b) {\n return (a << b) | (a >>> (32 - b));\n }\n\n function salsa20_8(B, x) {\n arraycopy(B, 0, x, 0, 16);\n\n for (let i = 8; i > 0; i -= 2) {\n x[ 4] ^= R(x[ 0] + x[12], 7);\n x[ 8] ^= R(x[ 4] + x[ 0], 9);\n x[12] ^= R(x[ 8] + x[ 4], 13);\n x[ 0] ^= R(x[12] + x[ 8], 18);\n x[ 9] ^= R(x[ 5] + x[ 1], 7);\n x[13] ^= R(x[ 9] + x[ 5], 9);\n x[ 1] ^= R(x[13] + x[ 9], 13);\n x[ 5] ^= R(x[ 1] + x[13], 18);\n x[14] ^= R(x[10] + x[ 6], 7);\n x[ 2] ^= R(x[14] + x[10], 9);\n x[ 6] ^= R(x[ 2] + x[14], 13);\n x[10] ^= R(x[ 6] + x[ 2], 18);\n x[ 3] ^= R(x[15] + x[11], 7);\n x[ 7] ^= R(x[ 3] + x[15], 9);\n x[11] ^= R(x[ 7] + x[ 3], 13);\n x[15] ^= R(x[11] + x[ 7], 18);\n x[ 1] ^= R(x[ 0] + x[ 3], 7);\n x[ 2] ^= R(x[ 1] + x[ 0], 9);\n x[ 3] ^= R(x[ 2] + x[ 1], 13);\n x[ 0] ^= R(x[ 3] + x[ 2], 18);\n x[ 6] ^= R(x[ 5] + x[ 4], 7);\n x[ 7] ^= R(x[ 6] + x[ 5], 9);\n x[ 4] ^= R(x[ 7] + x[ 6], 13);\n x[ 5] ^= R(x[ 4] + x[ 7], 18);\n x[11] ^= R(x[10] + x[ 9], 7);\n x[ 8] ^= R(x[11] + x[10], 9);\n x[ 9] ^= R(x[ 8] + x[11], 13);\n x[10] ^= R(x[ 9] + x[ 8], 18);\n x[12] ^= R(x[15] + x[14], 7);\n x[13] ^= R(x[12] + x[15], 9);\n x[14] ^= R(x[13] + x[12], 13);\n x[15] ^= R(x[14] + x[13], 18);\n }\n\n for (let i = 0; i < 16; ++i) {\n B[i] += x[i];\n }\n }\n\n // naive approach... going back to loop unrolling may yield additional performance\n function blockxor(S, Si, D, len) {\n for (let i = 0; i < len; i++) {\n D[i] ^= S[Si + i]\n }\n }\n\n function arraycopy(src, srcPos, dest, destPos, length) {\n while (length--) {\n dest[destPos++] = src[srcPos++];\n }\n }\n\n function checkBufferish(o) {\n if (!o || typeof(o.length) !== 'number') { return false; }\n\n for (let i = 0; i < o.length; i++) {\n const v = o[i];\n if (typeof(v) !== 'number' || v % 1 || v < 0 || v >= 256) {\n return false;\n }\n }\n\n return true;\n }\n\n function ensureInteger(value, name) {\n if (typeof(value) !== \"number\" || (value % 1)) { throw new Error('invalid ' + name); }\n return value;\n }\n\n // N = Cpu cost, r = Memory cost, p = parallelization cost\n // callback(error, progress, key)\n function _scrypt(password, salt, N, r, p, dkLen, callback) {\n\n N = ensureInteger(N, 'N');\n r = ensureInteger(r, 'r');\n p = ensureInteger(p, 'p');\n\n dkLen = ensureInteger(dkLen, 'dkLen');\n\n if (N === 0 || (N & (N - 1)) !== 0) { throw new Error('N must be power of 2'); }\n\n if (N > MAX_VALUE / 128 / r) { throw new Error('N too large'); }\n if (r > MAX_VALUE / 128 / p) { throw new Error('r too large'); }\n\n if (!checkBufferish(password)) {\n throw new Error('password must be an array or buffer');\n }\n password = Array.prototype.slice.call(password);\n\n if (!checkBufferish(salt)) {\n throw new Error('salt must be an array or buffer');\n }\n salt = Array.prototype.slice.call(salt);\n\n let b = PBKDF2_HMAC_SHA256_OneIter(password, salt, p * 128 * r);\n const B = new Uint32Array(p * 32 * r)\n for (let i = 0; i < B.length; i++) {\n const j = i * 4;\n B[i] = ((b[j + 3] & 0xff) << 24) |\n ((b[j + 2] & 0xff) << 16) |\n ((b[j + 1] & 0xff) << 8) |\n ((b[j + 0] & 0xff) << 0);\n }\n\n const XY = new Uint32Array(64 * r);\n const V = new Uint32Array(32 * r * N);\n\n const Yi = 32 * r;\n\n // scratch space\n const x = new Uint32Array(16); // salsa20_8\n const _X = new Uint32Array(16); // blockmix_salsa8\n\n const totalOps = p * N * 2;\n let currentOp = 0;\n let lastPercent10 = null;\n\n // Set this to true to abandon the scrypt on the next step\n let stop = false;\n\n // State information\n let state = 0;\n let i0 = 0, i1;\n let Bi;\n\n // How many blockmix_salsa8 can we do per step?\n const limit = callback ? parseInt(1000 / r): 0xffffffff;\n\n // Trick from scrypt-async; if there is a setImmediate shim in place, use it\n const nextTick = (typeof(setImmediate) !== 'undefined') ? setImmediate : setTimeout;\n\n // This is really all I changed; making scryptsy a state machine so we occasionally\n // stop and give other evnts on the evnt loop a chance to run. ~RicMoo\n const incrementalSMix = function() {\n if (stop) {\n return callback(new Error('cancelled'), currentOp / totalOps);\n }\n\n let steps;\n\n switch (state) {\n case 0:\n // for (var i = 0; i < p; i++)...\n Bi = i0 * 32 * r;\n\n arraycopy(B, Bi, XY, 0, Yi); // ROMix - 1\n\n state = 1; // Move to ROMix 2\n i1 = 0;\n\n // Fall through\n\n case 1:\n\n // Run up to 1000 steps of the first inner smix loop\n steps = N - i1;\n if (steps > limit) { steps = limit; }\n for (let i = 0; i < steps; i++) { // ROMix - 2\n arraycopy(XY, 0, V, (i1 + i) * Yi, Yi) // ROMix - 3\n blockmix_salsa8(XY, Yi, r, x, _X); // ROMix - 4\n }\n\n // for (var i = 0; i < N; i++)\n i1 += steps;\n currentOp += steps;\n\n if (callback) {\n // Call the callback with the progress (optionally stopping us)\n const percent10 = parseInt(1000 * currentOp / totalOps);\n if (percent10 !== lastPercent10) {\n stop = callback(null, currentOp / totalOps);\n if (stop) { break; }\n lastPercent10 = percent10;\n }\n }\n\n if (i1 < N) { break; }\n\n i1 = 0; // Move to ROMix 6\n state = 2;\n\n // Fall through\n\n case 2:\n\n // Run up to 1000 steps of the second inner smix loop\n steps = N - i1;\n if (steps > limit) { steps = limit; }\n for (let i = 0; i < steps; i++) { // ROMix - 6\n const offset = (2 * r - 1) * 16; // ROMix - 7\n const j = XY[offset] & (N - 1);\n blockxor(V, j * Yi, XY, Yi); // ROMix - 8 (inner)\n blockmix_salsa8(XY, Yi, r, x, _X); // ROMix - 9 (outer)\n }\n\n // for (var i = 0; i < N; i++)...\n i1 += steps;\n currentOp += steps;\n\n // Call the callback with the progress (optionally stopping us)\n if (callback) {\n const percent10 = parseInt(1000 * currentOp / totalOps);\n if (percent10 !== lastPercent10) {\n stop = callback(null, currentOp / totalOps);\n if (stop) { break; }\n lastPercent10 = percent10;\n }\n }\n\n if (i1 < N) { break; }\n\n arraycopy(XY, 0, B, Bi, Yi); // ROMix - 10\n\n // for (var i = 0; i < p; i++)...\n i0++;\n if (i0 < p) {\n state = 0;\n break;\n }\n\n b = [];\n for (let i = 0; i < B.length; i++) {\n b.push((B[i] >> 0) & 0xff);\n b.push((B[i] >> 8) & 0xff);\n b.push((B[i] >> 16) & 0xff);\n b.push((B[i] >> 24) & 0xff);\n }\n\n const derivedKey = PBKDF2_HMAC_SHA256_OneIter(password, b, dkLen);\n\n // Send the result to the callback\n if (callback) { callback(null, 1.0, derivedKey); }\n\n // Done; don't break (which would reschedule)\n return derivedKey;\n }\n\n // Schedule the next steps\n if (callback) { nextTick(incrementalSMix); }\n }\n\n // Run the smix state machine until completion\n if (!callback) {\n while (true) {\n const derivedKey = incrementalSMix();\n if (derivedKey != undefined) { return derivedKey; }\n }\n }\n\n // Bootstrap the async incremental smix\n incrementalSMix();\n }\n\n const lib = {\n scrypt: function(password, salt, N, r, p, dkLen, progressCallback) {\n return new Promise(function(resolve, reject) {\n let lastProgress = 0;\n if (progressCallback) { progressCallback(0); }\n _scrypt(password, salt, N, r, p, dkLen, function(error, progress, key) {\n if (error) {\n reject(error);\n } else if (key) {\n if (progressCallback && lastProgress !== 1) {\n progressCallback(1);\n }\n resolve(new Uint8Array(key));\n } else if (progressCallback && progress !== lastProgress) {\n lastProgress = progress;\n return progressCallback(progress);\n }\n });\n });\n },\n syncScrypt: function(password, salt, N, r, p, dkLen) {\n return new Uint8Array(_scrypt(password, salt, N, r, p, dkLen));\n }\n };\n\n // node.js\n if (typeof(exports) !== 'undefined') {\n module.exports = lib;\n\n // RequireJS/AMD\n // http://www.requirejs.org/docs/api.html\n // https://github.com/amdjs/amdjs-api/wiki/AMD\n } else if (typeof(define) === 'function' && define.amd) {\n define(lib);\n\n // Web Browsers\n } else if (root) {\n\n // If there was an existing library \"scrypt\", make sure it is still available\n if (root.scrypt) {\n root._scrypt = root.scrypt;\n }\n\n root.scrypt = lib;\n }\n\n})(this);\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport aes from \"aes-js\";\nimport scrypt from \"scrypt-js\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { arrayify, concat, hexlify } from \"@ethersproject/bytes\";\nimport { defaultPath, entropyToMnemonic, HDNode, mnemonicToEntropy } from \"@ethersproject/hdnode\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { pbkdf2 as _pbkdf2 } from \"@ethersproject/pbkdf2\";\nimport { randomBytes } from \"@ethersproject/random\";\nimport { Description } from \"@ethersproject/properties\";\nimport { computeAddress } from \"@ethersproject/transactions\";\nimport { getPassword, looseArrayify, searchPath, uuidV4, zpad } from \"./utils\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n// Exported Types\nfunction hasMnemonic(value) {\n return (value != null && value.mnemonic && value.mnemonic.phrase);\n}\nexport class KeystoreAccount extends Description {\n isKeystoreAccount(value) {\n return !!(value && value._isKeystoreAccount);\n }\n}\nfunction _decrypt(data, key, ciphertext) {\n const cipher = searchPath(data, \"crypto/cipher\");\n if (cipher === \"aes-128-ctr\") {\n const iv = looseArrayify(searchPath(data, \"crypto/cipherparams/iv\"));\n const counter = new aes.Counter(iv);\n const aesCtr = new aes.ModeOfOperation.ctr(key, counter);\n return arrayify(aesCtr.decrypt(ciphertext));\n }\n return null;\n}\nfunction _getAccount(data, key) {\n const ciphertext = looseArrayify(searchPath(data, \"crypto/ciphertext\"));\n const computedMAC = hexlify(keccak256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n if (computedMAC !== searchPath(data, \"crypto/mac\").toLowerCase()) {\n throw new Error(\"invalid password\");\n }\n const privateKey = _decrypt(data, key.slice(0, 16), ciphertext);\n if (!privateKey) {\n logger.throwError(\"unsupported cipher\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"decrypt\"\n });\n }\n const mnemonicKey = key.slice(32, 64);\n const address = computeAddress(privateKey);\n if (data.address) {\n let check = data.address.toLowerCase();\n if (check.substring(0, 2) !== \"0x\") {\n check = \"0x\" + check;\n }\n if (getAddress(check) !== address) {\n throw new Error(\"address mismatch\");\n }\n }\n const account = {\n _isKeystoreAccount: true,\n address: address,\n privateKey: hexlify(privateKey)\n };\n // Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase\n if (searchPath(data, \"x-ethers/version\") === \"0.1\") {\n const mnemonicCiphertext = looseArrayify(searchPath(data, \"x-ethers/mnemonicCiphertext\"));\n const mnemonicIv = looseArrayify(searchPath(data, \"x-ethers/mnemonicCounter\"));\n const mnemonicCounter = new aes.Counter(mnemonicIv);\n const mnemonicAesCtr = new aes.ModeOfOperation.ctr(mnemonicKey, mnemonicCounter);\n const path = searchPath(data, \"x-ethers/path\") || defaultPath;\n const locale = searchPath(data, \"x-ethers/locale\") || \"en\";\n const entropy = arrayify(mnemonicAesCtr.decrypt(mnemonicCiphertext));\n try {\n const mnemonic = entropyToMnemonic(entropy, locale);\n const node = HDNode.fromMnemonic(mnemonic, null, locale).derivePath(path);\n if (node.privateKey != account.privateKey) {\n throw new Error(\"mnemonic mismatch\");\n }\n account.mnemonic = node.mnemonic;\n }\n catch (error) {\n // If we don't have the locale wordlist installed to\n // read this mnemonic, just bail and don't set the\n // mnemonic\n if (error.code !== Logger.errors.INVALID_ARGUMENT || error.argument !== \"wordlist\") {\n throw error;\n }\n }\n }\n return new KeystoreAccount(account);\n}\nfunction pbkdf2Sync(passwordBytes, salt, count, dkLen, prfFunc) {\n return arrayify(_pbkdf2(passwordBytes, salt, count, dkLen, prfFunc));\n}\nfunction pbkdf2(passwordBytes, salt, count, dkLen, prfFunc) {\n return Promise.resolve(pbkdf2Sync(passwordBytes, salt, count, dkLen, prfFunc));\n}\nfunction _computeKdfKey(data, password, pbkdf2Func, scryptFunc, progressCallback) {\n const passwordBytes = getPassword(password);\n const kdf = searchPath(data, \"crypto/kdf\");\n if (kdf && typeof (kdf) === \"string\") {\n const throwError = function (name, value) {\n return logger.throwArgumentError(\"invalid key-derivation function parameters\", name, value);\n };\n if (kdf.toLowerCase() === \"scrypt\") {\n const salt = looseArrayify(searchPath(data, \"crypto/kdfparams/salt\"));\n const N = parseInt(searchPath(data, \"crypto/kdfparams/n\"));\n const r = parseInt(searchPath(data, \"crypto/kdfparams/r\"));\n const p = parseInt(searchPath(data, \"crypto/kdfparams/p\"));\n // Check for all required parameters\n if (!N || !r || !p) {\n throwError(\"kdf\", kdf);\n }\n // Make sure N is a power of 2\n if ((N & (N - 1)) !== 0) {\n throwError(\"N\", N);\n }\n const dkLen = parseInt(searchPath(data, \"crypto/kdfparams/dklen\"));\n if (dkLen !== 32) {\n throwError(\"dklen\", dkLen);\n }\n return scryptFunc(passwordBytes, salt, N, r, p, 64, progressCallback);\n }\n else if (kdf.toLowerCase() === \"pbkdf2\") {\n const salt = looseArrayify(searchPath(data, \"crypto/kdfparams/salt\"));\n let prfFunc = null;\n const prf = searchPath(data, \"crypto/kdfparams/prf\");\n if (prf === \"hmac-sha256\") {\n prfFunc = \"sha256\";\n }\n else if (prf === \"hmac-sha512\") {\n prfFunc = \"sha512\";\n }\n else {\n throwError(\"prf\", prf);\n }\n const count = parseInt(searchPath(data, \"crypto/kdfparams/c\"));\n const dkLen = parseInt(searchPath(data, \"crypto/kdfparams/dklen\"));\n if (dkLen !== 32) {\n throwError(\"dklen\", dkLen);\n }\n return pbkdf2Func(passwordBytes, salt, count, dkLen, prfFunc);\n }\n }\n return logger.throwArgumentError(\"unsupported key-derivation function\", \"kdf\", kdf);\n}\nexport function decryptSync(json, password) {\n const data = JSON.parse(json);\n const key = _computeKdfKey(data, password, pbkdf2Sync, scrypt.syncScrypt);\n return _getAccount(data, key);\n}\nexport function decrypt(json, password, progressCallback) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.parse(json);\n const key = yield _computeKdfKey(data, password, pbkdf2, scrypt.scrypt, progressCallback);\n return _getAccount(data, key);\n });\n}\nexport function encrypt(account, password, options, progressCallback) {\n try {\n // Check the address matches the private key\n if (getAddress(account.address) !== computeAddress(account.privateKey)) {\n throw new Error(\"address/privateKey mismatch\");\n }\n // Check the mnemonic (if any) matches the private key\n if (hasMnemonic(account)) {\n const mnemonic = account.mnemonic;\n const node = HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path || defaultPath);\n if (node.privateKey != account.privateKey) {\n throw new Error(\"mnemonic mismatch\");\n }\n }\n }\n catch (e) {\n return Promise.reject(e);\n }\n // The options are optional, so adjust the call as needed\n if (typeof (options) === \"function\" && !progressCallback) {\n progressCallback = options;\n options = {};\n }\n if (!options) {\n options = {};\n }\n const privateKey = arrayify(account.privateKey);\n const passwordBytes = getPassword(password);\n let entropy = null;\n let path = null;\n let locale = null;\n if (hasMnemonic(account)) {\n const srcMnemonic = account.mnemonic;\n entropy = arrayify(mnemonicToEntropy(srcMnemonic.phrase, srcMnemonic.locale || \"en\"));\n path = srcMnemonic.path || defaultPath;\n locale = srcMnemonic.locale || \"en\";\n }\n let client = options.client;\n if (!client) {\n client = \"ethers.js\";\n }\n // Check/generate the salt\n let salt = null;\n if (options.salt) {\n salt = arrayify(options.salt);\n }\n else {\n salt = randomBytes(32);\n ;\n }\n // Override initialization vector\n let iv = null;\n if (options.iv) {\n iv = arrayify(options.iv);\n if (iv.length !== 16) {\n throw new Error(\"invalid iv\");\n }\n }\n else {\n iv = randomBytes(16);\n }\n // Override the uuid\n let uuidRandom = null;\n if (options.uuid) {\n uuidRandom = arrayify(options.uuid);\n if (uuidRandom.length !== 16) {\n throw new Error(\"invalid uuid\");\n }\n }\n else {\n uuidRandom = randomBytes(16);\n }\n // Override the scrypt password-based key derivation function parameters\n let N = (1 << 17), r = 8, p = 1;\n if (options.scrypt) {\n if (options.scrypt.N) {\n N = options.scrypt.N;\n }\n if (options.scrypt.r) {\n r = options.scrypt.r;\n }\n if (options.scrypt.p) {\n p = options.scrypt.p;\n }\n }\n // We take 64 bytes:\n // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix)\n // - 32 bytes AES key to encrypt mnemonic with (required here to be Ethers Wallet)\n return scrypt.scrypt(passwordBytes, salt, N, r, p, 64, progressCallback).then((key) => {\n key = arrayify(key);\n // This will be used to encrypt the wallet (as per Web3 secret storage)\n const derivedKey = key.slice(0, 16);\n const macPrefix = key.slice(16, 32);\n // This will be used to encrypt the mnemonic phrase (if any)\n const mnemonicKey = key.slice(32, 64);\n // Encrypt the private key\n const counter = new aes.Counter(iv);\n const aesCtr = new aes.ModeOfOperation.ctr(derivedKey, counter);\n const ciphertext = arrayify(aesCtr.encrypt(privateKey));\n // Compute the message authentication code, used to check the password\n const mac = keccak256(concat([macPrefix, ciphertext]));\n // See: https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition\n const data = {\n address: account.address.substring(2).toLowerCase(),\n id: uuidV4(uuidRandom),\n version: 3,\n crypto: {\n cipher: \"aes-128-ctr\",\n cipherparams: {\n iv: hexlify(iv).substring(2),\n },\n ciphertext: hexlify(ciphertext).substring(2),\n kdf: \"scrypt\",\n kdfparams: {\n salt: hexlify(salt).substring(2),\n n: N,\n dklen: 32,\n p: p,\n r: r\n },\n mac: mac.substring(2)\n }\n };\n // If we have a mnemonic, encrypt it into the JSON wallet\n if (entropy) {\n const mnemonicIv = randomBytes(16);\n const mnemonicCounter = new aes.Counter(mnemonicIv);\n const mnemonicAesCtr = new aes.ModeOfOperation.ctr(mnemonicKey, mnemonicCounter);\n const mnemonicCiphertext = arrayify(mnemonicAesCtr.encrypt(entropy));\n const now = new Date();\n const timestamp = (now.getUTCFullYear() + \"-\" +\n zpad(now.getUTCMonth() + 1, 2) + \"-\" +\n zpad(now.getUTCDate(), 2) + \"T\" +\n zpad(now.getUTCHours(), 2) + \"-\" +\n zpad(now.getUTCMinutes(), 2) + \"-\" +\n zpad(now.getUTCSeconds(), 2) + \".0Z\");\n data[\"x-ethers\"] = {\n client: client,\n gethFilename: (\"UTC--\" + timestamp + \"--\" + data.address),\n mnemonicCounter: hexlify(mnemonicIv).substring(2),\n mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n path: path,\n locale: locale,\n version: \"0.1\"\n };\n }\n return JSON.stringify(data);\n });\n}\n//# sourceMappingURL=keystore.js.map","\"use strict\";\nimport { decrypt as decryptCrowdsale } from \"./crowdsale\";\nimport { getJsonWalletAddress, isCrowdsaleWallet, isKeystoreWallet } from \"./inspect\";\nimport { decrypt as decryptKeystore, decryptSync as decryptKeystoreSync, encrypt as encryptKeystore } from \"./keystore\";\nfunction decryptJsonWallet(json, password, progressCallback) {\n if (isCrowdsaleWallet(json)) {\n if (progressCallback) {\n progressCallback(0);\n }\n const account = decryptCrowdsale(json, password);\n if (progressCallback) {\n progressCallback(1);\n }\n return Promise.resolve(account);\n }\n if (isKeystoreWallet(json)) {\n return decryptKeystore(json, password, progressCallback);\n }\n return Promise.reject(new Error(\"invalid JSON wallet\"));\n}\nfunction decryptJsonWalletSync(json, password) {\n if (isCrowdsaleWallet(json)) {\n return decryptCrowdsale(json, password);\n }\n if (isKeystoreWallet(json)) {\n return decryptKeystoreSync(json, password);\n }\n throw new Error(\"invalid JSON wallet\");\n}\nexport { decryptCrowdsale, decryptKeystore, decryptKeystoreSync, encryptKeystore, isCrowdsaleWallet, isKeystoreWallet, getJsonWalletAddress, decryptJsonWallet, decryptJsonWalletSync, };\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { getAddress } from \"@ethersproject/address\";\nimport { Provider } from \"@ethersproject/abstract-provider\";\nimport { Signer } from \"@ethersproject/abstract-signer\";\nimport { arrayify, concat, hexDataSlice, isHexString, joinSignature } from \"@ethersproject/bytes\";\nimport { hashMessage, _TypedDataEncoder } from \"@ethersproject/hash\";\nimport { defaultPath, HDNode, entropyToMnemonic } from \"@ethersproject/hdnode\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { defineReadOnly, resolveProperties } from \"@ethersproject/properties\";\nimport { randomBytes } from \"@ethersproject/random\";\nimport { SigningKey } from \"@ethersproject/signing-key\";\nimport { decryptJsonWallet, decryptJsonWalletSync, encryptKeystore } from \"@ethersproject/json-wallets\";\nimport { computeAddress, recoverAddress, serialize } from \"@ethersproject/transactions\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nfunction isAccount(value) {\n return (value != null && isHexString(value.privateKey, 32) && value.address != null);\n}\nfunction hasMnemonic(value) {\n const mnemonic = value.mnemonic;\n return (mnemonic && mnemonic.phrase);\n}\nexport class Wallet extends Signer {\n constructor(privateKey, provider) {\n super();\n if (isAccount(privateKey)) {\n const signingKey = new SigningKey(privateKey.privateKey);\n defineReadOnly(this, \"_signingKey\", () => signingKey);\n defineReadOnly(this, \"address\", computeAddress(this.publicKey));\n if (this.address !== getAddress(privateKey.address)) {\n logger.throwArgumentError(\"privateKey/address mismatch\", \"privateKey\", \"[REDACTED]\");\n }\n if (hasMnemonic(privateKey)) {\n const srcMnemonic = privateKey.mnemonic;\n defineReadOnly(this, \"_mnemonic\", () => ({\n phrase: srcMnemonic.phrase,\n path: srcMnemonic.path || defaultPath,\n locale: srcMnemonic.locale || \"en\"\n }));\n const mnemonic = this.mnemonic;\n const node = HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path);\n if (computeAddress(node.privateKey) !== this.address) {\n logger.throwArgumentError(\"mnemonic/address mismatch\", \"privateKey\", \"[REDACTED]\");\n }\n }\n else {\n defineReadOnly(this, \"_mnemonic\", () => null);\n }\n }\n else {\n if (SigningKey.isSigningKey(privateKey)) {\n /* istanbul ignore if */\n if (privateKey.curve !== \"secp256k1\") {\n logger.throwArgumentError(\"unsupported curve; must be secp256k1\", \"privateKey\", \"[REDACTED]\");\n }\n defineReadOnly(this, \"_signingKey\", () => privateKey);\n }\n else {\n // A lot of common tools do not prefix private keys with a 0x (see: #1166)\n if (typeof (privateKey) === \"string\") {\n if (privateKey.match(/^[0-9a-f]*$/i) && privateKey.length === 64) {\n privateKey = \"0x\" + privateKey;\n }\n }\n const signingKey = new SigningKey(privateKey);\n defineReadOnly(this, \"_signingKey\", () => signingKey);\n }\n defineReadOnly(this, \"_mnemonic\", () => null);\n defineReadOnly(this, \"address\", computeAddress(this.publicKey));\n }\n /* istanbul ignore if */\n if (provider && !Provider.isProvider(provider)) {\n logger.throwArgumentError(\"invalid provider\", \"provider\", provider);\n }\n defineReadOnly(this, \"provider\", provider || null);\n }\n get mnemonic() { return this._mnemonic(); }\n get privateKey() { return this._signingKey().privateKey; }\n get publicKey() { return this._signingKey().publicKey; }\n getAddress() {\n return Promise.resolve(this.address);\n }\n connect(provider) {\n return new Wallet(this, provider);\n }\n signTransaction(transaction) {\n return resolveProperties(transaction).then((tx) => {\n if (tx.from != null) {\n if (getAddress(tx.from) !== this.address) {\n logger.throwArgumentError(\"transaction from address mismatch\", \"transaction.from\", transaction.from);\n }\n delete tx.from;\n }\n const signature = this._signingKey().signDigest(keccak256(serialize(tx)));\n return serialize(tx, signature);\n });\n }\n signMessage(message) {\n return __awaiter(this, void 0, void 0, function* () {\n return joinSignature(this._signingKey().signDigest(hashMessage(message)));\n });\n }\n _signTypedData(domain, types, value) {\n return __awaiter(this, void 0, void 0, function* () {\n // Populate any ENS names\n const populated = yield _TypedDataEncoder.resolveNames(domain, types, value, (name) => {\n if (this.provider == null) {\n logger.throwError(\"cannot resolve ENS names without a provider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"resolveName\",\n value: name\n });\n }\n return this.provider.resolveName(name);\n });\n return joinSignature(this._signingKey().signDigest(_TypedDataEncoder.hash(populated.domain, types, populated.value)));\n });\n }\n encrypt(password, options, progressCallback) {\n if (typeof (options) === \"function\" && !progressCallback) {\n progressCallback = options;\n options = {};\n }\n if (progressCallback && typeof (progressCallback) !== \"function\") {\n throw new Error(\"invalid callback\");\n }\n if (!options) {\n options = {};\n }\n return encryptKeystore(this, password, options, progressCallback);\n }\n /**\n * Static methods to create Wallet instances.\n */\n static createRandom(options) {\n let entropy = randomBytes(16);\n if (!options) {\n options = {};\n }\n if (options.extraEntropy) {\n entropy = arrayify(hexDataSlice(keccak256(concat([entropy, options.extraEntropy])), 0, 16));\n }\n const mnemonic = entropyToMnemonic(entropy, options.locale);\n return Wallet.fromMnemonic(mnemonic, options.path, options.locale);\n }\n static fromEncryptedJson(json, password, progressCallback) {\n return decryptJsonWallet(json, password, progressCallback).then((account) => {\n return new Wallet(account);\n });\n }\n static fromEncryptedJsonSync(json, password) {\n return new Wallet(decryptJsonWalletSync(json, password));\n }\n static fromMnemonic(mnemonic, path, wordlist) {\n if (!path) {\n path = defaultPath;\n }\n return new Wallet(HDNode.fromMnemonic(mnemonic, null, wordlist).derivePath(path));\n }\n}\nexport function verifyMessage(message, signature) {\n return recoverAddress(hashMessage(message), signature);\n}\nexport function verifyTypedData(domain, types, value, signature) {\n return recoverAddress(_TypedDataEncoder.hash(domain, types, value), signature);\n}\n//# sourceMappingURL=index.js.map","export const version = \"wallet/5.7.0\";\n//# sourceMappingURL=_version.js.map","export const version = \"networks/5.7.1\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n;\nfunction isRenetworkable(value) {\n return (value && typeof (value.renetwork) === \"function\");\n}\nfunction ethDefaultProvider(network) {\n const func = function (providers, options) {\n if (options == null) {\n options = {};\n }\n const providerList = [];\n if (providers.InfuraProvider && options.infura !== \"-\") {\n try {\n providerList.push(new providers.InfuraProvider(network, options.infura));\n }\n catch (error) { }\n }\n if (providers.EtherscanProvider && options.etherscan !== \"-\") {\n try {\n providerList.push(new providers.EtherscanProvider(network, options.etherscan));\n }\n catch (error) { }\n }\n if (providers.AlchemyProvider && options.alchemy !== \"-\") {\n try {\n providerList.push(new providers.AlchemyProvider(network, options.alchemy));\n }\n catch (error) { }\n }\n if (providers.PocketProvider && options.pocket !== \"-\") {\n // These networks are currently faulty on Pocket as their\n // network does not handle the Berlin hardfork, which is\n // live on these ones.\n // @TODO: This goes away once Pocket has upgraded their nodes\n const skip = [\"goerli\", \"ropsten\", \"rinkeby\", \"sepolia\"];\n try {\n const provider = new providers.PocketProvider(network, options.pocket);\n if (provider.network && skip.indexOf(provider.network.name) === -1) {\n providerList.push(provider);\n }\n }\n catch (error) { }\n }\n if (providers.CloudflareProvider && options.cloudflare !== \"-\") {\n try {\n providerList.push(new providers.CloudflareProvider(network));\n }\n catch (error) { }\n }\n if (providers.AnkrProvider && options.ankr !== \"-\") {\n try {\n const skip = [\"ropsten\"];\n const provider = new providers.AnkrProvider(network, options.ankr);\n if (provider.network && skip.indexOf(provider.network.name) === -1) {\n providerList.push(provider);\n }\n }\n catch (error) { }\n }\n if (providerList.length === 0) {\n return null;\n }\n if (providers.FallbackProvider) {\n let quorum = 1;\n if (options.quorum != null) {\n quorum = options.quorum;\n }\n else if (network === \"homestead\") {\n quorum = 2;\n }\n return new providers.FallbackProvider(providerList, quorum);\n }\n return providerList[0];\n };\n func.renetwork = function (network) {\n return ethDefaultProvider(network);\n };\n return func;\n}\nfunction etcDefaultProvider(url, network) {\n const func = function (providers, options) {\n if (providers.JsonRpcProvider) {\n return new providers.JsonRpcProvider(url, network);\n }\n return null;\n };\n func.renetwork = function (network) {\n return etcDefaultProvider(url, network);\n };\n return func;\n}\nconst homestead = {\n chainId: 1,\n ensAddress: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\",\n name: \"homestead\",\n _defaultProvider: ethDefaultProvider(\"homestead\")\n};\nconst ropsten = {\n chainId: 3,\n ensAddress: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\",\n name: \"ropsten\",\n _defaultProvider: ethDefaultProvider(\"ropsten\")\n};\nconst classicMordor = {\n chainId: 63,\n name: \"classicMordor\",\n _defaultProvider: etcDefaultProvider(\"https://www.ethercluster.com/mordor\", \"classicMordor\")\n};\n// See: https://chainlist.org\nconst networks = {\n unspecified: { chainId: 0, name: \"unspecified\" },\n homestead: homestead,\n mainnet: homestead,\n morden: { chainId: 2, name: \"morden\" },\n ropsten: ropsten,\n testnet: ropsten,\n rinkeby: {\n chainId: 4,\n ensAddress: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\",\n name: \"rinkeby\",\n _defaultProvider: ethDefaultProvider(\"rinkeby\")\n },\n kovan: {\n chainId: 42,\n name: \"kovan\",\n _defaultProvider: ethDefaultProvider(\"kovan\")\n },\n goerli: {\n chainId: 5,\n ensAddress: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\",\n name: \"goerli\",\n _defaultProvider: ethDefaultProvider(\"goerli\")\n },\n kintsugi: { chainId: 1337702, name: \"kintsugi\" },\n sepolia: {\n chainId: 11155111,\n name: \"sepolia\",\n _defaultProvider: ethDefaultProvider(\"sepolia\")\n },\n // ETC (See: #351)\n classic: {\n chainId: 61,\n name: \"classic\",\n _defaultProvider: etcDefaultProvider(\"https:/\\/www.ethercluster.com/etc\", \"classic\")\n },\n classicMorden: { chainId: 62, name: \"classicMorden\" },\n classicMordor: classicMordor,\n classicTestnet: classicMordor,\n classicKotti: {\n chainId: 6,\n name: \"classicKotti\",\n _defaultProvider: etcDefaultProvider(\"https:/\\/www.ethercluster.com/kotti\", \"classicKotti\")\n },\n xdai: { chainId: 100, name: \"xdai\" },\n matic: {\n chainId: 137,\n name: \"matic\",\n _defaultProvider: ethDefaultProvider(\"matic\")\n },\n maticmum: { chainId: 80001, name: \"maticmum\" },\n optimism: {\n chainId: 10,\n name: \"optimism\",\n _defaultProvider: ethDefaultProvider(\"optimism\")\n },\n \"optimism-kovan\": { chainId: 69, name: \"optimism-kovan\" },\n \"optimism-goerli\": { chainId: 420, name: \"optimism-goerli\" },\n arbitrum: { chainId: 42161, name: \"arbitrum\" },\n \"arbitrum-rinkeby\": { chainId: 421611, name: \"arbitrum-rinkeby\" },\n \"arbitrum-goerli\": { chainId: 421613, name: \"arbitrum-goerli\" },\n bnb: { chainId: 56, name: \"bnb\" },\n bnbt: { chainId: 97, name: \"bnbt\" },\n};\n/**\n * getNetwork\n *\n * Converts a named common networks or chain ID (network ID) to a Network\n * and verifies a network is a valid Network..\n */\nexport function getNetwork(network) {\n // No network (null)\n if (network == null) {\n return null;\n }\n if (typeof (network) === \"number\") {\n for (const name in networks) {\n const standard = networks[name];\n if (standard.chainId === network) {\n return {\n name: standard.name,\n chainId: standard.chainId,\n ensAddress: (standard.ensAddress || null),\n _defaultProvider: (standard._defaultProvider || null)\n };\n }\n }\n return {\n chainId: network,\n name: \"unknown\"\n };\n }\n if (typeof (network) === \"string\") {\n const standard = networks[network];\n if (standard == null) {\n return null;\n }\n return {\n name: standard.name,\n chainId: standard.chainId,\n ensAddress: standard.ensAddress,\n _defaultProvider: (standard._defaultProvider || null)\n };\n }\n const standard = networks[network.name];\n // Not a standard network; check that it is a valid network in general\n if (!standard) {\n if (typeof (network.chainId) !== \"number\") {\n logger.throwArgumentError(\"invalid network chainId\", \"network\", network);\n }\n return network;\n }\n // Make sure the chainId matches the expected network chainId (or is 0; disable EIP-155)\n if (network.chainId !== 0 && network.chainId !== standard.chainId) {\n logger.throwArgumentError(\"network chainId mismatch\", \"network\", network);\n }\n // @TODO: In the next major version add an attach function to a defaultProvider\n // class and move the _defaultProvider internal to this file (extend Network)\n let defaultProvider = network._defaultProvider || null;\n if (defaultProvider == null && standard._defaultProvider) {\n if (isRenetworkable(standard._defaultProvider)) {\n defaultProvider = standard._defaultProvider.renetwork(network);\n }\n else {\n defaultProvider = standard._defaultProvider;\n }\n }\n // Standard Network (allow overriding the ENS address)\n return {\n name: network.name,\n chainId: standard.chainId,\n ensAddress: (network.ensAddress || standard.ensAddress || null),\n _defaultProvider: defaultProvider\n };\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { arrayify } from \"@ethersproject/bytes\";\nexport function getUrl(href, options) {\n return __awaiter(this, void 0, void 0, function* () {\n if (options == null) {\n options = {};\n }\n const request = {\n method: (options.method || \"GET\"),\n headers: (options.headers || {}),\n body: (options.body || undefined),\n };\n if (options.skipFetchSetup !== true) {\n request.mode = \"cors\"; // no-cors, cors, *same-origin\n request.cache = \"no-cache\"; // *default, no-cache, reload, force-cache, only-if-cached\n request.credentials = \"same-origin\"; // include, *same-origin, omit\n request.redirect = \"follow\"; // manual, *follow, error\n request.referrer = \"client\"; // no-referrer, *client\n }\n ;\n if (options.fetchOptions != null) {\n const opts = options.fetchOptions;\n if (opts.mode) {\n request.mode = (opts.mode);\n }\n if (opts.cache) {\n request.cache = (opts.cache);\n }\n if (opts.credentials) {\n request.credentials = (opts.credentials);\n }\n if (opts.redirect) {\n request.redirect = (opts.redirect);\n }\n if (opts.referrer) {\n request.referrer = opts.referrer;\n }\n }\n const response = yield fetch(href, request);\n const body = yield response.arrayBuffer();\n const headers = {};\n if (response.headers.forEach) {\n response.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n }\n else {\n ((response.headers).keys)().forEach((key) => {\n headers[key.toLowerCase()] = response.headers.get(key);\n });\n }\n return {\n headers: headers,\n statusCode: response.status,\n statusMessage: response.statusText,\n body: arrayify(new Uint8Array(body)),\n };\n });\n}\n//# sourceMappingURL=geturl.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { decode as base64Decode, encode as base64Encode } from \"@ethersproject/base64\";\nimport { hexlify, isBytesLike } from \"@ethersproject/bytes\";\nimport { shallowCopy } from \"@ethersproject/properties\";\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { getUrl } from \"./geturl\";\nfunction staller(duration) {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\nfunction bodyify(value, type) {\n if (value == null) {\n return null;\n }\n if (typeof (value) === \"string\") {\n return value;\n }\n if (isBytesLike(value)) {\n if (type && (type.split(\"/\")[0] === \"text\" || type.split(\";\")[0].trim() === \"application/json\")) {\n try {\n return toUtf8String(value);\n }\n catch (error) { }\n ;\n }\n return hexlify(value);\n }\n return value;\n}\nfunction unpercent(value) {\n return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => {\n return String.fromCharCode(parseInt(code, 16));\n }));\n}\n// This API is still a work in progress; the future changes will likely be:\n// - ConnectionInfo => FetchDataRequest<T = any>\n// - FetchDataRequest.body? = string | Uint8Array | { contentType: string, data: string | Uint8Array }\n// - If string => text/plain, Uint8Array => application/octet-stream (if content-type unspecified)\n// - FetchDataRequest.processFunc = (body: Uint8Array, response: FetchDataResponse) => T\n// For this reason, it should be considered internal until the API is finalized\nexport function _fetchData(connection, body, processFunc) {\n // How many times to retry in the event of a throttle\n const attemptLimit = (typeof (connection) === \"object\" && connection.throttleLimit != null) ? connection.throttleLimit : 12;\n logger.assertArgument((attemptLimit > 0 && (attemptLimit % 1) === 0), \"invalid connection throttle limit\", \"connection.throttleLimit\", attemptLimit);\n const throttleCallback = ((typeof (connection) === \"object\") ? connection.throttleCallback : null);\n const throttleSlotInterval = ((typeof (connection) === \"object\" && typeof (connection.throttleSlotInterval) === \"number\") ? connection.throttleSlotInterval : 100);\n logger.assertArgument((throttleSlotInterval > 0 && (throttleSlotInterval % 1) === 0), \"invalid connection throttle slot interval\", \"connection.throttleSlotInterval\", throttleSlotInterval);\n const errorPassThrough = ((typeof (connection) === \"object\") ? !!(connection.errorPassThrough) : false);\n const headers = {};\n let url = null;\n // @TODO: Allow ConnectionInfo to override some of these values\n const options = {\n method: \"GET\",\n };\n let allow304 = false;\n let timeout = 2 * 60 * 1000;\n if (typeof (connection) === \"string\") {\n url = connection;\n }\n else if (typeof (connection) === \"object\") {\n if (connection == null || connection.url == null) {\n logger.throwArgumentError(\"missing URL\", \"connection.url\", connection);\n }\n url = connection.url;\n if (typeof (connection.timeout) === \"number\" && connection.timeout > 0) {\n timeout = connection.timeout;\n }\n if (connection.headers) {\n for (const key in connection.headers) {\n headers[key.toLowerCase()] = { key: key, value: String(connection.headers[key]) };\n if ([\"if-none-match\", \"if-modified-since\"].indexOf(key.toLowerCase()) >= 0) {\n allow304 = true;\n }\n }\n }\n options.allowGzip = !!connection.allowGzip;\n if (connection.user != null && connection.password != null) {\n if (url.substring(0, 6) !== \"https:\" && connection.allowInsecureAuthentication !== true) {\n logger.throwError(\"basic authentication requires a secure https url\", Logger.errors.INVALID_ARGUMENT, { argument: \"url\", url: url, user: connection.user, password: \"[REDACTED]\" });\n }\n const authorization = connection.user + \":\" + connection.password;\n headers[\"authorization\"] = {\n key: \"Authorization\",\n value: \"Basic \" + base64Encode(toUtf8Bytes(authorization))\n };\n }\n if (connection.skipFetchSetup != null) {\n options.skipFetchSetup = !!connection.skipFetchSetup;\n }\n if (connection.fetchOptions != null) {\n options.fetchOptions = shallowCopy(connection.fetchOptions);\n }\n }\n const reData = new RegExp(\"^data:([^;:]*)?(;base64)?,(.*)$\", \"i\");\n const dataMatch = ((url) ? url.match(reData) : null);\n if (dataMatch) {\n try {\n const response = {\n statusCode: 200,\n statusMessage: \"OK\",\n headers: { \"content-type\": (dataMatch[1] || \"text/plain\") },\n body: (dataMatch[2] ? base64Decode(dataMatch[3]) : unpercent(dataMatch[3]))\n };\n let result = response.body;\n if (processFunc) {\n result = processFunc(response.body, response);\n }\n return Promise.resolve(result);\n }\n catch (error) {\n logger.throwError(\"processing response error\", Logger.errors.SERVER_ERROR, {\n body: bodyify(dataMatch[1], dataMatch[2]),\n error: error,\n requestBody: null,\n requestMethod: \"GET\",\n url: url\n });\n }\n }\n if (body) {\n options.method = \"POST\";\n options.body = body;\n if (headers[\"content-type\"] == null) {\n headers[\"content-type\"] = { key: \"Content-Type\", value: \"application/octet-stream\" };\n }\n if (headers[\"content-length\"] == null) {\n headers[\"content-length\"] = { key: \"Content-Length\", value: String(body.length) };\n }\n }\n const flatHeaders = {};\n Object.keys(headers).forEach((key) => {\n const header = headers[key];\n flatHeaders[header.key] = header.value;\n });\n options.headers = flatHeaders;\n const runningTimeout = (function () {\n let timer = null;\n const promise = new Promise(function (resolve, reject) {\n if (timeout) {\n timer = setTimeout(() => {\n if (timer == null) {\n return;\n }\n timer = null;\n reject(logger.makeError(\"timeout\", Logger.errors.TIMEOUT, {\n requestBody: bodyify(options.body, flatHeaders[\"content-type\"]),\n requestMethod: options.method,\n timeout: timeout,\n url: url\n }));\n }, timeout);\n }\n });\n const cancel = function () {\n if (timer == null) {\n return;\n }\n clearTimeout(timer);\n timer = null;\n };\n return { promise, cancel };\n })();\n const runningFetch = (function () {\n return __awaiter(this, void 0, void 0, function* () {\n for (let attempt = 0; attempt < attemptLimit; attempt++) {\n let response = null;\n try {\n response = yield getUrl(url, options);\n if (attempt < attemptLimit) {\n if (response.statusCode === 301 || response.statusCode === 302) {\n // Redirection; for now we only support absolute locataions\n const location = response.headers.location || \"\";\n if (options.method === \"GET\" && location.match(/^https:/)) {\n url = response.headers.location;\n continue;\n }\n }\n else if (response.statusCode === 429) {\n // Exponential back-off throttling\n let tryAgain = true;\n if (throttleCallback) {\n tryAgain = yield throttleCallback(attempt, url);\n }\n if (tryAgain) {\n let stall = 0;\n const retryAfter = response.headers[\"retry-after\"];\n if (typeof (retryAfter) === \"string\" && retryAfter.match(/^[1-9][0-9]*$/)) {\n stall = parseInt(retryAfter) * 1000;\n }\n else {\n stall = throttleSlotInterval * parseInt(String(Math.random() * Math.pow(2, attempt)));\n }\n //console.log(\"Stalling 429\");\n yield staller(stall);\n continue;\n }\n }\n }\n }\n catch (error) {\n response = error.response;\n if (response == null) {\n runningTimeout.cancel();\n logger.throwError(\"missing response\", Logger.errors.SERVER_ERROR, {\n requestBody: bodyify(options.body, flatHeaders[\"content-type\"]),\n requestMethod: options.method,\n serverError: error,\n url: url\n });\n }\n }\n let body = response.body;\n if (allow304 && response.statusCode === 304) {\n body = null;\n }\n else if (!errorPassThrough && (response.statusCode < 200 || response.statusCode >= 300)) {\n runningTimeout.cancel();\n logger.throwError(\"bad response\", Logger.errors.SERVER_ERROR, {\n status: response.statusCode,\n headers: response.headers,\n body: bodyify(body, ((response.headers) ? response.headers[\"content-type\"] : null)),\n requestBody: bodyify(options.body, flatHeaders[\"content-type\"]),\n requestMethod: options.method,\n url: url\n });\n }\n if (processFunc) {\n try {\n const result = yield processFunc(body, response);\n runningTimeout.cancel();\n return result;\n }\n catch (error) {\n // Allow the processFunc to trigger a throttle\n if (error.throttleRetry && attempt < attemptLimit) {\n let tryAgain = true;\n if (throttleCallback) {\n tryAgain = yield throttleCallback(attempt, url);\n }\n if (tryAgain) {\n const timeout = throttleSlotInterval * parseInt(String(Math.random() * Math.pow(2, attempt)));\n //console.log(\"Stalling callback\");\n yield staller(timeout);\n continue;\n }\n }\n runningTimeout.cancel();\n logger.throwError(\"processing response error\", Logger.errors.SERVER_ERROR, {\n body: bodyify(body, ((response.headers) ? response.headers[\"content-type\"] : null)),\n error: error,\n requestBody: bodyify(options.body, flatHeaders[\"content-type\"]),\n requestMethod: options.method,\n url: url\n });\n }\n }\n runningTimeout.cancel();\n // If we had a processFunc, it either returned a T or threw above.\n // The \"body\" is now a Uint8Array.\n return body;\n }\n return logger.throwError(\"failed response\", Logger.errors.SERVER_ERROR, {\n requestBody: bodyify(options.body, flatHeaders[\"content-type\"]),\n requestMethod: options.method,\n url: url\n });\n });\n })();\n return Promise.race([runningTimeout.promise, runningFetch]);\n}\nexport function fetchJson(connection, json, processFunc) {\n let processJsonFunc = (value, response) => {\n let result = null;\n if (value != null) {\n try {\n result = JSON.parse(toUtf8String(value));\n }\n catch (error) {\n logger.throwError(\"invalid JSON\", Logger.errors.SERVER_ERROR, {\n body: value,\n error: error\n });\n }\n }\n if (processFunc) {\n result = processFunc(result, response);\n }\n return result;\n };\n // If we have json to send, we must\n // - add content-type of application/json (unless already overridden)\n // - convert the json to bytes\n let body = null;\n if (json != null) {\n body = toUtf8Bytes(json);\n // Create a connection with the content-type set for JSON\n const updated = (typeof (connection) === \"string\") ? ({ url: connection }) : shallowCopy(connection);\n if (updated.headers) {\n const hasContentType = (Object.keys(updated.headers).filter((k) => (k.toLowerCase() === \"content-type\")).length) !== 0;\n if (!hasContentType) {\n updated.headers = shallowCopy(updated.headers);\n updated.headers[\"content-type\"] = \"application/json\";\n }\n }\n else {\n updated.headers = { \"content-type\": \"application/json\" };\n }\n connection = updated;\n }\n return _fetchData(connection, body, processJsonFunc);\n}\nexport function poll(func, options) {\n if (!options) {\n options = {};\n }\n options = shallowCopy(options);\n if (options.floor == null) {\n options.floor = 0;\n }\n if (options.ceiling == null) {\n options.ceiling = 10000;\n }\n if (options.interval == null) {\n options.interval = 250;\n }\n return new Promise(function (resolve, reject) {\n let timer = null;\n let done = false;\n // Returns true if cancel was successful. Unsuccessful cancel means we're already done.\n const cancel = () => {\n if (done) {\n return false;\n }\n done = true;\n if (timer) {\n clearTimeout(timer);\n }\n return true;\n };\n if (options.timeout) {\n timer = setTimeout(() => {\n if (cancel()) {\n reject(new Error(\"timeout\"));\n }\n }, options.timeout);\n }\n const retryLimit = options.retryLimit;\n let attempt = 0;\n function check() {\n return func().then(function (result) {\n // If we have a result, or are allowed null then we're done\n if (result !== undefined) {\n if (cancel()) {\n resolve(result);\n }\n }\n else if (options.oncePoll) {\n options.oncePoll.once(\"poll\", check);\n }\n else if (options.onceBlock) {\n options.onceBlock.once(\"block\", check);\n // Otherwise, exponential back-off (up to 10s) our next request\n }\n else if (!done) {\n attempt++;\n if (attempt > retryLimit) {\n if (cancel()) {\n reject(new Error(\"retry limit reached\"));\n }\n return;\n }\n let timeout = options.interval * parseInt(String(Math.random() * Math.pow(2, attempt)));\n if (timeout < options.floor) {\n timeout = options.floor;\n }\n if (timeout > options.ceiling) {\n timeout = options.ceiling;\n }\n setTimeout(check, timeout);\n }\n return null;\n }, function (error) {\n if (cancel()) {\n reject(error);\n }\n });\n }\n check();\n });\n}\n//# sourceMappingURL=index.js.map","export const version = \"web/5.7.1\";\n//# sourceMappingURL=_version.js.map","'use strict'\nvar ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l'\n\n// pre-compute lookup table\nvar ALPHABET_MAP = {}\nfor (var z = 0; z < ALPHABET.length; z++) {\n var x = ALPHABET.charAt(z)\n\n if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')\n ALPHABET_MAP[x] = z\n}\n\nfunction polymodStep (pre) {\n var b = pre >> 25\n return ((pre & 0x1FFFFFF) << 5) ^\n (-((b >> 0) & 1) & 0x3b6a57b2) ^\n (-((b >> 1) & 1) & 0x26508e6d) ^\n (-((b >> 2) & 1) & 0x1ea119fa) ^\n (-((b >> 3) & 1) & 0x3d4233dd) ^\n (-((b >> 4) & 1) & 0x2a1462b3)\n}\n\nfunction prefixChk (prefix) {\n var chk = 1\n for (var i = 0; i < prefix.length; ++i) {\n var c = prefix.charCodeAt(i)\n if (c < 33 || c > 126) return 'Invalid prefix (' + prefix + ')'\n\n chk = polymodStep(chk) ^ (c >> 5)\n }\n chk = polymodStep(chk)\n\n for (i = 0; i < prefix.length; ++i) {\n var v = prefix.charCodeAt(i)\n chk = polymodStep(chk) ^ (v & 0x1f)\n }\n return chk\n}\n\nfunction encode (prefix, words, LIMIT) {\n LIMIT = LIMIT || 90\n if ((prefix.length + 7 + words.length) > LIMIT) throw new TypeError('Exceeds length limit')\n\n prefix = prefix.toLowerCase()\n\n // determine chk mod\n var chk = prefixChk(prefix)\n if (typeof chk === 'string') throw new Error(chk)\n\n var result = prefix + '1'\n for (var i = 0; i < words.length; ++i) {\n var x = words[i]\n if ((x >> 5) !== 0) throw new Error('Non 5-bit word')\n\n chk = polymodStep(chk) ^ x\n result += ALPHABET.charAt(x)\n }\n\n for (i = 0; i < 6; ++i) {\n chk = polymodStep(chk)\n }\n chk ^= 1\n\n for (i = 0; i < 6; ++i) {\n var v = (chk >> ((5 - i) * 5)) & 0x1f\n result += ALPHABET.charAt(v)\n }\n\n return result\n}\n\nfunction __decode (str, LIMIT) {\n LIMIT = LIMIT || 90\n if (str.length < 8) return str + ' too short'\n if (str.length > LIMIT) return 'Exceeds length limit'\n\n // don't allow mixed case\n var lowered = str.toLowerCase()\n var uppered = str.toUpperCase()\n if (str !== lowered && str !== uppered) return 'Mixed-case string ' + str\n str = lowered\n\n var split = str.lastIndexOf('1')\n if (split === -1) return 'No separator character for ' + str\n if (split === 0) return 'Missing prefix for ' + str\n\n var prefix = str.slice(0, split)\n var wordChars = str.slice(split + 1)\n if (wordChars.length < 6) return 'Data too short'\n\n var chk = prefixChk(prefix)\n if (typeof chk === 'string') return chk\n\n var words = []\n for (var i = 0; i < wordChars.length; ++i) {\n var c = wordChars.charAt(i)\n var v = ALPHABET_MAP[c]\n if (v === undefined) return 'Unknown character ' + c\n chk = polymodStep(chk) ^ v\n\n // not in the checksum?\n if (i + 6 >= wordChars.length) continue\n words.push(v)\n }\n\n if (chk !== 1) return 'Invalid checksum for ' + str\n return { prefix: prefix, words: words }\n}\n\nfunction decodeUnsafe () {\n var res = __decode.apply(null, arguments)\n if (typeof res === 'object') return res\n}\n\nfunction decode (str) {\n var res = __decode.apply(null, arguments)\n if (typeof res === 'object') return res\n\n throw new Error(res)\n}\n\nfunction convert (data, inBits, outBits, pad) {\n var value = 0\n var bits = 0\n var maxV = (1 << outBits) - 1\n\n var result = []\n for (var i = 0; i < data.length; ++i) {\n value = (value << inBits) | data[i]\n bits += inBits\n\n while (bits >= outBits) {\n bits -= outBits\n result.push((value >> bits) & maxV)\n }\n }\n\n if (pad) {\n if (bits > 0) {\n result.push((value << (outBits - bits)) & maxV)\n }\n } else {\n if (bits >= inBits) return 'Excess padding'\n if ((value << (outBits - bits)) & maxV) return 'Non-zero padding'\n }\n\n return result\n}\n\nfunction toWordsUnsafe (bytes) {\n var res = convert(bytes, 8, 5, true)\n if (Array.isArray(res)) return res\n}\n\nfunction toWords (bytes) {\n var res = convert(bytes, 8, 5, true)\n if (Array.isArray(res)) return res\n\n throw new Error(res)\n}\n\nfunction fromWordsUnsafe (words) {\n var res = convert(words, 5, 8, false)\n if (Array.isArray(res)) return res\n}\n\nfunction fromWords (words) {\n var res = convert(words, 5, 8, false)\n if (Array.isArray(res)) return res\n\n throw new Error(res)\n}\n\nmodule.exports = {\n decodeUnsafe: decodeUnsafe,\n decode: decode,\n encode: encode,\n toWordsUnsafe: toWordsUnsafe,\n toWords: toWords,\n fromWordsUnsafe: fromWordsUnsafe,\n fromWords: fromWords\n}\n","export const version = \"providers/5.7.2\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { getAddress, getContractAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { hexDataLength, hexDataSlice, hexValue, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { AddressZero } from \"@ethersproject/constants\";\nimport { shallowCopy } from \"@ethersproject/properties\";\nimport { accessListify, parse as parseTransaction } from \"@ethersproject/transactions\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport class Formatter {\n constructor() {\n this.formats = this.getDefaultFormats();\n }\n getDefaultFormats() {\n const formats = ({});\n const address = this.address.bind(this);\n const bigNumber = this.bigNumber.bind(this);\n const blockTag = this.blockTag.bind(this);\n const data = this.data.bind(this);\n const hash = this.hash.bind(this);\n const hex = this.hex.bind(this);\n const number = this.number.bind(this);\n const type = this.type.bind(this);\n const strictData = (v) => { return this.data(v, true); };\n formats.transaction = {\n hash: hash,\n type: type,\n accessList: Formatter.allowNull(this.accessList.bind(this), null),\n blockHash: Formatter.allowNull(hash, null),\n blockNumber: Formatter.allowNull(number, null),\n transactionIndex: Formatter.allowNull(number, null),\n confirmations: Formatter.allowNull(number, null),\n from: address,\n // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas)\n // must be set\n gasPrice: Formatter.allowNull(bigNumber),\n maxPriorityFeePerGas: Formatter.allowNull(bigNumber),\n maxFeePerGas: Formatter.allowNull(bigNumber),\n gasLimit: bigNumber,\n to: Formatter.allowNull(address, null),\n value: bigNumber,\n nonce: number,\n data: data,\n r: Formatter.allowNull(this.uint256),\n s: Formatter.allowNull(this.uint256),\n v: Formatter.allowNull(number),\n creates: Formatter.allowNull(address, null),\n raw: Formatter.allowNull(data),\n };\n formats.transactionRequest = {\n from: Formatter.allowNull(address),\n nonce: Formatter.allowNull(number),\n gasLimit: Formatter.allowNull(bigNumber),\n gasPrice: Formatter.allowNull(bigNumber),\n maxPriorityFeePerGas: Formatter.allowNull(bigNumber),\n maxFeePerGas: Formatter.allowNull(bigNumber),\n to: Formatter.allowNull(address),\n value: Formatter.allowNull(bigNumber),\n data: Formatter.allowNull(strictData),\n type: Formatter.allowNull(number),\n accessList: Formatter.allowNull(this.accessList.bind(this), null),\n };\n formats.receiptLog = {\n transactionIndex: number,\n blockNumber: number,\n transactionHash: hash,\n address: address,\n topics: Formatter.arrayOf(hash),\n data: data,\n logIndex: number,\n blockHash: hash,\n };\n formats.receipt = {\n to: Formatter.allowNull(this.address, null),\n from: Formatter.allowNull(this.address, null),\n contractAddress: Formatter.allowNull(address, null),\n transactionIndex: number,\n // should be allowNull(hash), but broken-EIP-658 support is handled in receipt\n root: Formatter.allowNull(hex),\n gasUsed: bigNumber,\n logsBloom: Formatter.allowNull(data),\n blockHash: hash,\n transactionHash: hash,\n logs: Formatter.arrayOf(this.receiptLog.bind(this)),\n blockNumber: number,\n confirmations: Formatter.allowNull(number, null),\n cumulativeGasUsed: bigNumber,\n effectiveGasPrice: Formatter.allowNull(bigNumber),\n status: Formatter.allowNull(number),\n type: type\n };\n formats.block = {\n hash: Formatter.allowNull(hash),\n parentHash: hash,\n number: number,\n timestamp: number,\n nonce: Formatter.allowNull(hex),\n difficulty: this.difficulty.bind(this),\n gasLimit: bigNumber,\n gasUsed: bigNumber,\n miner: Formatter.allowNull(address),\n extraData: data,\n transactions: Formatter.allowNull(Formatter.arrayOf(hash)),\n baseFeePerGas: Formatter.allowNull(bigNumber)\n };\n formats.blockWithTransactions = shallowCopy(formats.block);\n formats.blockWithTransactions.transactions = Formatter.allowNull(Formatter.arrayOf(this.transactionResponse.bind(this)));\n formats.filter = {\n fromBlock: Formatter.allowNull(blockTag, undefined),\n toBlock: Formatter.allowNull(blockTag, undefined),\n blockHash: Formatter.allowNull(hash, undefined),\n address: Formatter.allowNull(address, undefined),\n topics: Formatter.allowNull(this.topics.bind(this), undefined),\n };\n formats.filterLog = {\n blockNumber: Formatter.allowNull(number),\n blockHash: Formatter.allowNull(hash),\n transactionIndex: number,\n removed: Formatter.allowNull(this.boolean.bind(this)),\n address: address,\n data: Formatter.allowFalsish(data, \"0x\"),\n topics: Formatter.arrayOf(hash),\n transactionHash: hash,\n logIndex: number,\n };\n return formats;\n }\n accessList(accessList) {\n return accessListify(accessList || []);\n }\n // Requires a BigNumberish that is within the IEEE754 safe integer range; returns a number\n // Strict! Used on input.\n number(number) {\n if (number === \"0x\") {\n return 0;\n }\n return BigNumber.from(number).toNumber();\n }\n type(number) {\n if (number === \"0x\" || number == null) {\n return 0;\n }\n return BigNumber.from(number).toNumber();\n }\n // Strict! Used on input.\n bigNumber(value) {\n return BigNumber.from(value);\n }\n // Requires a boolean, \"true\" or \"false\"; returns a boolean\n boolean(value) {\n if (typeof (value) === \"boolean\") {\n return value;\n }\n if (typeof (value) === \"string\") {\n value = value.toLowerCase();\n if (value === \"true\") {\n return true;\n }\n if (value === \"false\") {\n return false;\n }\n }\n throw new Error(\"invalid boolean - \" + value);\n }\n hex(value, strict) {\n if (typeof (value) === \"string\") {\n if (!strict && value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexString(value)) {\n return value.toLowerCase();\n }\n }\n return logger.throwArgumentError(\"invalid hash\", \"value\", value);\n }\n data(value, strict) {\n const result = this.hex(value, strict);\n if ((result.length % 2) !== 0) {\n throw new Error(\"invalid data; odd-length - \" + value);\n }\n return result;\n }\n // Requires an address\n // Strict! Used on input.\n address(value) {\n return getAddress(value);\n }\n callAddress(value) {\n if (!isHexString(value, 32)) {\n return null;\n }\n const address = getAddress(hexDataSlice(value, 12));\n return (address === AddressZero) ? null : address;\n }\n contractAddress(value) {\n return getContractAddress(value);\n }\n // Strict! Used on input.\n blockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n if (blockTag === \"earliest\") {\n return \"0x0\";\n }\n switch (blockTag) {\n case \"earliest\": return \"0x0\";\n case \"latest\":\n case \"pending\":\n case \"safe\":\n case \"finalized\":\n return blockTag;\n }\n if (typeof (blockTag) === \"number\" || isHexString(blockTag)) {\n return hexValue(blockTag);\n }\n throw new Error(\"invalid blockTag\");\n }\n // Requires a hash, optionally requires 0x prefix; returns prefixed lowercase hash.\n hash(value, strict) {\n const result = this.hex(value, strict);\n if (hexDataLength(result) !== 32) {\n return logger.throwArgumentError(\"invalid hash\", \"value\", value);\n }\n return result;\n }\n // Returns the difficulty as a number, or if too large (i.e. PoA network) null\n difficulty(value) {\n if (value == null) {\n return null;\n }\n const v = BigNumber.from(value);\n try {\n return v.toNumber();\n }\n catch (error) { }\n return null;\n }\n uint256(value) {\n if (!isHexString(value)) {\n throw new Error(\"invalid uint256\");\n }\n return hexZeroPad(value, 32);\n }\n _block(value, format) {\n if (value.author != null && value.miner == null) {\n value.miner = value.author;\n }\n // The difficulty may need to come from _difficulty in recursed blocks\n const difficulty = (value._difficulty != null) ? value._difficulty : value.difficulty;\n const result = Formatter.check(format, value);\n result._difficulty = ((difficulty == null) ? null : BigNumber.from(difficulty));\n return result;\n }\n block(value) {\n return this._block(value, this.formats.block);\n }\n blockWithTransactions(value) {\n return this._block(value, this.formats.blockWithTransactions);\n }\n // Strict! Used on input.\n transactionRequest(value) {\n return Formatter.check(this.formats.transactionRequest, value);\n }\n transactionResponse(transaction) {\n // Rename gas to gasLimit\n if (transaction.gas != null && transaction.gasLimit == null) {\n transaction.gasLimit = transaction.gas;\n }\n // Some clients (TestRPC) do strange things like return 0x0 for the\n // 0 address; correct this to be a real address\n if (transaction.to && BigNumber.from(transaction.to).isZero()) {\n transaction.to = \"0x0000000000000000000000000000000000000000\";\n }\n // Rename input to data\n if (transaction.input != null && transaction.data == null) {\n transaction.data = transaction.input;\n }\n // If to and creates are empty, populate the creates from the transaction\n if (transaction.to == null && transaction.creates == null) {\n transaction.creates = this.contractAddress(transaction);\n }\n if ((transaction.type === 1 || transaction.type === 2) && transaction.accessList == null) {\n transaction.accessList = [];\n }\n const result = Formatter.check(this.formats.transaction, transaction);\n if (transaction.chainId != null) {\n let chainId = transaction.chainId;\n if (isHexString(chainId)) {\n chainId = BigNumber.from(chainId).toNumber();\n }\n result.chainId = chainId;\n }\n else {\n let chainId = transaction.networkId;\n // geth-etc returns chainId\n if (chainId == null && result.v == null) {\n chainId = transaction.chainId;\n }\n if (isHexString(chainId)) {\n chainId = BigNumber.from(chainId).toNumber();\n }\n if (typeof (chainId) !== \"number\" && result.v != null) {\n chainId = (result.v - 35) / 2;\n if (chainId < 0) {\n chainId = 0;\n }\n chainId = parseInt(chainId);\n }\n if (typeof (chainId) !== \"number\") {\n chainId = 0;\n }\n result.chainId = chainId;\n }\n // 0x0000... should actually be null\n if (result.blockHash && result.blockHash.replace(/0/g, \"\") === \"x\") {\n result.blockHash = null;\n }\n return result;\n }\n transaction(value) {\n return parseTransaction(value);\n }\n receiptLog(value) {\n return Formatter.check(this.formats.receiptLog, value);\n }\n receipt(value) {\n const result = Formatter.check(this.formats.receipt, value);\n // RSK incorrectly implemented EIP-658, so we munge things a bit here for it\n if (result.root != null) {\n if (result.root.length <= 4) {\n // Could be 0x00, 0x0, 0x01 or 0x1\n const value = BigNumber.from(result.root).toNumber();\n if (value === 0 || value === 1) {\n // Make sure if both are specified, they match\n if (result.status != null && (result.status !== value)) {\n logger.throwArgumentError(\"alt-root-status/status mismatch\", \"value\", { root: result.root, status: result.status });\n }\n result.status = value;\n delete result.root;\n }\n else {\n logger.throwArgumentError(\"invalid alt-root-status\", \"value.root\", result.root);\n }\n }\n else if (result.root.length !== 66) {\n // Must be a valid bytes32\n logger.throwArgumentError(\"invalid root hash\", \"value.root\", result.root);\n }\n }\n if (result.status != null) {\n result.byzantium = true;\n }\n return result;\n }\n topics(value) {\n if (Array.isArray(value)) {\n return value.map((v) => this.topics(v));\n }\n else if (value != null) {\n return this.hash(value, true);\n }\n return null;\n }\n filter(value) {\n return Formatter.check(this.formats.filter, value);\n }\n filterLog(value) {\n return Formatter.check(this.formats.filterLog, value);\n }\n static check(format, object) {\n const result = {};\n for (const key in format) {\n try {\n const value = format[key](object[key]);\n if (value !== undefined) {\n result[key] = value;\n }\n }\n catch (error) {\n error.checkKey = key;\n error.checkValue = object[key];\n throw error;\n }\n }\n return result;\n }\n // if value is null-ish, nullValue is returned\n static allowNull(format, nullValue) {\n return (function (value) {\n if (value == null) {\n return nullValue;\n }\n return format(value);\n });\n }\n // If value is false-ish, replaceValue is returned\n static allowFalsish(format, replaceValue) {\n return (function (value) {\n if (!value) {\n return replaceValue;\n }\n return format(value);\n });\n }\n // Requires an Array satisfying check\n static arrayOf(format) {\n return (function (array) {\n if (!Array.isArray(array)) {\n throw new Error(\"not an array\");\n }\n const result = [];\n array.forEach(function (value) {\n result.push(format(value));\n });\n return result;\n });\n }\n}\nexport function isCommunityResourcable(value) {\n return (value && typeof (value.isCommunityResource) === \"function\");\n}\nexport function isCommunityResource(value) {\n return (isCommunityResourcable(value) && value.isCommunityResource());\n}\n// Show the throttle message only once\nlet throttleMessage = false;\nexport function showThrottleMessage() {\n if (throttleMessage) {\n return;\n }\n throttleMessage = true;\n console.log(\"========= NOTICE =========\");\n console.log(\"Request-Rate Exceeded (this message will not be repeated)\");\n console.log(\"\");\n console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n console.log(\"community resource for low-traffic projects and early prototyping.\");\n console.log(\"\");\n console.log(\"While your application will continue to function, we highly recommended\");\n console.log(\"signing up for your own API keys to improve performance, increase your\");\n console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n console.log(\"\");\n console.log(\"For more details: https:/\\/docs.ethers.io/api-keys/\");\n console.log(\"==========================\");\n}\n//# sourceMappingURL=formatter.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { ForkEvent, Provider } from \"@ethersproject/abstract-provider\";\nimport { encode as base64Encode } from \"@ethersproject/base64\";\nimport { Base58 } from \"@ethersproject/basex\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, concat, hexConcat, hexDataLength, hexDataSlice, hexlify, hexValue, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { HashZero } from \"@ethersproject/constants\";\nimport { dnsEncode, namehash } from \"@ethersproject/hash\";\nimport { getNetwork } from \"@ethersproject/networks\";\nimport { defineReadOnly, getStatic, resolveProperties } from \"@ethersproject/properties\";\nimport { sha256 } from \"@ethersproject/sha2\";\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\nimport { fetchJson, poll } from \"@ethersproject/web\";\nimport bech32 from \"bech32\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { Formatter } from \"./formatter\";\nconst MAX_CCIP_REDIRECTS = 10;\n//////////////////////////////\n// Event Serializeing\nfunction checkTopic(topic) {\n if (topic == null) {\n return \"null\";\n }\n if (hexDataLength(topic) !== 32) {\n logger.throwArgumentError(\"invalid topic\", \"topic\", topic);\n }\n return topic.toLowerCase();\n}\nfunction serializeTopics(topics) {\n // Remove trailing null AND-topics; they are redundant\n topics = topics.slice();\n while (topics.length > 0 && topics[topics.length - 1] == null) {\n topics.pop();\n }\n return topics.map((topic) => {\n if (Array.isArray(topic)) {\n // Only track unique OR-topics\n const unique = {};\n topic.forEach((topic) => {\n unique[checkTopic(topic)] = true;\n });\n // The order of OR-topics does not matter\n const sorted = Object.keys(unique);\n sorted.sort();\n return sorted.join(\"|\");\n }\n else {\n return checkTopic(topic);\n }\n }).join(\"&\");\n}\nfunction deserializeTopics(data) {\n if (data === \"\") {\n return [];\n }\n return data.split(/&/g).map((topic) => {\n if (topic === \"\") {\n return [];\n }\n const comps = topic.split(\"|\").map((topic) => {\n return ((topic === \"null\") ? null : topic);\n });\n return ((comps.length === 1) ? comps[0] : comps);\n });\n}\nfunction getEventTag(eventName) {\n if (typeof (eventName) === \"string\") {\n eventName = eventName.toLowerCase();\n if (hexDataLength(eventName) === 32) {\n return \"tx:\" + eventName;\n }\n if (eventName.indexOf(\":\") === -1) {\n return eventName;\n }\n }\n else if (Array.isArray(eventName)) {\n return \"filter:*:\" + serializeTopics(eventName);\n }\n else if (ForkEvent.isForkEvent(eventName)) {\n logger.warn(\"not implemented\");\n throw new Error(\"not implemented\");\n }\n else if (eventName && typeof (eventName) === \"object\") {\n return \"filter:\" + (eventName.address || \"*\") + \":\" + serializeTopics(eventName.topics || []);\n }\n throw new Error(\"invalid event - \" + eventName);\n}\n//////////////////////////////\n// Helper Object\nfunction getTime() {\n return (new Date()).getTime();\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\n//////////////////////////////\n// Provider Object\n/**\n * EventType\n * - \"block\"\n * - \"poll\"\n * - \"didPoll\"\n * - \"pending\"\n * - \"error\"\n * - \"network\"\n * - filter\n * - topics array\n * - transaction hash\n */\nconst PollableEvents = [\"block\", \"network\", \"pending\", \"poll\"];\nexport class Event {\n constructor(tag, listener, once) {\n defineReadOnly(this, \"tag\", tag);\n defineReadOnly(this, \"listener\", listener);\n defineReadOnly(this, \"once\", once);\n this._lastBlockNumber = -2;\n this._inflight = false;\n }\n get event() {\n switch (this.type) {\n case \"tx\":\n return this.hash;\n case \"filter\":\n return this.filter;\n }\n return this.tag;\n }\n get type() {\n return this.tag.split(\":\")[0];\n }\n get hash() {\n const comps = this.tag.split(\":\");\n if (comps[0] !== \"tx\") {\n return null;\n }\n return comps[1];\n }\n get filter() {\n const comps = this.tag.split(\":\");\n if (comps[0] !== \"filter\") {\n return null;\n }\n const address = comps[1];\n const topics = deserializeTopics(comps[2]);\n const filter = {};\n if (topics.length > 0) {\n filter.topics = topics;\n }\n if (address && address !== \"*\") {\n filter.address = address;\n }\n return filter;\n }\n pollable() {\n return (this.tag.indexOf(\":\") >= 0 || PollableEvents.indexOf(this.tag) >= 0);\n }\n}\n;\n// https://github.com/satoshilabs/slips/blob/master/slip-0044.md\nconst coinInfos = {\n \"0\": { symbol: \"btc\", p2pkh: 0x00, p2sh: 0x05, prefix: \"bc\" },\n \"2\": { symbol: \"ltc\", p2pkh: 0x30, p2sh: 0x32, prefix: \"ltc\" },\n \"3\": { symbol: \"doge\", p2pkh: 0x1e, p2sh: 0x16 },\n \"60\": { symbol: \"eth\", ilk: \"eth\" },\n \"61\": { symbol: \"etc\", ilk: \"eth\" },\n \"700\": { symbol: \"xdai\", ilk: \"eth\" },\n};\nfunction bytes32ify(value) {\n return hexZeroPad(BigNumber.from(value).toHexString(), 32);\n}\n// Compute the Base58Check encoded data (checksum is first 4 bytes of sha256d)\nfunction base58Encode(data) {\n return Base58.encode(concat([data, hexDataSlice(sha256(sha256(data)), 0, 4)]));\n}\nconst matcherIpfs = new RegExp(\"^(ipfs):/\\/(.*)$\", \"i\");\nconst matchers = [\n new RegExp(\"^(https):/\\/(.*)$\", \"i\"),\n new RegExp(\"^(data):(.*)$\", \"i\"),\n matcherIpfs,\n new RegExp(\"^eip155:[0-9]+/(erc[0-9]+):(.*)$\", \"i\"),\n];\nfunction _parseString(result, start) {\n try {\n return toUtf8String(_parseBytes(result, start));\n }\n catch (error) { }\n return null;\n}\nfunction _parseBytes(result, start) {\n if (result === \"0x\") {\n return null;\n }\n const offset = BigNumber.from(hexDataSlice(result, start, start + 32)).toNumber();\n const length = BigNumber.from(hexDataSlice(result, offset, offset + 32)).toNumber();\n return hexDataSlice(result, offset + 32, offset + 32 + length);\n}\n// Trim off the ipfs:// prefix and return the default gateway URL\nfunction getIpfsLink(link) {\n if (link.match(/^ipfs:\\/\\/ipfs\\//i)) {\n link = link.substring(12);\n }\n else if (link.match(/^ipfs:\\/\\//i)) {\n link = link.substring(7);\n }\n else {\n logger.throwArgumentError(\"unsupported IPFS format\", \"link\", link);\n }\n return `https:/\\/gateway.ipfs.io/ipfs/${link}`;\n}\nfunction numPad(value) {\n const result = arrayify(value);\n if (result.length > 32) {\n throw new Error(\"internal; should not happen\");\n }\n const padded = new Uint8Array(32);\n padded.set(result, 32 - result.length);\n return padded;\n}\nfunction bytesPad(value) {\n if ((value.length % 32) === 0) {\n return value;\n }\n const result = new Uint8Array(Math.ceil(value.length / 32) * 32);\n result.set(value);\n return result;\n}\n// ABI Encodes a series of (bytes, bytes, ...)\nfunction encodeBytes(datas) {\n const result = [];\n let byteCount = 0;\n // Add place-holders for pointers as we add items\n for (let i = 0; i < datas.length; i++) {\n result.push(null);\n byteCount += 32;\n }\n for (let i = 0; i < datas.length; i++) {\n const data = arrayify(datas[i]);\n // Update the bytes offset\n result[i] = numPad(byteCount);\n // The length and padded value of data\n result.push(numPad(data.length));\n result.push(bytesPad(data));\n byteCount += 32 + Math.ceil(data.length / 32) * 32;\n }\n return hexConcat(result);\n}\nexport class Resolver {\n // The resolvedAddress is only for creating a ReverseLookup resolver\n constructor(provider, address, name, resolvedAddress) {\n defineReadOnly(this, \"provider\", provider);\n defineReadOnly(this, \"name\", name);\n defineReadOnly(this, \"address\", provider.formatter.address(address));\n defineReadOnly(this, \"_resolvedAddress\", resolvedAddress);\n }\n supportsWildcard() {\n if (!this._supportsEip2544) {\n // supportsInterface(bytes4 = selector(\"resolve(bytes,bytes)\"))\n this._supportsEip2544 = this.provider.call({\n to: this.address,\n data: \"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000\"\n }).then((result) => {\n return BigNumber.from(result).eq(1);\n }).catch((error) => {\n if (error.code === Logger.errors.CALL_EXCEPTION) {\n return false;\n }\n // Rethrow the error: link is down, etc. Let future attempts retry.\n this._supportsEip2544 = null;\n throw error;\n });\n }\n return this._supportsEip2544;\n }\n _fetch(selector, parameters) {\n return __awaiter(this, void 0, void 0, function* () {\n // e.g. keccak256(\"addr(bytes32,uint256)\")\n const tx = {\n to: this.address,\n ccipReadEnabled: true,\n data: hexConcat([selector, namehash(this.name), (parameters || \"0x\")])\n };\n // Wildcard support; use EIP-2544 to resolve the request\n let parseBytes = false;\n if (yield this.supportsWildcard()) {\n parseBytes = true;\n // selector(\"resolve(bytes,bytes)\")\n tx.data = hexConcat([\"0x9061b923\", encodeBytes([dnsEncode(this.name), tx.data])]);\n }\n try {\n let result = yield this.provider.call(tx);\n if ((arrayify(result).length % 32) === 4) {\n logger.throwError(\"resolver threw error\", Logger.errors.CALL_EXCEPTION, {\n transaction: tx, data: result\n });\n }\n if (parseBytes) {\n result = _parseBytes(result, 0);\n }\n return result;\n }\n catch (error) {\n if (error.code === Logger.errors.CALL_EXCEPTION) {\n return null;\n }\n throw error;\n }\n });\n }\n _fetchBytes(selector, parameters) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield this._fetch(selector, parameters);\n if (result != null) {\n return _parseBytes(result, 0);\n }\n return null;\n });\n }\n _getAddress(coinType, hexBytes) {\n const coinInfo = coinInfos[String(coinType)];\n if (coinInfo == null) {\n logger.throwError(`unsupported coin type: ${coinType}`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: `getAddress(${coinType})`\n });\n }\n if (coinInfo.ilk === \"eth\") {\n return this.provider.formatter.address(hexBytes);\n }\n const bytes = arrayify(hexBytes);\n // P2PKH: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG\n if (coinInfo.p2pkh != null) {\n const p2pkh = hexBytes.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);\n if (p2pkh) {\n const length = parseInt(p2pkh[1], 16);\n if (p2pkh[2].length === length * 2 && length >= 1 && length <= 75) {\n return base58Encode(concat([[coinInfo.p2pkh], (\"0x\" + p2pkh[2])]));\n }\n }\n }\n // P2SH: OP_HASH160 <scriptHash> OP_EQUAL\n if (coinInfo.p2sh != null) {\n const p2sh = hexBytes.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);\n if (p2sh) {\n const length = parseInt(p2sh[1], 16);\n if (p2sh[2].length === length * 2 && length >= 1 && length <= 75) {\n return base58Encode(concat([[coinInfo.p2sh], (\"0x\" + p2sh[2])]));\n }\n }\n }\n // Bech32\n if (coinInfo.prefix != null) {\n const length = bytes[1];\n // https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#witness-program\n let version = bytes[0];\n if (version === 0x00) {\n if (length !== 20 && length !== 32) {\n version = -1;\n }\n }\n else {\n version = -1;\n }\n if (version >= 0 && bytes.length === 2 + length && length >= 1 && length <= 75) {\n const words = bech32.toWords(bytes.slice(2));\n words.unshift(version);\n return bech32.encode(coinInfo.prefix, words);\n }\n }\n return null;\n }\n getAddress(coinType) {\n return __awaiter(this, void 0, void 0, function* () {\n if (coinType == null) {\n coinType = 60;\n }\n // If Ethereum, use the standard `addr(bytes32)`\n if (coinType === 60) {\n try {\n // keccak256(\"addr(bytes32)\")\n const result = yield this._fetch(\"0x3b3b57de\");\n // No address\n if (result === \"0x\" || result === HashZero) {\n return null;\n }\n return this.provider.formatter.callAddress(result);\n }\n catch (error) {\n if (error.code === Logger.errors.CALL_EXCEPTION) {\n return null;\n }\n throw error;\n }\n }\n // keccak256(\"addr(bytes32,uint256\")\n const hexBytes = yield this._fetchBytes(\"0xf1cb7e06\", bytes32ify(coinType));\n // No address\n if (hexBytes == null || hexBytes === \"0x\") {\n return null;\n }\n // Compute the address\n const address = this._getAddress(coinType, hexBytes);\n if (address == null) {\n logger.throwError(`invalid or unsupported coin data`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: `getAddress(${coinType})`,\n coinType: coinType,\n data: hexBytes\n });\n }\n return address;\n });\n }\n getAvatar() {\n return __awaiter(this, void 0, void 0, function* () {\n const linkage = [{ type: \"name\", content: this.name }];\n try {\n // test data for ricmoo.eth\n //const avatar = \"eip155:1/erc721:0x265385c7f4132228A0d54EB1A9e7460b91c0cC68/29233\";\n const avatar = yield this.getText(\"avatar\");\n if (avatar == null) {\n return null;\n }\n for (let i = 0; i < matchers.length; i++) {\n const match = avatar.match(matchers[i]);\n if (match == null) {\n continue;\n }\n const scheme = match[1].toLowerCase();\n switch (scheme) {\n case \"https\":\n linkage.push({ type: \"url\", content: avatar });\n return { linkage, url: avatar };\n case \"data\":\n linkage.push({ type: \"data\", content: avatar });\n return { linkage, url: avatar };\n case \"ipfs\":\n linkage.push({ type: \"ipfs\", content: avatar });\n return { linkage, url: getIpfsLink(avatar) };\n case \"erc721\":\n case \"erc1155\": {\n // Depending on the ERC type, use tokenURI(uint256) or url(uint256)\n const selector = (scheme === \"erc721\") ? \"0xc87b56dd\" : \"0x0e89341c\";\n linkage.push({ type: scheme, content: avatar });\n // The owner of this name\n const owner = (this._resolvedAddress || (yield this.getAddress()));\n const comps = (match[2] || \"\").split(\"/\");\n if (comps.length !== 2) {\n return null;\n }\n const addr = yield this.provider.formatter.address(comps[0]);\n const tokenId = hexZeroPad(BigNumber.from(comps[1]).toHexString(), 32);\n // Check that this account owns the token\n if (scheme === \"erc721\") {\n // ownerOf(uint256 tokenId)\n const tokenOwner = this.provider.formatter.callAddress(yield this.provider.call({\n to: addr, data: hexConcat([\"0x6352211e\", tokenId])\n }));\n if (owner !== tokenOwner) {\n return null;\n }\n linkage.push({ type: \"owner\", content: tokenOwner });\n }\n else if (scheme === \"erc1155\") {\n // balanceOf(address owner, uint256 tokenId)\n const balance = BigNumber.from(yield this.provider.call({\n to: addr, data: hexConcat([\"0x00fdd58e\", hexZeroPad(owner, 32), tokenId])\n }));\n if (balance.isZero()) {\n return null;\n }\n linkage.push({ type: \"balance\", content: balance.toString() });\n }\n // Call the token contract for the metadata URL\n const tx = {\n to: this.provider.formatter.address(comps[0]),\n data: hexConcat([selector, tokenId])\n };\n let metadataUrl = _parseString(yield this.provider.call(tx), 0);\n if (metadataUrl == null) {\n return null;\n }\n linkage.push({ type: \"metadata-url-base\", content: metadataUrl });\n // ERC-1155 allows a generic {id} in the URL\n if (scheme === \"erc1155\") {\n metadataUrl = metadataUrl.replace(\"{id}\", tokenId.substring(2));\n linkage.push({ type: \"metadata-url-expanded\", content: metadataUrl });\n }\n // Transform IPFS metadata links\n if (metadataUrl.match(/^ipfs:/i)) {\n metadataUrl = getIpfsLink(metadataUrl);\n }\n linkage.push({ type: \"metadata-url\", content: metadataUrl });\n // Get the token metadata\n const metadata = yield fetchJson(metadataUrl);\n if (!metadata) {\n return null;\n }\n linkage.push({ type: \"metadata\", content: JSON.stringify(metadata) });\n // Pull the image URL out\n let imageUrl = metadata.image;\n if (typeof (imageUrl) !== \"string\") {\n return null;\n }\n if (imageUrl.match(/^(https:\\/\\/|data:)/i)) {\n // Allow\n }\n else {\n // Transform IPFS link to gateway\n const ipfs = imageUrl.match(matcherIpfs);\n if (ipfs == null) {\n return null;\n }\n linkage.push({ type: \"url-ipfs\", content: imageUrl });\n imageUrl = getIpfsLink(imageUrl);\n }\n linkage.push({ type: \"url\", content: imageUrl });\n return { linkage, url: imageUrl };\n }\n }\n }\n }\n catch (error) { }\n return null;\n });\n }\n getContentHash() {\n return __awaiter(this, void 0, void 0, function* () {\n // keccak256(\"contenthash()\")\n const hexBytes = yield this._fetchBytes(\"0xbc1c58d1\");\n // No contenthash\n if (hexBytes == null || hexBytes === \"0x\") {\n return null;\n }\n // IPFS (CID: 1, Type: DAG-PB)\n const ipfs = hexBytes.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);\n if (ipfs) {\n const length = parseInt(ipfs[3], 16);\n if (ipfs[4].length === length * 2) {\n return \"ipfs:/\\/\" + Base58.encode(\"0x\" + ipfs[1]);\n }\n }\n // IPNS (CID: 1, Type: libp2p-key)\n const ipns = hexBytes.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);\n if (ipns) {\n const length = parseInt(ipns[3], 16);\n if (ipns[4].length === length * 2) {\n return \"ipns:/\\/\" + Base58.encode(\"0x\" + ipns[1]);\n }\n }\n // Swarm (CID: 1, Type: swarm-manifest; hash/length hard-coded to keccak256/32)\n const swarm = hexBytes.match(/^0xe40101fa011b20([0-9a-f]*)$/);\n if (swarm) {\n if (swarm[1].length === (32 * 2)) {\n return \"bzz:/\\/\" + swarm[1];\n }\n }\n const skynet = hexBytes.match(/^0x90b2c605([0-9a-f]*)$/);\n if (skynet) {\n if (skynet[1].length === (34 * 2)) {\n // URL Safe base64; https://datatracker.ietf.org/doc/html/rfc4648#section-5\n const urlSafe = { \"=\": \"\", \"+\": \"-\", \"/\": \"_\" };\n const hash = base64Encode(\"0x\" + skynet[1]).replace(/[=+\\/]/g, (a) => (urlSafe[a]));\n return \"sia:/\\/\" + hash;\n }\n }\n return logger.throwError(`invalid or unsupported content hash data`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"getContentHash()\",\n data: hexBytes\n });\n });\n }\n getText(key) {\n return __awaiter(this, void 0, void 0, function* () {\n // The key encoded as parameter to fetchBytes\n let keyBytes = toUtf8Bytes(key);\n // The nodehash consumes the first slot, so the string pointer targets\n // offset 64, with the length at offset 64 and data starting at offset 96\n keyBytes = concat([bytes32ify(64), bytes32ify(keyBytes.length), keyBytes]);\n // Pad to word-size (32 bytes)\n if ((keyBytes.length % 32) !== 0) {\n keyBytes = concat([keyBytes, hexZeroPad(\"0x\", 32 - (key.length % 32))]);\n }\n const hexBytes = yield this._fetchBytes(\"0x59d1d43c\", hexlify(keyBytes));\n if (hexBytes == null || hexBytes === \"0x\") {\n return null;\n }\n return toUtf8String(hexBytes);\n });\n }\n}\nlet defaultFormatter = null;\nlet nextPollId = 1;\nexport class BaseProvider extends Provider {\n /**\n * ready\n *\n * A Promise<Network> that resolves only once the provider is ready.\n *\n * Sub-classes that call the super with a network without a chainId\n * MUST set this. Standard named networks have a known chainId.\n *\n */\n constructor(network) {\n super();\n // Events being listened to\n this._events = [];\n this._emitted = { block: -2 };\n this.disableCcipRead = false;\n this.formatter = new.target.getFormatter();\n // If network is any, this Provider allows the underlying\n // network to change dynamically, and we auto-detect the\n // current network\n defineReadOnly(this, \"anyNetwork\", (network === \"any\"));\n if (this.anyNetwork) {\n network = this.detectNetwork();\n }\n if (network instanceof Promise) {\n this._networkPromise = network;\n // Squash any \"unhandled promise\" errors; that do not need to be handled\n network.catch((error) => { });\n // Trigger initial network setting (async)\n this._ready().catch((error) => { });\n }\n else {\n const knownNetwork = getStatic(new.target, \"getNetwork\")(network);\n if (knownNetwork) {\n defineReadOnly(this, \"_network\", knownNetwork);\n this.emit(\"network\", knownNetwork, null);\n }\n else {\n logger.throwArgumentError(\"invalid network\", \"network\", network);\n }\n }\n this._maxInternalBlockNumber = -1024;\n this._lastBlockNumber = -2;\n this._maxFilterBlockRange = 10;\n this._pollingInterval = 4000;\n this._fastQueryDate = 0;\n }\n _ready() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._network == null) {\n let network = null;\n if (this._networkPromise) {\n try {\n network = yield this._networkPromise;\n }\n catch (error) { }\n }\n // Try the Provider's network detection (this MUST throw if it cannot)\n if (network == null) {\n network = yield this.detectNetwork();\n }\n // This should never happen; every Provider sub-class should have\n // suggested a network by here (or have thrown).\n if (!network) {\n logger.throwError(\"no network detected\", Logger.errors.UNKNOWN_ERROR, {});\n }\n // Possible this call stacked so do not call defineReadOnly again\n if (this._network == null) {\n if (this.anyNetwork) {\n this._network = network;\n }\n else {\n defineReadOnly(this, \"_network\", network);\n }\n this.emit(\"network\", network, null);\n }\n }\n return this._network;\n });\n }\n // This will always return the most recently established network.\n // For \"any\", this can change (a \"network\" event is emitted before\n // any change is reflected); otherwise this cannot change\n get ready() {\n return poll(() => {\n return this._ready().then((network) => {\n return network;\n }, (error) => {\n // If the network isn't running yet, we will wait\n if (error.code === Logger.errors.NETWORK_ERROR && error.event === \"noNetwork\") {\n return undefined;\n }\n throw error;\n });\n });\n }\n // @TODO: Remove this and just create a singleton formatter\n static getFormatter() {\n if (defaultFormatter == null) {\n defaultFormatter = new Formatter();\n }\n return defaultFormatter;\n }\n // @TODO: Remove this and just use getNetwork\n static getNetwork(network) {\n return getNetwork((network == null) ? \"homestead\" : network);\n }\n ccipReadFetch(tx, calldata, urls) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.disableCcipRead || urls.length === 0) {\n return null;\n }\n const sender = tx.to.toLowerCase();\n const data = calldata.toLowerCase();\n const errorMessages = [];\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n // URL expansion\n const href = url.replace(\"{sender}\", sender).replace(\"{data}\", data);\n // If no {data} is present, use POST; otherwise GET\n const json = (url.indexOf(\"{data}\") >= 0) ? null : JSON.stringify({ data, sender });\n const result = yield fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => {\n value.status = response.statusCode;\n return value;\n });\n if (result.data) {\n return result.data;\n }\n const errorMessage = (result.message || \"unknown error\");\n // 4xx indicates the result is not present; stop\n if (result.status >= 400 && result.status < 500) {\n return logger.throwError(`response not found during CCIP fetch: ${errorMessage}`, Logger.errors.SERVER_ERROR, { url, errorMessage });\n }\n // 5xx indicates server issue; try the next url\n errorMessages.push(errorMessage);\n }\n return logger.throwError(`error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(\", \")}`, Logger.errors.SERVER_ERROR, {\n urls, errorMessages\n });\n });\n }\n // Fetches the blockNumber, but will reuse any result that is less\n // than maxAge old or has been requested since the last request\n _getInternalBlockNumber(maxAge) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this._ready();\n // Allowing stale data up to maxAge old\n if (maxAge > 0) {\n // While there are pending internal block requests...\n while (this._internalBlockNumber) {\n // ...\"remember\" which fetch we started with\n const internalBlockNumber = this._internalBlockNumber;\n try {\n // Check the result is not too stale\n const result = yield internalBlockNumber;\n if ((getTime() - result.respTime) <= maxAge) {\n return result.blockNumber;\n }\n // Too old; fetch a new value\n break;\n }\n catch (error) {\n // The fetch rejected; if we are the first to get the\n // rejection, drop through so we replace it with a new\n // fetch; all others blocked will then get that fetch\n // which won't match the one they \"remembered\" and loop\n if (this._internalBlockNumber === internalBlockNumber) {\n break;\n }\n }\n }\n }\n const reqTime = getTime();\n const checkInternalBlockNumber = resolveProperties({\n blockNumber: this.perform(\"getBlockNumber\", {}),\n networkError: this.getNetwork().then((network) => (null), (error) => (error))\n }).then(({ blockNumber, networkError }) => {\n if (networkError) {\n // Unremember this bad internal block number\n if (this._internalBlockNumber === checkInternalBlockNumber) {\n this._internalBlockNumber = null;\n }\n throw networkError;\n }\n const respTime = getTime();\n blockNumber = BigNumber.from(blockNumber).toNumber();\n if (blockNumber < this._maxInternalBlockNumber) {\n blockNumber = this._maxInternalBlockNumber;\n }\n this._maxInternalBlockNumber = blockNumber;\n this._setFastBlockNumber(blockNumber); // @TODO: Still need this?\n return { blockNumber, reqTime, respTime };\n });\n this._internalBlockNumber = checkInternalBlockNumber;\n // Swallow unhandled exceptions; if needed they are handled else where\n checkInternalBlockNumber.catch((error) => {\n // Don't null the dead (rejected) fetch, if it has already been updated\n if (this._internalBlockNumber === checkInternalBlockNumber) {\n this._internalBlockNumber = null;\n }\n });\n return (yield checkInternalBlockNumber).blockNumber;\n });\n }\n poll() {\n return __awaiter(this, void 0, void 0, function* () {\n const pollId = nextPollId++;\n // Track all running promises, so we can trigger a post-poll once they are complete\n const runners = [];\n let blockNumber = null;\n try {\n blockNumber = yield this._getInternalBlockNumber(100 + this.pollingInterval / 2);\n }\n catch (error) {\n this.emit(\"error\", error);\n return;\n }\n this._setFastBlockNumber(blockNumber);\n // Emit a poll event after we have the latest (fast) block number\n this.emit(\"poll\", pollId, blockNumber);\n // If the block has not changed, meh.\n if (blockNumber === this._lastBlockNumber) {\n this.emit(\"didPoll\", pollId);\n return;\n }\n // First polling cycle, trigger a \"block\" events\n if (this._emitted.block === -2) {\n this._emitted.block = blockNumber - 1;\n }\n if (Math.abs((this._emitted.block) - blockNumber) > 1000) {\n logger.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${blockNumber})`);\n this.emit(\"error\", logger.makeError(\"network block skew detected\", Logger.errors.NETWORK_ERROR, {\n blockNumber: blockNumber,\n event: \"blockSkew\",\n previousBlockNumber: this._emitted.block\n }));\n this.emit(\"block\", blockNumber);\n }\n else {\n // Notify all listener for each block that has passed\n for (let i = this._emitted.block + 1; i <= blockNumber; i++) {\n this.emit(\"block\", i);\n }\n }\n // The emitted block was updated, check for obsolete events\n if (this._emitted.block !== blockNumber) {\n this._emitted.block = blockNumber;\n Object.keys(this._emitted).forEach((key) => {\n // The block event does not expire\n if (key === \"block\") {\n return;\n }\n // The block we were at when we emitted this event\n const eventBlockNumber = this._emitted[key];\n // We cannot garbage collect pending transactions or blocks here\n // They should be garbage collected by the Provider when setting\n // \"pending\" events\n if (eventBlockNumber === \"pending\") {\n return;\n }\n // Evict any transaction hashes or block hashes over 12 blocks\n // old, since they should not return null anyways\n if (blockNumber - eventBlockNumber > 12) {\n delete this._emitted[key];\n }\n });\n }\n // First polling cycle\n if (this._lastBlockNumber === -2) {\n this._lastBlockNumber = blockNumber - 1;\n }\n // Find all transaction hashes we are waiting on\n this._events.forEach((event) => {\n switch (event.type) {\n case \"tx\": {\n const hash = event.hash;\n let runner = this.getTransactionReceipt(hash).then((receipt) => {\n if (!receipt || receipt.blockNumber == null) {\n return null;\n }\n this._emitted[\"t:\" + hash] = receipt.blockNumber;\n this.emit(hash, receipt);\n return null;\n }).catch((error) => { this.emit(\"error\", error); });\n runners.push(runner);\n break;\n }\n case \"filter\": {\n // We only allow a single getLogs to be in-flight at a time\n if (!event._inflight) {\n event._inflight = true;\n // This is the first filter for this event, so we want to\n // restrict events to events that happened no earlier than now\n if (event._lastBlockNumber === -2) {\n event._lastBlockNumber = blockNumber - 1;\n }\n // Filter from the last *known* event; due to load-balancing\n // and some nodes returning updated block numbers before\n // indexing events, a logs result with 0 entries cannot be\n // trusted and we must retry a range which includes it again\n const filter = event.filter;\n filter.fromBlock = event._lastBlockNumber + 1;\n filter.toBlock = blockNumber;\n // Prevent fitler ranges from growing too wild, since it is quite\n // likely there just haven't been any events to move the lastBlockNumber.\n const minFromBlock = filter.toBlock - this._maxFilterBlockRange;\n if (minFromBlock > filter.fromBlock) {\n filter.fromBlock = minFromBlock;\n }\n if (filter.fromBlock < 0) {\n filter.fromBlock = 0;\n }\n const runner = this.getLogs(filter).then((logs) => {\n // Allow the next getLogs\n event._inflight = false;\n if (logs.length === 0) {\n return;\n }\n logs.forEach((log) => {\n // Only when we get an event for a given block number\n // can we trust the events are indexed\n if (log.blockNumber > event._lastBlockNumber) {\n event._lastBlockNumber = log.blockNumber;\n }\n // Make sure we stall requests to fetch blocks and txs\n this._emitted[\"b:\" + log.blockHash] = log.blockNumber;\n this._emitted[\"t:\" + log.transactionHash] = log.blockNumber;\n this.emit(filter, log);\n });\n }).catch((error) => {\n this.emit(\"error\", error);\n // Allow another getLogs (the range was not updated)\n event._inflight = false;\n });\n runners.push(runner);\n }\n break;\n }\n }\n });\n this._lastBlockNumber = blockNumber;\n // Once all events for this loop have been processed, emit \"didPoll\"\n Promise.all(runners).then(() => {\n this.emit(\"didPoll\", pollId);\n }).catch((error) => { this.emit(\"error\", error); });\n return;\n });\n }\n // Deprecated; do not use this\n resetEventsBlock(blockNumber) {\n this._lastBlockNumber = blockNumber - 1;\n if (this.polling) {\n this.poll();\n }\n }\n get network() {\n return this._network;\n }\n // This method should query the network if the underlying network\n // can change, such as when connected to a JSON-RPC backend\n detectNetwork() {\n return __awaiter(this, void 0, void 0, function* () {\n return logger.throwError(\"provider does not support network detection\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"provider.detectNetwork\"\n });\n });\n }\n getNetwork() {\n return __awaiter(this, void 0, void 0, function* () {\n const network = yield this._ready();\n // Make sure we are still connected to the same network; this is\n // only an external call for backends which can have the underlying\n // network change spontaneously\n const currentNetwork = yield this.detectNetwork();\n if (network.chainId !== currentNetwork.chainId) {\n // We are allowing network changes, things can get complex fast;\n // make sure you know what you are doing if you use \"any\"\n if (this.anyNetwork) {\n this._network = currentNetwork;\n // Reset all internal block number guards and caches\n this._lastBlockNumber = -2;\n this._fastBlockNumber = null;\n this._fastBlockNumberPromise = null;\n this._fastQueryDate = 0;\n this._emitted.block = -2;\n this._maxInternalBlockNumber = -1024;\n this._internalBlockNumber = null;\n // The \"network\" event MUST happen before this method resolves\n // so any events have a chance to unregister, so we stall an\n // additional event loop before returning from /this/ call\n this.emit(\"network\", currentNetwork, network);\n yield stall(0);\n return this._network;\n }\n const error = logger.makeError(\"underlying network changed\", Logger.errors.NETWORK_ERROR, {\n event: \"changed\",\n network: network,\n detectedNetwork: currentNetwork\n });\n this.emit(\"error\", error);\n throw error;\n }\n return network;\n });\n }\n get blockNumber() {\n this._getInternalBlockNumber(100 + this.pollingInterval / 2).then((blockNumber) => {\n this._setFastBlockNumber(blockNumber);\n }, (error) => { });\n return (this._fastBlockNumber != null) ? this._fastBlockNumber : -1;\n }\n get polling() {\n return (this._poller != null);\n }\n set polling(value) {\n if (value && !this._poller) {\n this._poller = setInterval(() => { this.poll(); }, this.pollingInterval);\n if (!this._bootstrapPoll) {\n this._bootstrapPoll = setTimeout(() => {\n this.poll();\n // We block additional polls until the polling interval\n // is done, to prevent overwhelming the poll function\n this._bootstrapPoll = setTimeout(() => {\n // If polling was disabled, something may require a poke\n // since starting the bootstrap poll and it was disabled\n if (!this._poller) {\n this.poll();\n }\n // Clear out the bootstrap so we can do another\n this._bootstrapPoll = null;\n }, this.pollingInterval);\n }, 0);\n }\n }\n else if (!value && this._poller) {\n clearInterval(this._poller);\n this._poller = null;\n }\n }\n get pollingInterval() {\n return this._pollingInterval;\n }\n set pollingInterval(value) {\n if (typeof (value) !== \"number\" || value <= 0 || parseInt(String(value)) != value) {\n throw new Error(\"invalid polling interval\");\n }\n this._pollingInterval = value;\n if (this._poller) {\n clearInterval(this._poller);\n this._poller = setInterval(() => { this.poll(); }, this._pollingInterval);\n }\n }\n _getFastBlockNumber() {\n const now = getTime();\n // Stale block number, request a newer value\n if ((now - this._fastQueryDate) > 2 * this._pollingInterval) {\n this._fastQueryDate = now;\n this._fastBlockNumberPromise = this.getBlockNumber().then((blockNumber) => {\n if (this._fastBlockNumber == null || blockNumber > this._fastBlockNumber) {\n this._fastBlockNumber = blockNumber;\n }\n return this._fastBlockNumber;\n });\n }\n return this._fastBlockNumberPromise;\n }\n _setFastBlockNumber(blockNumber) {\n // Older block, maybe a stale request\n if (this._fastBlockNumber != null && blockNumber < this._fastBlockNumber) {\n return;\n }\n // Update the time we updated the blocknumber\n this._fastQueryDate = getTime();\n // Newer block number, use it\n if (this._fastBlockNumber == null || blockNumber > this._fastBlockNumber) {\n this._fastBlockNumber = blockNumber;\n this._fastBlockNumberPromise = Promise.resolve(blockNumber);\n }\n }\n waitForTransaction(transactionHash, confirmations, timeout) {\n return __awaiter(this, void 0, void 0, function* () {\n return this._waitForTransaction(transactionHash, (confirmations == null) ? 1 : confirmations, timeout || 0, null);\n });\n }\n _waitForTransaction(transactionHash, confirmations, timeout, replaceable) {\n return __awaiter(this, void 0, void 0, function* () {\n const receipt = yield this.getTransactionReceipt(transactionHash);\n // Receipt is already good\n if ((receipt ? receipt.confirmations : 0) >= confirmations) {\n return receipt;\n }\n // Poll until the receipt is good...\n return new Promise((resolve, reject) => {\n const cancelFuncs = [];\n let done = false;\n const alreadyDone = function () {\n if (done) {\n return true;\n }\n done = true;\n cancelFuncs.forEach((func) => { func(); });\n return false;\n };\n const minedHandler = (receipt) => {\n if (receipt.confirmations < confirmations) {\n return;\n }\n if (alreadyDone()) {\n return;\n }\n resolve(receipt);\n };\n this.on(transactionHash, minedHandler);\n cancelFuncs.push(() => { this.removeListener(transactionHash, minedHandler); });\n if (replaceable) {\n let lastBlockNumber = replaceable.startBlock;\n let scannedBlock = null;\n const replaceHandler = (blockNumber) => __awaiter(this, void 0, void 0, function* () {\n if (done) {\n return;\n }\n // Wait 1 second; this is only used in the case of a fault, so\n // we will trade off a little bit of latency for more consistent\n // results and fewer JSON-RPC calls\n yield stall(1000);\n this.getTransactionCount(replaceable.from).then((nonce) => __awaiter(this, void 0, void 0, function* () {\n if (done) {\n return;\n }\n if (nonce <= replaceable.nonce) {\n lastBlockNumber = blockNumber;\n }\n else {\n // First check if the transaction was mined\n {\n const mined = yield this.getTransaction(transactionHash);\n if (mined && mined.blockNumber != null) {\n return;\n }\n }\n // First time scanning. We start a little earlier for some\n // wiggle room here to handle the eventually consistent nature\n // of blockchain (e.g. the getTransactionCount was for a\n // different block)\n if (scannedBlock == null) {\n scannedBlock = lastBlockNumber - 3;\n if (scannedBlock < replaceable.startBlock) {\n scannedBlock = replaceable.startBlock;\n }\n }\n while (scannedBlock <= blockNumber) {\n if (done) {\n return;\n }\n const block = yield this.getBlockWithTransactions(scannedBlock);\n for (let ti = 0; ti < block.transactions.length; ti++) {\n const tx = block.transactions[ti];\n // Successfully mined!\n if (tx.hash === transactionHash) {\n return;\n }\n // Matches our transaction from and nonce; its a replacement\n if (tx.from === replaceable.from && tx.nonce === replaceable.nonce) {\n if (done) {\n return;\n }\n // Get the receipt of the replacement\n const receipt = yield this.waitForTransaction(tx.hash, confirmations);\n // Already resolved or rejected (prolly a timeout)\n if (alreadyDone()) {\n return;\n }\n // The reason we were replaced\n let reason = \"replaced\";\n if (tx.data === replaceable.data && tx.to === replaceable.to && tx.value.eq(replaceable.value)) {\n reason = \"repriced\";\n }\n else if (tx.data === \"0x\" && tx.from === tx.to && tx.value.isZero()) {\n reason = \"cancelled\";\n }\n // Explain why we were replaced\n reject(logger.makeError(\"transaction was replaced\", Logger.errors.TRANSACTION_REPLACED, {\n cancelled: (reason === \"replaced\" || reason === \"cancelled\"),\n reason,\n replacement: this._wrapTransaction(tx),\n hash: transactionHash,\n receipt\n }));\n return;\n }\n }\n scannedBlock++;\n }\n }\n if (done) {\n return;\n }\n this.once(\"block\", replaceHandler);\n }), (error) => {\n if (done) {\n return;\n }\n this.once(\"block\", replaceHandler);\n });\n });\n if (done) {\n return;\n }\n this.once(\"block\", replaceHandler);\n cancelFuncs.push(() => {\n this.removeListener(\"block\", replaceHandler);\n });\n }\n if (typeof (timeout) === \"number\" && timeout > 0) {\n const timer = setTimeout(() => {\n if (alreadyDone()) {\n return;\n }\n reject(logger.makeError(\"timeout exceeded\", Logger.errors.TIMEOUT, { timeout: timeout }));\n }, timeout);\n if (timer.unref) {\n timer.unref();\n }\n cancelFuncs.push(() => { clearTimeout(timer); });\n }\n });\n });\n }\n getBlockNumber() {\n return __awaiter(this, void 0, void 0, function* () {\n return this._getInternalBlockNumber(0);\n });\n }\n getGasPrice() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const result = yield this.perform(\"getGasPrice\", {});\n try {\n return BigNumber.from(result);\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"getGasPrice\",\n result, error\n });\n }\n });\n }\n getBalance(addressOrName, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({\n address: this._getAddress(addressOrName),\n blockTag: this._getBlockTag(blockTag)\n });\n const result = yield this.perform(\"getBalance\", params);\n try {\n return BigNumber.from(result);\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"getBalance\",\n params, result, error\n });\n }\n });\n }\n getTransactionCount(addressOrName, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({\n address: this._getAddress(addressOrName),\n blockTag: this._getBlockTag(blockTag)\n });\n const result = yield this.perform(\"getTransactionCount\", params);\n try {\n return BigNumber.from(result).toNumber();\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"getTransactionCount\",\n params, result, error\n });\n }\n });\n }\n getCode(addressOrName, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({\n address: this._getAddress(addressOrName),\n blockTag: this._getBlockTag(blockTag)\n });\n const result = yield this.perform(\"getCode\", params);\n try {\n return hexlify(result);\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"getCode\",\n params, result, error\n });\n }\n });\n }\n getStorageAt(addressOrName, position, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({\n address: this._getAddress(addressOrName),\n blockTag: this._getBlockTag(blockTag),\n position: Promise.resolve(position).then((p) => hexValue(p))\n });\n const result = yield this.perform(\"getStorageAt\", params);\n try {\n return hexlify(result);\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"getStorageAt\",\n params, result, error\n });\n }\n });\n }\n // This should be called by any subclass wrapping a TransactionResponse\n _wrapTransaction(tx, hash, startBlock) {\n if (hash != null && hexDataLength(hash) !== 32) {\n throw new Error(\"invalid response - sendTransaction\");\n }\n const result = tx;\n // Check the hash we expect is the same as the hash the server reported\n if (hash != null && tx.hash !== hash) {\n logger.throwError(\"Transaction hash mismatch from Provider.sendTransaction.\", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });\n }\n result.wait = (confirms, timeout) => __awaiter(this, void 0, void 0, function* () {\n if (confirms == null) {\n confirms = 1;\n }\n if (timeout == null) {\n timeout = 0;\n }\n // Get the details to detect replacement\n let replacement = undefined;\n if (confirms !== 0 && startBlock != null) {\n replacement = {\n data: tx.data,\n from: tx.from,\n nonce: tx.nonce,\n to: tx.to,\n value: tx.value,\n startBlock\n };\n }\n const receipt = yield this._waitForTransaction(tx.hash, confirms, timeout, replacement);\n if (receipt == null && confirms === 0) {\n return null;\n }\n // No longer pending, allow the polling loop to garbage collect this\n this._emitted[\"t:\" + tx.hash] = receipt.blockNumber;\n if (receipt.status === 0) {\n logger.throwError(\"transaction failed\", Logger.errors.CALL_EXCEPTION, {\n transactionHash: tx.hash,\n transaction: tx,\n receipt: receipt\n });\n }\n return receipt;\n });\n return result;\n }\n sendTransaction(signedTransaction) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const hexTx = yield Promise.resolve(signedTransaction).then(t => hexlify(t));\n const tx = this.formatter.transaction(signedTransaction);\n if (tx.confirmations == null) {\n tx.confirmations = 0;\n }\n const blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n try {\n const hash = yield this.perform(\"sendTransaction\", { signedTransaction: hexTx });\n return this._wrapTransaction(tx, hash, blockNumber);\n }\n catch (error) {\n error.transaction = tx;\n error.transactionHash = tx.hash;\n throw error;\n }\n });\n }\n _getTransactionRequest(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n const values = yield transaction;\n const tx = {};\n [\"from\", \"to\"].forEach((key) => {\n if (values[key] == null) {\n return;\n }\n tx[key] = Promise.resolve(values[key]).then((v) => (v ? this._getAddress(v) : null));\n });\n [\"gasLimit\", \"gasPrice\", \"maxFeePerGas\", \"maxPriorityFeePerGas\", \"value\"].forEach((key) => {\n if (values[key] == null) {\n return;\n }\n tx[key] = Promise.resolve(values[key]).then((v) => (v ? BigNumber.from(v) : null));\n });\n [\"type\"].forEach((key) => {\n if (values[key] == null) {\n return;\n }\n tx[key] = Promise.resolve(values[key]).then((v) => ((v != null) ? v : null));\n });\n if (values.accessList) {\n tx.accessList = this.formatter.accessList(values.accessList);\n }\n [\"data\"].forEach((key) => {\n if (values[key] == null) {\n return;\n }\n tx[key] = Promise.resolve(values[key]).then((v) => (v ? hexlify(v) : null));\n });\n return this.formatter.transactionRequest(yield resolveProperties(tx));\n });\n }\n _getFilter(filter) {\n return __awaiter(this, void 0, void 0, function* () {\n filter = yield filter;\n const result = {};\n if (filter.address != null) {\n result.address = this._getAddress(filter.address);\n }\n [\"blockHash\", \"topics\"].forEach((key) => {\n if (filter[key] == null) {\n return;\n }\n result[key] = filter[key];\n });\n [\"fromBlock\", \"toBlock\"].forEach((key) => {\n if (filter[key] == null) {\n return;\n }\n result[key] = this._getBlockTag(filter[key]);\n });\n return this.formatter.filter(yield resolveProperties(result));\n });\n }\n _call(transaction, blockTag, attempt) {\n return __awaiter(this, void 0, void 0, function* () {\n if (attempt >= MAX_CCIP_REDIRECTS) {\n logger.throwError(\"CCIP read exceeded maximum redirections\", Logger.errors.SERVER_ERROR, {\n redirects: attempt, transaction\n });\n }\n const txSender = transaction.to;\n const result = yield this.perform(\"call\", { transaction, blockTag });\n // CCIP Read request via OffchainLookup(address,string[],bytes,bytes4,bytes)\n if (attempt >= 0 && blockTag === \"latest\" && txSender != null && result.substring(0, 10) === \"0x556f1830\" && (hexDataLength(result) % 32 === 4)) {\n try {\n const data = hexDataSlice(result, 4);\n // Check the sender of the OffchainLookup matches the transaction\n const sender = hexDataSlice(data, 0, 32);\n if (!BigNumber.from(sender).eq(txSender)) {\n logger.throwError(\"CCIP Read sender did not match\", Logger.errors.CALL_EXCEPTION, {\n name: \"OffchainLookup\",\n signature: \"OffchainLookup(address,string[],bytes,bytes4,bytes)\",\n transaction, data: result\n });\n }\n // Read the URLs from the response\n const urls = [];\n const urlsOffset = BigNumber.from(hexDataSlice(data, 32, 64)).toNumber();\n const urlsLength = BigNumber.from(hexDataSlice(data, urlsOffset, urlsOffset + 32)).toNumber();\n const urlsData = hexDataSlice(data, urlsOffset + 32);\n for (let u = 0; u < urlsLength; u++) {\n const url = _parseString(urlsData, u * 32);\n if (url == null) {\n logger.throwError(\"CCIP Read contained corrupt URL string\", Logger.errors.CALL_EXCEPTION, {\n name: \"OffchainLookup\",\n signature: \"OffchainLookup(address,string[],bytes,bytes4,bytes)\",\n transaction, data: result\n });\n }\n urls.push(url);\n }\n // Get the CCIP calldata to forward\n const calldata = _parseBytes(data, 64);\n // Get the callbackSelector (bytes4)\n if (!BigNumber.from(hexDataSlice(data, 100, 128)).isZero()) {\n logger.throwError(\"CCIP Read callback selector included junk\", Logger.errors.CALL_EXCEPTION, {\n name: \"OffchainLookup\",\n signature: \"OffchainLookup(address,string[],bytes,bytes4,bytes)\",\n transaction, data: result\n });\n }\n const callbackSelector = hexDataSlice(data, 96, 100);\n // Get the extra data to send back to the contract as context\n const extraData = _parseBytes(data, 128);\n const ccipResult = yield this.ccipReadFetch(transaction, calldata, urls);\n if (ccipResult == null) {\n logger.throwError(\"CCIP Read disabled or provided no URLs\", Logger.errors.CALL_EXCEPTION, {\n name: \"OffchainLookup\",\n signature: \"OffchainLookup(address,string[],bytes,bytes4,bytes)\",\n transaction, data: result\n });\n }\n const tx = {\n to: txSender,\n data: hexConcat([callbackSelector, encodeBytes([ccipResult, extraData])])\n };\n return this._call(tx, blockTag, attempt + 1);\n }\n catch (error) {\n if (error.code === Logger.errors.SERVER_ERROR) {\n throw error;\n }\n }\n }\n try {\n return hexlify(result);\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"call\",\n params: { transaction, blockTag }, result, error\n });\n }\n });\n }\n call(transaction, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const resolved = yield resolveProperties({\n transaction: this._getTransactionRequest(transaction),\n blockTag: this._getBlockTag(blockTag),\n ccipReadEnabled: Promise.resolve(transaction.ccipReadEnabled)\n });\n return this._call(resolved.transaction, resolved.blockTag, resolved.ccipReadEnabled ? 0 : -1);\n });\n }\n estimateGas(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({\n transaction: this._getTransactionRequest(transaction)\n });\n const result = yield this.perform(\"estimateGas\", params);\n try {\n return BigNumber.from(result);\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"estimateGas\",\n params, result, error\n });\n }\n });\n }\n _getAddress(addressOrName) {\n return __awaiter(this, void 0, void 0, function* () {\n addressOrName = yield addressOrName;\n if (typeof (addressOrName) !== \"string\") {\n logger.throwArgumentError(\"invalid address or ENS name\", \"name\", addressOrName);\n }\n const address = yield this.resolveName(addressOrName);\n if (address == null) {\n logger.throwError(\"ENS name not configured\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: `resolveName(${JSON.stringify(addressOrName)})`\n });\n }\n return address;\n });\n }\n _getBlock(blockHashOrBlockTag, includeTransactions) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n blockHashOrBlockTag = yield blockHashOrBlockTag;\n // If blockTag is a number (not \"latest\", etc), this is the block number\n let blockNumber = -128;\n const params = {\n includeTransactions: !!includeTransactions\n };\n if (isHexString(blockHashOrBlockTag, 32)) {\n params.blockHash = blockHashOrBlockTag;\n }\n else {\n try {\n params.blockTag = yield this._getBlockTag(blockHashOrBlockTag);\n if (isHexString(params.blockTag)) {\n blockNumber = parseInt(params.blockTag.substring(2), 16);\n }\n }\n catch (error) {\n logger.throwArgumentError(\"invalid block hash or block tag\", \"blockHashOrBlockTag\", blockHashOrBlockTag);\n }\n }\n return poll(() => __awaiter(this, void 0, void 0, function* () {\n const block = yield this.perform(\"getBlock\", params);\n // Block was not found\n if (block == null) {\n // For blockhashes, if we didn't say it existed, that blockhash may\n // not exist. If we did see it though, perhaps from a log, we know\n // it exists, and this node is just not caught up yet.\n if (params.blockHash != null) {\n if (this._emitted[\"b:\" + params.blockHash] == null) {\n return null;\n }\n }\n // For block tags, if we are asking for a future block, we return null\n if (params.blockTag != null) {\n if (blockNumber > this._emitted.block) {\n return null;\n }\n }\n // Retry on the next block\n return undefined;\n }\n // Add transactions\n if (includeTransactions) {\n let blockNumber = null;\n for (let i = 0; i < block.transactions.length; i++) {\n const tx = block.transactions[i];\n if (tx.blockNumber == null) {\n tx.confirmations = 0;\n }\n else if (tx.confirmations == null) {\n if (blockNumber == null) {\n blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n }\n // Add the confirmations using the fast block number (pessimistic)\n let confirmations = (blockNumber - tx.blockNumber) + 1;\n if (confirmations <= 0) {\n confirmations = 1;\n }\n tx.confirmations = confirmations;\n }\n }\n const blockWithTxs = this.formatter.blockWithTransactions(block);\n blockWithTxs.transactions = blockWithTxs.transactions.map((tx) => this._wrapTransaction(tx));\n return blockWithTxs;\n }\n return this.formatter.block(block);\n }), { oncePoll: this });\n });\n }\n getBlock(blockHashOrBlockTag) {\n return (this._getBlock(blockHashOrBlockTag, false));\n }\n getBlockWithTransactions(blockHashOrBlockTag) {\n return (this._getBlock(blockHashOrBlockTag, true));\n }\n getTransaction(transactionHash) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n transactionHash = yield transactionHash;\n const params = { transactionHash: this.formatter.hash(transactionHash, true) };\n return poll(() => __awaiter(this, void 0, void 0, function* () {\n const result = yield this.perform(\"getTransaction\", params);\n if (result == null) {\n if (this._emitted[\"t:\" + transactionHash] == null) {\n return null;\n }\n return undefined;\n }\n const tx = this.formatter.transactionResponse(result);\n if (tx.blockNumber == null) {\n tx.confirmations = 0;\n }\n else if (tx.confirmations == null) {\n const blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n // Add the confirmations using the fast block number (pessimistic)\n let confirmations = (blockNumber - tx.blockNumber) + 1;\n if (confirmations <= 0) {\n confirmations = 1;\n }\n tx.confirmations = confirmations;\n }\n return this._wrapTransaction(tx);\n }), { oncePoll: this });\n });\n }\n getTransactionReceipt(transactionHash) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n transactionHash = yield transactionHash;\n const params = { transactionHash: this.formatter.hash(transactionHash, true) };\n return poll(() => __awaiter(this, void 0, void 0, function* () {\n const result = yield this.perform(\"getTransactionReceipt\", params);\n if (result == null) {\n if (this._emitted[\"t:\" + transactionHash] == null) {\n return null;\n }\n return undefined;\n }\n // \"geth-etc\" returns receipts before they are ready\n if (result.blockHash == null) {\n return undefined;\n }\n const receipt = this.formatter.receipt(result);\n if (receipt.blockNumber == null) {\n receipt.confirmations = 0;\n }\n else if (receipt.confirmations == null) {\n const blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n // Add the confirmations using the fast block number (pessimistic)\n let confirmations = (blockNumber - receipt.blockNumber) + 1;\n if (confirmations <= 0) {\n confirmations = 1;\n }\n receipt.confirmations = confirmations;\n }\n return receipt;\n }), { oncePoll: this });\n });\n }\n getLogs(filter) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({ filter: this._getFilter(filter) });\n const logs = yield this.perform(\"getLogs\", params);\n logs.forEach((log) => {\n if (log.removed == null) {\n log.removed = false;\n }\n });\n return Formatter.arrayOf(this.formatter.filterLog.bind(this.formatter))(logs);\n });\n }\n getEtherPrice() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n return this.perform(\"getEtherPrice\", {});\n });\n }\n _getBlockTag(blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n blockTag = yield blockTag;\n if (typeof (blockTag) === \"number\" && blockTag < 0) {\n if (blockTag % 1) {\n logger.throwArgumentError(\"invalid BlockTag\", \"blockTag\", blockTag);\n }\n let blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n blockNumber += blockTag;\n if (blockNumber < 0) {\n blockNumber = 0;\n }\n return this.formatter.blockTag(blockNumber);\n }\n return this.formatter.blockTag(blockTag);\n });\n }\n getResolver(name) {\n return __awaiter(this, void 0, void 0, function* () {\n let currentName = name;\n while (true) {\n if (currentName === \"\" || currentName === \".\") {\n return null;\n }\n // Optimization since the eth node cannot change and does\n // not have a wildcard resolver\n if (name !== \"eth\" && currentName === \"eth\") {\n return null;\n }\n // Check the current node for a resolver\n const addr = yield this._getResolver(currentName, \"getResolver\");\n // Found a resolver!\n if (addr != null) {\n const resolver = new Resolver(this, addr, name);\n // Legacy resolver found, using EIP-2544 so it isn't safe to use\n if (currentName !== name && !(yield resolver.supportsWildcard())) {\n return null;\n }\n return resolver;\n }\n // Get the parent node\n currentName = currentName.split(\".\").slice(1).join(\".\");\n }\n });\n }\n _getResolver(name, operation) {\n return __awaiter(this, void 0, void 0, function* () {\n if (operation == null) {\n operation = \"ENS\";\n }\n const network = yield this.getNetwork();\n // No ENS...\n if (!network.ensAddress) {\n logger.throwError(\"network does not support ENS\", Logger.errors.UNSUPPORTED_OPERATION, { operation, network: network.name });\n }\n try {\n // keccak256(\"resolver(bytes32)\")\n const addrData = yield this.call({\n to: network.ensAddress,\n data: (\"0x0178b8bf\" + namehash(name).substring(2))\n });\n return this.formatter.callAddress(addrData);\n }\n catch (error) {\n // ENS registry cannot throw errors on resolver(bytes32)\n }\n return null;\n });\n }\n resolveName(name) {\n return __awaiter(this, void 0, void 0, function* () {\n name = yield name;\n // If it is already an address, nothing to resolve\n try {\n return Promise.resolve(this.formatter.address(name));\n }\n catch (error) {\n // If is is a hexstring, the address is bad (See #694)\n if (isHexString(name)) {\n throw error;\n }\n }\n if (typeof (name) !== \"string\") {\n logger.throwArgumentError(\"invalid ENS name\", \"name\", name);\n }\n // Get the addr from the resolver\n const resolver = yield this.getResolver(name);\n if (!resolver) {\n return null;\n }\n return yield resolver.getAddress();\n });\n }\n lookupAddress(address) {\n return __awaiter(this, void 0, void 0, function* () {\n address = yield address;\n address = this.formatter.address(address);\n const node = address.substring(2).toLowerCase() + \".addr.reverse\";\n const resolverAddr = yield this._getResolver(node, \"lookupAddress\");\n if (resolverAddr == null) {\n return null;\n }\n // keccak(\"name(bytes32)\")\n const name = _parseString(yield this.call({\n to: resolverAddr,\n data: (\"0x691f3431\" + namehash(node).substring(2))\n }), 0);\n const addr = yield this.resolveName(name);\n if (addr != address) {\n return null;\n }\n return name;\n });\n }\n getAvatar(nameOrAddress) {\n return __awaiter(this, void 0, void 0, function* () {\n let resolver = null;\n if (isHexString(nameOrAddress)) {\n // Address; reverse lookup\n const address = this.formatter.address(nameOrAddress);\n const node = address.substring(2).toLowerCase() + \".addr.reverse\";\n const resolverAddress = yield this._getResolver(node, \"getAvatar\");\n if (!resolverAddress) {\n return null;\n }\n // Try resolving the avatar against the addr.reverse resolver\n resolver = new Resolver(this, resolverAddress, node);\n try {\n const avatar = yield resolver.getAvatar();\n if (avatar) {\n return avatar.url;\n }\n }\n catch (error) {\n if (error.code !== Logger.errors.CALL_EXCEPTION) {\n throw error;\n }\n }\n // Try getting the name and performing forward lookup; allowing wildcards\n try {\n // keccak(\"name(bytes32)\")\n const name = _parseString(yield this.call({\n to: resolverAddress,\n data: (\"0x691f3431\" + namehash(node).substring(2))\n }), 0);\n resolver = yield this.getResolver(name);\n }\n catch (error) {\n if (error.code !== Logger.errors.CALL_EXCEPTION) {\n throw error;\n }\n return null;\n }\n }\n else {\n // ENS name; forward lookup with wildcard\n resolver = yield this.getResolver(nameOrAddress);\n if (!resolver) {\n return null;\n }\n }\n const avatar = yield resolver.getAvatar();\n if (avatar == null) {\n return null;\n }\n return avatar.url;\n });\n }\n perform(method, params) {\n return logger.throwError(method + \" not implemented\", Logger.errors.NOT_IMPLEMENTED, { operation: method });\n }\n _startEvent(event) {\n this.polling = (this._events.filter((e) => e.pollable()).length > 0);\n }\n _stopEvent(event) {\n this.polling = (this._events.filter((e) => e.pollable()).length > 0);\n }\n _addEventListener(eventName, listener, once) {\n const event = new Event(getEventTag(eventName), listener, once);\n this._events.push(event);\n this._startEvent(event);\n return this;\n }\n on(eventName, listener) {\n return this._addEventListener(eventName, listener, false);\n }\n once(eventName, listener) {\n return this._addEventListener(eventName, listener, true);\n }\n emit(eventName, ...args) {\n let result = false;\n let stopped = [];\n let eventTag = getEventTag(eventName);\n this._events = this._events.filter((event) => {\n if (event.tag !== eventTag) {\n return true;\n }\n setTimeout(() => {\n event.listener.apply(this, args);\n }, 0);\n result = true;\n if (event.once) {\n stopped.push(event);\n return false;\n }\n return true;\n });\n stopped.forEach((event) => { this._stopEvent(event); });\n return result;\n }\n listenerCount(eventName) {\n if (!eventName) {\n return this._events.length;\n }\n let eventTag = getEventTag(eventName);\n return this._events.filter((event) => {\n return (event.tag === eventTag);\n }).length;\n }\n listeners(eventName) {\n if (eventName == null) {\n return this._events.map((event) => event.listener);\n }\n let eventTag = getEventTag(eventName);\n return this._events\n .filter((event) => (event.tag === eventTag))\n .map((event) => event.listener);\n }\n off(eventName, listener) {\n if (listener == null) {\n return this.removeAllListeners(eventName);\n }\n const stopped = [];\n let found = false;\n let eventTag = getEventTag(eventName);\n this._events = this._events.filter((event) => {\n if (event.tag !== eventTag || event.listener != listener) {\n return true;\n }\n if (found) {\n return true;\n }\n found = true;\n stopped.push(event);\n return false;\n });\n stopped.forEach((event) => { this._stopEvent(event); });\n return this;\n }\n removeAllListeners(eventName) {\n let stopped = [];\n if (eventName == null) {\n stopped = this._events;\n this._events = [];\n }\n else {\n const eventTag = getEventTag(eventName);\n this._events = this._events.filter((event) => {\n if (event.tag !== eventTag) {\n return true;\n }\n stopped.push(event);\n return false;\n });\n }\n stopped.forEach((event) => { this._stopEvent(event); });\n return this;\n }\n}\n//# sourceMappingURL=base-provider.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { Signer } from \"@ethersproject/abstract-signer\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { hexlify, hexValue, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { _TypedDataEncoder } from \"@ethersproject/hash\";\nimport { checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nimport { accessListify } from \"@ethersproject/transactions\";\nimport { fetchJson, poll } from \"@ethersproject/web\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { BaseProvider } from \"./base-provider\";\nconst errorGas = [\"call\", \"estimateGas\"];\nfunction spelunk(value, requireData) {\n if (value == null) {\n return null;\n }\n // These *are* the droids we're looking for.\n if (typeof (value.message) === \"string\" && value.message.match(\"reverted\")) {\n const data = isHexString(value.data) ? value.data : null;\n if (!requireData || data) {\n return { message: value.message, data };\n }\n }\n // Spelunk further...\n if (typeof (value) === \"object\") {\n for (const key in value) {\n const result = spelunk(value[key], requireData);\n if (result) {\n return result;\n }\n }\n return null;\n }\n // Might be a JSON string we can further descend...\n if (typeof (value) === \"string\") {\n try {\n return spelunk(JSON.parse(value), requireData);\n }\n catch (error) { }\n }\n return null;\n}\nfunction checkError(method, error, params) {\n const transaction = params.transaction || params.signedTransaction;\n // Undo the \"convenience\" some nodes are attempting to prevent backwards\n // incompatibility; maybe for v6 consider forwarding reverts as errors\n if (method === \"call\") {\n const result = spelunk(error, true);\n if (result) {\n return result.data;\n }\n // Nothing descriptive..\n logger.throwError(\"missing revert data in call exception; Transaction reverted without a reason string\", Logger.errors.CALL_EXCEPTION, {\n data: \"0x\", transaction, error\n });\n }\n if (method === \"estimateGas\") {\n // Try to find something, with a preference on SERVER_ERROR body\n let result = spelunk(error.body, false);\n if (result == null) {\n result = spelunk(error, false);\n }\n // Found \"reverted\", this is a CALL_EXCEPTION\n if (result) {\n logger.throwError(\"cannot estimate gas; transaction may fail or may require manual gas limit\", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {\n reason: result.message, method, transaction, error\n });\n }\n }\n // @TODO: Should we spelunk for message too?\n let message = error.message;\n if (error.code === Logger.errors.SERVER_ERROR && error.error && typeof (error.error.message) === \"string\") {\n message = error.error.message;\n }\n else if (typeof (error.body) === \"string\") {\n message = error.body;\n }\n else if (typeof (error.responseText) === \"string\") {\n message = error.responseText;\n }\n message = (message || \"\").toLowerCase();\n // \"insufficient funds for gas * price + value + cost(data)\"\n if (message.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)) {\n logger.throwError(\"insufficient funds for intrinsic transaction cost\", Logger.errors.INSUFFICIENT_FUNDS, {\n error, method, transaction\n });\n }\n // \"nonce too low\"\n if (message.match(/nonce (is )?too low/i)) {\n logger.throwError(\"nonce has already been used\", Logger.errors.NONCE_EXPIRED, {\n error, method, transaction\n });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction underpriced|transaction gas price.*too low/i)) {\n logger.throwError(\"replacement fee too low\", Logger.errors.REPLACEMENT_UNDERPRICED, {\n error, method, transaction\n });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/only replay-protected/i)) {\n logger.throwError(\"legacy pre-eip-155 transactions not supported\", Logger.errors.UNSUPPORTED_OPERATION, {\n error, method, transaction\n });\n }\n if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)) {\n logger.throwError(\"cannot estimate gas; transaction may fail or may require manual gas limit\", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {\n error, method, transaction\n });\n }\n throw error;\n}\nfunction timer(timeout) {\n return new Promise(function (resolve) {\n setTimeout(resolve, timeout);\n });\n}\nfunction getResult(payload) {\n if (payload.error) {\n // @TODO: not any\n const error = new Error(payload.error.message);\n error.code = payload.error.code;\n error.data = payload.error.data;\n throw error;\n }\n return payload.result;\n}\nfunction getLowerCase(value) {\n if (value) {\n return value.toLowerCase();\n }\n return value;\n}\nconst _constructorGuard = {};\nexport class JsonRpcSigner extends Signer {\n constructor(constructorGuard, provider, addressOrIndex) {\n super();\n if (constructorGuard !== _constructorGuard) {\n throw new Error(\"do not call the JsonRpcSigner constructor directly; use provider.getSigner\");\n }\n defineReadOnly(this, \"provider\", provider);\n if (addressOrIndex == null) {\n addressOrIndex = 0;\n }\n if (typeof (addressOrIndex) === \"string\") {\n defineReadOnly(this, \"_address\", this.provider.formatter.address(addressOrIndex));\n defineReadOnly(this, \"_index\", null);\n }\n else if (typeof (addressOrIndex) === \"number\") {\n defineReadOnly(this, \"_index\", addressOrIndex);\n defineReadOnly(this, \"_address\", null);\n }\n else {\n logger.throwArgumentError(\"invalid address or index\", \"addressOrIndex\", addressOrIndex);\n }\n }\n connect(provider) {\n return logger.throwError(\"cannot alter JSON-RPC Signer connection\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"connect\"\n });\n }\n connectUnchecked() {\n return new UncheckedJsonRpcSigner(_constructorGuard, this.provider, this._address || this._index);\n }\n getAddress() {\n if (this._address) {\n return Promise.resolve(this._address);\n }\n return this.provider.send(\"eth_accounts\", []).then((accounts) => {\n if (accounts.length <= this._index) {\n logger.throwError(\"unknown account #\" + this._index, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"getAddress\"\n });\n }\n return this.provider.formatter.address(accounts[this._index]);\n });\n }\n sendUncheckedTransaction(transaction) {\n transaction = shallowCopy(transaction);\n const fromAddress = this.getAddress().then((address) => {\n if (address) {\n address = address.toLowerCase();\n }\n return address;\n });\n // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user\n // wishes to use this, it is easy to specify explicitly, otherwise\n // we look it up for them.\n if (transaction.gasLimit == null) {\n const estimate = shallowCopy(transaction);\n estimate.from = fromAddress;\n transaction.gasLimit = this.provider.estimateGas(estimate);\n }\n if (transaction.to != null) {\n transaction.to = Promise.resolve(transaction.to).then((to) => __awaiter(this, void 0, void 0, function* () {\n if (to == null) {\n return null;\n }\n const address = yield this.provider.resolveName(to);\n if (address == null) {\n logger.throwArgumentError(\"provided ENS name resolves to null\", \"tx.to\", to);\n }\n return address;\n }));\n }\n return resolveProperties({\n tx: resolveProperties(transaction),\n sender: fromAddress\n }).then(({ tx, sender }) => {\n if (tx.from != null) {\n if (tx.from.toLowerCase() !== sender) {\n logger.throwArgumentError(\"from address mismatch\", \"transaction\", transaction);\n }\n }\n else {\n tx.from = sender;\n }\n const hexTx = this.provider.constructor.hexlifyTransaction(tx, { from: true });\n return this.provider.send(\"eth_sendTransaction\", [hexTx]).then((hash) => {\n return hash;\n }, (error) => {\n if (typeof (error.message) === \"string\" && error.message.match(/user denied/i)) {\n logger.throwError(\"user rejected transaction\", Logger.errors.ACTION_REJECTED, {\n action: \"sendTransaction\",\n transaction: tx\n });\n }\n return checkError(\"sendTransaction\", error, hexTx);\n });\n });\n }\n signTransaction(transaction) {\n return logger.throwError(\"signing transactions is unsupported\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"signTransaction\"\n });\n }\n sendTransaction(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n // This cannot be mined any earlier than any recent block\n const blockNumber = yield this.provider._getInternalBlockNumber(100 + 2 * this.provider.pollingInterval);\n // Send the transaction\n const hash = yield this.sendUncheckedTransaction(transaction);\n try {\n // Unfortunately, JSON-RPC only provides and opaque transaction hash\n // for a response, and we need the actual transaction, so we poll\n // for it; it should show up very quickly\n return yield poll(() => __awaiter(this, void 0, void 0, function* () {\n const tx = yield this.provider.getTransaction(hash);\n if (tx === null) {\n return undefined;\n }\n return this.provider._wrapTransaction(tx, hash, blockNumber);\n }), { oncePoll: this.provider });\n }\n catch (error) {\n error.transactionHash = hash;\n throw error;\n }\n });\n }\n signMessage(message) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = ((typeof (message) === \"string\") ? toUtf8Bytes(message) : message);\n const address = yield this.getAddress();\n try {\n return yield this.provider.send(\"personal_sign\", [hexlify(data), address.toLowerCase()]);\n }\n catch (error) {\n if (typeof (error.message) === \"string\" && error.message.match(/user denied/i)) {\n logger.throwError(\"user rejected signing\", Logger.errors.ACTION_REJECTED, {\n action: \"signMessage\",\n from: address,\n messageData: message\n });\n }\n throw error;\n }\n });\n }\n _legacySignMessage(message) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = ((typeof (message) === \"string\") ? toUtf8Bytes(message) : message);\n const address = yield this.getAddress();\n try {\n // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign\n return yield this.provider.send(\"eth_sign\", [address.toLowerCase(), hexlify(data)]);\n }\n catch (error) {\n if (typeof (error.message) === \"string\" && error.message.match(/user denied/i)) {\n logger.throwError(\"user rejected signing\", Logger.errors.ACTION_REJECTED, {\n action: \"_legacySignMessage\",\n from: address,\n messageData: message\n });\n }\n throw error;\n }\n });\n }\n _signTypedData(domain, types, value) {\n return __awaiter(this, void 0, void 0, function* () {\n // Populate any ENS names (in-place)\n const populated = yield _TypedDataEncoder.resolveNames(domain, types, value, (name) => {\n return this.provider.resolveName(name);\n });\n const address = yield this.getAddress();\n try {\n return yield this.provider.send(\"eth_signTypedData_v4\", [\n address.toLowerCase(),\n JSON.stringify(_TypedDataEncoder.getPayload(populated.domain, types, populated.value))\n ]);\n }\n catch (error) {\n if (typeof (error.message) === \"string\" && error.message.match(/user denied/i)) {\n logger.throwError(\"user rejected signing\", Logger.errors.ACTION_REJECTED, {\n action: \"_signTypedData\",\n from: address,\n messageData: { domain: populated.domain, types, value: populated.value }\n });\n }\n throw error;\n }\n });\n }\n unlock(password) {\n return __awaiter(this, void 0, void 0, function* () {\n const provider = this.provider;\n const address = yield this.getAddress();\n return provider.send(\"personal_unlockAccount\", [address.toLowerCase(), password, null]);\n });\n }\n}\nclass UncheckedJsonRpcSigner extends JsonRpcSigner {\n sendTransaction(transaction) {\n return this.sendUncheckedTransaction(transaction).then((hash) => {\n return {\n hash: hash,\n nonce: null,\n gasLimit: null,\n gasPrice: null,\n data: null,\n value: null,\n chainId: null,\n confirmations: 0,\n from: null,\n wait: (confirmations) => { return this.provider.waitForTransaction(hash, confirmations); }\n };\n });\n }\n}\nconst allowedTransactionKeys = {\n chainId: true, data: true, gasLimit: true, gasPrice: true, nonce: true, to: true, value: true,\n type: true, accessList: true,\n maxFeePerGas: true, maxPriorityFeePerGas: true\n};\nexport class JsonRpcProvider extends BaseProvider {\n constructor(url, network) {\n let networkOrReady = network;\n // The network is unknown, query the JSON-RPC for it\n if (networkOrReady == null) {\n networkOrReady = new Promise((resolve, reject) => {\n setTimeout(() => {\n this.detectNetwork().then((network) => {\n resolve(network);\n }, (error) => {\n reject(error);\n });\n }, 0);\n });\n }\n super(networkOrReady);\n // Default URL\n if (!url) {\n url = getStatic(this.constructor, \"defaultUrl\")();\n }\n if (typeof (url) === \"string\") {\n defineReadOnly(this, \"connection\", Object.freeze({\n url: url\n }));\n }\n else {\n defineReadOnly(this, \"connection\", Object.freeze(shallowCopy(url)));\n }\n this._nextId = 42;\n }\n get _cache() {\n if (this._eventLoopCache == null) {\n this._eventLoopCache = {};\n }\n return this._eventLoopCache;\n }\n static defaultUrl() {\n return \"http:/\\/localhost:8545\";\n }\n detectNetwork() {\n if (!this._cache[\"detectNetwork\"]) {\n this._cache[\"detectNetwork\"] = this._uncachedDetectNetwork();\n // Clear this cache at the beginning of the next event loop\n setTimeout(() => {\n this._cache[\"detectNetwork\"] = null;\n }, 0);\n }\n return this._cache[\"detectNetwork\"];\n }\n _uncachedDetectNetwork() {\n return __awaiter(this, void 0, void 0, function* () {\n yield timer(0);\n let chainId = null;\n try {\n chainId = yield this.send(\"eth_chainId\", []);\n }\n catch (error) {\n try {\n chainId = yield this.send(\"net_version\", []);\n }\n catch (error) { }\n }\n if (chainId != null) {\n const getNetwork = getStatic(this.constructor, \"getNetwork\");\n try {\n return getNetwork(BigNumber.from(chainId).toNumber());\n }\n catch (error) {\n return logger.throwError(\"could not detect network\", Logger.errors.NETWORK_ERROR, {\n chainId: chainId,\n event: \"invalidNetwork\",\n serverError: error\n });\n }\n }\n return logger.throwError(\"could not detect network\", Logger.errors.NETWORK_ERROR, {\n event: \"noNetwork\"\n });\n });\n }\n getSigner(addressOrIndex) {\n return new JsonRpcSigner(_constructorGuard, this, addressOrIndex);\n }\n getUncheckedSigner(addressOrIndex) {\n return this.getSigner(addressOrIndex).connectUnchecked();\n }\n listAccounts() {\n return this.send(\"eth_accounts\", []).then((accounts) => {\n return accounts.map((a) => this.formatter.address(a));\n });\n }\n send(method, params) {\n const request = {\n method: method,\n params: params,\n id: (this._nextId++),\n jsonrpc: \"2.0\"\n };\n this.emit(\"debug\", {\n action: \"request\",\n request: deepCopy(request),\n provider: this\n });\n // We can expand this in the future to any call, but for now these\n // are the biggest wins and do not require any serializing parameters.\n const cache = ([\"eth_chainId\", \"eth_blockNumber\"].indexOf(method) >= 0);\n if (cache && this._cache[method]) {\n return this._cache[method];\n }\n const result = fetchJson(this.connection, JSON.stringify(request), getResult).then((result) => {\n this.emit(\"debug\", {\n action: \"response\",\n request: request,\n response: result,\n provider: this\n });\n return result;\n }, (error) => {\n this.emit(\"debug\", {\n action: \"response\",\n error: error,\n request: request,\n provider: this\n });\n throw error;\n });\n // Cache the fetch, but clear it on the next event loop\n if (cache) {\n this._cache[method] = result;\n setTimeout(() => {\n this._cache[method] = null;\n }, 0);\n }\n return result;\n }\n prepareRequest(method, params) {\n switch (method) {\n case \"getBlockNumber\":\n return [\"eth_blockNumber\", []];\n case \"getGasPrice\":\n return [\"eth_gasPrice\", []];\n case \"getBalance\":\n return [\"eth_getBalance\", [getLowerCase(params.address), params.blockTag]];\n case \"getTransactionCount\":\n return [\"eth_getTransactionCount\", [getLowerCase(params.address), params.blockTag]];\n case \"getCode\":\n return [\"eth_getCode\", [getLowerCase(params.address), params.blockTag]];\n case \"getStorageAt\":\n return [\"eth_getStorageAt\", [getLowerCase(params.address), hexZeroPad(params.position, 32), params.blockTag]];\n case \"sendTransaction\":\n return [\"eth_sendRawTransaction\", [params.signedTransaction]];\n case \"getBlock\":\n if (params.blockTag) {\n return [\"eth_getBlockByNumber\", [params.blockTag, !!params.includeTransactions]];\n }\n else if (params.blockHash) {\n return [\"eth_getBlockByHash\", [params.blockHash, !!params.includeTransactions]];\n }\n return null;\n case \"getTransaction\":\n return [\"eth_getTransactionByHash\", [params.transactionHash]];\n case \"getTransactionReceipt\":\n return [\"eth_getTransactionReceipt\", [params.transactionHash]];\n case \"call\": {\n const hexlifyTransaction = getStatic(this.constructor, \"hexlifyTransaction\");\n return [\"eth_call\", [hexlifyTransaction(params.transaction, { from: true }), params.blockTag]];\n }\n case \"estimateGas\": {\n const hexlifyTransaction = getStatic(this.constructor, \"hexlifyTransaction\");\n return [\"eth_estimateGas\", [hexlifyTransaction(params.transaction, { from: true })]];\n }\n case \"getLogs\":\n if (params.filter && params.filter.address != null) {\n params.filter.address = getLowerCase(params.filter.address);\n }\n return [\"eth_getLogs\", [params.filter]];\n default:\n break;\n }\n return null;\n }\n perform(method, params) {\n return __awaiter(this, void 0, void 0, function* () {\n // Legacy networks do not like the type field being passed along (which\n // is fair), so we delete type if it is 0 and a non-EIP-1559 network\n if (method === \"call\" || method === \"estimateGas\") {\n const tx = params.transaction;\n if (tx && tx.type != null && BigNumber.from(tx.type).isZero()) {\n // If there are no EIP-1559 properties, it might be non-EIP-1559\n if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {\n const feeData = yield this.getFeeData();\n if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {\n // Network doesn't know about EIP-1559 (and hence type)\n params = shallowCopy(params);\n params.transaction = shallowCopy(tx);\n delete params.transaction.type;\n }\n }\n }\n }\n const args = this.prepareRequest(method, params);\n if (args == null) {\n logger.throwError(method + \" not implemented\", Logger.errors.NOT_IMPLEMENTED, { operation: method });\n }\n try {\n return yield this.send(args[0], args[1]);\n }\n catch (error) {\n return checkError(method, error, params);\n }\n });\n }\n _startEvent(event) {\n if (event.tag === \"pending\") {\n this._startPending();\n }\n super._startEvent(event);\n }\n _startPending() {\n if (this._pendingFilter != null) {\n return;\n }\n const self = this;\n const pendingFilter = this.send(\"eth_newPendingTransactionFilter\", []);\n this._pendingFilter = pendingFilter;\n pendingFilter.then(function (filterId) {\n function poll() {\n self.send(\"eth_getFilterChanges\", [filterId]).then(function (hashes) {\n if (self._pendingFilter != pendingFilter) {\n return null;\n }\n let seq = Promise.resolve();\n hashes.forEach(function (hash) {\n // @TODO: This should be garbage collected at some point... How? When?\n self._emitted[\"t:\" + hash.toLowerCase()] = \"pending\";\n seq = seq.then(function () {\n return self.getTransaction(hash).then(function (tx) {\n self.emit(\"pending\", tx);\n return null;\n });\n });\n });\n return seq.then(function () {\n return timer(1000);\n });\n }).then(function () {\n if (self._pendingFilter != pendingFilter) {\n self.send(\"eth_uninstallFilter\", [filterId]);\n return;\n }\n setTimeout(function () { poll(); }, 0);\n return null;\n }).catch((error) => { });\n }\n poll();\n return filterId;\n }).catch((error) => { });\n }\n _stopEvent(event) {\n if (event.tag === \"pending\" && this.listenerCount(\"pending\") === 0) {\n this._pendingFilter = null;\n }\n super._stopEvent(event);\n }\n // Convert an ethers.js transaction into a JSON-RPC transaction\n // - gasLimit => gas\n // - All values hexlified\n // - All numeric values zero-striped\n // - All addresses are lowercased\n // NOTE: This allows a TransactionRequest, but all values should be resolved\n // before this is called\n // @TODO: This will likely be removed in future versions and prepareRequest\n // will be the preferred method for this.\n static hexlifyTransaction(transaction, allowExtra) {\n // Check only allowed properties are given\n const allowed = shallowCopy(allowedTransactionKeys);\n if (allowExtra) {\n for (const key in allowExtra) {\n if (allowExtra[key]) {\n allowed[key] = true;\n }\n }\n }\n checkProperties(transaction, allowed);\n const result = {};\n // JSON-RPC now requires numeric values to be \"quantity\" values\n [\"chainId\", \"gasLimit\", \"gasPrice\", \"type\", \"maxFeePerGas\", \"maxPriorityFeePerGas\", \"nonce\", \"value\"].forEach(function (key) {\n if (transaction[key] == null) {\n return;\n }\n const value = hexValue(BigNumber.from(transaction[key]));\n if (key === \"gasLimit\") {\n key = \"gas\";\n }\n result[key] = value;\n });\n [\"from\", \"to\", \"data\"].forEach(function (key) {\n if (transaction[key] == null) {\n return;\n }\n result[key] = hexlify(transaction[key]);\n });\n if (transaction.accessList) {\n result[\"accessList\"] = accessListify(transaction.accessList);\n }\n return result;\n }\n}\n//# sourceMappingURL=json-rpc-provider.js.map","\"use strict\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nlet WS = null;\ntry {\n WS = WebSocket;\n if (WS == null) {\n throw new Error(\"inject please\");\n }\n}\ncatch (error) {\n const logger = new Logger(version);\n WS = function () {\n logger.throwError(\"WebSockets not supported in this environment\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new WebSocket()\"\n });\n };\n}\n//export default WS;\n//module.exports = WS;\nexport { WS as WebSocket };\n//# sourceMappingURL=ws.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { JsonRpcProvider } from \"./json-rpc-provider\";\nimport { WebSocket } from \"./ws\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n/**\n * Notes:\n *\n * This provider differs a bit from the polling providers. One main\n * difference is how it handles consistency. The polling providers\n * will stall responses to ensure a consistent state, while this\n * WebSocket provider assumes the connected backend will manage this.\n *\n * For example, if a polling provider emits an event which indicates\n * the event occurred in blockhash XXX, a call to fetch that block by\n * its hash XXX, if not present will retry until it is present. This\n * can occur when querying a pool of nodes that are mildly out of sync\n * with each other.\n */\nlet NextId = 1;\n// For more info about the Real-time Event API see:\n// https://geth.ethereum.org/docs/rpc/pubsub\nexport class WebSocketProvider extends JsonRpcProvider {\n constructor(url, network) {\n // This will be added in the future; please open an issue to expedite\n if (network === \"any\") {\n logger.throwError(\"WebSocketProvider does not support 'any' network yet\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"network:any\"\n });\n }\n if (typeof (url) === \"string\") {\n super(url, network);\n }\n else {\n super(\"_websocket\", network);\n }\n this._pollingInterval = -1;\n this._wsReady = false;\n if (typeof (url) === \"string\") {\n defineReadOnly(this, \"_websocket\", new WebSocket(this.connection.url));\n }\n else {\n defineReadOnly(this, \"_websocket\", url);\n }\n defineReadOnly(this, \"_requests\", {});\n defineReadOnly(this, \"_subs\", {});\n defineReadOnly(this, \"_subIds\", {});\n defineReadOnly(this, \"_detectNetwork\", super.detectNetwork());\n // Stall sending requests until the socket is open...\n this.websocket.onopen = () => {\n this._wsReady = true;\n Object.keys(this._requests).forEach((id) => {\n this.websocket.send(this._requests[id].payload);\n });\n };\n this.websocket.onmessage = (messageEvent) => {\n const data = messageEvent.data;\n const result = JSON.parse(data);\n if (result.id != null) {\n const id = String(result.id);\n const request = this._requests[id];\n delete this._requests[id];\n if (result.result !== undefined) {\n request.callback(null, result.result);\n this.emit(\"debug\", {\n action: \"response\",\n request: JSON.parse(request.payload),\n response: result.result,\n provider: this\n });\n }\n else {\n let error = null;\n if (result.error) {\n error = new Error(result.error.message || \"unknown error\");\n defineReadOnly(error, \"code\", result.error.code || null);\n defineReadOnly(error, \"response\", data);\n }\n else {\n error = new Error(\"unknown error\");\n }\n request.callback(error, undefined);\n this.emit(\"debug\", {\n action: \"response\",\n error: error,\n request: JSON.parse(request.payload),\n provider: this\n });\n }\n }\n else if (result.method === \"eth_subscription\") {\n // Subscription...\n const sub = this._subs[result.params.subscription];\n if (sub) {\n //this.emit.apply(this, );\n sub.processFunc(result.params.result);\n }\n }\n else {\n console.warn(\"this should not happen\");\n }\n };\n // This Provider does not actually poll, but we want to trigger\n // poll events for things that depend on them (like stalling for\n // block and transaction lookups)\n const fauxPoll = setInterval(() => {\n this.emit(\"poll\");\n }, 1000);\n if (fauxPoll.unref) {\n fauxPoll.unref();\n }\n }\n // Cannot narrow the type of _websocket, as that is not backwards compatible\n // so we add a getter and let the WebSocket be a public API.\n get websocket() { return this._websocket; }\n detectNetwork() {\n return this._detectNetwork;\n }\n get pollingInterval() {\n return 0;\n }\n resetEventsBlock(blockNumber) {\n logger.throwError(\"cannot reset events block on WebSocketProvider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"resetEventBlock\"\n });\n }\n set pollingInterval(value) {\n logger.throwError(\"cannot set polling interval on WebSocketProvider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setPollingInterval\"\n });\n }\n poll() {\n return __awaiter(this, void 0, void 0, function* () {\n return null;\n });\n }\n set polling(value) {\n if (!value) {\n return;\n }\n logger.throwError(\"cannot set polling on WebSocketProvider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setPolling\"\n });\n }\n send(method, params) {\n const rid = NextId++;\n return new Promise((resolve, reject) => {\n function callback(error, result) {\n if (error) {\n return reject(error);\n }\n return resolve(result);\n }\n const payload = JSON.stringify({\n method: method,\n params: params,\n id: rid,\n jsonrpc: \"2.0\"\n });\n this.emit(\"debug\", {\n action: \"request\",\n request: JSON.parse(payload),\n provider: this\n });\n this._requests[String(rid)] = { callback, payload };\n if (this._wsReady) {\n this.websocket.send(payload);\n }\n });\n }\n static defaultUrl() {\n return \"ws:/\\/localhost:8546\";\n }\n _subscribe(tag, param, processFunc) {\n return __awaiter(this, void 0, void 0, function* () {\n let subIdPromise = this._subIds[tag];\n if (subIdPromise == null) {\n subIdPromise = Promise.all(param).then((param) => {\n return this.send(\"eth_subscribe\", param);\n });\n this._subIds[tag] = subIdPromise;\n }\n const subId = yield subIdPromise;\n this._subs[subId] = { tag, processFunc };\n });\n }\n _startEvent(event) {\n switch (event.type) {\n case \"block\":\n this._subscribe(\"block\", [\"newHeads\"], (result) => {\n const blockNumber = BigNumber.from(result.number).toNumber();\n this._emitted.block = blockNumber;\n this.emit(\"block\", blockNumber);\n });\n break;\n case \"pending\":\n this._subscribe(\"pending\", [\"newPendingTransactions\"], (result) => {\n this.emit(\"pending\", result);\n });\n break;\n case \"filter\":\n this._subscribe(event.tag, [\"logs\", this._getFilter(event.filter)], (result) => {\n if (result.removed == null) {\n result.removed = false;\n }\n this.emit(event.filter, this.formatter.filterLog(result));\n });\n break;\n case \"tx\": {\n const emitReceipt = (event) => {\n const hash = event.hash;\n this.getTransactionReceipt(hash).then((receipt) => {\n if (!receipt) {\n return;\n }\n this.emit(hash, receipt);\n });\n };\n // In case it is already mined\n emitReceipt(event);\n // To keep things simple, we start up a single newHeads subscription\n // to keep an eye out for transactions we are watching for.\n // Starting a subscription for an event (i.e. \"tx\") that is already\n // running is (basically) a nop.\n this._subscribe(\"tx\", [\"newHeads\"], (result) => {\n this._events.filter((e) => (e.type === \"tx\")).forEach(emitReceipt);\n });\n break;\n }\n // Nothing is needed\n case \"debug\":\n case \"poll\":\n case \"willPoll\":\n case \"didPoll\":\n case \"error\":\n break;\n default:\n console.log(\"unhandled:\", event);\n break;\n }\n }\n _stopEvent(event) {\n let tag = event.tag;\n if (event.type === \"tx\") {\n // There are remaining transaction event listeners\n if (this._events.filter((e) => (e.type === \"tx\")).length) {\n return;\n }\n tag = \"tx\";\n }\n else if (this.listenerCount(event.event)) {\n // There are remaining event listeners\n return;\n }\n const subId = this._subIds[tag];\n if (!subId) {\n return;\n }\n delete this._subIds[tag];\n subId.then((subId) => {\n if (!this._subs[subId]) {\n return;\n }\n delete this._subs[subId];\n this.send(\"eth_unsubscribe\", [subId]);\n });\n }\n destroy() {\n return __awaiter(this, void 0, void 0, function* () {\n // Wait until we have connected before trying to disconnect\n if (this.websocket.readyState === WebSocket.CONNECTING) {\n yield (new Promise((resolve) => {\n this.websocket.onopen = function () {\n resolve(true);\n };\n this.websocket.onerror = function () {\n resolve(false);\n };\n }));\n }\n // Hangup\n // See: https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes\n this.websocket.close(1000);\n });\n }\n}\n//# sourceMappingURL=websocket-provider.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { defineReadOnly, getStatic } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { JsonRpcProvider } from \"./json-rpc-provider\";\n// A StaticJsonRpcProvider is useful when you *know* for certain that\n// the backend will never change, as it never calls eth_chainId to\n// verify its backend. However, if the backend does change, the effects\n// are undefined and may include:\n// - inconsistent results\n// - locking up the UI\n// - block skew warnings\n// - wrong results\n// If the network is not explicit (i.e. auto-detection is expected), the\n// node MUST be running and available to respond to requests BEFORE this\n// is instantiated.\nexport class StaticJsonRpcProvider extends JsonRpcProvider {\n detectNetwork() {\n const _super = Object.create(null, {\n detectNetwork: { get: () => super.detectNetwork }\n });\n return __awaiter(this, void 0, void 0, function* () {\n let network = this.network;\n if (network == null) {\n network = yield _super.detectNetwork.call(this);\n if (!network) {\n logger.throwError(\"no network detected\", Logger.errors.UNKNOWN_ERROR, {});\n }\n // If still not set, set it\n if (this._network == null) {\n // A static network does not support \"any\"\n defineReadOnly(this, \"_network\", network);\n this.emit(\"network\", network, null);\n }\n }\n return network;\n });\n }\n}\nexport class UrlJsonRpcProvider extends StaticJsonRpcProvider {\n constructor(network, apiKey) {\n logger.checkAbstract(new.target, UrlJsonRpcProvider);\n // Normalize the Network and API Key\n network = getStatic(new.target, \"getNetwork\")(network);\n apiKey = getStatic(new.target, \"getApiKey\")(apiKey);\n const connection = getStatic(new.target, \"getUrl\")(network, apiKey);\n super(connection, network);\n if (typeof (apiKey) === \"string\") {\n defineReadOnly(this, \"apiKey\", apiKey);\n }\n else if (apiKey != null) {\n Object.keys(apiKey).forEach((key) => {\n defineReadOnly(this, key, apiKey[key]);\n });\n }\n }\n _startPending() {\n logger.warn(\"WARNING: API provider does not support pending filters\");\n }\n isCommunityResource() {\n return false;\n }\n getSigner(address) {\n return logger.throwError(\"API provider does not support signing\", Logger.errors.UNSUPPORTED_OPERATION, { operation: \"getSigner\" });\n }\n listAccounts() {\n return Promise.resolve([]);\n }\n // Return a defaultApiKey if null, otherwise validate the API key\n static getApiKey(apiKey) {\n return apiKey;\n }\n // Returns the url or connection for the given network and API key. The\n // API key will have been sanitized by the getApiKey first, so any validation\n // or transformations can be done there.\n static getUrl(network, apiKey) {\n return logger.throwError(\"not implemented; sub-classes must override getUrl\", Logger.errors.NOT_IMPLEMENTED, {\n operation: \"getUrl\"\n });\n }\n}\n//# sourceMappingURL=url-json-rpc-provider.js.map","\"use strict\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { showThrottleMessage } from \"./formatter\";\nimport { WebSocketProvider } from \"./websocket-provider\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\n// This key was provided to ethers.js by Alchemy to be used by the\n// default provider, but it is recommended that for your own\n// production environments, that you acquire your own API key at:\n// https://dashboard.alchemyapi.io\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nexport class AlchemyWebSocketProvider extends WebSocketProvider {\n constructor(network, apiKey) {\n const provider = new AlchemyProvider(network, apiKey);\n const url = provider.connection.url.replace(/^http/i, \"ws\")\n .replace(\".alchemyapi.\", \".ws.alchemyapi.\");\n super(url, provider.network);\n defineReadOnly(this, \"apiKey\", provider.apiKey);\n }\n isCommunityResource() {\n return (this.apiKey === defaultApiKey);\n }\n}\nexport class AlchemyProvider extends UrlJsonRpcProvider {\n static getWebSocketProvider(network, apiKey) {\n return new AlchemyWebSocketProvider(network, apiKey);\n }\n static getApiKey(apiKey) {\n if (apiKey == null) {\n return defaultApiKey;\n }\n if (apiKey && typeof (apiKey) !== \"string\") {\n logger.throwArgumentError(\"invalid apiKey\", \"apiKey\", apiKey);\n }\n return apiKey;\n }\n static getUrl(network, apiKey) {\n let host = null;\n switch (network.name) {\n case \"homestead\":\n host = \"eth-mainnet.alchemyapi.io/v2/\";\n break;\n case \"goerli\":\n host = \"eth-goerli.g.alchemy.com/v2/\";\n break;\n case \"matic\":\n host = \"polygon-mainnet.g.alchemy.com/v2/\";\n break;\n case \"maticmum\":\n host = \"polygon-mumbai.g.alchemy.com/v2/\";\n break;\n case \"arbitrum\":\n host = \"arb-mainnet.g.alchemy.com/v2/\";\n break;\n case \"arbitrum-goerli\":\n host = \"arb-goerli.g.alchemy.com/v2/\";\n break;\n case \"optimism\":\n host = \"opt-mainnet.g.alchemy.com/v2/\";\n break;\n case \"optimism-goerli\":\n host = \"opt-goerli.g.alchemy.com/v2/\";\n break;\n default:\n logger.throwArgumentError(\"unsupported network\", \"network\", arguments[0]);\n }\n return {\n allowGzip: true,\n url: (\"https:/\" + \"/\" + host + apiKey),\n throttleCallback: (attempt, url) => {\n if (apiKey === defaultApiKey) {\n showThrottleMessage();\n }\n return Promise.resolve(true);\n }\n };\n }\n isCommunityResource() {\n return (this.apiKey === defaultApiKey);\n }\n}\n//# sourceMappingURL=alchemy-provider.js.map","import { showThrottleMessage } from \"./formatter\";\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nconst defaultApiKey = \"9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972\";\nfunction getHost(name) {\n switch (name) {\n case \"homestead\":\n return \"rpc.ankr.com/eth/\";\n case \"ropsten\":\n return \"rpc.ankr.com/eth_ropsten/\";\n case \"rinkeby\":\n return \"rpc.ankr.com/eth_rinkeby/\";\n case \"goerli\":\n return \"rpc.ankr.com/eth_goerli/\";\n case \"matic\":\n return \"rpc.ankr.com/polygon/\";\n case \"arbitrum\":\n return \"rpc.ankr.com/arbitrum/\";\n }\n return logger.throwArgumentError(\"unsupported network\", \"name\", name);\n}\nexport class AnkrProvider extends UrlJsonRpcProvider {\n isCommunityResource() {\n return (this.apiKey === defaultApiKey);\n }\n static getApiKey(apiKey) {\n if (apiKey == null) {\n return defaultApiKey;\n }\n return apiKey;\n }\n static getUrl(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const connection = {\n allowGzip: true,\n url: (\"https:/\\/\" + getHost(network.name) + apiKey),\n throttleCallback: (attempt, url) => {\n if (apiKey.apiKey === defaultApiKey) {\n showThrottleMessage();\n }\n return Promise.resolve(true);\n }\n };\n if (apiKey.projectSecret != null) {\n connection.user = \"\";\n connection.password = apiKey.projectSecret;\n }\n return connection;\n }\n}\n//# sourceMappingURL=ankr-provider.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport class CloudflareProvider extends UrlJsonRpcProvider {\n static getApiKey(apiKey) {\n if (apiKey != null) {\n logger.throwArgumentError(\"apiKey not supported for cloudflare\", \"apiKey\", apiKey);\n }\n return null;\n }\n static getUrl(network, apiKey) {\n let host = null;\n switch (network.name) {\n case \"homestead\":\n host = \"https://cloudflare-eth.com/\";\n break;\n default:\n logger.throwArgumentError(\"unsupported network\", \"network\", arguments[0]);\n }\n return host;\n }\n perform(method, params) {\n const _super = Object.create(null, {\n perform: { get: () => super.perform }\n });\n return __awaiter(this, void 0, void 0, function* () {\n // The Cloudflare provider does not support eth_blockNumber,\n // so we get the latest block and pull it from that\n if (method === \"getBlockNumber\") {\n const block = yield _super.perform.call(this, \"getBlock\", { blockTag: \"latest\" });\n return block.number;\n }\n return _super.perform.call(this, method, params);\n });\n }\n}\n//# sourceMappingURL=cloudflare-provider.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { hexlify, hexValue, isHexString } from \"@ethersproject/bytes\";\nimport { deepCopy, defineReadOnly } from \"@ethersproject/properties\";\nimport { accessListify } from \"@ethersproject/transactions\";\nimport { fetchJson } from \"@ethersproject/web\";\nimport { showThrottleMessage } from \"./formatter\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { BaseProvider } from \"./base-provider\";\n// The transaction has already been sanitized by the calls in Provider\nfunction getTransactionPostData(transaction) {\n const result = {};\n for (let key in transaction) {\n if (transaction[key] == null) {\n continue;\n }\n let value = transaction[key];\n if (key === \"type\" && value === 0) {\n continue;\n }\n // Quantity-types require no leading zero, unless 0\n if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) {\n value = hexValue(hexlify(value));\n }\n else if (key === \"accessList\") {\n value = \"[\" + accessListify(value).map((set) => {\n return `{address:\"${set.address}\",storageKeys:[\"${set.storageKeys.join('\",\"')}\"]}`;\n }).join(\",\") + \"]\";\n }\n else {\n value = hexlify(value);\n }\n result[key] = value;\n }\n return result;\n}\nfunction getResult(result) {\n // getLogs, getHistory have weird success responses\n if (result.status == 0 && (result.message === \"No records found\" || result.message === \"No transactions found\")) {\n return result.result;\n }\n if (result.status != 1 || typeof (result.message) !== \"string\" || !result.message.match(/^OK/)) {\n const error = new Error(\"invalid response\");\n error.result = JSON.stringify(result);\n if ((result.result || \"\").toLowerCase().indexOf(\"rate limit\") >= 0) {\n error.throttleRetry = true;\n }\n throw error;\n }\n return result.result;\n}\nfunction getJsonResult(result) {\n // This response indicates we are being throttled\n if (result && result.status == 0 && result.message == \"NOTOK\" && (result.result || \"\").toLowerCase().indexOf(\"rate limit\") >= 0) {\n const error = new Error(\"throttled response\");\n error.result = JSON.stringify(result);\n error.throttleRetry = true;\n throw error;\n }\n if (result.jsonrpc != \"2.0\") {\n // @TODO: not any\n const error = new Error(\"invalid response\");\n error.result = JSON.stringify(result);\n throw error;\n }\n if (result.error) {\n // @TODO: not any\n const error = new Error(result.error.message || \"unknown error\");\n if (result.error.code) {\n error.code = result.error.code;\n }\n if (result.error.data) {\n error.data = result.error.data;\n }\n throw error;\n }\n return result.result;\n}\n// The blockTag was normalized as a string by the Provider pre-perform operations\nfunction checkLogTag(blockTag) {\n if (blockTag === \"pending\") {\n throw new Error(\"pending not supported\");\n }\n if (blockTag === \"latest\") {\n return blockTag;\n }\n return parseInt(blockTag.substring(2), 16);\n}\nfunction checkError(method, error, transaction) {\n // Undo the \"convenience\" some nodes are attempting to prevent backwards\n // incompatibility; maybe for v6 consider forwarding reverts as errors\n if (method === \"call\" && error.code === Logger.errors.SERVER_ERROR) {\n const e = error.error;\n // Etherscan keeps changing their string\n if (e && (e.message.match(/reverted/i) || e.message.match(/VM execution error/i))) {\n // Etherscan prefixes the data like \"Reverted 0x1234\"\n let data = e.data;\n if (data) {\n data = \"0x\" + data.replace(/^.*0x/i, \"\");\n }\n if (isHexString(data)) {\n return data;\n }\n logger.throwError(\"missing revert data in call exception\", Logger.errors.CALL_EXCEPTION, {\n error, data: \"0x\"\n });\n }\n }\n // Get the message from any nested error structure\n let message = error.message;\n if (error.code === Logger.errors.SERVER_ERROR) {\n if (error.error && typeof (error.error.message) === \"string\") {\n message = error.error.message;\n }\n else if (typeof (error.body) === \"string\") {\n message = error.body;\n }\n else if (typeof (error.responseText) === \"string\") {\n message = error.responseText;\n }\n }\n message = (message || \"\").toLowerCase();\n // \"Insufficient funds. The account you tried to send transaction from does not have enough funds. Required 21464000000000 and got: 0\"\n if (message.match(/insufficient funds/)) {\n logger.throwError(\"insufficient funds for intrinsic transaction cost\", Logger.errors.INSUFFICIENT_FUNDS, {\n error, method, transaction\n });\n }\n // \"Transaction with the same hash was already imported.\"\n if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) {\n logger.throwError(\"nonce has already been used\", Logger.errors.NONCE_EXPIRED, {\n error, method, transaction\n });\n }\n // \"Transaction gas price is too low. There is another transaction with same nonce in the queue. Try increasing the gas price or incrementing the nonce.\"\n if (message.match(/another transaction with same nonce/)) {\n logger.throwError(\"replacement fee too low\", Logger.errors.REPLACEMENT_UNDERPRICED, {\n error, method, transaction\n });\n }\n if (message.match(/execution failed due to an exception|execution reverted/)) {\n logger.throwError(\"cannot estimate gas; transaction may fail or may require manual gas limit\", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {\n error, method, transaction\n });\n }\n throw error;\n}\nexport class EtherscanProvider extends BaseProvider {\n constructor(network, apiKey) {\n super(network);\n defineReadOnly(this, \"baseUrl\", this.getBaseUrl());\n defineReadOnly(this, \"apiKey\", apiKey || null);\n }\n getBaseUrl() {\n switch (this.network ? this.network.name : \"invalid\") {\n case \"homestead\":\n return \"https:/\\/api.etherscan.io\";\n case \"goerli\":\n return \"https:/\\/api-goerli.etherscan.io\";\n case \"sepolia\":\n return \"https:/\\/api-sepolia.etherscan.io\";\n case \"matic\":\n return \"https:/\\/api.polygonscan.com\";\n case \"maticmum\":\n return \"https:/\\/api-testnet.polygonscan.com\";\n case \"arbitrum\":\n return \"https:/\\/api.arbiscan.io\";\n case \"arbitrum-goerli\":\n return \"https:/\\/api-goerli.arbiscan.io\";\n case \"optimism\":\n return \"https:/\\/api-optimistic.etherscan.io\";\n case \"optimism-goerli\":\n return \"https:/\\/api-goerli-optimistic.etherscan.io\";\n default:\n }\n return logger.throwArgumentError(\"unsupported network\", \"network\", this.network.name);\n }\n getUrl(module, params) {\n const query = Object.keys(params).reduce((accum, key) => {\n const value = params[key];\n if (value != null) {\n accum += `&${key}=${value}`;\n }\n return accum;\n }, \"\");\n const apiKey = ((this.apiKey) ? `&apikey=${this.apiKey}` : \"\");\n return `${this.baseUrl}/api?module=${module}${query}${apiKey}`;\n }\n getPostUrl() {\n return `${this.baseUrl}/api`;\n }\n getPostData(module, params) {\n params.module = module;\n params.apikey = this.apiKey;\n return params;\n }\n fetch(module, params, post) {\n return __awaiter(this, void 0, void 0, function* () {\n const url = (post ? this.getPostUrl() : this.getUrl(module, params));\n const payload = (post ? this.getPostData(module, params) : null);\n const procFunc = (module === \"proxy\") ? getJsonResult : getResult;\n this.emit(\"debug\", {\n action: \"request\",\n request: url,\n provider: this\n });\n const connection = {\n url: url,\n throttleSlotInterval: 1000,\n throttleCallback: (attempt, url) => {\n if (this.isCommunityResource()) {\n showThrottleMessage();\n }\n return Promise.resolve(true);\n }\n };\n let payloadStr = null;\n if (payload) {\n connection.headers = { \"content-type\": \"application/x-www-form-urlencoded; charset=UTF-8\" };\n payloadStr = Object.keys(payload).map((key) => {\n return `${key}=${payload[key]}`;\n }).join(\"&\");\n }\n const result = yield fetchJson(connection, payloadStr, procFunc || getJsonResult);\n this.emit(\"debug\", {\n action: \"response\",\n request: url,\n response: deepCopy(result),\n provider: this\n });\n return result;\n });\n }\n detectNetwork() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.network;\n });\n }\n perform(method, params) {\n const _super = Object.create(null, {\n perform: { get: () => super.perform }\n });\n return __awaiter(this, void 0, void 0, function* () {\n switch (method) {\n case \"getBlockNumber\":\n return this.fetch(\"proxy\", { action: \"eth_blockNumber\" });\n case \"getGasPrice\":\n return this.fetch(\"proxy\", { action: \"eth_gasPrice\" });\n case \"getBalance\":\n // Returns base-10 result\n return this.fetch(\"account\", {\n action: \"balance\",\n address: params.address,\n tag: params.blockTag\n });\n case \"getTransactionCount\":\n return this.fetch(\"proxy\", {\n action: \"eth_getTransactionCount\",\n address: params.address,\n tag: params.blockTag\n });\n case \"getCode\":\n return this.fetch(\"proxy\", {\n action: \"eth_getCode\",\n address: params.address,\n tag: params.blockTag\n });\n case \"getStorageAt\":\n return this.fetch(\"proxy\", {\n action: \"eth_getStorageAt\",\n address: params.address,\n position: params.position,\n tag: params.blockTag\n });\n case \"sendTransaction\":\n return this.fetch(\"proxy\", {\n action: \"eth_sendRawTransaction\",\n hex: params.signedTransaction\n }, true).catch((error) => {\n return checkError(\"sendTransaction\", error, params.signedTransaction);\n });\n case \"getBlock\":\n if (params.blockTag) {\n return this.fetch(\"proxy\", {\n action: \"eth_getBlockByNumber\",\n tag: params.blockTag,\n boolean: (params.includeTransactions ? \"true\" : \"false\")\n });\n }\n throw new Error(\"getBlock by blockHash not implemented\");\n case \"getTransaction\":\n return this.fetch(\"proxy\", {\n action: \"eth_getTransactionByHash\",\n txhash: params.transactionHash\n });\n case \"getTransactionReceipt\":\n return this.fetch(\"proxy\", {\n action: \"eth_getTransactionReceipt\",\n txhash: params.transactionHash\n });\n case \"call\": {\n if (params.blockTag !== \"latest\") {\n throw new Error(\"EtherscanProvider does not support blockTag for call\");\n }\n const postData = getTransactionPostData(params.transaction);\n postData.module = \"proxy\";\n postData.action = \"eth_call\";\n try {\n return yield this.fetch(\"proxy\", postData, true);\n }\n catch (error) {\n return checkError(\"call\", error, params.transaction);\n }\n }\n case \"estimateGas\": {\n const postData = getTransactionPostData(params.transaction);\n postData.module = \"proxy\";\n postData.action = \"eth_estimateGas\";\n try {\n return yield this.fetch(\"proxy\", postData, true);\n }\n catch (error) {\n return checkError(\"estimateGas\", error, params.transaction);\n }\n }\n case \"getLogs\": {\n const args = { action: \"getLogs\" };\n if (params.filter.fromBlock) {\n args.fromBlock = checkLogTag(params.filter.fromBlock);\n }\n if (params.filter.toBlock) {\n args.toBlock = checkLogTag(params.filter.toBlock);\n }\n if (params.filter.address) {\n args.address = params.filter.address;\n }\n // @TODO: We can handle slightly more complicated logs using the logs API\n if (params.filter.topics && params.filter.topics.length > 0) {\n if (params.filter.topics.length > 1) {\n logger.throwError(\"unsupported topic count\", Logger.errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics });\n }\n if (params.filter.topics.length === 1) {\n const topic0 = params.filter.topics[0];\n if (typeof (topic0) !== \"string\" || topic0.length !== 66) {\n logger.throwError(\"unsupported topic format\", Logger.errors.UNSUPPORTED_OPERATION, { topic0: topic0 });\n }\n args.topic0 = topic0;\n }\n }\n const logs = yield this.fetch(\"logs\", args);\n // Cache txHash => blockHash\n let blocks = {};\n // Add any missing blockHash to the logs\n for (let i = 0; i < logs.length; i++) {\n const log = logs[i];\n if (log.blockHash != null) {\n continue;\n }\n if (blocks[log.blockNumber] == null) {\n const block = yield this.getBlock(log.blockNumber);\n if (block) {\n blocks[log.blockNumber] = block.hash;\n }\n }\n log.blockHash = blocks[log.blockNumber];\n }\n return logs;\n }\n case \"getEtherPrice\":\n if (this.network.name !== \"homestead\") {\n return 0.0;\n }\n return parseFloat((yield this.fetch(\"stats\", { action: \"ethprice\" })).ethusd);\n default:\n break;\n }\n return _super.perform.call(this, method, params);\n });\n }\n // Note: The `page` page parameter only allows pagination within the\n // 10,000 window available without a page and offset parameter\n // Error: Result window is too large, PageNo x Offset size must\n // be less than or equal to 10000\n getHistory(addressOrName, startBlock, endBlock) {\n return __awaiter(this, void 0, void 0, function* () {\n const params = {\n action: \"txlist\",\n address: (yield this.resolveName(addressOrName)),\n startblock: ((startBlock == null) ? 0 : startBlock),\n endblock: ((endBlock == null) ? 99999999 : endBlock),\n sort: \"asc\"\n };\n const result = yield this.fetch(\"account\", params);\n return result.map((tx) => {\n [\"contractAddress\", \"to\"].forEach(function (key) {\n if (tx[key] == \"\") {\n delete tx[key];\n }\n });\n if (tx.creates == null && tx.contractAddress != null) {\n tx.creates = tx.contractAddress;\n }\n const item = this.formatter.transactionResponse(tx);\n if (tx.timeStamp) {\n item.timestamp = parseInt(tx.timeStamp);\n }\n return item;\n });\n });\n }\n isCommunityResource() {\n return (this.apiKey == null);\n }\n}\n//# sourceMappingURL=etherscan-provider.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { Provider } from \"@ethersproject/abstract-provider\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { isHexString } from \"@ethersproject/bytes\";\nimport { deepCopy, defineReadOnly, shallowCopy } from \"@ethersproject/properties\";\nimport { shuffled } from \"@ethersproject/random\";\nimport { poll } from \"@ethersproject/web\";\nimport { BaseProvider } from \"./base-provider\";\nimport { isCommunityResource } from \"./formatter\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nfunction now() { return (new Date()).getTime(); }\n// Returns to network as long as all agree, or null if any is null.\n// Throws an error if any two networks do not match.\nfunction checkNetworks(networks) {\n let result = null;\n for (let i = 0; i < networks.length; i++) {\n const network = networks[i];\n // Null! We do not know our network; bail.\n if (network == null) {\n return null;\n }\n if (result) {\n // Make sure the network matches the previous networks\n if (!(result.name === network.name && result.chainId === network.chainId &&\n ((result.ensAddress === network.ensAddress) || (result.ensAddress == null && network.ensAddress == null)))) {\n logger.throwArgumentError(\"provider mismatch\", \"networks\", networks);\n }\n }\n else {\n result = network;\n }\n }\n return result;\n}\nfunction median(values, maxDelta) {\n values = values.slice().sort();\n const middle = Math.floor(values.length / 2);\n // Odd length; take the middle\n if (values.length % 2) {\n return values[middle];\n }\n // Even length; take the average of the two middle\n const a = values[middle - 1], b = values[middle];\n if (maxDelta != null && Math.abs(a - b) > maxDelta) {\n return null;\n }\n return (a + b) / 2;\n}\nfunction serialize(value) {\n if (value === null) {\n return \"null\";\n }\n else if (typeof (value) === \"number\" || typeof (value) === \"boolean\") {\n return JSON.stringify(value);\n }\n else if (typeof (value) === \"string\") {\n return value;\n }\n else if (BigNumber.isBigNumber(value)) {\n return value.toString();\n }\n else if (Array.isArray(value)) {\n return JSON.stringify(value.map((i) => serialize(i)));\n }\n else if (typeof (value) === \"object\") {\n const keys = Object.keys(value);\n keys.sort();\n return \"{\" + keys.map((key) => {\n let v = value[key];\n if (typeof (v) === \"function\") {\n v = \"[function]\";\n }\n else {\n v = serialize(v);\n }\n return JSON.stringify(key) + \":\" + v;\n }).join(\",\") + \"}\";\n }\n throw new Error(\"unknown value type: \" + typeof (value));\n}\n// Next request ID to use for emitting debug info\nlet nextRid = 1;\n;\nfunction stall(duration) {\n let cancel = null;\n let timer = null;\n let promise = (new Promise((resolve) => {\n cancel = function () {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n resolve();\n };\n timer = setTimeout(cancel, duration);\n }));\n const wait = (func) => {\n promise = promise.then(func);\n return promise;\n };\n function getPromise() {\n return promise;\n }\n return { cancel, getPromise, wait };\n}\nconst ForwardErrors = [\n Logger.errors.CALL_EXCEPTION,\n Logger.errors.INSUFFICIENT_FUNDS,\n Logger.errors.NONCE_EXPIRED,\n Logger.errors.REPLACEMENT_UNDERPRICED,\n Logger.errors.UNPREDICTABLE_GAS_LIMIT\n];\nconst ForwardProperties = [\n \"address\",\n \"args\",\n \"errorArgs\",\n \"errorSignature\",\n \"method\",\n \"transaction\",\n];\n;\nfunction exposeDebugConfig(config, now) {\n const result = {\n weight: config.weight\n };\n Object.defineProperty(result, \"provider\", { get: () => config.provider });\n if (config.start) {\n result.start = config.start;\n }\n if (now) {\n result.duration = (now - config.start);\n }\n if (config.done) {\n if (config.error) {\n result.error = config.error;\n }\n else {\n result.result = config.result || null;\n }\n }\n return result;\n}\nfunction normalizedTally(normalize, quorum) {\n return function (configs) {\n // Count the votes for each result\n const tally = {};\n configs.forEach((c) => {\n const value = normalize(c.result);\n if (!tally[value]) {\n tally[value] = { count: 0, result: c.result };\n }\n tally[value].count++;\n });\n // Check for a quorum on any given result\n const keys = Object.keys(tally);\n for (let i = 0; i < keys.length; i++) {\n const check = tally[keys[i]];\n if (check.count >= quorum) {\n return check.result;\n }\n }\n // No quroum\n return undefined;\n };\n}\nfunction getProcessFunc(provider, method, params) {\n let normalize = serialize;\n switch (method) {\n case \"getBlockNumber\":\n // Return the median value, unless there is (median + 1) is also\n // present, in which case that is probably true and the median\n // is going to be stale soon. In the event of a malicious node,\n // the lie will be true soon enough.\n return function (configs) {\n const values = configs.map((c) => c.result);\n // Get the median block number\n let blockNumber = median(configs.map((c) => c.result), 2);\n if (blockNumber == null) {\n return undefined;\n }\n blockNumber = Math.ceil(blockNumber);\n // If the next block height is present, its prolly safe to use\n if (values.indexOf(blockNumber + 1) >= 0) {\n blockNumber++;\n }\n // Don't ever roll back the blockNumber\n if (blockNumber >= provider._highestBlockNumber) {\n provider._highestBlockNumber = blockNumber;\n }\n return provider._highestBlockNumber;\n };\n case \"getGasPrice\":\n // Return the middle (round index up) value, similar to median\n // but do not average even entries and choose the higher.\n // Malicious actors must compromise 50% of the nodes to lie.\n return function (configs) {\n const values = configs.map((c) => c.result);\n values.sort();\n return values[Math.floor(values.length / 2)];\n };\n case \"getEtherPrice\":\n // Returns the median price. Malicious actors must compromise at\n // least 50% of the nodes to lie (in a meaningful way).\n return function (configs) {\n return median(configs.map((c) => c.result));\n };\n // No additional normalizing required; serialize is enough\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n case \"getStorageAt\":\n case \"call\":\n case \"estimateGas\":\n case \"getLogs\":\n break;\n // We drop the confirmations from transactions as it is approximate\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n normalize = function (tx) {\n if (tx == null) {\n return null;\n }\n tx = shallowCopy(tx);\n tx.confirmations = -1;\n return serialize(tx);\n };\n break;\n // We drop the confirmations from transactions as it is approximate\n case \"getBlock\":\n // We drop the confirmations from transactions as it is approximate\n if (params.includeTransactions) {\n normalize = function (block) {\n if (block == null) {\n return null;\n }\n block = shallowCopy(block);\n block.transactions = block.transactions.map((tx) => {\n tx = shallowCopy(tx);\n tx.confirmations = -1;\n return tx;\n });\n return serialize(block);\n };\n }\n else {\n normalize = function (block) {\n if (block == null) {\n return null;\n }\n return serialize(block);\n };\n }\n break;\n default:\n throw new Error(\"unknown method: \" + method);\n }\n // Return the result if and only if the expected quorum is\n // satisfied and agreed upon for the final result.\n return normalizedTally(normalize, provider.quorum);\n}\n// If we are doing a blockTag query, we need to make sure the backend is\n// caught up to the FallbackProvider, before sending a request to it.\nfunction waitForSync(config, blockNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n const provider = (config.provider);\n if ((provider.blockNumber != null && provider.blockNumber >= blockNumber) || blockNumber === -1) {\n return provider;\n }\n return poll(() => {\n return new Promise((resolve, reject) => {\n setTimeout(function () {\n // We are synced\n if (provider.blockNumber >= blockNumber) {\n return resolve(provider);\n }\n // We're done; just quit\n if (config.cancelled) {\n return resolve(null);\n }\n // Try again, next block\n return resolve(undefined);\n }, 0);\n });\n }, { oncePoll: provider });\n });\n}\nfunction getRunner(config, currentBlockNumber, method, params) {\n return __awaiter(this, void 0, void 0, function* () {\n let provider = config.provider;\n switch (method) {\n case \"getBlockNumber\":\n case \"getGasPrice\":\n return provider[method]();\n case \"getEtherPrice\":\n if (provider.getEtherPrice) {\n return provider.getEtherPrice();\n }\n break;\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n if (params.blockTag && isHexString(params.blockTag)) {\n provider = yield waitForSync(config, currentBlockNumber);\n }\n return provider[method](params.address, params.blockTag || \"latest\");\n case \"getStorageAt\":\n if (params.blockTag && isHexString(params.blockTag)) {\n provider = yield waitForSync(config, currentBlockNumber);\n }\n return provider.getStorageAt(params.address, params.position, params.blockTag || \"latest\");\n case \"getBlock\":\n if (params.blockTag && isHexString(params.blockTag)) {\n provider = yield waitForSync(config, currentBlockNumber);\n }\n return provider[(params.includeTransactions ? \"getBlockWithTransactions\" : \"getBlock\")](params.blockTag || params.blockHash);\n case \"call\":\n case \"estimateGas\":\n if (params.blockTag && isHexString(params.blockTag)) {\n provider = yield waitForSync(config, currentBlockNumber);\n }\n if (method === \"call\" && params.blockTag) {\n return provider[method](params.transaction, params.blockTag);\n }\n return provider[method](params.transaction);\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n return provider[method](params.transactionHash);\n case \"getLogs\": {\n let filter = params.filter;\n if ((filter.fromBlock && isHexString(filter.fromBlock)) || (filter.toBlock && isHexString(filter.toBlock))) {\n provider = yield waitForSync(config, currentBlockNumber);\n }\n return provider.getLogs(filter);\n }\n }\n return logger.throwError(\"unknown method error\", Logger.errors.UNKNOWN_ERROR, {\n method: method,\n params: params\n });\n });\n}\nexport class FallbackProvider extends BaseProvider {\n constructor(providers, quorum) {\n if (providers.length === 0) {\n logger.throwArgumentError(\"missing providers\", \"providers\", providers);\n }\n const providerConfigs = providers.map((configOrProvider, index) => {\n if (Provider.isProvider(configOrProvider)) {\n const stallTimeout = isCommunityResource(configOrProvider) ? 2000 : 750;\n const priority = 1;\n return Object.freeze({ provider: configOrProvider, weight: 1, stallTimeout, priority });\n }\n const config = shallowCopy(configOrProvider);\n if (config.priority == null) {\n config.priority = 1;\n }\n if (config.stallTimeout == null) {\n config.stallTimeout = isCommunityResource(configOrProvider) ? 2000 : 750;\n }\n if (config.weight == null) {\n config.weight = 1;\n }\n const weight = config.weight;\n if (weight % 1 || weight > 512 || weight < 1) {\n logger.throwArgumentError(\"invalid weight; must be integer in [1, 512]\", `providers[${index}].weight`, weight);\n }\n return Object.freeze(config);\n });\n const total = providerConfigs.reduce((accum, c) => (accum + c.weight), 0);\n if (quorum == null) {\n quorum = total / 2;\n }\n else if (quorum > total) {\n logger.throwArgumentError(\"quorum will always fail; larger than total weight\", \"quorum\", quorum);\n }\n // Are all providers' networks are known\n let networkOrReady = checkNetworks(providerConfigs.map((c) => (c.provider).network));\n // Not all networks are known; we must stall\n if (networkOrReady == null) {\n networkOrReady = new Promise((resolve, reject) => {\n setTimeout(() => {\n this.detectNetwork().then(resolve, reject);\n }, 0);\n });\n }\n super(networkOrReady);\n // Preserve a copy, so we do not get mutated\n defineReadOnly(this, \"providerConfigs\", Object.freeze(providerConfigs));\n defineReadOnly(this, \"quorum\", quorum);\n this._highestBlockNumber = -1;\n }\n detectNetwork() {\n return __awaiter(this, void 0, void 0, function* () {\n const networks = yield Promise.all(this.providerConfigs.map((c) => c.provider.getNetwork()));\n return checkNetworks(networks);\n });\n }\n perform(method, params) {\n return __awaiter(this, void 0, void 0, function* () {\n // Sending transactions is special; always broadcast it to all backends\n if (method === \"sendTransaction\") {\n const results = yield Promise.all(this.providerConfigs.map((c) => {\n return c.provider.sendTransaction(params.signedTransaction).then((result) => {\n return result.hash;\n }, (error) => {\n return error;\n });\n }));\n // Any success is good enough (other errors are likely \"already seen\" errors\n for (let i = 0; i < results.length; i++) {\n const result = results[i];\n if (typeof (result) === \"string\") {\n return result;\n }\n }\n // They were all an error; pick the first error\n throw results[0];\n }\n // We need to make sure we are in sync with our backends, so we need\n // to know this before we can make a lot of calls\n if (this._highestBlockNumber === -1 && method !== \"getBlockNumber\") {\n yield this.getBlockNumber();\n }\n const processFunc = getProcessFunc(this, method, params);\n // Shuffle the providers and then sort them by their priority; we\n // shallowCopy them since we will store the result in them too\n const configs = shuffled(this.providerConfigs.map(shallowCopy));\n configs.sort((a, b) => (a.priority - b.priority));\n const currentBlockNumber = this._highestBlockNumber;\n let i = 0;\n let first = true;\n while (true) {\n const t0 = now();\n // Compute the inflight weight (exclude anything past)\n let inflightWeight = configs.filter((c) => (c.runner && ((t0 - c.start) < c.stallTimeout)))\n .reduce((accum, c) => (accum + c.weight), 0);\n // Start running enough to meet quorum\n while (inflightWeight < this.quorum && i < configs.length) {\n const config = configs[i++];\n const rid = nextRid++;\n config.start = now();\n config.staller = stall(config.stallTimeout);\n config.staller.wait(() => { config.staller = null; });\n config.runner = getRunner(config, currentBlockNumber, method, params).then((result) => {\n config.done = true;\n config.result = result;\n if (this.listenerCount(\"debug\")) {\n this.emit(\"debug\", {\n action: \"request\",\n rid: rid,\n backend: exposeDebugConfig(config, now()),\n request: { method: method, params: deepCopy(params) },\n provider: this\n });\n }\n }, (error) => {\n config.done = true;\n config.error = error;\n if (this.listenerCount(\"debug\")) {\n this.emit(\"debug\", {\n action: \"request\",\n rid: rid,\n backend: exposeDebugConfig(config, now()),\n request: { method: method, params: deepCopy(params) },\n provider: this\n });\n }\n });\n if (this.listenerCount(\"debug\")) {\n this.emit(\"debug\", {\n action: \"request\",\n rid: rid,\n backend: exposeDebugConfig(config, null),\n request: { method: method, params: deepCopy(params) },\n provider: this\n });\n }\n inflightWeight += config.weight;\n }\n // Wait for anything meaningful to finish or stall out\n const waiting = [];\n configs.forEach((c) => {\n if (c.done || !c.runner) {\n return;\n }\n waiting.push(c.runner);\n if (c.staller) {\n waiting.push(c.staller.getPromise());\n }\n });\n if (waiting.length) {\n yield Promise.race(waiting);\n }\n // Check the quorum and process the results; the process function\n // may additionally decide the quorum is not met\n const results = configs.filter((c) => (c.done && c.error == null));\n if (results.length >= this.quorum) {\n const result = processFunc(results);\n if (result !== undefined) {\n // Shut down any stallers\n configs.forEach(c => {\n if (c.staller) {\n c.staller.cancel();\n }\n c.cancelled = true;\n });\n return result;\n }\n if (!first) {\n yield stall(100).getPromise();\n }\n first = false;\n }\n // No result, check for errors that should be forwarded\n const errors = configs.reduce((accum, c) => {\n if (!c.done || c.error == null) {\n return accum;\n }\n const code = (c.error).code;\n if (ForwardErrors.indexOf(code) >= 0) {\n if (!accum[code]) {\n accum[code] = { error: c.error, weight: 0 };\n }\n accum[code].weight += c.weight;\n }\n return accum;\n }, ({}));\n Object.keys(errors).forEach((errorCode) => {\n const tally = errors[errorCode];\n if (tally.weight < this.quorum) {\n return;\n }\n // Shut down any stallers\n configs.forEach(c => {\n if (c.staller) {\n c.staller.cancel();\n }\n c.cancelled = true;\n });\n const e = (tally.error);\n const props = {};\n ForwardProperties.forEach((name) => {\n if (e[name] == null) {\n return;\n }\n props[name] = e[name];\n });\n logger.throwError(e.reason || e.message, errorCode, props);\n });\n // All configs have run to completion; we will never get more data\n if (configs.filter((c) => !c.done).length === 0) {\n break;\n }\n }\n // Shut down any stallers; shouldn't be any\n configs.forEach(c => {\n if (c.staller) {\n c.staller.cancel();\n }\n c.cancelled = true;\n });\n return logger.throwError(\"failed to meet quorum\", Logger.errors.SERVER_ERROR, {\n method: method,\n params: params,\n //results: configs.map((c) => c.result),\n //errors: configs.map((c) => c.error),\n results: configs.map((c) => exposeDebugConfig(c)),\n provider: this\n });\n });\n }\n}\n//# sourceMappingURL=fallback-provider.js.map","\"use strict\";\nconst IpcProvider = null;\nexport { IpcProvider };\n//# sourceMappingURL=ipc-provider.js.map","\"use strict\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { WebSocketProvider } from \"./websocket-provider\";\nimport { showThrottleMessage } from \"./formatter\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n constructor(network, apiKey) {\n const provider = new InfuraProvider(network, apiKey);\n const connection = provider.connection;\n if (connection.password) {\n logger.throwError(\"INFURA WebSocket project secrets unsupported\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"InfuraProvider.getWebSocketProvider()\"\n });\n }\n const url = connection.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, network);\n defineReadOnly(this, \"apiKey\", provider.projectId);\n defineReadOnly(this, \"projectId\", provider.projectId);\n defineReadOnly(this, \"projectSecret\", provider.projectSecret);\n }\n isCommunityResource() {\n return (this.projectId === defaultProjectId);\n }\n}\nexport class InfuraProvider extends UrlJsonRpcProvider {\n static getWebSocketProvider(network, apiKey) {\n return new InfuraWebSocketProvider(network, apiKey);\n }\n static getApiKey(apiKey) {\n const apiKeyObj = {\n apiKey: defaultProjectId,\n projectId: defaultProjectId,\n projectSecret: null\n };\n if (apiKey == null) {\n return apiKeyObj;\n }\n if (typeof (apiKey) === \"string\") {\n apiKeyObj.projectId = apiKey;\n }\n else if (apiKey.projectSecret != null) {\n logger.assertArgument((typeof (apiKey.projectId) === \"string\"), \"projectSecret requires a projectId\", \"projectId\", apiKey.projectId);\n logger.assertArgument((typeof (apiKey.projectSecret) === \"string\"), \"invalid projectSecret\", \"projectSecret\", \"[REDACTED]\");\n apiKeyObj.projectId = apiKey.projectId;\n apiKeyObj.projectSecret = apiKey.projectSecret;\n }\n else if (apiKey.projectId) {\n apiKeyObj.projectId = apiKey.projectId;\n }\n apiKeyObj.apiKey = apiKeyObj.projectId;\n return apiKeyObj;\n }\n static getUrl(network, apiKey) {\n let host = null;\n switch (network ? network.name : \"unknown\") {\n case \"homestead\":\n host = \"mainnet.infura.io\";\n break;\n case \"goerli\":\n host = \"goerli.infura.io\";\n break;\n case \"sepolia\":\n host = \"sepolia.infura.io\";\n break;\n case \"matic\":\n host = \"polygon-mainnet.infura.io\";\n break;\n case \"maticmum\":\n host = \"polygon-mumbai.infura.io\";\n break;\n case \"optimism\":\n host = \"optimism-mainnet.infura.io\";\n break;\n case \"optimism-goerli\":\n host = \"optimism-goerli.infura.io\";\n break;\n case \"arbitrum\":\n host = \"arbitrum-mainnet.infura.io\";\n break;\n case \"arbitrum-goerli\":\n host = \"arbitrum-goerli.infura.io\";\n break;\n default:\n logger.throwError(\"unsupported network\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"network\",\n value: network\n });\n }\n const connection = {\n allowGzip: true,\n url: (\"https:/\" + \"/\" + host + \"/v3/\" + apiKey.projectId),\n throttleCallback: (attempt, url) => {\n if (apiKey.projectId === defaultProjectId) {\n showThrottleMessage();\n }\n return Promise.resolve(true);\n }\n };\n if (apiKey.projectSecret != null) {\n connection.user = \"\";\n connection.password = apiKey.projectSecret;\n }\n return connection;\n }\n isCommunityResource() {\n return (this.projectId === defaultProjectId);\n }\n}\n//# sourceMappingURL=infura-provider.js.map","/* istanbul ignore file */\n\"use strict\";\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n// Special API key provided by Nodesmith for ethers.js\nconst defaultApiKey = \"ETHERS_JS_SHARED\";\nexport class NodesmithProvider extends UrlJsonRpcProvider {\n static getApiKey(apiKey) {\n if (apiKey && typeof (apiKey) !== \"string\") {\n logger.throwArgumentError(\"invalid apiKey\", \"apiKey\", apiKey);\n }\n return apiKey || defaultApiKey;\n }\n static getUrl(network, apiKey) {\n logger.warn(\"NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.\");\n let host = null;\n switch (network.name) {\n case \"homestead\":\n host = \"https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc\";\n break;\n case \"ropsten\":\n host = \"https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc\";\n break;\n case \"rinkeby\":\n host = \"https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc\";\n break;\n case \"goerli\":\n host = \"https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc\";\n break;\n case \"kovan\":\n host = \"https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc\";\n break;\n default:\n logger.throwArgumentError(\"unsupported network\", \"network\", arguments[0]);\n }\n return (host + \"?apiKey=\" + apiKey);\n }\n}\n//# sourceMappingURL=nodesmith-provider.js.map","\"use strict\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\nconst defaultApplicationId = \"62e1ad51b37b8e00394bda3b\";\nexport class PocketProvider extends UrlJsonRpcProvider {\n static getApiKey(apiKey) {\n const apiKeyObj = {\n applicationId: null,\n loadBalancer: true,\n applicationSecretKey: null\n };\n // Parse applicationId and applicationSecretKey\n if (apiKey == null) {\n apiKeyObj.applicationId = defaultApplicationId;\n }\n else if (typeof (apiKey) === \"string\") {\n apiKeyObj.applicationId = apiKey;\n }\n else if (apiKey.applicationSecretKey != null) {\n apiKeyObj.applicationId = apiKey.applicationId;\n apiKeyObj.applicationSecretKey = apiKey.applicationSecretKey;\n }\n else if (apiKey.applicationId) {\n apiKeyObj.applicationId = apiKey.applicationId;\n }\n else {\n logger.throwArgumentError(\"unsupported PocketProvider apiKey\", \"apiKey\", apiKey);\n }\n return apiKeyObj;\n }\n static getUrl(network, apiKey) {\n let host = null;\n switch (network ? network.name : \"unknown\") {\n case \"goerli\":\n host = \"eth-goerli.gateway.pokt.network\";\n break;\n case \"homestead\":\n host = \"eth-mainnet.gateway.pokt.network\";\n break;\n case \"kovan\":\n host = \"poa-kovan.gateway.pokt.network\";\n break;\n case \"matic\":\n host = \"poly-mainnet.gateway.pokt.network\";\n break;\n case \"maticmum\":\n host = \"polygon-mumbai-rpc.gateway.pokt.network\";\n break;\n case \"rinkeby\":\n host = \"eth-rinkeby.gateway.pokt.network\";\n break;\n case \"ropsten\":\n host = \"eth-ropsten.gateway.pokt.network\";\n break;\n default:\n logger.throwError(\"unsupported network\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"network\",\n value: network\n });\n }\n const url = `https:/\\/${host}/v1/lb/${apiKey.applicationId}`;\n const connection = { headers: {}, url };\n if (apiKey.applicationSecretKey != null) {\n connection.user = \"\";\n connection.password = apiKey.applicationSecretKey;\n }\n return connection;\n }\n isCommunityResource() {\n return (this.applicationId === defaultApplicationId);\n }\n}\n//# sourceMappingURL=pocket-provider.js.map","\"use strict\";\nimport { deepCopy, defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { JsonRpcProvider } from \"./json-rpc-provider\";\nlet _nextId = 1;\nfunction buildWeb3LegacyFetcher(provider, sendFunc) {\n const fetcher = \"Web3LegacyFetcher\";\n return function (method, params) {\n const request = {\n method: method,\n params: params,\n id: (_nextId++),\n jsonrpc: \"2.0\"\n };\n return new Promise((resolve, reject) => {\n this.emit(\"debug\", {\n action: \"request\",\n fetcher,\n request: deepCopy(request),\n provider: this\n });\n sendFunc(request, (error, response) => {\n if (error) {\n this.emit(\"debug\", {\n action: \"response\",\n fetcher,\n error,\n request,\n provider: this\n });\n return reject(error);\n }\n this.emit(\"debug\", {\n action: \"response\",\n fetcher,\n request,\n response,\n provider: this\n });\n if (response.error) {\n const error = new Error(response.error.message);\n error.code = response.error.code;\n error.data = response.error.data;\n return reject(error);\n }\n resolve(response.result);\n });\n });\n };\n}\nfunction buildEip1193Fetcher(provider) {\n return function (method, params) {\n if (params == null) {\n params = [];\n }\n const request = { method, params };\n this.emit(\"debug\", {\n action: \"request\",\n fetcher: \"Eip1193Fetcher\",\n request: deepCopy(request),\n provider: this\n });\n return provider.request(request).then((response) => {\n this.emit(\"debug\", {\n action: \"response\",\n fetcher: \"Eip1193Fetcher\",\n request,\n response,\n provider: this\n });\n return response;\n }, (error) => {\n this.emit(\"debug\", {\n action: \"response\",\n fetcher: \"Eip1193Fetcher\",\n request,\n error,\n provider: this\n });\n throw error;\n });\n };\n}\nexport class Web3Provider extends JsonRpcProvider {\n constructor(provider, network) {\n if (provider == null) {\n logger.throwArgumentError(\"missing provider\", \"provider\", provider);\n }\n let path = null;\n let jsonRpcFetchFunc = null;\n let subprovider = null;\n if (typeof (provider) === \"function\") {\n path = \"unknown:\";\n jsonRpcFetchFunc = provider;\n }\n else {\n path = provider.host || provider.path || \"\";\n if (!path && provider.isMetaMask) {\n path = \"metamask\";\n }\n subprovider = provider;\n if (provider.request) {\n if (path === \"\") {\n path = \"eip-1193:\";\n }\n jsonRpcFetchFunc = buildEip1193Fetcher(provider);\n }\n else if (provider.sendAsync) {\n jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.sendAsync.bind(provider));\n }\n else if (provider.send) {\n jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.send.bind(provider));\n }\n else {\n logger.throwArgumentError(\"unsupported provider\", \"provider\", provider);\n }\n if (!path) {\n path = \"unknown:\";\n }\n }\n super(path, network);\n defineReadOnly(this, \"jsonRpcFetchFunc\", jsonRpcFetchFunc);\n defineReadOnly(this, \"provider\", subprovider);\n }\n send(method, params) {\n return this.jsonRpcFetchFunc(method, params);\n }\n}\n//# sourceMappingURL=web3-provider.js.map","\"use strict\";\nimport { Provider } from \"@ethersproject/abstract-provider\";\nimport { getNetwork } from \"@ethersproject/networks\";\nimport { BaseProvider, Resolver } from \"./base-provider\";\nimport { AlchemyProvider, AlchemyWebSocketProvider } from \"./alchemy-provider\";\nimport { AnkrProvider } from \"./ankr-provider\";\nimport { CloudflareProvider } from \"./cloudflare-provider\";\nimport { EtherscanProvider } from \"./etherscan-provider\";\nimport { FallbackProvider } from \"./fallback-provider\";\nimport { IpcProvider } from \"./ipc-provider\";\nimport { InfuraProvider, InfuraWebSocketProvider } from \"./infura-provider\";\nimport { JsonRpcProvider, JsonRpcSigner } from \"./json-rpc-provider\";\nimport { JsonRpcBatchProvider } from \"./json-rpc-batch-provider\";\nimport { NodesmithProvider } from \"./nodesmith-provider\";\nimport { PocketProvider } from \"./pocket-provider\";\nimport { StaticJsonRpcProvider, UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\nimport { Web3Provider } from \"./web3-provider\";\nimport { WebSocketProvider } from \"./websocket-provider\";\nimport { Formatter, isCommunityResourcable, isCommunityResource, showThrottleMessage } from \"./formatter\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n////////////////////////\n// Helper Functions\nfunction getDefaultProvider(network, options) {\n if (network == null) {\n network = \"homestead\";\n }\n // If passed a URL, figure out the right type of provider based on the scheme\n if (typeof (network) === \"string\") {\n // @TODO: Add support for IpcProvider; maybe if it ends in \".ipc\"?\n // Handle http and ws (and their secure variants)\n const match = network.match(/^(ws|http)s?:/i);\n if (match) {\n switch (match[1].toLowerCase()) {\n case \"http\":\n case \"https\":\n return new JsonRpcProvider(network);\n case \"ws\":\n case \"wss\":\n return new WebSocketProvider(network);\n default:\n logger.throwArgumentError(\"unsupported URL scheme\", \"network\", network);\n }\n }\n }\n const n = getNetwork(network);\n if (!n || !n._defaultProvider) {\n logger.throwError(\"unsupported getDefaultProvider network\", Logger.errors.NETWORK_ERROR, {\n operation: \"getDefaultProvider\",\n network: network\n });\n }\n return n._defaultProvider({\n FallbackProvider,\n AlchemyProvider,\n AnkrProvider,\n CloudflareProvider,\n EtherscanProvider,\n InfuraProvider,\n JsonRpcProvider,\n NodesmithProvider,\n PocketProvider,\n Web3Provider,\n IpcProvider,\n }, options);\n}\n////////////////////////\n// Exports\nexport { \n// Abstract Providers (or Abstract-ish)\nProvider, BaseProvider, Resolver, UrlJsonRpcProvider, \n///////////////////////\n// Concrete Providers\nFallbackProvider, AlchemyProvider, AlchemyWebSocketProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, JsonRpcProvider, JsonRpcBatchProvider, NodesmithProvider, PocketProvider, StaticJsonRpcProvider, Web3Provider, WebSocketProvider, IpcProvider, \n///////////////////////\n// Signer\nJsonRpcSigner, \n///////////////////////\n// Functions\ngetDefaultProvider, getNetwork, isCommunityResource, isCommunityResourcable, showThrottleMessage, \n///////////////////////\n// Objects\nFormatter };\n//# sourceMappingURL=index.js.map","import { deepCopy } from \"@ethersproject/properties\";\nimport { fetchJson } from \"@ethersproject/web\";\nimport { JsonRpcProvider } from \"./json-rpc-provider\";\n// Experimental\nexport class JsonRpcBatchProvider extends JsonRpcProvider {\n send(method, params) {\n const request = {\n method: method,\n params: params,\n id: (this._nextId++),\n jsonrpc: \"2.0\"\n };\n if (this._pendingBatch == null) {\n this._pendingBatch = [];\n }\n const inflightRequest = { request, resolve: null, reject: null };\n const promise = new Promise((resolve, reject) => {\n inflightRequest.resolve = resolve;\n inflightRequest.reject = reject;\n });\n this._pendingBatch.push(inflightRequest);\n if (!this._pendingBatchAggregator) {\n // Schedule batch for next event loop + short duration\n this._pendingBatchAggregator = setTimeout(() => {\n // Get teh current batch and clear it, so new requests\n // go into the next batch\n const batch = this._pendingBatch;\n this._pendingBatch = null;\n this._pendingBatchAggregator = null;\n // Get the request as an array of requests\n const request = batch.map((inflight) => inflight.request);\n this.emit(\"debug\", {\n action: \"requestBatch\",\n request: deepCopy(request),\n provider: this\n });\n return fetchJson(this.connection, JSON.stringify(request)).then((result) => {\n this.emit(\"debug\", {\n action: \"response\",\n request: request,\n response: result,\n provider: this\n });\n // For each result, feed it to the correct Promise, depending\n // on whether it was a success or error\n batch.forEach((inflightRequest, index) => {\n const payload = result[index];\n if (payload.error) {\n const error = new Error(payload.error.message);\n error.code = payload.error.code;\n error.data = payload.error.data;\n inflightRequest.reject(error);\n }\n else {\n inflightRequest.resolve(payload.result);\n }\n });\n }, (error) => {\n this.emit(\"debug\", {\n action: \"response\",\n error: error,\n request: request,\n provider: this\n });\n batch.forEach((inflightRequest) => {\n inflightRequest.reject(error);\n });\n });\n }, 10);\n }\n return promise;\n }\n}\n//# sourceMappingURL=json-rpc-batch-provider.js.map","export const version = \"solidity/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, concat, hexlify, zeroPad } from \"@ethersproject/bytes\";\nimport { keccak256 as hashKeccak256 } from \"@ethersproject/keccak256\";\nimport { sha256 as hashSha256 } from \"@ethersproject/sha2\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\nconst Zeros = \"0000000000000000000000000000000000000000000000000000000000000000\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nfunction _pack(type, value, isArray) {\n switch (type) {\n case \"address\":\n if (isArray) {\n return zeroPad(value, 32);\n }\n return arrayify(value);\n case \"string\":\n return toUtf8Bytes(value);\n case \"bytes\":\n return arrayify(value);\n case \"bool\":\n value = (value ? \"0x01\" : \"0x00\");\n if (isArray) {\n return zeroPad(value, 32);\n }\n return arrayify(value);\n }\n let match = type.match(regexNumber);\n if (match) {\n //let signed = (match[1] === \"int\")\n let size = parseInt(match[2] || \"256\");\n if ((match[2] && String(size) !== match[2]) || (size % 8 !== 0) || size === 0 || size > 256) {\n logger.throwArgumentError(\"invalid number type\", \"type\", type);\n }\n if (isArray) {\n size = 256;\n }\n value = BigNumber.from(value).toTwos(size);\n return zeroPad(value, size / 8);\n }\n match = type.match(regexBytes);\n if (match) {\n const size = parseInt(match[1]);\n if (String(size) !== match[1] || size === 0 || size > 32) {\n logger.throwArgumentError(\"invalid bytes type\", \"type\", type);\n }\n if (arrayify(value).byteLength !== size) {\n logger.throwArgumentError(`invalid value for ${type}`, \"value\", value);\n }\n if (isArray) {\n return arrayify((value + Zeros).substring(0, 66));\n }\n return value;\n }\n match = type.match(regexArray);\n if (match && Array.isArray(value)) {\n const baseType = match[1];\n const count = parseInt(match[2] || String(value.length));\n if (count != value.length) {\n logger.throwArgumentError(`invalid array length for ${type}`, \"value\", value);\n }\n const result = [];\n value.forEach(function (value) {\n result.push(_pack(baseType, value, true));\n });\n return concat(result);\n }\n return logger.throwArgumentError(\"invalid type\", \"type\", type);\n}\n// @TODO: Array Enum\nexport function pack(types, values) {\n if (types.length != values.length) {\n logger.throwArgumentError(\"wrong number of values; expected ${ types.length }\", \"values\", values);\n }\n const tight = [];\n types.forEach(function (type, index) {\n tight.push(_pack(type, values[index]));\n });\n return hexlify(concat(tight));\n}\nexport function keccak256(types, values) {\n return hashKeccak256(pack(types, values));\n}\nexport function sha256(types, values) {\n return hashSha256(pack(types, values));\n}\n//# sourceMappingURL=index.js.map","export const version = \"units/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { formatFixed, parseFixed } from \"@ethersproject/bignumber\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nconst names = [\n \"wei\",\n \"kwei\",\n \"mwei\",\n \"gwei\",\n \"szabo\",\n \"finney\",\n \"ether\",\n];\n// Some environments have issues with RegEx that contain back-tracking, so we cannot\n// use them.\nexport function commify(value) {\n const comps = String(value).split(\".\");\n if (comps.length > 2 || !comps[0].match(/^-?[0-9]*$/) || (comps[1] && !comps[1].match(/^[0-9]*$/)) || value === \".\" || value === \"-.\") {\n logger.throwArgumentError(\"invalid value\", \"value\", value);\n }\n // Make sure we have at least one whole digit (0 if none)\n let whole = comps[0];\n let negative = \"\";\n if (whole.substring(0, 1) === \"-\") {\n negative = \"-\";\n whole = whole.substring(1);\n }\n // Make sure we have at least 1 whole digit with no leading zeros\n while (whole.substring(0, 1) === \"0\") {\n whole = whole.substring(1);\n }\n if (whole === \"\") {\n whole = \"0\";\n }\n let suffix = \"\";\n if (comps.length === 2) {\n suffix = \".\" + (comps[1] || \"0\");\n }\n while (suffix.length > 2 && suffix[suffix.length - 1] === \"0\") {\n suffix = suffix.substring(0, suffix.length - 1);\n }\n const formatted = [];\n while (whole.length) {\n if (whole.length <= 3) {\n formatted.unshift(whole);\n break;\n }\n else {\n const index = whole.length - 3;\n formatted.unshift(whole.substring(index));\n whole = whole.substring(0, index);\n }\n }\n return negative + formatted.join(\",\") + suffix;\n}\nexport function formatUnits(value, unitName) {\n if (typeof (unitName) === \"string\") {\n const index = names.indexOf(unitName);\n if (index !== -1) {\n unitName = 3 * index;\n }\n }\n return formatFixed(value, (unitName != null) ? unitName : 18);\n}\nexport function parseUnits(value, unitName) {\n if (typeof (value) !== \"string\") {\n logger.throwArgumentError(\"value must be a string\", \"value\", value);\n }\n if (typeof (unitName) === \"string\") {\n const index = names.indexOf(unitName);\n if (index !== -1) {\n unitName = 3 * index;\n }\n }\n return parseFixed(value, (unitName != null) ? unitName : 18);\n}\nexport function formatEther(wei) {\n return formatUnits(wei, 18);\n}\nexport function parseEther(ether) {\n return parseUnits(ether, 18);\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.formatBytes32String = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports._toEscapedUtf8String = exports.nameprep = exports.hexDataSlice = exports.hexDataLength = exports.hexZeroPad = exports.hexValue = exports.hexStripZeros = exports.hexConcat = exports.isHexString = exports.hexlify = exports.base64 = exports.base58 = exports.TransactionDescription = exports.LogDescription = exports.Interface = exports.SigningKey = exports.HDNode = exports.defaultPath = exports.isBytesLike = exports.isBytes = exports.zeroPad = exports.stripZeros = exports.concat = exports.arrayify = exports.shallowCopy = exports.resolveProperties = exports.getStatic = exports.defineReadOnly = exports.deepCopy = exports.checkProperties = exports.poll = exports.fetchJson = exports._fetchData = exports.RLP = exports.Logger = exports.checkResultErrors = exports.FormatTypes = exports.ParamType = exports.FunctionFragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.Fragment = exports.defaultAbiCoder = exports.AbiCoder = void 0;\nexports.Indexed = exports.Utf8ErrorReason = exports.UnicodeNormalizationForm = exports.SupportedAlgorithm = exports.mnemonicToSeed = exports.isValidMnemonic = exports.entropyToMnemonic = exports.mnemonicToEntropy = exports.getAccountPath = exports.verifyTypedData = exports.verifyMessage = exports.recoverPublicKey = exports.computePublicKey = exports.recoverAddress = exports.computeAddress = exports.getJsonWalletAddress = exports.TransactionTypes = exports.serializeTransaction = exports.parseTransaction = exports.accessListify = exports.joinSignature = exports.splitSignature = exports.soliditySha256 = exports.solidityKeccak256 = exports.solidityPack = exports.shuffled = exports.randomBytes = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.computeHmac = exports.commify = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.isAddress = exports.getCreate2Address = exports.getContractAddress = exports.getIcapAddress = exports.getAddress = exports._TypedDataEncoder = exports.id = exports.isValidName = exports.namehash = exports.hashMessage = exports.dnsEncode = exports.parseBytes32String = void 0;\nvar abi_1 = require(\"@ethersproject/abi\");\nObject.defineProperty(exports, \"AbiCoder\", { enumerable: true, get: function () { return abi_1.AbiCoder; } });\nObject.defineProperty(exports, \"checkResultErrors\", { enumerable: true, get: function () { return abi_1.checkResultErrors; } });\nObject.defineProperty(exports, \"ConstructorFragment\", { enumerable: true, get: function () { return abi_1.ConstructorFragment; } });\nObject.defineProperty(exports, \"defaultAbiCoder\", { enumerable: true, get: function () { return abi_1.defaultAbiCoder; } });\nObject.defineProperty(exports, \"ErrorFragment\", { enumerable: true, get: function () { return abi_1.ErrorFragment; } });\nObject.defineProperty(exports, \"EventFragment\", { enumerable: true, get: function () { return abi_1.EventFragment; } });\nObject.defineProperty(exports, \"FormatTypes\", { enumerable: true, get: function () { return abi_1.FormatTypes; } });\nObject.defineProperty(exports, \"Fragment\", { enumerable: true, get: function () { return abi_1.Fragment; } });\nObject.defineProperty(exports, \"FunctionFragment\", { enumerable: true, get: function () { return abi_1.FunctionFragment; } });\nObject.defineProperty(exports, \"Indexed\", { enumerable: true, get: function () { return abi_1.Indexed; } });\nObject.defineProperty(exports, \"Interface\", { enumerable: true, get: function () { return abi_1.Interface; } });\nObject.defineProperty(exports, \"LogDescription\", { enumerable: true, get: function () { return abi_1.LogDescription; } });\nObject.defineProperty(exports, \"ParamType\", { enumerable: true, get: function () { return abi_1.ParamType; } });\nObject.defineProperty(exports, \"TransactionDescription\", { enumerable: true, get: function () { return abi_1.TransactionDescription; } });\nvar address_1 = require(\"@ethersproject/address\");\nObject.defineProperty(exports, \"getAddress\", { enumerable: true, get: function () { return address_1.getAddress; } });\nObject.defineProperty(exports, \"getCreate2Address\", { enumerable: true, get: function () { return address_1.getCreate2Address; } });\nObject.defineProperty(exports, \"getContractAddress\", { enumerable: true, get: function () { return address_1.getContractAddress; } });\nObject.defineProperty(exports, \"getIcapAddress\", { enumerable: true, get: function () { return address_1.getIcapAddress; } });\nObject.defineProperty(exports, \"isAddress\", { enumerable: true, get: function () { return address_1.isAddress; } });\nvar base64 = __importStar(require(\"@ethersproject/base64\"));\nexports.base64 = base64;\nvar basex_1 = require(\"@ethersproject/basex\");\nObject.defineProperty(exports, \"base58\", { enumerable: true, get: function () { return basex_1.Base58; } });\nvar bytes_1 = require(\"@ethersproject/bytes\");\nObject.defineProperty(exports, \"arrayify\", { enumerable: true, get: function () { return bytes_1.arrayify; } });\nObject.defineProperty(exports, \"concat\", { enumerable: true, get: function () { return bytes_1.concat; } });\nObject.defineProperty(exports, \"hexConcat\", { enumerable: true, get: function () { return bytes_1.hexConcat; } });\nObject.defineProperty(exports, \"hexDataSlice\", { enumerable: true, get: function () { return bytes_1.hexDataSlice; } });\nObject.defineProperty(exports, \"hexDataLength\", { enumerable: true, get: function () { return bytes_1.hexDataLength; } });\nObject.defineProperty(exports, \"hexlify\", { enumerable: true, get: function () { return bytes_1.hexlify; } });\nObject.defineProperty(exports, \"hexStripZeros\", { enumerable: true, get: function () { return bytes_1.hexStripZeros; } });\nObject.defineProperty(exports, \"hexValue\", { enumerable: true, get: function () { return bytes_1.hexValue; } });\nObject.defineProperty(exports, \"hexZeroPad\", { enumerable: true, get: function () { return bytes_1.hexZeroPad; } });\nObject.defineProperty(exports, \"isBytes\", { enumerable: true, get: function () { return bytes_1.isBytes; } });\nObject.defineProperty(exports, \"isBytesLike\", { enumerable: true, get: function () { return bytes_1.isBytesLike; } });\nObject.defineProperty(exports, \"isHexString\", { enumerable: true, get: function () { return bytes_1.isHexString; } });\nObject.defineProperty(exports, \"joinSignature\", { enumerable: true, get: function () { return bytes_1.joinSignature; } });\nObject.defineProperty(exports, \"zeroPad\", { enumerable: true, get: function () { return bytes_1.zeroPad; } });\nObject.defineProperty(exports, \"splitSignature\", { enumerable: true, get: function () { return bytes_1.splitSignature; } });\nObject.defineProperty(exports, \"stripZeros\", { enumerable: true, get: function () { return bytes_1.stripZeros; } });\nvar hash_1 = require(\"@ethersproject/hash\");\nObject.defineProperty(exports, \"_TypedDataEncoder\", { enumerable: true, get: function () { return hash_1._TypedDataEncoder; } });\nObject.defineProperty(exports, \"dnsEncode\", { enumerable: true, get: function () { return hash_1.dnsEncode; } });\nObject.defineProperty(exports, \"hashMessage\", { enumerable: true, get: function () { return hash_1.hashMessage; } });\nObject.defineProperty(exports, \"id\", { enumerable: true, get: function () { return hash_1.id; } });\nObject.defineProperty(exports, \"isValidName\", { enumerable: true, get: function () { return hash_1.isValidName; } });\nObject.defineProperty(exports, \"namehash\", { enumerable: true, get: function () { return hash_1.namehash; } });\nvar hdnode_1 = require(\"@ethersproject/hdnode\");\nObject.defineProperty(exports, \"defaultPath\", { enumerable: true, get: function () { return hdnode_1.defaultPath; } });\nObject.defineProperty(exports, \"entropyToMnemonic\", { enumerable: true, get: function () { return hdnode_1.entropyToMnemonic; } });\nObject.defineProperty(exports, \"getAccountPath\", { enumerable: true, get: function () { return hdnode_1.getAccountPath; } });\nObject.defineProperty(exports, \"HDNode\", { enumerable: true, get: function () { return hdnode_1.HDNode; } });\nObject.defineProperty(exports, \"isValidMnemonic\", { enumerable: true, get: function () { return hdnode_1.isValidMnemonic; } });\nObject.defineProperty(exports, \"mnemonicToEntropy\", { enumerable: true, get: function () { return hdnode_1.mnemonicToEntropy; } });\nObject.defineProperty(exports, \"mnemonicToSeed\", { enumerable: true, get: function () { return hdnode_1.mnemonicToSeed; } });\nvar json_wallets_1 = require(\"@ethersproject/json-wallets\");\nObject.defineProperty(exports, \"getJsonWalletAddress\", { enumerable: true, get: function () { return json_wallets_1.getJsonWalletAddress; } });\nvar keccak256_1 = require(\"@ethersproject/keccak256\");\nObject.defineProperty(exports, \"keccak256\", { enumerable: true, get: function () { return keccak256_1.keccak256; } });\nvar logger_1 = require(\"@ethersproject/logger\");\nObject.defineProperty(exports, \"Logger\", { enumerable: true, get: function () { return logger_1.Logger; } });\nvar sha2_1 = require(\"@ethersproject/sha2\");\nObject.defineProperty(exports, \"computeHmac\", { enumerable: true, get: function () { return sha2_1.computeHmac; } });\nObject.defineProperty(exports, \"ripemd160\", { enumerable: true, get: function () { return sha2_1.ripemd160; } });\nObject.defineProperty(exports, \"sha256\", { enumerable: true, get: function () { return sha2_1.sha256; } });\nObject.defineProperty(exports, \"sha512\", { enumerable: true, get: function () { return sha2_1.sha512; } });\nvar solidity_1 = require(\"@ethersproject/solidity\");\nObject.defineProperty(exports, \"solidityKeccak256\", { enumerable: true, get: function () { return solidity_1.keccak256; } });\nObject.defineProperty(exports, \"solidityPack\", { enumerable: true, get: function () { return solidity_1.pack; } });\nObject.defineProperty(exports, \"soliditySha256\", { enumerable: true, get: function () { return solidity_1.sha256; } });\nvar random_1 = require(\"@ethersproject/random\");\nObject.defineProperty(exports, \"randomBytes\", { enumerable: true, get: function () { return random_1.randomBytes; } });\nObject.defineProperty(exports, \"shuffled\", { enumerable: true, get: function () { return random_1.shuffled; } });\nvar properties_1 = require(\"@ethersproject/properties\");\nObject.defineProperty(exports, \"checkProperties\", { enumerable: true, get: function () { return properties_1.checkProperties; } });\nObject.defineProperty(exports, \"deepCopy\", { enumerable: true, get: function () { return properties_1.deepCopy; } });\nObject.defineProperty(exports, \"defineReadOnly\", { enumerable: true, get: function () { return properties_1.defineReadOnly; } });\nObject.defineProperty(exports, \"getStatic\", { enumerable: true, get: function () { return properties_1.getStatic; } });\nObject.defineProperty(exports, \"resolveProperties\", { enumerable: true, get: function () { return properties_1.resolveProperties; } });\nObject.defineProperty(exports, \"shallowCopy\", { enumerable: true, get: function () { return properties_1.shallowCopy; } });\nvar RLP = __importStar(require(\"@ethersproject/rlp\"));\nexports.RLP = RLP;\nvar signing_key_1 = require(\"@ethersproject/signing-key\");\nObject.defineProperty(exports, \"computePublicKey\", { enumerable: true, get: function () { return signing_key_1.computePublicKey; } });\nObject.defineProperty(exports, \"recoverPublicKey\", { enumerable: true, get: function () { return signing_key_1.recoverPublicKey; } });\nObject.defineProperty(exports, \"SigningKey\", { enumerable: true, get: function () { return signing_key_1.SigningKey; } });\nvar strings_1 = require(\"@ethersproject/strings\");\nObject.defineProperty(exports, \"formatBytes32String\", { enumerable: true, get: function () { return strings_1.formatBytes32String; } });\nObject.defineProperty(exports, \"nameprep\", { enumerable: true, get: function () { return strings_1.nameprep; } });\nObject.defineProperty(exports, \"parseBytes32String\", { enumerable: true, get: function () { return strings_1.parseBytes32String; } });\nObject.defineProperty(exports, \"_toEscapedUtf8String\", { enumerable: true, get: function () { return strings_1._toEscapedUtf8String; } });\nObject.defineProperty(exports, \"toUtf8Bytes\", { enumerable: true, get: function () { return strings_1.toUtf8Bytes; } });\nObject.defineProperty(exports, \"toUtf8CodePoints\", { enumerable: true, get: function () { return strings_1.toUtf8CodePoints; } });\nObject.defineProperty(exports, \"toUtf8String\", { enumerable: true, get: function () { return strings_1.toUtf8String; } });\nObject.defineProperty(exports, \"Utf8ErrorFuncs\", { enumerable: true, get: function () { return strings_1.Utf8ErrorFuncs; } });\nvar transactions_1 = require(\"@ethersproject/transactions\");\nObject.defineProperty(exports, \"accessListify\", { enumerable: true, get: function () { return transactions_1.accessListify; } });\nObject.defineProperty(exports, \"computeAddress\", { enumerable: true, get: function () { return transactions_1.computeAddress; } });\nObject.defineProperty(exports, \"parseTransaction\", { enumerable: true, get: function () { return transactions_1.parse; } });\nObject.defineProperty(exports, \"recoverAddress\", { enumerable: true, get: function () { return transactions_1.recoverAddress; } });\nObject.defineProperty(exports, \"serializeTransaction\", { enumerable: true, get: function () { return transactions_1.serialize; } });\nObject.defineProperty(exports, \"TransactionTypes\", { enumerable: true, get: function () { return transactions_1.TransactionTypes; } });\nvar units_1 = require(\"@ethersproject/units\");\nObject.defineProperty(exports, \"commify\", { enumerable: true, get: function () { return units_1.commify; } });\nObject.defineProperty(exports, \"formatEther\", { enumerable: true, get: function () { return units_1.formatEther; } });\nObject.defineProperty(exports, \"parseEther\", { enumerable: true, get: function () { return units_1.parseEther; } });\nObject.defineProperty(exports, \"formatUnits\", { enumerable: true, get: function () { return units_1.formatUnits; } });\nObject.defineProperty(exports, \"parseUnits\", { enumerable: true, get: function () { return units_1.parseUnits; } });\nvar wallet_1 = require(\"@ethersproject/wallet\");\nObject.defineProperty(exports, \"verifyMessage\", { enumerable: true, get: function () { return wallet_1.verifyMessage; } });\nObject.defineProperty(exports, \"verifyTypedData\", { enumerable: true, get: function () { return wallet_1.verifyTypedData; } });\nvar web_1 = require(\"@ethersproject/web\");\nObject.defineProperty(exports, \"_fetchData\", { enumerable: true, get: function () { return web_1._fetchData; } });\nObject.defineProperty(exports, \"fetchJson\", { enumerable: true, get: function () { return web_1.fetchJson; } });\nObject.defineProperty(exports, \"poll\", { enumerable: true, get: function () { return web_1.poll; } });\n////////////////////////\n// Enums\nvar sha2_2 = require(\"@ethersproject/sha2\");\nObject.defineProperty(exports, \"SupportedAlgorithm\", { enumerable: true, get: function () { return sha2_2.SupportedAlgorithm; } });\nvar strings_2 = require(\"@ethersproject/strings\");\nObject.defineProperty(exports, \"UnicodeNormalizationForm\", { enumerable: true, get: function () { return strings_2.UnicodeNormalizationForm; } });\nObject.defineProperty(exports, \"Utf8ErrorReason\", { enumerable: true, get: function () { return strings_2.Utf8ErrorReason; } });\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\nexports.version = \"ethers/5.7.2\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Wordlist = exports.version = exports.wordlists = exports.utils = exports.logger = exports.errors = exports.constants = exports.FixedNumber = exports.BigNumber = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.providers = exports.getDefaultProvider = exports.VoidSigner = exports.Wallet = exports.Signer = void 0;\nvar contracts_1 = require(\"@ethersproject/contracts\");\nObject.defineProperty(exports, \"BaseContract\", { enumerable: true, get: function () { return contracts_1.BaseContract; } });\nObject.defineProperty(exports, \"Contract\", { enumerable: true, get: function () { return contracts_1.Contract; } });\nObject.defineProperty(exports, \"ContractFactory\", { enumerable: true, get: function () { return contracts_1.ContractFactory; } });\nvar bignumber_1 = require(\"@ethersproject/bignumber\");\nObject.defineProperty(exports, \"BigNumber\", { enumerable: true, get: function () { return bignumber_1.BigNumber; } });\nObject.defineProperty(exports, \"FixedNumber\", { enumerable: true, get: function () { return bignumber_1.FixedNumber; } });\nvar abstract_signer_1 = require(\"@ethersproject/abstract-signer\");\nObject.defineProperty(exports, \"Signer\", { enumerable: true, get: function () { return abstract_signer_1.Signer; } });\nObject.defineProperty(exports, \"VoidSigner\", { enumerable: true, get: function () { return abstract_signer_1.VoidSigner; } });\nvar wallet_1 = require(\"@ethersproject/wallet\");\nObject.defineProperty(exports, \"Wallet\", { enumerable: true, get: function () { return wallet_1.Wallet; } });\nvar constants = __importStar(require(\"@ethersproject/constants\"));\nexports.constants = constants;\nvar providers = __importStar(require(\"@ethersproject/providers\"));\nexports.providers = providers;\nvar providers_1 = require(\"@ethersproject/providers\");\nObject.defineProperty(exports, \"getDefaultProvider\", { enumerable: true, get: function () { return providers_1.getDefaultProvider; } });\nvar wordlists_1 = require(\"@ethersproject/wordlists\");\nObject.defineProperty(exports, \"Wordlist\", { enumerable: true, get: function () { return wordlists_1.Wordlist; } });\nObject.defineProperty(exports, \"wordlists\", { enumerable: true, get: function () { return wordlists_1.wordlists; } });\nvar utils = __importStar(require(\"./utils\"));\nexports.utils = utils;\nvar logger_1 = require(\"@ethersproject/logger\");\nObject.defineProperty(exports, \"errors\", { enumerable: true, get: function () { return logger_1.ErrorCode; } });\n////////////////////////\n// Compile-Time Constants\n// This is generated by \"npm run dist\"\nvar _version_1 = require(\"./_version\");\nObject.defineProperty(exports, \"version\", { enumerable: true, get: function () { return _version_1.version; } });\nvar logger = new logger_1.Logger(_version_1.version);\nexports.logger = logger;\n//# sourceMappingURL=ethers.js.map","let contractAddresses = {\r\n PROOF_OF_INTEGRITY_ADDRESS: \"0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512\",\r\n STEALTH_ANNOUNCER_ADDRESS: \"0x5FbDB2315678afecb367f032d93F642f64180aa3\"\r\n};\r\n\r\nif (typeof window === 'undefined') {\r\n const { fileURLToPath } = require('url');\r\n const { dirname } = require('path');\r\n const { readFileSync } = require('fs');\r\n const { join } = require('path');\r\n\r\n try {\r\n const __filename = fileURLToPath(import.meta.url);\r\n const __dirname = dirname(__filename);\r\n const rawdata = readFileSync(join(__dirname, 'contract-address.json'), 'utf8');\r\n contractAddresses = JSON.parse(rawdata);\r\n console.log(\"Loaded contract addresses:\", contractAddresses);\r\n } catch (error) {\r\n console.warn(\"Warning: contract-address.json not found or invalid\");\r\n }\r\n}\r\n\r\nexport const LOCAL_CONFIG = {\r\n CHAIN_ID: 1337,\r\n PROOF_OF_INTEGRITY_ADDRESS: contractAddresses.PROOF_OF_INTEGRITY_ADDRESS,\r\n STEALTH_ANNOUNCER_ADDRESS: contractAddresses.STEALTH_ANNOUNCER_ADDRESS,\r\n RPC_URL: \"http://127.0.0.1:8545\",\r\n GUN_PEER: \"http://localhost:8765/gun\"\r\n}; ","import { LOCAL_CONFIG } from '../config/local.js';\r\n\r\n// Indirizzi di produzione per diverse chain\r\nexport const CHAIN_CONFIG = {\r\n optimismSepolia: {\r\n STEALTH_ANNOUNCER_ADDRESS: \"0xD0F2e9DA59d2DFECFdE67CcF17300BB6093A72f8\",\r\n PROOF_OF_INTEGRITY_ADDRESS: \"0x...\",\r\n RPC_URL: \"https://sepolia.optimism.io\",\r\n CHAIN_ID: 11155420\r\n },\r\n arbitrumSepolia: {\r\n STEALTH_ANNOUNCER_ADDRESS: \"0x...\",\r\n PROOF_OF_INTEGRITY_ADDRESS: \"0x...\",\r\n RPC_URL: \"https://sepolia-rollup.arbitrum.io/rpc\",\r\n CHAIN_ID: 421614\r\n },\r\n localhost: {\r\n RPC_URL: \"http://127.0.0.1:8545\",\r\n CHAIN_ID: 1337\r\n }\r\n};\r\n\r\n// Esporta gli indirizzi di default (Optimism Sepolia)\r\nexport const STEALTH_ANNOUNCER_ADDRESS = CHAIN_CONFIG.optimismSepolia.STEALTH_ANNOUNCER_ADDRESS;\r\nexport const PROOF_OF_INTEGRITY_ADDRESS = CHAIN_CONFIG.optimismSepolia.PROOF_OF_INTEGRITY_ADDRESS;\r\n\r\n// Funzione per ottenere gli indirizzi corretti\r\nexport function getAddressesForChain(chainName) {\r\n let config;\r\n\r\n // Se è localhost, prova a caricare gli indirizzi locali\r\n if (chainName === 'localhost') {\r\n try {\r\n // Carica gli indirizzi dal file generato dal deploy locale\r\n const localAddresses = require('../config/contract-address.json');\r\n config = {\r\n ...CHAIN_CONFIG.localhost,\r\n ...localAddresses\r\n };\r\n console.log(\"Using local addresses:\", config);\r\n return config;\r\n } catch (err) {\r\n console.warn('No local addresses found');\r\n throw new Error('No local addresses found. Did you run local deployment?');\r\n }\r\n }\r\n\r\n // Altrimenti usa gli indirizzi di produzione\r\n config = CHAIN_CONFIG[chainName];\r\n if (!config) {\r\n throw new Error(`Chain ${chainName} not supported. Supported chains: ${Object.keys(CHAIN_CONFIG).join(', ')}`);\r\n }\r\n\r\n return config;\r\n}\r\n\r\n// Funzione helper per verificare se siamo in ambiente locale\r\nexport function isLocalEnvironment() {\r\n return process.env.NODE_ENV === 'development' && \r\n typeof window !== 'undefined' && \r\n window.location.hostname === 'localhost';\r\n}\r\n\r\nexport const STEALTH_ANNOUNCER_ABI = [\r\n {\r\n \"inputs\": [\r\n {\r\n \"internalType\": \"address\",\r\n \"name\": \"_devAddress\",\r\n \"type\": \"address\"\r\n }\r\n ],\r\n \"stateMutability\": \"nonpayable\",\r\n \"type\": \"constructor\"\r\n },\r\n {\r\n \"anonymous\": false,\r\n \"inputs\": [\r\n {\r\n \"internalType\": \"string\",\r\n \"name\": \"senderPublicKey\",\r\n \"type\": \"string\"\r\n },\r\n {\r\n \"internalType\": \"string\",\r\n \"name\": \"spendingPublicKey\",\r\n \"type\": \"string\"\r\n },\r\n {\r\n \"internalType\": \"address\",\r\n \"name\": \"stealthAddress\",\r\n \"type\": \"address\"\r\n },\r\n {\r\n \"internalType\": \"uint256\",\r\n \"name\": \"timestamp\",\r\n \"type\": \"uint256\"\r\n }\r\n ],\r\n \"name\": \"StealthPaymentAnnounced\",\r\n \"type\": \"event\"\r\n },\r\n {\r\n \"anonymous\": false,\r\n \"inputs\": [\r\n {\r\n \"internalType\": \"address\",\r\n \"name\": \"newAddress\",\r\n \"type\": \"address\"\r\n }\r\n ],\r\n \"name\": \"DevAddressUpdated\",\r\n \"type\": \"event\"\r\n },\r\n {\r\n \"anonymous\": false,\r\n \"inputs\": [\r\n {\r\n \"internalType\": \"uint256\",\r\n \"name\": \"newFee\",\r\n \"type\": \"uint256\"\r\n }\r\n ],\r\n \"name\": \"DevFeeUpdated\",\r\n \"type\": \"event\"\r\n },\r\n {\r\n \"inputs\": [\r\n {\r\n \"internalType\": \"string\",\r\n \"name\": \"senderPublicKey\",\r\n \"type\": \"string\"\r\n },\r\n {\r\n \"internalType\": \"string\",\r\n \"name\": \"spendingPublicKey\",\r\n \"type\": \"string\"\r\n },\r\n {\r\n \"internalType\": \"address\",\r\n \"name\": \"stealthAddress\",\r\n \"type\": \"address\"\r\n }\r\n ],\r\n \"name\": \"announcePayment\",\r\n \"outputs\": [],\r\n \"stateMutability\": \"payable\",\r\n \"type\": \"function\"\r\n },\r\n {\r\n \"inputs\": [],\r\n \"name\": \"devAddress\",\r\n \"outputs\": [\r\n {\r\n \"internalType\": \"address\",\r\n \"name\": \"\",\r\n \"type\": \"address\"\r\n }\r\n ],\r\n \"stateMutability\": \"view\",\r\n \"type\": \"function\"\r\n },\r\n {\r\n \"inputs\": [],\r\n \"name\": \"devFee\",\r\n \"outputs\": [\r\n {\r\n \"internalType\": \"uint256\",\r\n \"name\": \"\",\r\n \"type\": \"uint256\"\r\n }\r\n ],\r\n \"stateMutability\": \"view\",\r\n \"type\": \"function\"\r\n },\r\n {\r\n \"inputs\": [],\r\n \"name\": \"getAnnouncementsCount\",\r\n \"outputs\": [\r\n {\r\n \"internalType\": \"uint256\",\r\n \"name\": \"\",\r\n \"type\": \"uint256\"\r\n }\r\n ],\r\n \"stateMutability\": \"view\",\r\n \"type\": \"function\"\r\n },\r\n {\r\n \"inputs\": [\r\n {\r\n \"internalType\": \"uint256\",\r\n \"name\": \"fromIndex\",\r\n \"type\": \"uint256\"\r\n },\r\n {\r\n \"internalType\": \"uint256\",\r\n \"name\": \"toIndex\",\r\n \"type\": \"uint256\"\r\n }\r\n ],\r\n \"name\": \"getAnnouncementsInRange\",\r\n \"outputs\": [\r\n {\r\n \"components\": [\r\n {\r\n \"internalType\": \"string\",\r\n \"name\": \"senderPublicKey\",\r\n \"type\": \"string\"\r\n },\r\n {\r\n \"internalType\": \"string\",\r\n \"name\": \"spendingPublicKey\",\r\n \"type\": \"string\"\r\n },\r\n {\r\n \"internalType\": \"address\",\r\n \"name\": \"stealthAddress\",\r\n \"type\": \"address\"\r\n },\r\n {\r\n \"internalType\": \"uint256\",\r\n \"name\": \"timestamp\",\r\n \"type\": \"uint256\"\r\n }\r\n ],\r\n \"internalType\": \"struct StealthAnnouncer.StealthAnnouncement[]\",\r\n \"name\": \"\",\r\n \"type\": \"tuple[]\"\r\n }\r\n ],\r\n \"stateMutability\": \"view\",\r\n \"type\": \"function\"\r\n },\r\n {\r\n \"inputs\": [\r\n {\r\n \"internalType\": \"uint256\",\r\n \"name\": \"_newFee\",\r\n \"type\": \"uint256\"\r\n }\r\n ],\r\n \"name\": \"updateDevFee\",\r\n \"outputs\": [],\r\n \"stateMutability\": \"nonpayable\",\r\n \"type\": \"function\"\r\n },\r\n {\r\n \"inputs\": [\r\n {\r\n \"internalType\": \"address\",\r\n \"name\": \"_newAddress\",\r\n \"type\": \"address\"\r\n }\r\n ],\r\n \"name\": \"updateDevAddress\",\r\n \"outputs\": [],\r\n \"stateMutability\": \"nonpayable\",\r\n \"type\": \"function\"\r\n },\r\n {\r\n \"inputs\": [],\r\n \"name\": \"withdrawStuckETH\",\r\n \"outputs\": [],\r\n \"stateMutability\": \"nonpayable\",\r\n \"type\": \"function\"\r\n }\r\n];\r\n\r\nexport const PROOF_OF_INTEGRITY_ABI = [\r\n {\r\n \"inputs\": [\r\n {\r\n \"internalType\": \"bytes[]\",\r\n \"name\": \"nodeIds\",\r\n \"type\": \"bytes[]\"\r\n },\r\n {\r\n \"internalType\": \"bytes32[]\",\r\n \"name\": \"contentHashes\",\r\n \"type\": \"bytes32[]\"\r\n }\r\n ],\r\n \"name\": \"batchUpdateData\",\r\n \"outputs\": [],\r\n \"stateMutability\": \"nonpayable\",\r\n \"type\": \"function\"\r\n },\r\n {\r\n \"anonymous\": false,\r\n \"inputs\": [\r\n {\r\n \"indexed\": true,\r\n \"internalType\": \"bytes\",\r\n \"name\": \"nodeId\",\r\n \"type\": \"bytes\"\r\n },\r\n {\r\n \"indexed\": false,\r\n \"internalType\": \"bytes32\",\r\n \"name\": \"contentHash\",\r\n \"type\": \"bytes32\"\r\n },\r\n {\r\n \"indexed\": false,\r\n \"internalType\": \"address\",\r\n \"name\": \"updater\",\r\n \"type\": \"address\"\r\n }\r\n ],\r\n \"name\": \"DataUpdated\",\r\n \"type\": \"event\"\r\n },\r\n {\r\n \"inputs\": [\r\n {\r\n \"internalType\": \"bytes\",\r\n \"name\": \"nodeId\",\r\n \"type\": \"bytes\"\r\n }\r\n ],\r\n \"name\": \"getLatestRecord\",\r\n \"outputs\": [\r\n {\r\n \"internalType\": \"bytes32\",\r\n \"name\": \"\",\r\n \"type\": \"bytes32\"\r\n },\r\n {\r\n \"internalType\": \"uint256\",\r\n \"name\": \"\",\r\n \"type\": \"uint256\"\r\n },\r\n {\r\n \"internalType\": \"address\",\r\n \"name\": \"\",\r\n \"type\": \"address\"\r\n }\r\n ],\r\n \"stateMutability\": \"view\",\r\n \"type\": \"function\"\r\n },\r\n {\r\n \"inputs\": [\r\n {\r\n \"internalType\": \"bytes\",\r\n \"name\": \"nodeId\",\r\n \"type\": \"bytes\"\r\n },\r\n {\r\n \"internalType\": \"bytes32\",\r\n \"name\": \"contentHash\",\r\n \"type\": \"bytes32\"\r\n }\r\n ],\r\n \"name\": \"updateData\",\r\n \"outputs\": [],\r\n \"stateMutability\": \"nonpayable\",\r\n \"type\": \"function\"\r\n },\r\n {\r\n \"inputs\": [\r\n {\r\n \"internalType\": \"bytes\",\r\n \"name\": \"nodeId\",\r\n \"type\": \"bytes\"\r\n },\r\n {\r\n \"internalType\": \"bytes32\",\r\n \"name\": \"contentHash\",\r\n \"type\": \"bytes32\"\r\n }\r\n ],\r\n \"name\": \"verifyData\",\r\n \"outputs\": [\r\n {\r\n \"internalType\": \"bool\",\r\n \"name\": \"\",\r\n \"type\": \"bool\"\r\n },\r\n {\r\n \"internalType\": \"uint256\",\r\n \"name\": \"\",\r\n \"type\": \"uint256\"\r\n },\r\n {\r\n \"internalType\": \"address\",\r\n \"name\": \"\",\r\n \"type\": \"address\"\r\n }\r\n ],\r\n \"stateMutability\": \"view\",\r\n \"type\": \"function\"\r\n }\r\n];\r\n\r\n\r\nexport const SHINE_OPTIMISM_SEPOLIA = \"0x43D838b683F772F08f321E5FA265ad3e333BE9C2\";\r\n","// =============================================\r\n// IMPORTS AND GLOBAL VARIABLES\r\n// =============================================\r\nimport Gun from \"gun\";\r\nimport SEA from \"gun/sea.js\";\r\nimport { \r\n ethers,\r\n JsonRpcProvider,\r\n BrowserProvider,\r\n Contract,\r\n Wallet,\r\n getBytes,\r\n concat,\r\n toUtf8Bytes,\r\n keccak256,\r\n verifyMessage,\r\n randomBytes,\r\n hexlify\r\n} from \"ethers/lib/ethers.js\";\r\nimport { \r\n PROOF_OF_INTEGRITY_ABI, \r\n STEALTH_ANNOUNCER_ABI, \r\n getAddressesForChain, \r\n isLocalEnvironment,\r\n CHAIN_CONFIG\r\n} from \"./abis/abis.js\";\r\nimport { LOCAL_CONFIG } from \"./config/local.js\";\r\n\r\nlet PROOF_CONTRACT_ADDRESS;\r\nlet rpcUrl = \"\";\r\nlet privateKey = \"\";\r\n\r\nexport const MESSAGE_TO_SIGN = \"Access GunDB with Ethereum\";\r\n\r\nlet contractAddresses = {\r\n PROOF_OF_INTEGRITY_ADDRESS: CHAIN_CONFIG.optimismSepolia.PROOF_OF_INTEGRITY_ADDRESS,\r\n STEALTH_ANNOUNCER_ADDRESS: CHAIN_CONFIG.optimismSepolia.STEALTH_ANNOUNCER_ADDRESS\r\n};\r\n\r\n// Solo per Node.js\r\nif (typeof window === 'undefined') {\r\n const { fileURLToPath } = require('url');\r\n const { dirname } = require('path');\r\n const { readFileSync } = require('fs');\r\n const path = require('path');\r\n \r\n const __filename = fileURLToPath(import.meta.url);\r\n const __dirname = dirname(__filename);\r\n\r\n try {\r\n const rawdata = readFileSync(path.join(__dirname, 'contract-address.json'), 'utf8');\r\n contractAddresses = JSON.parse(rawdata);\r\n console.log('Loaded contract addresses:', contractAddresses);\r\n } catch (err) {\r\n console.warn('Warning: contract-address.json not found or invalid');\r\n }\r\n}\r\n\r\n// =============================================\r\n// UTILITY FUNCTIONS\r\n// =============================================\r\n/**\r\n * Generates a random node ID for GunDB\r\n * @returns {string} A random hexadecimal string\r\n */\r\nexport function generateRandomId() {\r\n const bytes = randomBytes(32);\r\n return hexlify(bytes).slice(2);\r\n}\r\n\r\n/**\r\n * Generates a password from a signature.\r\n * @param {string} signature - The signature to derive the password from.\r\n * @returns {string|null} The generated password or null if generation fails.\r\n */\r\nexport function generatePassword(signature) {\r\n try {\r\n const signatureBytes = getBytes(signature);\r\n const hash = keccak256(signatureBytes);\r\n console.log(\"Generated password:\", hash);\r\n return hash;\r\n } catch (error) {\r\n console.error(\"Error generating password:\", error);\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * Converts a Gun private key to an Ethereum account.\r\n * @param {string} gunPrivateKey - The Gun private key in base64url format.\r\n * @returns {Object} An object containing the Ethereum account and public key.\r\n */\r\nexport function gunToEthAccount(gunPrivateKey) {\r\n // Function to convert base64url to hex\r\n const base64UrlToHex = (base64url) => {\r\n const padding = \"=\".repeat((4 - (base64url.length % 4)) % 4);\r\n const base64 = base64url.replace(/-/g, \"+\").replace(/_/g, \"/\") + padding;\r\n const binary = atob(base64);\r\n return Array.from(binary, (char) =>\r\n char.charCodeAt(0).toString(16).padStart(2, \"0\")\r\n ).join(\"\");\r\n };\r\n\r\n // Convert Gun private key to hex format\r\n const hexPrivateKey = \"0x\" + base64UrlToHex(gunPrivateKey);\r\n\r\n // Create an Ethereum wallet from the private key\r\n const wallet = new ethers.Wallet(hexPrivateKey);\r\n\r\n // Get the public address (public key)\r\n const publicKey = wallet.address;\r\n\r\n return {\r\n account: wallet,\r\n publicKey: publicKey,\r\n privateKey: hexPrivateKey,\r\n };\r\n}\r\n\r\n/**\r\n * Gets an Ethereum signer based on current configuration\r\n * @returns {Promise<ethers.Signer>} The configured signer\r\n * @throws {Error} If no valid provider is found\r\n */\r\nexport const getSigner = async () => {\r\n if (rpcUrl && privateKey) {\r\n const provider = new JsonRpcProvider(rpcUrl, {\r\n chainId: LOCAL_CONFIG.CHAIN_ID,\r\n name: \"localhost\"\r\n });\r\n return new Wallet(privateKey, provider);\r\n } else if (\r\n typeof window !== \"undefined\" &&\r\n typeof window.ethereum !== \"undefined\"\r\n ) {\r\n await window.ethereum.request({ method: \"eth_requestAccounts\" });\r\n const provider = new BrowserProvider(window.ethereum);\r\n return provider.getSigner();\r\n } else {\r\n throw new Error(\"No valid Ethereum provider found\");\r\n }\r\n};\r\n\r\n/**\r\n * Utility function to generate stealth address\r\n * @param {string} sharedSecret - The shared secret\r\n * @param {string} spendingPublicKey - The spending public key\r\n * @returns {Object} The stealth address and private key\r\n */\r\nexport function deriveStealthAddress(sharedSecret, spendingPublicKey) {\r\n try {\r\n const sharedSecretBytes = getBytes(sharedSecret);\r\n const spendingPublicKeyBytes = getBytes(spendingPublicKey);\r\n \r\n const stealthPrivateKey = keccak256(\r\n concat([\r\n sharedSecretBytes,\r\n spendingPublicKeyBytes\r\n ])\r\n );\r\n \r\n const stealthWallet = new Wallet(stealthPrivateKey);\r\n\r\n console.log(\"Debug deriveStealthAddress:\", {\r\n sharedSecretHex: stealthPrivateKey,\r\n spendingPublicKey,\r\n stealthPrivateKey,\r\n stealthAddress: stealthWallet.address\r\n });\r\n\r\n return {\r\n stealthPrivateKey,\r\n stealthAddress: stealthWallet.address,\r\n wallet: stealthWallet\r\n };\r\n } catch (error) {\r\n console.error(\"Error in deriveStealthAddress:\", error);\r\n throw error;\r\n }\r\n}\r\n\r\n// =============================================\r\n// BASIC GUN-ETH CHAIN METHODS\r\n// =============================================\r\n\r\n// Set the message to sign\r\nGun.chain.MESSAGE_TO_SIGN = MESSAGE_TO_SIGN;\r\n\r\n/**\r\n * Sets standalone configuration for Gun.\r\n * @param {string} newRpcUrl - The new RPC URL.\r\n * @param {string} newPrivateKey - The new private key.\r\n * @returns {Gun} The Gun instance for chaining.\r\n */\r\nGun.chain.setSigner = function (newRpcUrl, newPrivateKey) {\r\n rpcUrl = newRpcUrl;\r\n privateKey = newPrivateKey;\r\n console.log(\"Standalone configuration set\");\r\n return this;\r\n};\r\n\r\nGun.chain.getSigner = getSigner();\r\n\r\n/**\r\n * Verifies an Ethereum signature.\r\n * @param {string} message - The original message that was signed.\r\n * @param {string} signature - The signature to verify.\r\n * @returns {Promise<string|null>} The recovered address or null if verification fails.\r\n */\r\nGun.chain.verifySignature = async function (message, signature) {\r\n try {\r\n const recoveredAddress = verifyMessage(message, signature);\r\n return recoveredAddress;\r\n } catch (error) {\r\n console.error(\"Error verifying signature:\", error);\r\n return null;\r\n }\r\n};\r\n\r\n/**\r\n * Generates a password from a signature.\r\n * @param {string} signature - The signature to derive the password from.\r\n * @returns {string|null} The generated password or null if generation fails.\r\n */\r\nGun.chain.generatePassword = function (signature) {\r\n return generatePassword(signature);\r\n};\r\n\r\n/**\r\n * Creates an Ethereum signature for a given message.\r\n * @param {string} message - The message to sign.\r\n * @returns {Promise<string|null>} The signature or null if signing fails.\r\n */\r\nGun.chain.createSignature = async function (message) {\r\n try {\r\n // Check if message matches MESSAGE_TO_SIGN\r\n if (message !== MESSAGE_TO_SIGN) {\r\n throw new Error(\"Invalid message, valid message is: \" + MESSAGE_TO_SIGN);\r\n }\r\n const signer = await getSigner();\r\n const signature = await signer.signMessage(message);\r\n console.log(\"Signature created:\", signature);\r\n return signature;\r\n } catch (error) {\r\n console.error(\"Error creating signature:\", error);\r\n return null;\r\n }\r\n};\r\n\r\n// =============================================\r\n// KEY PAIR MANAGEMENT\r\n// =============================================\r\n/**\r\n * Creates and stores an encrypted key pair for a given address.\r\n * @param {string} address - The Ethereum address to associate with the key pair.\r\n * @param {string} signature - The signature to use for encryption.\r\n * @returns {Promise<void>}\r\n */\r\nGun.chain.createAndStoreEncryptedPair = async function (address, signature) {\r\n try {\r\n const gun = this;\r\n const pair = await SEA.pair();\r\n const v_pair = await SEA.pair();\r\n const s_pair = await SEA.pair();\r\n const password = generatePassword(signature);\r\n\r\n // Save original SEA pairs\r\n const encryptedPair = await SEA.encrypt(JSON.stringify(pair), password);\r\n const encryptedV_pair = await SEA.encrypt(JSON.stringify(v_pair), password);\r\n const encryptedS_pair = await SEA.encrypt(JSON.stringify(s_pair), password);\r\n\r\n // Convert only to get Ethereum addresses\r\n const viewingAccount = gunToEthAccount(v_pair.priv);\r\n const spendingAccount = gunToEthAccount(s_pair.priv);\r\n\r\n gun.get(\"gun-eth\").get(\"users\").get(address).put({\r\n pair: encryptedPair,\r\n v_pair: encryptedV_pair,\r\n s_pair: encryptedS_pair,\r\n publicKeys: {\r\n viewingPublicKey: v_pair.epub, // Use SEA encryption public key\r\n viewingPublicKey: v_pair.epub, // Use SEA encryption public key\r\n spendingPublicKey: spendingAccount.publicKey, // Use Ethereum address\r\n ethViewingAddress: viewingAccount.publicKey // Also save Ethereum address\r\n }\r\n });\r\n\r\n console.log(\"Encrypted pairs and public keys stored for:\", address);\r\n } catch (error) {\r\n console.error(\"Error creating and storing encrypted pair:\", error);\r\n throw error;\r\n }\r\n};\r\n\r\n/**\r\n * Retrieves and decrypts a stored key pair for a given address.\r\n * @param {string} address - The Ethereum address associated with the key pair.\r\n * @param {string} signature - The signature to use for decryption.\r\n * @returns {Promise<Object|null>} The decrypted key pair or null if retrieval fails.\r\n */\r\nGun.chain.getAndDecryptPair = async function (address, signature) {\r\n try {\r\n const gun = this;\r\n const encryptedData = await gun\r\n .get(\"gun-eth\")\r\n .get(\"users\")\r\n .get(address)\r\n .get(\"pair\")\r\n .then();\r\n if (!encryptedData) {\r\n throw new Error(\"No encrypted data found for this address\");\r\n }\r\n const password = generatePassword(signature);\r\n const decryptedPair = await SEA.decrypt(encryptedData, password);\r\n console.log(decryptedPair);\r\n return decryptedPair;\r\n } catch (error) {\r\n console.error(\"Error retrieving and decrypting pair:\", error);\r\n return null;\r\n }\r\n};\r\n\r\n// =============================================\r\n// PROOF OF INTEGRITY\r\n// =============================================\r\n/**\r\n * Proof of Integrity\r\n * @param {string} chain - The blockchain to use (e.g., \"optimismSepolia\").\r\n * @param {string} nodeId - The ID of the node to verify or write.\r\n * @param {Object} data - The data to write (if writing).\r\n * @param {Function} callback - Callback function to handle the result.\r\n * @returns {Gun} The Gun instance for chaining.\r\n */\r\nGun.chain.proof = function (chain, nodeId, data, callback) {\r\n console.log(\"Proof plugin called with:\", { chain, nodeId, data });\r\n\r\n if (typeof callback !== \"function\") {\r\n console.error(\"Callback must be a function\");\r\n return this;\r\n }\r\n\r\n try {\r\n // Se siamo in localhost e in development, usa automaticamente la chain locale\r\n const targetChain = isLocalEnvironment() ? 'localhost' : chain;\r\n const chainConfig = getAddressesForChain(targetChain);\r\n \r\n console.log(`Using ${targetChain} configuration:`, chainConfig);\r\n\r\n // Usa gli indirizzi dalla configurazione\r\n const contract = new Contract(\r\n chainConfig.PROOF_OF_INTEGRITY_ADDRESS,\r\n PROOF_OF_INTEGRITY_ABI,\r\n signer\r\n );\r\n\r\n // Funzione per verificare on-chain\r\n const verifyOnChain = async (nodeId, contentHash) => {\r\n console.log(\"Verifying on chain:\", { nodeId, contentHash });\r\n const signer = await getSigner();\r\n const contract = new Contract(\r\n PROOF_CONTRACT_ADDRESS,\r\n PROOF_OF_INTEGRITY_ABI,\r\n signer\r\n );\r\n const [isValid, timestamp, updater] = await contract.verifyData(\r\n toUtf8Bytes(nodeId),\r\n contentHash\r\n );\r\n console.log(\"Verification result:\", { isValid, timestamp, updater });\r\n return { isValid, timestamp, updater };\r\n };\r\n\r\n // Funzione per scrivere on-chain\r\n const writeOnChain = async (nodeId, contentHash) => {\r\n console.log(\"Writing on chain:\", { nodeId, contentHash });\r\n const signer = await getSigner();\r\n const contract = new Contract(\r\n PROOF_CONTRACT_ADDRESS,\r\n PROOF_OF_INTEGRITY_ABI,\r\n signer\r\n );\r\n const tx = await contract.updateData(\r\n toUtf8Bytes(nodeId),\r\n contentHash\r\n );\r\n console.log(\"Transaction sent:\", tx.hash);\r\n const receipt = await tx.wait();\r\n console.log(\"Transaction confirmed:\", receipt);\r\n return tx;\r\n };\r\n\r\n // Funzione per ottenere l'ultimo record\r\n const getLatestRecord = async (nodeId) => {\r\n const signer = await getSigner();\r\n const contract = new Contract(\r\n PROOF_CONTRACT_ADDRESS,\r\n PROOF_OF_INTEGRITY_ABI,\r\n signer\r\n );\r\n const [contentHash, timestamp, updater] = await contract.getLatestRecord(\r\n toUtf8Bytes(nodeId)\r\n );\r\n console.log(\"Latest record from blockchain:\", {\r\n nodeId,\r\n contentHash,\r\n timestamp,\r\n updater,\r\n });\r\n return { contentHash, timestamp, updater };\r\n };\r\n\r\n \r\n if (nodeId && !data) {\r\n // Case 1: User passes only node\r\n gun.get(nodeId).once(async (existingData) => {\r\n if (!existingData) {\r\n if (callback) callback({ err: \"Node not found in GunDB\" });\r\n return;\r\n }\r\n\r\n console.log(\"existingData\", existingData);\r\n\r\n // Use stored contentHash instead of recalculating\r\n const contentHash = existingData._contentHash;\r\n console.log(\"contentHash\", contentHash);\r\n\r\n if (!contentHash) {\r\n if (callback) callback({ err: \"No content hash found for this node\" });\r\n return;\r\n }\r\n\r\n try {\r\n const { isValid, timestamp, updater } = await verifyOnChain(\r\n nodeId,\r\n contentHash\r\n );\r\n const latestRecord = await getLatestRecord(nodeId);\r\n\r\n if (isValid) {\r\n if (callback)\r\n callback({\r\n ok: true,\r\n message: \"Data verified on blockchain\",\r\n timestamp,\r\n updater,\r\n latestRecord,\r\n });\r\n } else {\r\n if (callback)\r\n callback({\r\n ok: false,\r\n message: \"Data not verified on blockchain\",\r\n latestRecord,\r\n });\r\n }\r\n } catch (error) {\r\n if (callback) callback({ err: error.message });\r\n }\r\n });\r\n } else if (data && !nodeId) {\r\n // Case 2: User passes only text (data)\r\n const newNodeId = generateRandomId();\r\n const dataString = JSON.stringify(data);\r\n const contentHash = keccak256(toUtf8Bytes(dataString));\r\n\r\n gun\r\n .get(newNodeId)\r\n .put({ ...data, _contentHash: contentHash }, async (ack) => {\r\n console.log(\"ack\", ack);\r\n if (ack.err) {\r\n if (callback) callback({ err: \"Error saving data to GunDB\" });\r\n return;\r\n }\r\n\r\n try {\r\n const tx = await writeOnChain(newNodeId, contentHash);\r\n if (callback)\r\n callback({\r\n ok: true,\r\n message: \"Data written to GunDB and blockchain\",\r\n nodeId: newNodeId,\r\n txHash: tx.hash,\r\n });\r\n } catch (error) {\r\n if (callback) callback({ err: error.message });\r\n }\r\n });\r\n } else {\r\n if (callback)\r\n callback({\r\n err: \"Invalid input. Provide either nodeId or data, not both.\",\r\n });\r\n }\r\n\r\n return gun;\r\n } catch (error) {\r\n callback({ err: error.message });\r\n return this;\r\n }\r\n};\r\n\r\n// =============================================\r\n// STEALTH ADDRESS CORE FUNCTIONS\r\n// =============================================\r\n/**\r\n * Converts a Gun private key to an Ethereum account.\r\n * @param {string} gunPrivateKey - The Gun private key in base64url format.\r\n * @returns {Object} An object containing the Ethereum account and public key.\r\n */\r\nGun.chain.gunToEthAccount = function (gunPrivateKey) {\r\n return gunToEthAccount(gunPrivateKey);\r\n};\r\n\r\n/**\r\n * Generate a stealth key and related key pairs\r\n * @param {string} recipientAddress - The recipient's Ethereum address\r\n * @param {string} signature - The sender's signature to access their keys\r\n * @returns {Promise<Object>} Object containing stealth addresses and keys\r\n */\r\nGun.chain.generateStealthAddress = async function (recipientAddress, signature) {\r\n try {\r\n const gun = this;\r\n \r\n // Get recipient's public keys\r\n const recipientData = await gun\r\n .get(\"gun-eth\")\r\n .get(\"users\")\r\n .get(recipientAddress)\r\n .get(\"publicKeys\")\r\n .then();\r\n\r\n if (!recipientData || !recipientData.viewingPublicKey || !recipientData.spendingPublicKey) {\r\n throw new Error(\"Recipient's public keys not found\");\r\n }\r\n\r\n // Get sender's keys\r\n const senderAddress = await this.verifySignature(MESSAGE_TO_SIGN, signature);\r\n const password = generatePassword(signature);\r\n \r\n const senderData = await gun\r\n .get(\"gun-eth\")\r\n .get(\"users\")\r\n .get(senderAddress)\r\n .then();\r\n\r\n if (!senderData || !senderData.s_pair) {\r\n throw new Error(\"Sender's keys not found\");\r\n }\r\n\r\n // Decrypt sender's spending pair\r\n let spendingKeyPair;\r\n try {\r\n const decryptedData = await SEA.decrypt(senderData.s_pair, password);\r\n spendingKeyPair = typeof decryptedData === 'string' ? \r\n JSON.parse(decryptedData) : \r\n decryptedData;\r\n } catch (error) {\r\n console.error(\"Error decrypting spending pair:\", error);\r\n throw new Error(\"Unable to decrypt spending pair\");\r\n }\r\n\r\n // Generate shared secret using SEA ECDH with encryption public key\r\n const sharedSecret = await SEA.secret(recipientData.viewingPublicKey, spendingKeyPair);\r\n\r\n if (!sharedSecret) {\r\n throw new Error(\"Unable to generate shared secret\");\r\n }\r\n\r\n console.log(\"Generate shared secret:\", sharedSecret);\r\n\r\n const { stealthAddress } = deriveStealthAddress(\r\n sharedSecret,\r\n recipientData.spendingPublicKey\r\n );\r\n\r\n return {\r\n stealthAddress,\r\n senderPublicKey: spendingKeyPair.epub, // Use encryption public key\r\n spendingPublicKey: recipientData.spendingPublicKey\r\n };\r\n\r\n } catch (error) {\r\n console.error(\"Error generating stealth address:\", error);\r\n throw error;\r\n }\r\n};\r\n\r\n/**\r\n * Publish public keys needed to receive stealth payments\r\n * @param {string} signature - The signature to authenticate the user\r\n * @returns {Promise<void>}\r\n */\r\nGun.chain.publishStealthKeys = async function (signature) {\r\n try {\r\n const gun = this;\r\n const address = await this.verifySignature(MESSAGE_TO_SIGN, signature);\r\n const password = generatePassword(signature);\r\n\r\n // Get encrypted key pairs\r\n const encryptedData = await gun\r\n .get(\"gun-eth\")\r\n .get(\"users\")\r\n .get(address)\r\n .then();\r\n\r\n if (!encryptedData || !encryptedData.v_pair || !encryptedData.s_pair) {\r\n throw new Error(\"Keys not found\");\r\n }\r\n\r\n // Decrypt viewing and spending pairs\r\n const viewingKeyPair = JSON.parse(\r\n await SEA.decrypt(encryptedData.v_pair, password)\r\n );\r\n const spendingKeyPair = JSON.parse(\r\n await SEA.decrypt(encryptedData.s_pair, password)\r\n );\r\n\r\n const viewingAccount = gunToEthAccount(viewingKeyPair.priv);\r\n const spendingAccount = gunToEthAccount(spendingKeyPair.priv);\r\n\r\n // Publish only public keys\r\n gun.get(\"gun-eth\").get(\"users\").get(address).get(\"publicKeys\").put({\r\n viewingPublicKey: viewingAccount.publicKey,\r\n spendingPublicKey: spendingAccount.publicKey,\r\n });\r\n\r\n console.log(\"Stealth public keys published successfully\");\r\n } catch (error) {\r\n console.error(\"Error publishing stealth keys:\", error);\r\n throw error;\r\n }\r\n};\r\n\r\n// =============================================\r\n// STEALTH PAYMENT FUNCTIONS\r\n// =============================================\r\n/**\r\n * Recover funds from a stealth address\r\n * @param {string} stealthAddress - The stealth address to recover funds from\r\n * @param {string} senderPublicKey - The sender's public key used to generate the address\r\n * @param {string} signature - The signature to decrypt private keys\r\n * @returns {Promise<Object>} Object containing wallet to access funds\r\n */\r\nGun.chain.recoverStealthFunds = async function (\r\n stealthAddress,\r\n senderPublicKey,\r\n signature,\r\n spendingPublicKey\r\n) {\r\n try {\r\n const gun = this;\r\n const password = generatePassword(signature);\r\n\r\n // Get own key pairs\r\n const myAddress = await this.verifySignature(MESSAGE_TO_SIGN, signature);\r\n const encryptedData = await gun\r\n .get(\"gun-eth\")\r\n .get(\"users\")\r\n .get(myAddress)\r\n .then();\r\n\r\n if (!encryptedData || !encryptedData.v_pair || !encryptedData.s_pair) {\r\n throw new Error(\"Keys not found\");\r\n }\r\n\r\n // Decrypt viewing and spending pairs\r\n let viewingKeyPair;\r\n try {\r\n const decryptedViewingData = await SEA.decrypt(encryptedData.v_pair, password);\r\n viewingKeyPair = typeof decryptedViewingData === 'string' ? \r\n JSON.parse(decryptedViewingData) : \r\n decryptedViewingData;\r\n } catch (error) {\r\n console.error(\"Error decrypting keys:\", error);\r\n throw new Error(\"Unable to decrypt keys\");\r\n }\r\n\r\n // Generate shared secret using SEA ECDH\r\n const sharedSecret = await SEA.secret(senderPublicKey, viewingKeyPair);\r\n\r\n if (!sharedSecret) {\r\n throw new Error(\"Unable to generate shared secret\");\r\n }\r\n\r\n console.log(\"Recover shared secret:\", sharedSecret);\r\n\r\n const { wallet, stealthAddress: recoveredAddress } = deriveStealthAddress(\r\n sharedSecret,\r\n spendingPublicKey\r\n );\r\n\r\n // Verify address matches\r\n if (recoveredAddress.toLowerCase() !== stealthAddress.toLowerCase()) {\r\n console.error(\"Mismatch:\", {\r\n recovered: recoveredAddress,\r\n expected: stealthAddress,\r\n sharedSecret\r\n });\r\n throw new Error(\"Recovered stealth address does not match\");\r\n }\r\n\r\n return {\r\n wallet,\r\n address: recoveredAddress,\r\n };\r\n } catch (error) {\r\n console.error(\"Error recovering stealth funds:\", error);\r\n throw error;\r\n }\r\n};\r\n\r\n/**\r\n * Announce a stealth payment\r\n * @param {string} stealthAddress - The generated stealth address\r\n * @param {string} senderPublicKey - The sender's public key\r\n * @param {string} spendingPublicKey - The spending public key\r\n * @param {string} signature - The sender's signature\r\n * @returns {Promise<void>}\r\n */\r\nGun.chain.announceStealthPayment = async function (\r\n stealthAddress,\r\n senderPublicKey,\r\n spendingPublicKey,\r\n signature,\r\n options = { onChain: false, chain: 'optimismSepolia' }\r\n) {\r\n try {\r\n const gun = this;\r\n const senderAddress = await this.verifySignature(MESSAGE_TO_SIGN, signature);\r\n\r\n if (options.onChain) {\r\n // On-chain announcement\r\n const signer = await getSigner();\r\n const chainConfig = getAddressesForChain(options.chain);\r\n const contractAddress = chainConfig.STEALTH_ANNOUNCER_ADDRESS;\r\n\r\n console.log(\"Using contract address:\", contractAddress);\r\n\r\n const contract = new Contract(\r\n contractAddress,\r\n STEALTH_ANNOUNCER_ABI,\r\n signer\r\n );\r\n\r\n // Get dev fee from contract\r\n const devFee = await contract.devFee();\r\n console.log(\"Dev fee:\", devFee.toString());\r\n\r\n // Call contract\r\n const tx = await contract.announcePayment(\r\n senderPublicKey,\r\n spendingPublicKey,\r\n stealthAddress,\r\n { value: devFee }\r\n );\r\n \r\n console.log(\"Transaction sent:\", tx.hash);\r\n const receipt = await tx.wait();\r\n console.log(\"Transaction confirmed:\", receipt.hash);\r\n \r\n console.log(\"Stealth payment announced on-chain (dev fee paid)\");\r\n } else {\r\n // Off-chain announcement (GunDB)\r\n gun\r\n .get(\"gun-eth\")\r\n .get(\"stealth-payments\")\r\n .set({\r\n stealthAddress,\r\n senderAddress,\r\n senderPublicKey,\r\n spendingPublicKey,\r\n timestamp: Date.now(),\r\n });\r\n console.log(\"Stealth payment announced off-chain\");\r\n }\r\n } catch (error) {\r\n console.error(\"Error announcing stealth payment:\", error);\r\n console.error(\"Error details:\", error.stack);\r\n throw error;\r\n }\r\n};\r\n\r\n/**\r\n * Get all stealth payments for an address\r\n * @param {string} signature - The signature to authenticate the user\r\n * @returns {Promise<Array>} List of stealth payments\r\n */\r\nGun.chain.getStealthPayments = async function (signature, options = { source: 'both' }) {\r\n try {\r\n const payments = [];\r\n\r\n if (options.source === 'onChain' || options.source === 'both') {\r\n const signer = await getSigner();\r\n const chainConfig = getAddressesForChain(options.chain || 'optimismSepolia');\r\n const contractAddress = chainConfig.STEALTH_ANNOUNCER_ADDRESS;\r\n\r\n const contract = new Contract(\r\n contractAddress,\r\n STEALTH_ANNOUNCER_ABI,\r\n signer\r\n );\r\n \r\n try {\r\n // Get total number of announcements\r\n const totalAnnouncements = await contract.getAnnouncementsCount();\r\n const totalCount = Number(totalAnnouncements.toString());\r\n console.log(\"Total on-chain announcements:\", totalCount);\r\n \r\n if (totalCount > 0) {\r\n // Get announcements in batches of 100\r\n const batchSize = 100;\r\n const lastIndex = totalCount - 1;\r\n \r\n for(let i = 0; i <= lastIndex; i += batchSize) {\r\n const toIndex = Math.min(i + batchSize - 1, lastIndex);\r\n const batch = await contract.getAnnouncementsInRange(i, toIndex);\r\n \r\n // For each announcement, try to decrypt\r\n for(const announcement of batch) {\r\n try {\r\n // Verify announcement is valid\r\n if (!announcement || !announcement.stealthAddress || \r\n !announcement.senderPublicKey || !announcement.spendingPublicKey) {\r\n console.log(\"Invalid announcement:\", announcement);\r\n continue;\r\n }\r\n\r\n // Try to recover funds to verify if announcement is for us\r\n const recoveredWallet = await this.recoverStealthFunds(\r\n announcement.stealthAddress,\r\n announcement.senderPublicKey,\r\n signature,\r\n announcement.spendingPublicKey\r\n );\r\n \r\n // If no errors thrown, announcement is for us\r\n payments.push({\r\n stealthAddress: announcement.stealthAddress,\r\n senderPublicKey: announcement.senderPublicKey,\r\n spendingPublicKey: announcement.spendingPublicKey,\r\n timestamp: Number(announcement.timestamp),\r\n source: 'onChain',\r\n wallet: recoveredWallet\r\n });\r\n\r\n } catch (e) {\r\n // Not for us, continue\r\n console.log(`Announcement not for us: ${announcement.stealthAddress}`);\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n } catch (error) {\r\n console.error(\"Error retrieving on-chain announcements:\", error);\r\n }\r\n }\r\n\r\n if (options.source === 'offChain' || options.source === 'both') {\r\n // Get off-chain payments\r\n const gun = this;\r\n const offChainPayments = await new Promise((resolve) => {\r\n const p = [];\r\n gun\r\n .get(\"gun-eth\")\r\n .get(\"stealth-payments\")\r\n .get(recipientAddress)\r\n .map()\r\n .once((payment, id) => {\r\n if (payment?.stealthAddress) {\r\n p.push({ ...payment, id, source: 'offChain' });\r\n }\r\n });\r\n setTimeout(() => resolve(p), 2000);\r\n });\r\n \r\n payments.push(...offChainPayments);\r\n }\r\n\r\n console.log(`Found ${payments.length} stealth payments`);\r\n return payments;\r\n } catch (error) {\r\n console.error(\"Error retrieving stealth payments:\", error);\r\n throw error;\r\n }\r\n};\r\n\r\n/**\r\n * Clean up old stealth payments\r\n * @param {string} recipientAddress - The recipient's address\r\n * @returns {Promise<void>}\r\n */\r\nGun.chain.cleanStealthPayments = async function(recipientAddress) {\r\n try {\r\n const gun = this;\r\n const payments = await gun\r\n .get(\"gun-eth\")\r\n .get(\"stealth-payments\")\r\n .get(recipientAddress)\r\n .map()\r\n .once()\r\n .then();\r\n\r\n // Remove empty or invalid nodes\r\n if (payments) {\r\n Object.keys(payments).forEach(async (key) => {\r\n const payment = payments[key];\r\n if (!payment || !payment.stealthAddress || !payment.senderPublicKey || !payment.spendingPublicKey) {\r\n await gun\r\n .get(\"gun-eth\")\r\n .get(\"stealth-payments\")\r\n .get(recipientAddress)\r\n .get(key)\r\n .put(null);\r\n }\r\n });\r\n }\r\n } catch (error) {\r\n console.error(\"Error cleaning stealth payments:\", error);\r\n }\r\n};\r\n\r\n// =============================================\r\n// EXPORTS\r\n// =============================================\r\n\r\n// Crea una classe GunEth che contiene tutti i metodi e le utility\r\nexport class GunEth {\r\n // Static utility methods\r\n static generateRandomId = generateRandomId;\r\n static generatePassword = generatePassword;\r\n static gunToEthAccount = gunToEthAccount;\r\n static getSigner = getSigner;\r\n static deriveStealthAddress = deriveStealthAddress;\r\n \r\n // Chain methods\r\n static chainMethods = {\r\n setSigner: Gun.chain.setSigner,\r\n getSigner: Gun.chain.getSigner,\r\n verifySignature: Gun.chain.verifySignature,\r\n generatePassword: Gun.chain.generatePassword,\r\n createSignature: Gun.chain.createSignature,\r\n createAndStoreEncryptedPair: Gun.chain.createAndStoreEncryptedPair,\r\n getAndDecryptPair: Gun.chain.getAndDecryptPair,\r\n proof: Gun.chain.proof,\r\n gunToEthAccount: Gun.chain.gunToEthAccount,\r\n generateStealthAddress: Gun.chain.generateStealthAddress,\r\n publishStealthKeys: Gun.chain.publishStealthKeys,\r\n recoverStealthFunds: Gun.chain.recoverStealthFunds,\r\n announceStealthPayment: Gun.chain.announceStealthPayment,\r\n getStealthPayments: Gun.chain.getStealthPayments,\r\n cleanStealthPayments: Gun.chain.cleanStealthPayments\r\n };\r\n\r\n // Constants\r\n static MESSAGE_TO_SIGN = MESSAGE_TO_SIGN;\r\n static PROOF_CONTRACT_ADDRESS = PROOF_CONTRACT_ADDRESS;\r\n static LOCAL_CONFIG = LOCAL_CONFIG;\r\n}\r\n\r\n// Esporta Gun come default\r\nexport default Gun;\r\n"],"names":["module","exports","assert","val","msg","Error","inherits","ctor","superCtor","super_","TempCtor","prototype","constructor","BN","number","base","endian","isBN","this","negative","words","length","red","_init","Buffer","wordSize","window","require$$0","e","parseHex4Bits","string","index","c","charCodeAt","parseHexByte","lowerBound","r","parseBase","str","start","end","mul","b","len","Math","min","i","move","dest","src","num","Array","isArray","max","left","right","cmp","_initNumber","_initArray","toString","replace","_parseHex","_parseBase","toArray","ceil","j","w","off","_strip","limbLen","limbPow","total","mod","word","imuln","_iaddn","pow","copy","_move","clone","_expand","size","_normSign","Symbol","for","inspect","zeros","groupSizes","groupBases","padding","out","carry","groupSize","groupBase","isZero","modrn","idivn","toNumber","ret","toJSON","toBuffer","toArrayLike","smallMulTo","self","a","lo","k","ncarry","rword","maxJ","ArrayType","byteLength","reqLength","res","allocUnsafe","allocate","_toArrayLikeLE","position","shift","_toArrayLikeBE","clz32","_countBits","t","_zeroBits","bitLength","hi","zeroBits","toTwos","width","abs","inotn","iaddn","fromTwos","testn","notn","ineg","isNeg","neg","iuor","ior","or","uor","iuand","iand","and","uand","iuxor","ixor","xor","uxor","bytesNeeded","bitsLeft","setn","bit","wbit","iadd","isub","add","sub","comb10MulTo","mid","o","a0","al0","ah0","a1","al1","ah1","a2","al2","ah2","a3","al3","ah3","a4","al4","ah4","a5","al5","ah5","a6","al6","ah6","a7","al7","ah7","a8","al8","ah8","a9","al9","ah9","b0","bl0","bh0","b1","bl1","bh1","b2","bl2","bh2","b3","bl3","bh3","b4","bl4","bh4","b5","bl5","bh5","b6","bl6","bh6","b7","bl7","bh7","b8","bl8","bh8","b9","bl9","bh9","w0","imul","w1","w2","w3","w4","w5","w6","w7","w8","w9","w10","w11","w12","w13","w14","w15","w16","w17","w18","bigMulTo","hncarry","jumboMulTo","mulTo","mulf","isNegNum","muln","sqr","isqr","toBitArray","q","iushln","bits","s","carryMask","newCarry","ishln","iushrn","hint","extended","h","mask","maskedWords","ishrn","shln","ushln","shrn","ushrn","imaskn","maskn","isubn","addn","subn","iabs","_ishlnsubmul","_wordDiv","mode","bhi","m","diff","qj","div","divmod","positive","divn","umod","divRound","dm","half","r2","andln","p","acc","modn","egcd","x","y","A","B","C","D","g","isEven","yp","xp","im","isOdd","jm","gcd","_invmp","x1","x2","delta","cmpn","invm","bincn","ucmp","gtn","gt","gten","gte","ltn","lt","lten","lte","eqn","eq","Red","toRed","ctx","convertTo","_forceRed","fromRed","convertFrom","forceRed","redAdd","redIAdd","redSub","redISub","redShl","shl","redMul","_verify2","redIMul","redSqr","_verify1","redISqr","redSqrt","sqrt","redInvm","redNeg","redPow","primes","k256","p224","p192","p25519","MPrime","name","n","tmp","_tmp","K256","call","P224","P192","P25519","prime","_prime","Mont","imod","rinv","minv","ireduce","rlen","split","imulK","undefined","strip","input","output","outLen","prev","next","mod3","one","nOne","lpow","z","inv","wnd","current","currentLen","mont","u","_permanentCensorErrors","_censorErrors","LogLevels","debug","default","info","warning","error","_logLevel","_globalLogger","_normalizeError","missing","forEach","form","normalize","push","join","String","fromCharCode","message","_checkNormalize","LogLevel","ErrorCode","HEX","Logger","version","Object","defineProperty","enumerable","value","writable","_log","logLevel","args","level","toLowerCase","throwArgumentError","console","log","apply","levels","DEBUG","INFO","warn","WARNING","makeError","code","params","errors","UNKNOWN_ERROR","messageDetails","keys","key","Uint8Array","hex","JSON","stringify","reason","url","NUMERIC_FAULT","fault","CALL_EXCEPTION","INSUFFICIENT_FUNDS","MISSING_NEW","NONCE_EXPIRED","REPLACEMENT_UNDERPRICED","TRANSACTION_REPLACED","UNPREDICTABLE_GAS_LIMIT","throwError","INVALID_ARGUMENT","argument","condition","assertArgument","checkNormalize","UNSUPPORTED_OPERATION","operation","checkSafeUint53","checkArgumentCount","count","expectedCount","MISSING_ARGUMENT","UNEXPECTED_ARGUMENT","checkNew","target","kind","checkAbstract","globalLogger","setCensorship","censorship","permanent","setLogLevel","from","logger","isHexable","addSlice","array","slice","arguments","isBytesLike","isHexString","isBytes","isInteger","v","arrayify","options","result","unshift","parseInt","allowMissingPrefix","substring","toHexString","hexPad","concat","items","objects","map","item","reduce","accum","offset","object","set","stripZeros","zeroPad","match","HexCharacters","hexlify","floor","hexDataLength","data","hexDataSlice","endOffset","hexConcat","hexValue","trimmed","hexStripZeros","hexZeroPad","splitSignature","signature","_vs","recoveryParam","yParityAndS","compact","bytes","vs","recId","joinSignature","_BN","_constructorGuard","MAX_SAFE","_warnedToStringRadix","BigNumber","constructorGuard","_hex","_isBigNumber","freeze","toBigNumber","toBN","other","throwFault","isNegative","shr","toBigInt","BigInt","type","toHex","anyValue","isBigNumber","_base36To16","_base16To36","Zero","NegativeOne","getMultiplier","decimals","formatFixed","multiplier","fraction","whole","parseFixed","comps","wholeValue","fractionValue","wei","FixedFormat","signed","_multiplier","check","defaultValue","FixedNumber","format","_value","_isFixedNumber","_checkFormat","addUnsafe","fromValue","subUnsafe","mulUnsafe","divUnsafe","hasFraction","ONE","toFormat","ceiling","round","factor","bump","BUMP","toUnsafeFloat","parseFloat","fromString","isBigNumberish","fixedFormat","numeric","decimal","fromBytes","isFixedNumber","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","rejected","done","then","defineReadOnly","getStatic","getPrototypeOf","resolveProperties","promises","all","checkProperties","properties","shallowCopy","opaque","bigint","boolean","function","_isFrozen","isFrozen","_deepCopy","deepCopy","Description","ModifiersBytes","calldata","memory","storage","ModifiersNest","checkModifier","indexOf","populate","FormatTypes","sighash","minimal","full","json","paramTypeArray","RegExp","ParamType","arrayLength","arrayChildren","fromObject","components","baseType","_isParamType","indexed","comp","parse","allowIndexed","isParamType","verifyType","node","param","originalParam","newNode","parent","state","allowType","allowParams","child","allowName","allowArray","sibling","readArray","parseParamType","parseParams","allowIndex","trim","depth","splitNesting","Fragment","_isFragment","isFragment","FunctionFragment","EventFragment","ConstructorFragment","ErrorFragment","anonymous","inputs","isEventFragment","verifyIdentifier","regexParen","modifier","parseGas","gas","parseModifiers","constant","payable","stateMutability","verifyState","isConstructorFragment","parens","outputs","isFunctionFragment","returns","checkForbidden","fragment","sig","isErrorFragment","regexIdentifier","checkResultErrors","checkErrors","path","childPath","Coder","localName","dynamic","_throwError","Writer","_data","_dataLength","_padding","_writeData","appendWriter","writer","writeBytes","paddingOffset","_getValue","BUFFER_OVERRUN","writeValue","writeUpdatableValue","Reader","coerceFunc","allowLoose","_offset","consumed","coerce","_coerceFunc","_peekBytes","loose","alignedLength","subReader","readBytes","readValue","INPUT_ERROR","WINDOW","root","JS_SHA3_NO_WINDOW","WEB_WORKER","JS_SHA3_NO_NODE_JS","process","versions","global","COMMON_JS","JS_SHA3_NO_COMMON_JS","ARRAY_BUFFER","JS_SHA3_NO_ARRAY_BUFFER","ArrayBuffer","HEX_CHARS","CSHAKE_PADDING","SHIFT","RC","BITS","SHAKE_BITS","OUTPUT_TYPES","CSHAKE_BYTEPAD","obj","JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW","isView","buffer","createOutputMethod","outputType","Keccak","update","createShakeOutputMethod","outputBits","createCshakeOutputMethod","methods","createKmacOutputMethod","createOutputMethods","method","createMethod","create","algorithms","bytepad","Kmac","methodNames","algorithm","methodName","newMethodName","blocks","reset","finalized","block","blockCount","byteCount","outputBlocks","extraBytes","notString","lastByteIndex","f","encode","encodeString","strs","paddingBytes","finalize","arrayBuffer","Uint32Array","digest","l","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","b10","b11","b12","b13","b14","b15","b16","b17","b18","b19","b20","b21","b22","b23","b24","b25","b26","b27","b28","b29","b30","b31","b32","b33","b34","b35","b36","b37","b38","b39","b40","b41","b42","b43","b44","b45","b46","b47","b48","b49","keccak256","sha3","keccak_256","arrayifyInteger","unarrayifyInteger","_encode","payload","_decodeChildren","childOffset","decoded","_decode","lengthLength","decode","getChecksumAddress","address","chars","expanded","hashed","toUpperCase","ibanLookup","safeDigits","log10","LN10","ibanChecksum","checksum","getAddress","getContractAddress","transaction","nonce","salt","initCodeHash","base36","AddressCoder","super","reader","AnonymousCoder","coder","pack","coders","values","arrayValues","unique","staticWriter","dynamicWriter","updateFuncs","dynamicOffset","updateFunc","baseOffset","func","unpack","baseReader","offsetReader","uniqueNames","get","ArrayCoder","defaultChild","BooleanCoder","DynamicBytesCoder","BytesCoder","FixedBytesCoder","NullCoder","AddressZero","One","Two","WeiPerEther","MaxUint256","MinInt256","MaxInt256","HashZero","NumberCoder","maxUintValue","bounds","UnicodeNormalizationForm","Utf8ErrorReason","ignoreFunc","badCodepoint","BAD_PREFIX","UNEXPECTED_CONTINUE","OVERRUN","Utf8ErrorFuncs","ignore","OVERLONG","getUtf8CodePoints","onError","extraLength","overlongMask","nextChar","MISSING_CONTINUE","OUT_OF_RANGE","UTF16_SURROGATE","toUtf8Bytes","pair","escapeChar","_toUtf8String","codePoints","codePoint","toUtf8String","toUtf8CodePoints","createTable","createRangeTable","matchMap","ranges","range","d","Table_A_1_ranges","Table_B_1_flags","Table_B_2_ranges","Table_B_2_lut_abs","Table_B_2_lut_rel","Table_B_2_complex","Table_C_ranges","text","codes","codesTableB2","codepoint","_nameprepTableB2","NFKC","StringCoder","TupleCoder","types","paramTypeBytes","paramTypeNumber","AbiCoder","_getCoder","component","_getWordSize","_getReader","_getWriter","getDefaultValue","defaultAbiCoder","id","textData","atob","btoa","flat","flatDeep","arr","read_compressed_payload","pos","read_payload","u16","symbol_count","skip","pos_payload","read_width","read_buffer","read_bit","FULL","HALF","QRTR","MASK","register","symbols","low","decode_arithmetic","read_ascending","read_deltas","read_member_array","lookup","vX","vN","read_counts","read_transposed","fill","read_linear_table","dx","dy","read_zero_terminated_array","ys","_","j_dy","read_replacement_table","VALID","Set","IGNORED","MAPPED","fromEntries","read_mapped_map","EMOJI_ROOT","sorted","sort","read","branches","temp","valid","fe0f","save","read_emoji_trie","explode_cp","filter_fe0f","cps","filter","cp","ens_normalize_post_check","label","lastIndexOf","every","err","ens_normalize","emoji_filter","reverse","emoji","consume_emoji_reversed","pop","has","nfc","fromCodePoint","eaten","_a","saved","stack","find","splice","Zeros","checkComponent","ensNameSplit","last","namehash","dnsEncode","messagePrefix","hashMessage","hexTrue","hexFalse","domainFieldTypes","chainId","verifyingContract","domainFieldNames","checkString","domainChecks","getBaseEncoder","boundsUpper","boundsLower","padOffset","hexPadRight","encodeType","fields","TypedDataEncoder","links","parents","subtypes","field","primaryTypes","checkCircular","found","subtype","primaryType","st","_types","getEncoder","encoder","_encoderCache","_getEncoder","subEncoder","encodedType","encodeData","hashStruct","hash","_visit","callback","visit","getPrimaryType","hashDomain","domain","domainFields","EIP712Domain","resolveNames","resolveName","ensCache","getPayload","domainValues","domainTypes","typesWithDomain","LogDescription","TransactionDescription","ErrorDescription","Indexed","isIndexed","_isIndexed","BuiltinErrors","wrapAccessError","property","wrap","Interface","fragments","abi","bucket","deploy","functions","events","getAbiCoder","getSighash","getEventTopic","eventFragment","getFunction","nameOrSignatureOrSighash","matching","getEvent","nameOrSignatureOrTopic","topichash","getError","_decodeParams","_abiCoder","_encodeParams","encodeDeploy","decodeErrorResult","encodeErrorResult","decodeFunctionData","functionFragment","encodeFunctionData","decodeFunctionResult","errorArgs","errorName","errorSignature","selector","builtin","encodeFunctionResult","encodeFilterTopics","topics","encodeTopic","encodeEventLog","dataTypes","dataValues","decodeEventLog","topicHash","expected","nonIndexed","resultIndexed","resultNonIndexed","nonIndexedIndex","indexedIndex","parseTransaction","tx","parseLog","topic","parseError","hexData","errorFragment","isInterface","_isInterface","ForkEvent","isForkEvent","_isForkEvent","Provider","getFeeData","gasPrice","getBlock","getGasPrice","catch","lastBaseFeePerGas","maxFeePerGas","maxPriorityFeePerGas","baseFeePerGas","addListener","eventName","listener","on","removeListener","isProvider","_isProvider","allowedTransactionKeys","forwardErrors","Signer","getBalance","blockTag","_checkProvider","provider","getTransactionCount","estimateGas","checkTransaction","sendTransaction","populateTransaction","signedTx","signTransaction","getChainId","getNetwork","to","hasEip1559","feeData","gasLimit","results","isSigner","_isSigner","VoidSigner","_fail","signMessage","_signTypedData","connect","minimalisticAssert","assert$b","equal","inherits_browserModule","configurable","require$$1","isSurrogatePair","htonl","zero2","zero8","utils$a","enc","toHex32","join32","split32","rotr32","rotl32","sum32","sum32_3","sum32_4","sum32_5","sum64","buf","ah","al","bh","sum64_hi","bl","sum64_lo","sum64_4_hi","ch","cl","dh","dl","sum64_4_lo","sum64_5_hi","eh","el","sum64_5_lo","rotr64_hi","rotr64_lo","shr64_hi","shr64_lo","utils","BlockHash","pending","pendingTotal","blockSize","outSize","hmacStrength","padLength","_delta8","_delta32","common$5","BlockHash$4","_update","_pad","_digest","ch32","maj32","p32","common$4","ft_1","s0_256","s1_256","g0_256","g1_256","common","shaCommon","require$$2","sha1_K","SHA1","W","_1","require$$3","sha256_K","SHA256","_256","SHA256$1","T1","T2","SHA224","_224","sha512_K","SHA512","_512","ch64_hi","xh","xl","yh","yl","zh","ch64_lo","zl","maj64_hi","maj64_lo","s0_512_hi","s0_512_lo","s1_512_hi","s1_512_lo","g0_512_hi","g0_512_lo","g1_512_hi","g1_512_lo","SHA512$1","_prepareBlock","c0_hi","c0_lo","c1_hi","c1_lo","c2_hi","c2_lo","c3_hi","c3_lo","fh","fl","gh","gl","hh","hl","c4_hi","c4_lo","T1_hi","T1_lo","T2_hi","T2_lo","SHA384","_384","sha","sha1","sha224","sha256","sha384","sha512","require$$4","RIPEMD160","K","Kh","ripemd","ripemd160","E","Ah","Bh","Ch","Dh","Eh","T","rh","sh","Hmac","Hash","inner","outer","hmac","createCommonjsModule","fn","basedir","require","commonjsRequire","utils_1","utils_1$1","getNAF","naf","ws","getJSF","k1","k2","jsf","m8","d1","d2","u1","u2","m14","m24","cachedProperty","computer","parseBytes","intFromLE","assert$1","BaseCurve","conf","zero","two","pointFromJSON","gRed","_wnafT1","_wnafT2","_wnafT3","_wnafT4","_bitLength","adjustCount","redN","_maxwellTrick","BasePoint","curve","precomputed","point","validate","_fixedNafMul","doubles","_getDoubles","I","nafW","repr","jpoint","mixedAdd","points","toP","_wnafMul","nafPoints","_getNAFPoints","dblp","_wnafMulAdd","defW","coeffs","jacobianResult","wndWidth","comb","toJ","ja","jb","decodePoint","pointFromX","encodeCompressed","getX","getY","precompute","power","beta","_getBeta","_hasDoubles","dbl","inherits_browser","assert$2","ShortCurve","tinv","zeroA","threeA","endo","_getEndomorphism","_endoWnafT1","_endoWnafT2","short_1","Point","isRed","inf","JPoint","zOne","lambda","betas","_getEndoRoots","lambdas","basis","vec","_getEndoBasis","ntinv","prevR","aprxSqrt","y1","y2","len1","_endoSplit","v1","v2","p1","p2","q1","q2","odd","ax","rhs","_endoWnafMulAdd","npoints","ncoeffs","fromJSON","pre","endoMul","obj2point","isInfinity","nx","ny","ys1","dyinv","mulAdd","jmulAdd","_precompute","negate","zinv","zinv2","ay","pz2","z2","s1","s2","h2","h3","nz","jx","jy","jz","jz4","jyd","jx2","jyd2","jyd4","t1","t2","dny","_zeroDbl","_threeDbl","_dbl","xx","yy","yyyy","yyyy8","gamma","alpha","beta4","beta8","ggamma8","jy2","jxd4","jyd8","trpl","zz","mm","ee","yyu4","kbase","z3","pz3","eqXToP","zs","rx","xc","curve_1","short","edwards","curves_1","curves","PresetCurve","defineCurve","crash","HmacDRBG","predResist","minEntropy","_reseed","reseedInterval","V","entropy","entropyEnc","nonceEnc","pers","persEnc","hmacDrbg","seed","_hmac","kmac","reseed","addEnc","generate","assert$3","KeyPair","ec","priv","pub","_importPrivate","privEnc","_importPublic","pubEnc","fromPublic","fromPrivate","getPublic","getPrivate","derive","sign","verify","assert$4","Signature","_importDER","Position","place","getLength","initial","octetLen","rmPadding","constructLength","octets","LN2","slen","toDER","backHalf","rand","assert$5","EC","hasOwnProperty","nh","keyPair","keyFromPrivate","keyFromPublic","genKeyPair","drbg","ns2","_truncateToN","truncOnly","bkey","ns1","iter","kp","kpX","canonical","signature$1","sinv","recoverPubKey","isYOdd","isSecondKey","rInv","getKeyRecoveryParam","Q","Qprime","elliptic_1","elliptic","eddsa","EC$1","_curve","getCurve","SigningKey","privateKey","_addPoint","p0","publicKey","signDigest","digestBytes","computeSharedSecret","otherKey","otherKeyPair","computePublicKey","isSigningKey","_isSigningKey","recoverPublicKey","rs","compressed","signingKey","TransactionTypes","handleAddress","handleNumber","transactionFields","maxLength","computeAddress","recoverAddress","formatNumber","accessSetify","addr","storageKeys","storageKey","accessListify","localeCompare","formatAccessList","_serializeEip1559","accessList","RLP.encode","_serializeEip2930","serialize","raw","fieldInfo","_serialize","transactionType","_parseEipSignature","recid","rawTransaction","RLP.decode","_parse","_parseEip2930","_parseEip1559","customData","ccipReadEnabled","resolver","nameOrPromise","resolveAddresses","paramType","contract","overrides","signer","override","resolved","resolvedAddress","interface","ro","intrinsic","roValue","leftovers","addContractWait","wait","bind","confirmations","receipt","logs","event","parsed","eventSignature","blockHash","getTransaction","transactionHash","getTransactionReceipt","buildCall","collapseSimple","signerOrProvider","deployTransaction","_deployed","buildDefault","txRequest","buildSend","getEventTag","RunningEvent","tag","_listeners","once","removeAllListeners","listeners","listenerCount","run","argsCopy","setTimeout","prepareEvent","getEmit","ErrorRunningEvent","FragmentRunningEvent","contractInterface","decodeError","WildcardRunningEvent","BaseContract","addressOrName","uniqueFilters","filters","uniqueSignatures","callStatic","buildPopulate","buildEstimate","signatures","getInterface","deployed","_deployedPromise","getCode","contractAddress","fallback","attach","_normalizeRunningEvent","runningEvent","_runningEvents","_getRunningEvent","_checkRunningEvents","emit","_wrappedEmits","_wrapEvent","_addEventListener","wrappedEmit","queryFilter","fromBlockOrBlockhash","toBlock","fromBlock","getLogs","Contract","bytecode","bytecodeHex","getDeployTransaction","unsignedTx","getContract","fromSolidity","compilerOutput","evm","BaseX","alphabet","charAt","_alphabetMap","source","digits","_leader","TypeError","byte","Base32","Base58","SupportedAlgorithm","computeHmac","pbkdf2","password","iterations","keylen","hashAlgorithm","hLen","DK","block1","U","destPos","Wordlist","locale","mnemonic","wordlist","getWord","getWordIndex","lang","loadWords","langEn","wordlists","en","N","MasterSecret","HardenedBit","getUpperMask","bytes32","base58check","getWordlist","defaultPath","HDNode","parentFingerprint","chainCode","mnemonicOrPath","compressedPublicKey","extendedKey","neuter","_derive","IL","IR","ki","Ki","srcMnemonic","phrase","fingerprint","derivePath","_fromSeed","seedArray","fromMnemonic","entropyToMnemonic","mnemonicToEntropy","mnemonicToSeed","fromSeed","fromExtendedKey","NFKD","entropyBits","checksumMask","indices","remainingBits","checksumBits","anyGlobal","getGlobal","crypto","msCrypto","randomBytes","getRandomValues","shuffled","random","checkInt","checkInts","arrayish","coerceArray","arg","createArray","copyArray","sourceArray","targetArray","targetStart","sourceStart","sourceEnd","Hex","convertUtf8","toBytes","encodeURI","substr","convertHex","numberOfRounds","rcon","S","Si","T3","T4","T5","T6","T7","T8","U1","U2","U3","U4","convertToInt32","AES","_prepare","rounds","_Ke","_Kd","roundKeyCount","KC","tk","tt","rconpointer","encrypt","plaintext","decrypt","ciphertext","ModeOfOperationECB","description","_aes","ModeOfOperationCBC","iv","_lastCipherblock","ModeOfOperationCFB","segmentSize","_shiftRegister","xorSegment","encrypted","ModeOfOperationOFB","_lastPrecipher","_lastPrecipherIndex","Counter","initialValue","_counter","setValue","setBytes","increment","ModeOfOperationCTR","counter","_remainingCounter","_remainingCounterIndex","aesjs","ModeOfOperation","ecb","cbc","cfb","ofb","ctr","utf8","pkcs7","pad","padder","_arrayTest","looseArrayify","hexString","zpad","getPassword","searchPath","currentChild","matchingChild","uuidV4","CrowdsaleAccount","isCrowdsaleAccount","_isCrowdsaleAccount","ethaddr","encseed","encryptedSeed","aesCbc","aes","seedHex","isCrowdsaleWallet","isKeystoreWallet","MAX_VALUE","h0","h1","h4","h5","h6","h7","bytesLeft","bitLenHi","bitLenLo","numZeros","PBKDF2_HMAC_SHA256_OneIter","dkLen","innerLen","outerKey","dk","incrementCounter","blockmix_salsa8","BY","Yi","_X","arraycopy","blockxor","salsa20_8","R","srcPos","checkBufferish","ensureInteger","_scrypt","XY","totalOps","i1","Bi","currentOp","lastPercent10","stop","i0","limit","nextTick","setImmediate","incrementalSMix","steps","percent10","derivedKey","lib","scrypt","progressCallback","lastProgress","progress","syncScrypt","hasMnemonic","KeystoreAccount","isKeystoreAccount","_isKeystoreAccount","_getAccount","_decrypt","mnemonicKey","account","mnemonicCiphertext","mnemonicIv","mnemonicCounter","mnemonicAesCtr","pbkdf2Sync","passwordBytes","prfFunc","_pbkdf2","_computeKdfKey","pbkdf2Func","scryptFunc","kdf","prf","decryptSync","client","uuidRandom","uuid","macPrefix","mac","cipher","cipherparams","kdfparams","dklen","now","Date","timestamp","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","gethFilename","decryptJsonWallet","decryptCrowdsale","decryptKeystore","decryptJsonWalletSync","decryptKeystoreSync","Wallet","_mnemonic","_signingKey","populated","_TypedDataEncoder","encryptKeystore","createRandom","extraEntropy","fromEncryptedJson","fromEncryptedJsonSync","ethDefaultProvider","network","providers","providerList","InfuraProvider","infura","EtherscanProvider","etherscan","AlchemyProvider","alchemy","PocketProvider","pocket","CloudflareProvider","cloudflare","AnkrProvider","ankr","FallbackProvider","quorum","renetwork","etcDefaultProvider","JsonRpcProvider","homestead","ensAddress","_defaultProvider","ropsten","classicMordor","networks","unspecified","mainnet","morden","testnet","rinkeby","kovan","goerli","kintsugi","sepolia","classic","classicMorden","classicTestnet","classicKotti","xdai","matic","maticmum","optimism","arbitrum","bnb","bnbt","standard","defaultProvider","getUrl","href","request","headers","body","skipFetchSetup","cache","credentials","redirect","referrer","fetchOptions","opts","response","fetch","statusCode","status","statusMessage","statusText","staller","duration","bodyify","_fetchData","connection","processFunc","attemptLimit","throttleLimit","throttleCallback","throttleSlotInterval","errorPassThrough","allow304","timeout","allowGzip","user","allowInsecureAuthentication","authorization","base64Encode","reData","dataMatch","base64Decode","SERVER_ERROR","requestBody","requestMethod","flatHeaders","header","runningTimeout","timer","promise","TIMEOUT","cancel","clearTimeout","runningFetch","attempt","location","tryAgain","stall","retryAfter","serverError","throttleRetry","race","fetchJson","updated","poll","interval","retryLimit","oncePoll","onceBlock","ALPHABET","ALPHABET_MAP","polymodStep","prefixChk","prefix","chk","__decode","LIMIT","lowered","uppered","wordChars","convert","inBits","outBits","maxV","bech32","decodeUnsafe","toWordsUnsafe","toWords","fromWordsUnsafe","fromWords","Formatter","formats","getDefaultFormats","bigNumber","allowNull","blockNumber","transactionIndex","uint256","creates","transactionRequest","receiptLog","arrayOf","logIndex","gasUsed","logsBloom","cumulativeGasUsed","effectiveGasPrice","parentHash","difficulty","miner","extraData","transactions","blockWithTransactions","transactionResponse","filterLog","removed","allowFalsish","strict","callAddress","_block","author","_difficulty","networkId","byzantium","checkKey","checkValue","nullValue","replaceValue","isCommunityResourcable","isCommunityResource","throttleMessage","showThrottleMessage","checkTopic","serializeTopics","getTime","PollableEvents","Event","_lastBlockNumber","_inflight","pollable","coinInfos","symbol","p2pkh","p2sh","ilk","bytes32ify","base58Encode","matcherIpfs","matchers","_parseString","_parseBytes","getIpfsLink","link","numPad","padded","bytesPad","encodeBytes","datas","Resolver","formatter","supportsWildcard","_supportsEip2544","_fetch","parameters","_fetchBytes","_getAddress","coinType","hexBytes","coinInfo","getAvatar","linkage","content","avatar","getText","scheme","owner","_resolvedAddress","tokenId","tokenOwner","balance","metadataUrl","metadata","imageUrl","image","getContentHash","ipfs","ipns","swarm","skynet","urlSafe","keyBytes","defaultFormatter","nextPollId","BaseProvider","_events","_emitted","disableCcipRead","getFormatter","anyNetwork","detectNetwork","_networkPromise","_ready","knownNetwork","_maxInternalBlockNumber","_maxFilterBlockRange","_pollingInterval","_fastQueryDate","_network","ready","NETWORK_ERROR","ccipReadFetch","urls","sender","errorMessages","errorMessage","_getInternalBlockNumber","maxAge","_internalBlockNumber","internalBlockNumber","respTime","reqTime","checkInternalBlockNumber","perform","networkError","_setFastBlockNumber","pollId","runners","pollingInterval","previousBlockNumber","eventBlockNumber","runner","minFromBlock","resetEventsBlock","polling","currentNetwork","_fastBlockNumber","_fastBlockNumberPromise","detectedNetwork","_poller","setInterval","_bootstrapPoll","clearInterval","_getFastBlockNumber","getBlockNumber","waitForTransaction","_waitForTransaction","replaceable","cancelFuncs","alreadyDone","minedHandler","lastBlockNumber","startBlock","scannedBlock","replaceHandler","mined","getBlockWithTransactions","ti","cancelled","replacement","_wrapTransaction","unref","_getBlockTag","getStorageAt","expectedHash","returnedHash","confirms","signedTransaction","hexTx","_getTransactionRequest","_getFilter","_call","redirects","txSender","urlsOffset","urlsLength","urlsData","callbackSelector","ccipResult","_getBlock","blockHashOrBlockTag","includeTransactions","blockWithTxs","getEtherPrice","getResolver","currentName","_getResolver","addrData","lookupAddress","resolverAddr","nameOrAddress","resolverAddress","NOT_IMPLEMENTED","_startEvent","_stopEvent","stopped","eventTag","errorGas","spelunk","requireData","checkError","responseText","getResult","getLowerCase","JsonRpcSigner","addressOrIndex","connectUnchecked","UncheckedJsonRpcSigner","_address","_index","send","accounts","sendUncheckedTransaction","fromAddress","estimate","hexlifyTransaction","ACTION_REJECTED","action","messageData","_legacySignMessage","unlock","networkOrReady","_nextId","_cache","_eventLoopCache","defaultUrl","_uncachedDetectNetwork","getSigner","getUncheckedSigner","listAccounts","jsonrpc","prepareRequest","_startPending","_pendingFilter","pendingFilter","filterId","hashes","seq","allowExtra","allowed","WS","WebSocket","NextId","WebSocketProvider","_wsReady","websocket","onopen","_requests","onmessage","messageEvent","_subs","subscription","fauxPoll","_websocket","_detectNetwork","rid","_subscribe","subIdPromise","_subIds","subId","emitReceipt","destroy","readyState","CONNECTING","onerror","close","StaticJsonRpcProvider","_super","UrlJsonRpcProvider","apiKey","getApiKey","defaultApiKey","AlchemyWebSocketProvider","getWebSocketProvider","host","getHost","projectSecret","getTransactionPostData","maxFeePerGs","getJsonResult","checkLogTag","getBaseUrl","query","baseUrl","getPostUrl","getPostData","apikey","post","procFunc","payloadStr","txhash","postData","topic0","ethusd","getHistory","endBlock","startblock","endblock","timeStamp","checkNetworks","median","maxDelta","middle","nextRid","getPromise","ForwardErrors","ForwardProperties","exposeDebugConfig","config","weight","getProcessFunc","configs","_highestBlockNumber","tally","normalizedTally","waitForSync","getRunner","currentBlockNumber","providerConfigs","configOrProvider","stallTimeout","priority","first","t0","inflightWeight","backend","waiting","errorCode","props","defaultProjectId","InfuraWebSocketProvider","projectId","apiKeyObj","NodesmithProvider","defaultApplicationId","applicationId","loadBalancer","applicationSecretKey","buildWeb3LegacyFetcher","sendFunc","fetcher","Web3Provider","jsonRpcFetchFunc","subprovider","isMetaMask","buildEip1193Fetcher","sendAsync","_pendingBatch","inflightRequest","_pendingBatchAggregator","batch","inflight","IpcProvider","regexBytes","regexNumber","regexArray","_pack","tight","hashKeccak256","hashSha256","names","formatUnits","unitName","parseUnits","suffix","formatted","ether","__createBinding","__setModuleDefault","__importStar","__esModule","formatBytes32String","nameprep","base64","base58","RLP","getAccountPath","verifyTypedData","verifyMessage","serializeTransaction","soliditySha256","solidityKeccak256","solidityPack","commify","parseEther","formatEther","isAddress","getIcapAddress","isValidName","parseBytes32String","abi_1","address_1","getCreate2Address","basex_1","bytes_1","hash_1","require$$5","hdnode_1","require$$6","isValidMnemonic","json_wallets_1","require$$7","getJsonWalletAddress","keccak256_1","require$$8","logger_1","require$$9","sha2_1","require$$10","solidity_1","require$$11","random_1","require$$12","properties_1","require$$13","require$$14","signing_key_1","require$$15","strings_1","require$$16","_toEscapedUtf8String","transactions_1","require$$17","units_1","require$$18","wallet_1","require$$19","web_1","require$$20","sha2_2","strings_2","_version","ContractFactory","getDefaultProvider","contracts_1","bignumber_1","abstract_signer_1","constants","providers_1","wordlists_1","_version_1","contractAddresses","PROOF_OF_INTEGRITY_ADDRESS","STEALTH_ANNOUNCER_ADDRESS","fileURLToPath","dirname","readFileSync","__filename","document","pathToFileURL","_documentCurrentScript","tagName","URL","baseURI","rawdata","LOCAL_CONFIG","CHAIN_ID","RPC_URL","GUN_PEER","CHAIN_CONFIG","optimismSepolia","arbitrumSepolia","localhost","getAddressesForChain","chainName","localAddresses","STEALTH_ANNOUNCER_ABI","internalType","PROOF_OF_INTEGRITY_ABI","PROOF_CONTRACT_ADDRESS","rpcUrl","MESSAGE_TO_SIGN","__dirname","generateRandomId","generatePassword","signatureBytes","getBytes","gunToEthAccount","gunPrivateKey","hexPrivateKey","base64url","repeat","binary","char","padStart","base64UrlToHex","wallet","ethers","async","ethereum","BrowserProvider","deriveStealthAddress","sharedSecret","spendingPublicKey","sharedSecretBytes","spendingPublicKeyBytes","stealthPrivateKey","stealthWallet","sharedSecretHex","stealthAddress","Gun","chain","setSigner","newRpcUrl","newPrivateKey","verifySignature","createSignature","createAndStoreEncryptedPair","gun","SEA","v_pair","s_pair","encryptedPair","encryptedV_pair","encryptedS_pair","viewingAccount","spendingAccount","put","publicKeys","viewingPublicKey","epub","ethViewingAddress","getAndDecryptPair","encryptedData","decryptedPair","proof","nodeId","targetChain","env","NODE_ENV","hostname","chainConfig","verifyOnChain","contentHash","isValid","updater","verifyData","writeOnChain","updateData","getLatestRecord","existingData","_contentHash","latestRecord","ok","newNodeId","dataString","ack","txHash","generateStealthAddress","recipientAddress","recipientData","senderAddress","senderData","spendingKeyPair","decryptedData","secret","senderPublicKey","publishStealthKeys","viewingKeyPair","recoverStealthFunds","myAddress","decryptedViewingData","recoveredAddress","recovered","announceStealthPayment","onChain","devFee","announcePayment","getStealthPayments","payments","totalAnnouncements","getAnnouncementsCount","totalCount","Number","batchSize","lastIndex","toIndex","getAnnouncementsInRange","announcement","recoveredWallet","offChainPayments","payment","cleanStealthPayments","GunEth","static"],"mappings":"koCAAA,SAAWA,EAAQC,GAIjB,SAASC,EAAQC,EAAKC,GACpB,IAAKD,EAAK,MAAM,IAAIE,MAAMD,GAAO,mBACrC,CAIE,SAASE,EAAUC,EAAMC,GACvBD,EAAKE,OAASD,EACd,IAAIE,EAAW,aACfA,EAASC,UAAYH,EAAUG,UAC/BJ,EAAKI,UAAY,IAAID,EACrBH,EAAKI,UAAUC,YAAcL,CACjC,CAIE,SAASM,EAAIC,EAAQC,EAAMC,GACzB,GAAIH,EAAGI,KAAKH,GACV,OAAOA,EAGTI,KAAKC,SAAW,EAChBD,KAAKE,MAAQ,KACbF,KAAKG,OAAS,EAGdH,KAAKI,IAAM,KAEI,OAAXR,IACW,OAATC,GAA0B,OAATA,IACnBC,EAASD,EACTA,EAAO,IAGTG,KAAKK,MAAMT,GAAU,EAAGC,GAAQ,GAAIC,GAAU,MAEpD,CAUE,IAAIQ,EATkB,iBAAXxB,EACTA,EAAOC,QAAUY,EAEjBZ,EAAQY,GAAKA,EAGfA,EAAGA,GAAKA,EACRA,EAAGY,SAAW,GAGd,IAEID,EADoB,oBAAXE,aAAmD,IAAlBA,OAAOF,OACxCE,OAAOF,OAEPG,EAAkBH,MAE9B,CAAC,MAAOI,GACX,CA+HE,SAASC,EAAeC,EAAQC,GAC9B,IAAIC,EAAIF,EAAOG,WAAWF,GAE1B,OAAIC,GAAK,IAAMA,GAAK,GACXA,EAAI,GAEFA,GAAK,IAAMA,GAAK,GAClBA,EAAI,GAEFA,GAAK,IAAMA,GAAK,IAClBA,EAAI,QAEX9B,GAAO,EAAO,wBAA0B4B,EAE9C,CAEE,SAASI,EAAcJ,EAAQK,EAAYJ,GACzC,IAAIK,EAAIP,EAAcC,EAAQC,GAI9B,OAH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WF,EAAIC,MAAMC,UACrBnR,UAAWiR,EAAIC,MAAMlR,UACrBsR,gBAAiBL,EAAIC,MAAMI,gBAC3B/B,iBAAkB0B,EAAIC,MAAM3B,iBAC5BgC,gBAAiBN,EAAIC,MAAMK,gBAC3BC,4BAA6BP,EAAIC,MAAMM,4BACvCe,kBAAmBtB,EAAIC,MAAMqB,kBAC7BG,MAAOzB,EAAIC,MAAMwB,MACjBhD,gBAAiBuB,EAAIC,MAAMxB,gBAC3BuE,uBAAwBhD,EAAIC,MAAM+C,uBAClCS,mBAAoBzD,EAAIC,MAAMwD,mBAC9BE,oBAAqB3D,EAAIC,MAAM0D,oBAC/BK,uBAAwBhE,EAAIC,MAAM+D,uBAClCI,mBAAoBpE,EAAIC,MAAMmE,mBAC9Bc,qBAAsBlF,EAAIC,MAAMiF,sBAIlCE,uBAAyBjH,GACzBiH,8BAAgCnH,GAChCmH,oBAAsBjI","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128]}
|