{"version":3,"sources":["../../../node_modules/bn.js/lib/bn.js","../../logger/src.ts/_version.ts","../../logger/src.ts/index.ts","../../bytes/src.ts/_version.ts","../../bytes/src.ts/index.ts","../../bignumber/src.ts/_version.ts","../../bignumber/src.ts/bignumber.ts","../../bignumber/src.ts/fixednumber.ts","../../bignumber/src.ts/index.ts","../../properties/src.ts/_version.ts","../../properties/src.ts/index.ts","../../abi/src.ts/_version.ts","../../abi/src.ts/fragments.ts","../../abi/src.ts/coders/abstract-coder.ts","../../../node_modules/js-sha3/src/sha3.js","../../keccak256/src.ts/index.ts","../../rlp/src.ts/_version.ts","../../rlp/src.ts/index.ts","../../address/src.ts/_version.ts","../../address/src.ts/index.ts","../../abi/src.ts/coders/address.ts","../../abi/src.ts/coders/anonymous.ts","../../abi/src.ts/coders/array.ts","../../abi/src.ts/coders/boolean.ts","../../abi/src.ts/coders/bytes.ts","../../abi/src.ts/coders/fixed-bytes.ts","../../abi/src.ts/coders/null.ts","../../constants/src.ts/addresses.ts","../../constants/src.ts/bignumbers.ts","../../constants/src.ts/hashes.ts","../../constants/src.ts/strings.ts","../../constants/src.ts/index.ts","../../abi/src.ts/coders/number.ts","../../strings/src.ts/_version.ts","../../strings/src.ts/utf8.ts","../../strings/src.ts/bytes32.ts","../../strings/src.ts/idna.ts","../../strings/src.ts/index.ts","../../abi/src.ts/coders/string.ts","../../abi/src.ts/coders/tuple.ts","../../abi/src.ts/abi-coder.ts","../../hash/src.ts/id.ts","../../hash/src.ts/_version.ts","../../hash/src.ts/namehash.ts","../../hash/src.ts/message.ts","../../hash/src.ts/typed-data.ts","../../hash/src.ts/index.ts","../../abi/src.ts/interface.ts","../../abi/src.ts/index.ts","../../abstract-provider/src.ts/_version.ts","../../abstract-provider/src.ts/index.ts","../../abstract-signer/src.ts/_version.ts","../../abstract-signer/src.ts/index.ts","../../contracts/src.ts/_version.ts","../../contracts/src.ts/index.ts","../../basex/src.ts/index.ts","../../../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","../../sha2/src.ts/types.ts","../../sha2/src.ts/_version.ts","../../sha2/src.ts/browser-sha2.ts","../../sha2/src.ts/index.ts","../../pbkdf2/src.ts/browser-pbkdf2.ts","../../pbkdf2/src.ts/index.ts","../../../node_modules/minimalistic-crypto-utils/lib/utils.js","../../../node_modules/elliptic/lib/elliptic/utils.js","../../../node_modules/elliptic/lib/elliptic/curve/base.js","../../../node_modules/elliptic/lib/elliptic/curve/short.js","../../../node_modules/elliptic/lib/elliptic/curve/index.js","../../../node_modules/elliptic/lib/elliptic/curves.js","../../../node_modules/hmac-drbg/lib/hmac-drbg.js","../../../node_modules/elliptic/lib/elliptic/ec/key.js","../../../node_modules/elliptic/lib/elliptic/ec/signature.js","../../../node_modules/elliptic/lib/elliptic/ec/index.js","../../../node_modules/elliptic/lib/elliptic.js","../../signing-key/src.ts/elliptic.ts","../../signing-key/src.ts/_version.ts","../../signing-key/src.ts/index.ts","../../transactions/src.ts/_version.ts","../../transactions/src.ts/index.ts","../../wordlists/src.ts/_version.ts","../../wordlists/src.ts/wordlist.ts","../../wordlists/src.ts/lang-cz.ts","../../wordlists/src.ts/lang-en.ts","../../wordlists/src.ts/lang-es.ts","../../wordlists/src.ts/lang-fr.ts","../../wordlists/src.ts/lang-ja.ts","../../wordlists/src.ts/lang-ko.ts","../../wordlists/src.ts/lang-it.ts","../../wordlists/src.ts/lang-zh.ts","../../wordlists/src.ts/wordlists.ts","../../wordlists/src.ts/index.ts","../../hdnode/src.ts/_version.ts","../../hdnode/src.ts/index.ts","../../random/src.ts/_version.ts","../../random/src.ts/browser-random.ts","../../random/src.ts/shuffle.ts","../../random/src.ts/index.ts","../../../node_modules/aes-js/index.js","../../json-wallets/src.ts/_version.ts","../../json-wallets/src.ts/utils.ts","../../json-wallets/src.ts/crowdsale.ts","../../json-wallets/src.ts/inspect.ts","../../../node_modules/scrypt-js/scrypt.js","../../json-wallets/src.ts/keystore.ts","../../json-wallets/src.ts/index.ts","../../wallet/src.ts/_version.ts","../../wallet/src.ts/index.ts","../../networks/src.ts/_version.ts","../../networks/src.ts/index.ts","../../base64/src.ts/browser-base64.ts","../../base64/src.ts/index.ts","../../web/src.ts/_version.ts","../../web/src.ts/browser-geturl.ts","../../web/src.ts/index.ts","../../../node_modules/bech32/index.js","../../providers/src.ts/_version.ts","../../providers/src.ts/formatter.ts","../../providers/src.ts/base-provider.ts","../../providers/src.ts/json-rpc-provider.ts","../../providers/src.ts/browser-ws.ts","../../providers/src.ts/websocket-provider.ts","../../providers/src.ts/url-json-rpc-provider.ts","../../providers/src.ts/alchemy-provider.ts","../../providers/src.ts/cloudflare-provider.ts","../../providers/src.ts/etherscan-provider.ts","../../providers/src.ts/fallback-provider.ts","../../providers/src.ts/browser-ipc-provider.ts","../../providers/src.ts/infura-provider.ts","../../providers/src.ts/nodesmith-provider.ts","../../providers/src.ts/pocket-provider.ts","../../providers/src.ts/web3-provider.ts","../../providers/src.ts/index.ts","../../solidity/src.ts/index.ts","../../units/src.ts/_version.ts","../../units/src.ts/index.ts","../src.ts/utils.ts","../src.ts/_version.ts","../src.ts/ethers.ts","../src.ts/index.ts"],"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","wordSize","Buffer","e","num","Array","isArray","max","left","right","cmp","min","init","_initNumber","_initArray","toString","replace","start","_parseHex","_parseBase","strip","toArray","Math","ceil","i","j","w","off","parseHex","str","end","r","len","c","charCodeAt","parseBase","mul","limbLen","limbPow","total","mod","word","imuln","_iaddn","pow","copy","dest","clone","_expand","size","_normSign","inspect","zeros","groupSizes","groupBases","padding","out","carry","groupSize","groupBase","isZero","modn","idivn","toNumber","ret","toJSON","toBuffer","toArrayLike","ArrayType","byteLength","reqLength","littleEndian","res","b","q","andln","iushrn","clz32","_countBits","t","_zeroBits","bitLength","hi","toBitArray","bit","wbit","zeroBits","toTwos","width","abs","inotn","iaddn","fromTwos","testn","notn","ineg","isNeg","neg","iuor","ior","or","uor","iuand","iand","and","uand","iuxor","a","ixor","xor","uxor","bytesNeeded","bitsLeft","setn","iadd","isub","add","sub","smallMulTo","self","lo","k","ncarry","rword","maxJ","comb10MulTo","o","mid","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","imul","w0","w1","w2","w3","w4","w5","w6","w7","w8","w9","w10","w11","w12","w13","w14","w15","w16","w17","w18","bigMulTo","hncarry","jumboMulTo","fftm","FFTM","mulp","mulTo","x","y","makeRBT","N","l","revBin","rb","permute","rbt","rws","iws","rtws","itws","transform","s","rtwdf","cos","PI","itwdf","sin","p","rtwdf_","itwdf_","re","ie","ro","io","rx","guessLen13b","n","m","odd","conjugate","normalize13b","ws","round","convert13b","stub","ph","_","rwst","iwst","nrws","nrwst","niwst","rmws","mulf","muln","sqr","isqr","iushln","bits","carryMask","newCarry","ishln","hint","extended","h","mask","maskedWords","ishrn","shln","ushln","shrn","ushrn","imaskn","maskn","isubn","addn","subn","iabs","_ishlnsubmul","shift","_wordDiv","mode","bhi","bhiBits","diff","qj","div","divmod","positive","divn","umod","divRound","dm","half","r2","acc","egcd","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","tmp","_tmp","ireduce","rlen","split","imulK","undefined","_strip","input","K256","call","output","outLen","prev","next","P224","P192","P25519","_prime","prime","imod","mod3","one","nOne","lpow","z","inv","windowSize","wnd","current","currentLen","mont","Mont","rinv","minv","u","version","_permanentCensorErrors","_censorErrors","LogLevels","debug","default","info","warning","error","_logLevel","_globalLogger","_checkNormalize","missing_1","forEach","form","normalize","push","join","String","fromCharCode","message","_normalizeError","LogLevel","ErrorCode","Logger","Object","defineProperty","enumerable","value","writable","_log","logLevel","args","level","toLowerCase","throwArgumentError","console","log","apply","_i","arguments","levels","DEBUG","INFO","warn","WARNING","makeError","code","params","errors","UNKNOWN_ERROR","messageDetails","keys","key","JSON","stringify","reason","throwError","INVALID_ARGUMENT","argument","condition","assertArgument","checkNormalize","UNSUPPORTED_OPERATION","operation","checkSafeUint53","NUMERIC_FAULT","fault","checkArgumentCount","count","expectedCount","MISSING_ARGUMENT","UNEXPECTED_ARGUMENT","checkNew","target","kind","MISSING_NEW","checkAbstract","globalLogger","_version_1","setCensorship","censorship","permanent","setLogLevel","from","logger","logger_1","isHexable","addSlice","array","slice","Uint8Array","isBytesLike","isHexString","isBytes","v","arrayify","options","result","unshift","parseInt","allowMissingPrefix","substring","toHexString","hex","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","bytes","vs_1","vs","joinSignature","bn_js_1","__importDefault","bn","_constructorGuard","MAX_SAFE","isBigNumberish","BigNumber","isBigNumber","bytes_1","constructorGuard","_newTarget","_hex","_isBigNumber","freeze","toBigNumber","toBN","other","throwFault","isNegative","shr","type","toHex","anyValue","_base36To16","_base16To36","Zero","bignumber_1","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","ceiling","factor","BUMP","toUnsafeFloat","parseFloat","toFormat","fromString","fixedFormat","numeric","decimal","fromBytes","isFixedNumber","bignumber","fixednumber","bignumber_2","defineReadOnly","getStatic","getPrototypeOf","resolveProperties","promises","Promise","resolve","then","all","results","_a","sent","checkProperties","properties","shallowCopy","opaque","bigint","boolean","function","string","_isFrozen","isFrozen","_deepCopy","deepCopy","Description","ModifiersBytes","calldata","memory","storage","ModifiersNest","checkModifier","indexOf","parseParamType","param","allowIndexed","originalParam","newNode","parent","node","state","allowType","indexed","allowParams","verifyType","components","child","allowName","allowArray","sibling","readArray","populate","properties_1","FormatTypes","sighash","minimal","full","json","paramTypeArray","RegExp","ParamType","arrayLength","arrayChildren","fromObject","baseType","_isParamType","result_1","comp","parse","isParamType","ParamTypify","parseParams","allowIndex","splitNesting","Fragment","_isFragment","isFragment","FunctionFragment","EventFragment","ConstructorFragment","trim","_super","__extends","anonymous","inputs","isEventFragment","verifyIdentifier","regexParen","modifier","parseGas","gas","parseModifiers","constant","payable","stateMutability","verifyState","payble","isConstructorFragment","parens","ouputs","outputs","isFunctionFragment","returns","regexIdentifier","depth","checkResultErrors","checkErrors","path","childPath","Coder","localName","dynamic","_throwError","Writer","_data","_dataLength","_padding","_writeData","appendWriter","writer","writeBytes","paddingOffset","_getValue","BUFFER_OVERRUN","writeValue","writeUpdatableValue","_this","Reader","coerceFunc","allowLoose","_offset","coerce","_coerceFunc","_peekBytes","loose","alignedLength","subReader","readBytes","readValue","root","window","NODE_JS","JS_SHA3_NO_NODE_JS","process","versions","global","COMMON_JS","JS_SHA3_NO_COMMON_JS","HEX_CHARS","SHAKE_PADDING","KECCAK_PADDING","PADDING","SHIFT","RC","BITS","SHAKE_BITS","OUTPUT_TYPES","createOutputMethod","outputType","Keccak","update","createShakeOutputMethod","outputBits","createMethod","method","create","createShakeMethod","algorithms","methods","methodNames","algorithm","methodName","blocks","reset","block","blockCount","byteCount","outputBlocks","extraBytes","notString","ArrayBuffer","index","lastByteIndex","f","finalize","arrayBuffer","buffer","Uint32Array","digest","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","js_sha3_1","sha3","keccak256","keccak_256","arrayifyInteger","unarrayifyInteger","_encode","payload_1","length_1","encode","_decodeChildren","childOffset","decoded","_decode","consumed","lengthLength","length_2","length_3","length_4","length_5","decode","getChecksumAddress","address","chars","expanded","hashed","keccak256_1","toUpperCase","MAX_SAFE_INTEGER","log10","LN10","ibanLookup","safeDigits","ibanChecksum","checksum","getAddress","isAddress","getIcapAddress","base36","getContractAddress","transaction","nonce","rlp_1","getCreate2Address","salt","initCodeHash","AddressCoder","address_1","reader","abstract_coder_1","AnonymousCoder","coder","pack","coders","values","arrayValues","unique_1","staticWriter","dynamicWriter","updateFuncs","dynamicOffset_1","updateFunc_1","baseOffset","func","unpack","baseReader","offsetReader","uniqueNames","get","ArrayCoder","anonymous_1","BooleanCoder","DynamicBytesCoder","BytesCoder","FixedBytesCoder","NullCoder","AddressZero","One","Two","WeiPerEther","MaxUint256","HashZero","EtherSymbol","addresses","bignumbers","hashes","strings","NumberCoder","maxUintValue","constants_1","bounds","UnicodeNormalizationForm","Utf8ErrorReason","errorFunc","badCodepoint","ignoreFunc","BAD_PREFIX","UNEXPECTED_CONTINUE","OVERRUN","replaceFunc","OVERLONG","Utf8ErrorFuncs","ignore","getUtf8CodePoints","onError","extraLength","overlongMask","nextChar","MISSING_CONTINUE","OUT_OF_RANGE","UTF16_SURROGATE","toUtf8Bytes","pair","escapeChar","_toEscapedUtf8String","codePoint","_toUtf8String","codePoints","toUtf8String","toUtf8CodePoints","formatBytes32String","text","utf8_1","parseBytes32String","bytes2","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","flatten","_nameprepTableA1","codepoint","_nameprepTableB2","codes","complex","_nameprepTableC","nameprep","codesTableB2","NFKC","bytes32_1","idna_1","StringCoder","strings_1","TupleCoder","types","array_1","paramTypeBytes","paramTypeNumber","AbiCoder","_getCoder","boolean_1","string_1","bytes_2","tuple_1","component","null_1","number_1","fixed_bytes_1","_getWordSize","_getReader","_getWriter","fragments_1","defaultAbiCoder","id","Zeros","fill","Partition","isValidName","namehash","partition","label","messagePrefix","hashMessage","hexPadRight","padOffset","hexTrue","hexFalse","domainFieldTypes","chainId","verifyingContract","domainFieldNames","checkString","domainChecks","getBaseEncoder","boundsUpper_1","boundsLower_1","width_1","id_1","encodeType","fields","TypedDataEncoder","links","parents","subtypes","name_1","field","encoder","primaryTypes","filter","checkCircular","found","subtype","primaryType","name_2","st","sort","_types","getEncoder","_encoderCache","_getEncoder","subtype_1","subEncoder_1","encodedType_1","encodeData","hashStruct","hash","_visit","callback","subtype_2","visit","getPrimaryType","hashDomain","domain","domainFields","name_3","EIP712Domain","resolveNames","resolveName","ensCache","_c","_d","name_4","_e","getPayload","domainValues","domainTypes","typesWithDomain","prefix","namehash_1","message_1","_TypedDataEncoder","typed_data_1","LogDescription","TransactionDescription","Indexed","isIndexed","_isIndexed","wrapAccessError","property","wrap","Interface","fragments","abi","fragment","bucket","deploy","functions","events","getAbiCoder","abi_coder_1","getSighash","functionFragment","hash_1","getEventTopic","eventFragment","getFunction","nameOrSignatureOrSighash","matching","getEvent","nameOrSignatureOrTopic","topichash","_decodeParams","_abiCoder","_encodeParams","encodeDeploy","decodeFunctionData","encodeFunctionData","decodeFunctionResult","errorSignature","CALL_EXCEPTION","errorArgs","encodeFunctionResult","encodeFilterTopics","topics","encodeTopic","pop","encodeEventLog","dataTypes","dataValues","decodeEventLog","topicHash","expected","nonIndexed","resultIndexed","resultNonIndexed","nonIndexedIndex","indexedIndex","value_1","parseTransaction","tx","parseLog","topic","isInterface","_isInterface","interface_1","ForkEvent","isForkEvent","_isForkEvent","BlockForkEvent","blockHash","expiry","_isBlockForkEvent","TransactionForkEvent","_isTransactionForkEvent","TransactionOrderForkEvent","beforeHash","afterHash","_isTransactionOrderForkEvent","Provider","addListener","eventName","listener","on","removeListener","isProvider","_isProvider","allowedTransactionKeys","forwardErrors","INSUFFICIENT_FUNDS","NONCE_EXPIRED","REPLACEMENT_UNDERPRICED","Signer","getBalance","blockTag","_checkProvider","provider","getTransactionCount","estimateGas","checkTransaction","sendTransaction","populateTransaction","signTransaction","signedTx","getChainId","getNetwork","network","getGasPrice","to","gasPrice","gasLimit","catch","UNPREDICTABLE_GAS_LIMIT","isSigner","_isSigner","VoidSigner","_fail","signMessage","_signTypedData","connect","resolver","nameOrPromise","resolveAddresses","paramType","reject","contract","overrides","signer","override","__awaiter","resolvedAddress","resolved","interface","intrinsic","roValue","leftovers","buildPopulate","buildEstimate","signerOrProvider","buildCall","collapseSimple","deployTransaction","_deployed","buildSend","txRequest","wait","bind","confirmations","receipt","logs","event","parsed","eventSignature","getBlock","getTransaction","transactionHash","getTransactionReceipt","buildDefault","getEventTag","RunningEvent","tag","_listeners","once","done","removeAllListeners","listeners","listenerCount","run","argsCopy","setTimeout","prepareEvent","getEmit","ErrorRunningEvent","FragmentRunningEvent","contractInterface","decodeError","abi_1","WildcardRunningEvent","parsed_1","Contract","addressOrName","abstract_signer_1","abstract_provider_1","uniqueFilters_1","filters","uniqueSignatures","callStatic","signatures","getInterface","deployed","_deployedPromise","getCode","contractAddress","fallback","attach","_normalizeRunningEvent","runningEvent","_runningEvents","_getRunningEvent","_checkRunningEvents","emit","_wrappedEmits","_wrapEvent","_addEventListener","wrappedEmit","__spreadArrays","queryFilter","fromBlockOrBlockhash","toBlock","fromBlock","getLogs","runningEvent_1","ContractFactory","bytecode","bytecodeHex","getDeployTransaction","unsignedTx","getContract","fromSolidity","compilerOutput","evm","BaseX","alphabet","charAt","_alphabetMap","source","digits","_leader","TypeError","byte","reverse","Base32","Base58","minimalisticAssert","equal","assertEqual","configurable","inherits_1","enc","toArray_1","zero2","toHex_1","htonl","htonl_1","toHex32","zero8","toHex32_1","zero2_1","zero8_1","join32","join32_1","split32","split32_1","rotr32","rotr32_1","rotl32","rotl32_1","sum32","sum32_1","sum32_3","sum32_3_1","sum32_4","sum32_4_1","sum32_5","sum32_5_1","sum64","buf","pos","ah","al","bh","bl","sum64_1","sum64_hi","sum64_hi_1","sum64_lo","sum64_lo_1","sum64_4_hi","ch","cl","dh","dl","sum64_4_hi_1","sum64_4_lo","sum64_4_lo_1","sum64_5_hi","eh","el","sum64_5_hi_1","sum64_5_lo","sum64_5_lo_1","rotr64_hi","rotr64_hi_1","rotr64_lo","rotr64_lo_1","shr64_hi","shr64_hi_1","shr64_lo","shr64_lo_1","BlockHash","pending","pendingTotal","blockSize","outSize","hmacStrength","padLength","_delta8","_delta32","BlockHash_1","utils","_update","_pad","_digest","pad","ft_1","ch32","p32","maj32","ft_1_1","ch32_1","maj32_1","p32_1","s0_256","s0_256_1","s1_256","s1_256_1","g0_256","g0_256_1","g1_256","g1_256_1","shaCommon","common","sha1_K","SHA1","W","_1","sha256_K","SHA256","_256","T1","T2","SHA224","_224","sha512_K","SHA512","_512","_prepareBlock","c0_hi","g1_512_hi","c0_lo","g1_512_lo","c1_hi","c1_lo","c2_hi","g0_512_hi","c2_lo","g0_512_lo","c3_hi","c3_lo","fh","fl","gh","gl","hh","hl","s1_512_hi","s1_512_lo","ch64_hi","ch64_lo","c4_hi","c4_lo","T1_hi","T1_lo","s0_512_hi","s0_512_lo","maj64_hi","maj64_lo","T2_hi","T2_lo","xh","xl","yh","yl","zh","zl","SHA384","_384","sha1","require$$0","sha224","require$$1","sha256","require$$2","sha384","require$$3","sha512","require$$4","RIPEMD160","ripemd160","E","Ah","Bh","Ch","Dh","Eh","T","K","rh","Kh","sh","Hmac","Hash","inner","outer","hmac","sha","ripemd","SupportedAlgorithm","hash_js_1","computeHmac","types_1","sha2_1","pbkdf2","password","iterations","keylen","hashAlgorithm","hLen","DK","block1","U","destPos","browserPbkdf2","arr","minAssert","minUtils","getNAF","naf","getJSF","k1","k2","jsf","d1","d2","m14","m24","u1","m8","u2","cachedProperty","obj","computer","parseBytes","intFromLE","BaseCurve","conf","zero","two","pointFromJSON","gRed","_wnafT1","_wnafT2","_wnafT3","_wnafT4","_bitLength","adjustCount","redN","_maxwellTrick","point","validate","_fixedNafMul","precomputed","doubles","_getDoubles","I","step","repr","nafW","jpoint","mixedAdd","points","toP","_wnafMul","nafPoints","_getNAFPoints","dblp","_wnafMulAdd","defW","coeffs","jacobianResult","wndWidth","comb","toJ","ja","jb","BasePoint","curve","decodePoint","pointFromX","encodeCompressed","compact","getX","getY","precompute","power","beta","_getBeta","_hasDoubles","dbl","ShortCurve","Base","tinv","zeroA","threeA","endo","_getEndomorphism","_endoWnafT1","_endoWnafT2","short_1","lambda","betas","_getEndoRoots","lambdas","basis","vec","_getEndoBasis","ntinv","l1","l2","aprxSqrt","y1","y2","prevR","len1","len2","_endoSplit","v1","v2","p1","p2","q1","q2","inf","ax","rhs","_endoWnafMulAdd","npoints","ncoeffs","Point","isRed","fromJSON","pre","endoMul","obj2point","isInfinity","nx","ny","ys1","dyinv","mulAdd","jmulAdd","_precompute","negate","JPoint","zOne","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","xc","short","edwards","curves","PresetCurve","defineCurve","crash","HmacDRBG","predResist","minEntropy","_reseed","reseedInterval","V","entropy","entropyEnc","nonceEnc","pers","persEnc","hmacDrbg","seed","_hmac","kmac","reseed","addEnc","generate","temp","KeyPair","ec","priv","pub","_importPrivate","privEnc","_importPublic","pubEnc","fromPublic","fromPrivate","getPublic","getPrivate","derive","sign","verify","Signature","_importDER","Position","place","getLength","initial","octetLen","rmPadding","slen","constructLength","octets","LN2","toDER","backHalf","rand","EC","hasOwnProperty","nh","keyPair","keyFromPrivate","keyFromPublic","genKeyPair","drbg","ns2","_truncateToN","truncateToN","truncOnly","bkey","ns1","iter","kp","kpX","canonical","sinv","recoverPubKey","isYOdd","isSecondKey","rInv","getKeyRecoveryParam","Q","Qprime","elliptic","eddsa","elliptic_1$1","elliptic_1","_curve","getCurve","SigningKey","privateKey","_addPoint","p0","publicKey","signDigest","computeSharedSecret","otherKey","otherKeyPair","computePublicKey","isSigningKey","_isSigningKey","recoverPublicKey","sig","rs","compressed","signingKey","RLP","__importStar","lib$5","handleAddress","handleNumber","transactionFields","maxLength","computeAddress","signing_key_1","recoverAddress","serialize","raw","fieldInfo","rawTransaction","exportWordlist","Wordlist","locale","mnemonic","wordlist","getWord","getWordIndex","register","lang","anyGlobal","_ethers","wordlists","loadWords","wordlist_1","LangCz","langCz","LangEn","langEn","lookup","dropDiacritic","expand","LangEs","langEs","LangFr","langFr","mapping","KiYoKu","KyoKu","kana","sortJapanese","LangJa","langJa","getHangul","LangKo","langKo","LangIt","langIt","deltaData","zh_cn","zh_tw","Checks","style","deltaOffset","i_1","LangZh","country","langZhCn","langZhTw","cz","lang_cz_1","en","lang_en_1","es","lang_es_1","fr","lang_fr_1","it","lang_it_1","lang_ja_1","ko","lang_ko_1","lang_zh_1","wordlists_1","MasterSecret","HardenedBit","getUpperMask","getLowerMask","bytes32","base58check","basex_1","getWordlist","defaultPath","HDNode","parentFingerprint","chainCode","mnemonicOrPath","compressedPublicKey","transactions_1","neuter","_derive","IL","IR","ki","Ki","ek","srcMnemonic","phrase","fingerprint","derivePath","_fromSeed","seedArray","fromMnemonic","entropyToMnemonic","mnemonicToEntropy","mnemonicToSeed","fromSeed","fromExtendedKey","extendedKey","NFKD","pbkdf2_1","entropyBits","checksumBits","checksumMask","indices","remainingBits","isValidMnemonic","crypto","msCrypto","getRandomValues","randomBytes","shuffled","random","browserRandom","shuffle","checkInt","checkInts","arrayish","coerceArray","arg","isView","createArray","copyArray","sourceArray","targetArray","targetStart","sourceStart","sourceEnd","convertUtf8","toBytes","encodeURI","substr","convertHex","Hex","numberOfRounds","16","24","32","rcon","S","Si","T3","T4","T5","T6","T7","T8","U1","U2","U3","U4","convertToInt32","AES","_prepare","rounds","_Ke","_Kd","roundKeyCount","KC","tk","rconpointer","tt","encrypt","plaintext","decrypt","ciphertext","ModeOfOperationECB","description","_aes","ModeOfOperationCBC","iv","_lastCipherblock","ModeOfOperationCFB","segmentSize","_shiftRegister","encrypted","xorSegment","ModeOfOperationOFB","_lastPrecipher","_lastPrecipherIndex","Counter","initialValue","_counter","setValue","setBytes","increment","ModeOfOperationCTR","counter","_remainingCounter","_remainingCounterIndex","pkcs7pad","padder","pkcs7strip","aesjs","ModeOfOperation","ecb","cbc","cfb","ofb","ctr","utf8","pkcs7","_arrayTest","define","amd","_aesjs","looseArrayify","hexString","zpad","getPassword","searchPath","currentChild","matchingChild","uuidV4","aes_js_1","aesJs","CrowdsaleAccount","isCrowdsaleAccount","_isCrowdsaleAccount","utils_1","ethaddr","encseed","encryptedSeed","aesCbc","seedHex","seedHexBytes","isCrowdsaleWallet","isKeystoreWallet","getJsonWalletAddress","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","src","srcPos","checkBufferish","ensureInteger","_scrypt","XY","totalOps","currentOp","lastPercent10","stop","i0","i1","Bi","limit","nextTick","setImmediate","incrementalSMix","steps","percent10","derivedKey","lib","scrypt","progressCallback","lastProgress","progress","syncScrypt","scrypt_js_1","hasMnemonic","KeystoreAccount","isKeystoreAccount","_isKeystoreAccount","_decrypt","cipher","aesCtr","_getAccount","computedMAC","mnemonicKey","account","mnemonicCiphertext","mnemonicIv","mnemonicCounter","mnemonicAesCtr","hdnode_1","pbkdf2Sync","passwordBytes","prfFunc","_computeKdfKey","pbkdf2Func","scryptFunc","kdf","prf","decryptSync","client","random_1","uuidRandom","uuid","macPrefix","mac","Crypto","cipherparams","kdfparams","dklen","now","Date","timestamp","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","gethFilename","decryptCrowdsale","crowdsale_1","inspect_1","decryptKeystore","keystore_1","decryptKeystoreSync","encryptKeystore","decryptJsonWallet","decryptJsonWalletSync","isAccount","Wallet","signingKey_1","srcMnemonic_1","signingKey_2","_mnemonic","_signingKey","populated","json_wallets_1","createRandom","extraEntropy","fromEncryptedJson","fromEncryptedJsonSync","verifyMessage","verifyTypedData","isRenetworkable","ethDefaultProvider","providers","providerList","InfuraProvider","infura","EtherscanProvider","etherscan","AlchemyProvider","alchemy","CloudflareProvider","FallbackProvider","quorum","renetwork","etcDefaultProvider","url","JsonRpcProvider","homestead","ensAddress","_defaultProvider","ropsten","classicMordor","networks","unspecified","mainnet","morden","testnet","rinkeby","kovan","goerli","classic","classicMorden","classicTestnet","classicKotti","standard_1","standard_2","standard","defaultProvider","textData","atob","btoa","browserBase64","getUrl","href","request","headers","body","cache","credentials","redirect","referrer","fetch","response","statusCode","status","statusMessage","statusText","staller","duration","bodyify","_fetchData","connection","processFunc","attemptLimit","throttleLimit","throttleCallback","throttleSlotInterval","allow304","timeout","allowGzip","user","allowInsecureAuthentication","authorization","base64_1","flatHeaders","header","runningTimeout","timer","promise","TIMEOUT","requestBody","requestMethod","cancel","clearTimeout","runningFetch","attempt","geturl_1","tryAgain","stall","retryAfter","error_1","SERVER_ERROR","serverError","body_1","error_2","throttleRetry","timeout_1","race","fetchJson","processJsonFunc","updated","hasContentType","content-type","poll","interval","retryLimit","oncePoll","onceBlock","ALPHABET","ALPHABET_MAP","polymodStep","prefixChk","chk","LIMIT","__decode","lowered","uppered","lastIndexOf","wordChars","decodeUnsafe","convert","inBits","outBits","maxV","toWordsUnsafe","toWords","fromWordsUnsafe","fromWords","bech32","Formatter","formats","getDefaultFormats","bigNumber","strictData","allowNull","blockNumber","transactionIndex","uint256","creates","transactionRequest","receiptLog","arrayOf","logIndex","gasUsed","logsBloom","cumulativeGasUsed","parentHash","difficulty","miner","extraData","transactions","blockWithTransactions","transactionResponse","filterLog","removed","allowFalsish","strict","callAddress","_block","author","networkId","byzantium","checkKey","checkValue","nullValue","replaceValue","isCommunityResourcable","isCommunityResource","throttleMessage","showThrottleMessage","bech32_1","checkTopic","serializeTopics","sorted","deserializeTopics","getTime","PollableEvents","Event","pollable","coinInfos","0","symbol","p2pkh","p2sh","2","3","60","ilk","61","700","bytes32ify","base58Encode","Resolver","formatter","_fetchBytes","selector","parameters","_getAddress","coinType","hexBytes","coinInfo","version_1","hexBytes_1","getContentHash","ipfs","swarm","getText","keyBytes","defaultFormatter","nextPollId","BaseProvider","_events","_emitted","getFormatter","anyNetwork","detectNetwork","_networkPromise","_ready","knownNetwork","_maxInternalBlockNumber","_lastBlockNumber","_pollingInterval","_fastQueryDate","_network","web_1","NETWORK_ERROR","formatter_1","networks_1","_getInternalBlockNumber","maxAge","internalBlockNumber","_internalBlockNumber","respTime","reqTime","checkInternalBlockNumber","perform","networkError","_setFastBlockNumber","pollId","runners","pollingInterval","previousBlockNumber","eventBlockNumber","hash_2","runner","filter_1","resetEventsBlock","polling","currentNetwork","_fastBlockNumber","_fastBlockNumberPromise","detectedNetwork","_poller","setInterval","_bootstrapPoll","clearInterval","_getFastBlockNumber","getBlockNumber","waitForTransaction","handler","unref","_b","_getBlockTag","getStorageAt","position","_wrapTransaction","expectedHash","returnedHash","signedTransaction","hexTx","_getTransactionRequest","_getFilter","_getBlock","blockHashOrBlockTag","includeTransactions","blockNumber_1","getBlockWithTransactions","getEtherPrice","getResolver","_getResolver","lookupAddress","reverseName","resolverAddress","addr","NOT_IMPLEMENTED","_startEvent","_stopEvent","stopped","eventTag","eventTag_1","errorGas","checkError","responseText","getResult","payload","getLowerCase","JsonRpcSigner","addressOrIndex","connectUnchecked","UncheckedJsonRpcSigner","_address","_index","send","accounts","sendUncheckedTransaction","fromAddress","estimate","sender","hexlifyTransaction","unlock","networkOrReady","_nextId","defaultUrl","getSigner","getUncheckedSigner","listAccounts","jsonrpc","action","prepareRequest","error_3","_startPending","_pendingFilter","pendingFilter","filterId","seq","allowExtra","allowed","base_provider_1","WS","WebSocket","logger_2","NextId","WebSocketProvider","_wsReady","ws_1","_websocket","onopen","_requests","onmessage","messageEvent","_subs","subscription","fauxPoll","_detectNetwork","rid","_subscribe","subIdPromise","_subIds","subId","emitReceipt_1","destroy","readyState","CONNECTING","onerror","close","json_rpc_provider_1","StaticJsonRpcProvider","UrlJsonRpcProvider","apiKey","getApiKey","defaultApiKey","AlchemyWebSocketProvider","websocket_provider_1","getWebSocketProvider","host","url_json_rpc_provider_1","getTransactionPostData","getJsonResult","checkLogTag","baseUrl","procFunc","payloadStr","apikey","postData","topic0","ethusd","getHistory","startBlock","endBlock","timeStamp","checkNetworks","median","maxDelta","middle","nextRid","getPromise","ForwardErrors","ForwardProperties","exposeDebugConfig","config","weight","normalizedTally","configs","tally","getProcessFunc","_highestBlockNumber","waitForSync","cancelled","getRunner","currentBlockNumber","providerConfigs","configOrProvider","stallTimeout","priority","first","t0","inflightWeight","backend","this_1","waiting","errorCode","props","IpcProvider","defaultProjectId","InfuraWebSocketProvider","projectId","projectSecret","apiKeyObj","NodesmithProvider","defaultApplicationId","PocketProvider","applicationId","applicationSecretKey","buildWeb3LegacyFetcher","sendFunc","isMetaMask","buildEip1193Fetcher","Web3Provider","jsonRpcFetchFunc","subprovider","sendAsync","alchemy_provider_1","cloudflare_provider_1","etherscan_provider_1","fallback_provider_1","ipc_provider_1","infura_provider_1","nodesmith_provider_1","pocket_provider_1","web3_provider_1","getDefaultProvider","fallbackProvider","alchemyProvider","cloudflareProvider","etherscanProvider","infuraProvider","jsonRpcProvider","nodesmithProvider","pocketProvider","web3Provider","browserIpcProvider","regexBytes","regexNumber","regexArray","_pack","baseType_1","tight","names","commify","suffix","formatted","formatUnits","unitName","parseUnits","formatEther","parseEther","ether","base64","lib$p","base58","solidityKeccak256","solidity_1","solidityPack","soliditySha256","serializeTransaction","units_1","wallet_1","sha2_2","lib$f","strings_2","lib$8","contracts_1","constants","lib$7","lib$r","providers_1","utils$3","ethers$1","ethers","ethers_1"],"mappings":"kgDAAA,SAAWA,OAAQC,SACjB,aAGA,SAASC,OAAQC,IAAKC,KACpB,IAAKD,IAAK,MAAM,IAAIE,MAAMD,KAAO,oBAKnC,SAASE,SAAUC,KAAMC,WACvBD,KAAKE,OAASD,UACd,IAAIE,SAAW,aACfA,SAASC,UAAYH,UAAUG,UAC/BJ,KAAKI,UAAY,IAAID,SACrBH,KAAKI,UAAUC,YAAcL,KAK/B,SAASM,GAAIC,OAAQC,KAAMC,QACzB,GAAIH,GAAGI,KAAKH,QAAS,CACnB,OAAOA,OAGTI,KAAKC,SAAW,EAChBD,KAAKE,MAAQ,KACbF,KAAKG,OAAS,EAGdH,KAAKI,IAAM,KAEX,GAAIR,SAAW,KAAM,CACnB,GAAIC,OAAS,MAAQA,OAAS,KAAM,CAClCC,OAASD,KACTA,KAAO,GAGTG,KAAKK,MAAMT,QAAU,EAAGC,MAAQ,GAAIC,QAAU,OAGlD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oxC,SAAA62C,SAAA72C,SACApxC,QAAAqzC,gBAAA40C,SAAA50C,gBAEArzC,QAAA0jB,UAAAukE,SAAAvkE,UACA1jB,QAAAgmB,YAAAiiE,SAAAjiE,YAEAhmB,QAAA0nF,UAAAO,SAAAP,UACA1nF,QAAA0d,OAAAuqE,SAAAvqE,OAEA1d,QAAA8f,OAAAmoE,SAAAnoE,OAEA9f,QAAAs5C,MAAA2uC,SAAA3uC,MAEAt5C,QAAAs0D,UAAA2zB,SAAA3zB,UAMAt0D,QAAAya,QAAAwtE,SAAAxtE,QA8BAza,QAAA4zD,SAAAq0B,SAAAr0B","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 Buffer = require('buffer').Buffer;\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 }\n\n if (base === 16) {\n this._parseHex(number, start);\n } else {\n this._parseBase(number, base, start);\n }\n\n if (number[0] === '-') {\n this.negative = 1;\n }\n\n this.strip();\n\n if (endian !== 'le') return;\n\n this._initArray(this.toArray(), base, endian);\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 parseHex (str, start, end) {\n var r = 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 <<= 4;\n\n // 'a' - 'f'\n if (c >= 49 && c <= 54) {\n r |= c - 49 + 0xa;\n\n // 'A' - 'F'\n } else if (c >= 17 && c <= 22) {\n r |= c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r |= c & 0xf;\n }\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start) {\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 var j, w;\n // Scan 24-bit chunks and add them to the number\n var off = 0;\n for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n w = parseHex(number, i, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n if (i + 6 !== start) {\n w = parseHex(number, start, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n }\n this.strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 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 r += c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n r += c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r += c;\n }\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\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 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 BN.prototype.inspect = function inspect () {\n return (this.red ? '';\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 if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\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.modn(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);\n };\n\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n assert(typeof Buffer !== 'undefined');\n return this.toArrayLike(Buffer, endian, length);\n };\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\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 this.strip();\n var littleEndian = endian === 'le';\n var res = new ArrayType(reqLength);\n\n var b, i;\n var q = this.clone();\n if (!littleEndian) {\n // Assume big-endian\n for (i = 0; i < reqLength - byteLength; i++) {\n res[i] = 0;\n }\n\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[reqLength - i - 1] = b;\n }\n } else {\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[i] = b;\n }\n\n for (; i < reqLength; i++) {\n res[i] = 0;\n }\n }\n\n return res;\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] & (1 << wbit)) >>> wbit;\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 var fftm = new FFTM();\n return fftm.mulp(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 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 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.modn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(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.modn = function modn (num) {\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 acc;\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\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 return this.strip();\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 BN v4 instance\n r.strip();\n } else {\n // r is 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 return a.umod(this.m)._forceRed(this);\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","export const version = \"logger/5.0.7\";\n","\"use strict\";\n\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\n\nconst LogLevels: { [ name: string ]: number } = { debug: 1, \"default\": 2, info: 2, warning: 3, error: 4, off: 5 };\nlet _logLevel = LogLevels[\"default\"];\n\nimport { version } from \"./_version\";\n\nlet _globalLogger: Logger = null;\n\nfunction _checkNormalize(): string {\n try {\n const missing: Array = [ ];\n\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 } catch(error) {\n missing.push(form);\n }\n });\n\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !== String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\")\n }\n } catch (error) {\n return error.message;\n }\n\n return null;\n}\n\nconst _normalizeError = _checkNormalize();\n\nexport enum LogLevel {\n DEBUG = \"DEBUG\",\n INFO = \"INFO\",\n WARNING = \"WARNING\",\n ERROR = \"ERROR\",\n OFF = \"OFF\"\n}\n\n\nexport enum ErrorCode {\n\n ///////////////////\n // Generic Errors\n\n // Unknown Error\n UNKNOWN_ERROR = \"UNKNOWN_ERROR\",\n\n // Not Implemented\n NOT_IMPLEMENTED = \"NOT_IMPLEMENTED\",\n\n // Unsupported Operation\n // - operation\n UNSUPPORTED_OPERATION = \"UNSUPPORTED_OPERATION\",\n\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 NETWORK_ERROR = \"NETWORK_ERROR\",\n\n // Some sort of bad response from the server\n SERVER_ERROR = \"SERVER_ERROR\",\n\n // Timeout\n TIMEOUT = \"TIMEOUT\",\n\n ///////////////////\n // Operational Errors\n\n // Buffer Overrun\n BUFFER_OVERRUN = \"BUFFER_OVERRUN\",\n\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n NUMERIC_FAULT = \"NUMERIC_FAULT\",\n\n\n ///////////////////\n // Argument Errors\n\n // Missing new operator to an object\n // - name: The name of the class\n MISSING_NEW = \"MISSING_NEW\",\n\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 INVALID_ARGUMENT = \"INVALID_ARGUMENT\",\n\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n MISSING_ARGUMENT = \"MISSING_ARGUMENT\",\n\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n UNEXPECTED_ARGUMENT = \"UNEXPECTED_ARGUMENT\",\n\n\n ///////////////////\n // Blockchain Errors\n\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 CALL_EXCEPTION = \"CALL_EXCEPTION\",\n\n // Insufficien funds (< value + gasLimit * gasPrice)\n // - transaction: the transaction attempted\n INSUFFICIENT_FUNDS = \"INSUFFICIENT_FUNDS\",\n\n // Nonce has already been used\n // - transaction: the transaction attempted\n NONCE_EXPIRED = \"NONCE_EXPIRED\",\n\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n REPLACEMENT_UNDERPRICED = \"REPLACEMENT_UNDERPRICED\",\n\n // The gas limit could not be estimated\n // - transaction: the transaction passed to estimateGas\n UNPREDICTABLE_GAS_LIMIT = \"UNPREDICTABLE_GAS_LIMIT\",\n};\n\nexport class Logger {\n readonly version: string;\n\n static errors = ErrorCode;\n\n static levels = LogLevel;\n\n constructor(version: string) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false\n });\n }\n\n _log(logLevel: LogLevel, args: Array): void {\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]) { return; }\n console.log.apply(console, args);\n }\n\n debug(...args: Array): void {\n this._log(Logger.levels.DEBUG, args);\n }\n\n info(...args: Array): void {\n this._log(Logger.levels.INFO, args);\n }\n\n warn(...args: Array): void {\n this._log(Logger.levels.WARNING, args);\n }\n\n makeError(message: string, code?: ErrorCode, params?: any): Error {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, { });\n }\n\n if (!code) { code = Logger.errors.UNKNOWN_ERROR; }\n if (!params) { params = {}; }\n\n const messageDetails: Array = [];\n Object.keys(params).forEach((key) => {\n try {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key]));\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\n const reason = message;\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n\n // @TODO: Any??\n const error: any = new Error(message);\n error.reason = reason;\n error.code = code\n\n Object.keys(params).forEach(function(key) {\n error[key] = params[key];\n });\n\n return error;\n }\n\n throwError(message: string, code?: ErrorCode, params?: any): never {\n throw this.makeError(message, code, params);\n }\n\n throwArgumentError(message: string, name: string, value: any): never {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value\n });\n }\n\n assert(condition: any, message: string, code?: ErrorCode, params?: any): void {\n if (!!condition) { return; }\n this.throwError(message, code, params);\n }\n\n assertArgument(condition: any, message: string, name: string, value: any): void {\n if (!!condition) { return; }\n this.throwArgumentError(message, name, value);\n }\n\n checkNormalize(message?: string): void {\n if (message == null) { message = \"platform missing String.prototype.normalize\"; }\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\n checkSafeUint53(value: number, message?: string): void {\n if (typeof(value) !== \"number\") { return; }\n\n if (message == null) { 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\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\n checkArgumentCount(count: number, expectedCount: number, message?: string): void {\n if (message) {\n message = \": \" + message;\n } else {\n message = \"\";\n }\n\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount\n });\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\n checkNew(target: any, kind: any): void {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, { name: kind.name });\n }\n }\n\n checkAbstract(target: any, kind: any): void {\n if (target === kind) {\n this.throwError(\n \"cannot instantiate abstract class \" + JSON.stringify(kind.name) + \" directly; use a sub-class\",\n Logger.errors.UNSUPPORTED_OPERATION,\n { 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\n static globalLogger(): Logger {\n if (!_globalLogger) { _globalLogger = new Logger(version); }\n return _globalLogger;\n }\n\n static setCensorship(censorship: boolean, permanent?: boolean): void {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\"\n });\n }\n\n if (_permanentCensorErrors) {\n if (!censorship) { return; }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\"\n });\n }\n\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n\n static setLogLevel(logLevel: LogLevel): void {\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\n static from(version: string): Logger {\n return new Logger(version);\n }\n}\n","export const version = \"bytes/5.0.6\";\n","\"use strict\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\n///////////////////////////////\n// Exported Types\n\nexport type Bytes = ArrayLike;\n\nexport type BytesLike = Bytes | string;\n\nexport type DataOptions = {\n allowMissingPrefix?: boolean;\n hexPad?: \"left\" | \"right\" | null;\n};\n\nexport interface Hexable {\n toHexString(): string;\n}\n\n\n/*\nexport interface HexString {\n length: number;\n substring: (start: number, end?: number) => string;\n\n [index: number]: string;\n}\n*/\n\nexport type SignatureLike = {\n r: string;\n s?: string;\n _vs?: string,\n recoveryParam?: number;\n v?: number;\n} | BytesLike;\n\nexport interface Signature {\n r: string;\n\n s: string;\n _vs: string,\n\n recoveryParam: number;\n v: number;\n}\n\n///////////////////////////////\n\n\nfunction isHexable(value: any): value is Hexable {\n return !!(value.toHexString);\n}\n\nfunction addSlice(array: Uint8Array): Uint8Array {\n if (array.slice) { 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\n return array;\n}\n\nexport function isBytesLike(value: any): value is BytesLike {\n return ((isHexString(value) && !(value.length % 2)) || isBytes(value));\n}\n\nexport function isBytes(value: any): value is Bytes {\n if (value == null) { return false; }\n\n if (value.constructor === Uint8Array) { return true; }\n if (typeof(value) === \"string\") { return false; }\n if (value.length == null) { return false; }\n\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (v < 0 || v >= 256 || (v % 1)) {\n return false;\n }\n }\n\n return true;\n}\n\n\nexport function arrayify(value: BytesLike | Hexable | number, options?: DataOptions): Uint8Array {\n if (!options) { options = { }; }\n\n if (typeof(value) === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) { result.push(0); }\n\n return addSlice(new Uint8Array(result));\n }\n\n if (options.allowMissingPrefix && typeof(value) === \"string\" && value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n\n if (isHexable(value)) { 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 = \"0x0\" + hex.substring(2);\n } else if (options.hexPad === \"right\") {\n hex += \"0\";\n } else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\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\n return addSlice(new Uint8Array(result));\n }\n\n if (isBytes(value)) {\n return addSlice(new Uint8Array(value));\n }\n\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\n\nexport function concat(items: Array): Uint8Array {\n const objects = items.map(item => arrayify(item));\n const length = objects.reduce((accum, item) => (accum + item.length), 0);\n\n const result = new Uint8Array(length);\n\n objects.reduce((offset, object) => {\n result.set(object, offset);\n return offset + object.length;\n }, 0);\n\n return addSlice(result);\n}\n\nexport function stripZeros(value: BytesLike): Uint8Array {\n let result: Uint8Array = arrayify(value);\n\n if (result.length === 0) { return result; }\n\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) { start++ }\n\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n\n return result;\n}\n\nexport function zeroPad(value: BytesLike, length: number): Uint8Array {\n value = arrayify(value);\n\n if (value.length > length) {\n logger.throwArgumentError(\"value out of range\", \"value\", arguments[0]);\n }\n\n const result = new Uint8Array(length);\n result.set(value, length - value.length);\n return addSlice(result);\n}\n\n\nexport function isHexString(value: any, length?: number): boolean {\n if (typeof(value) !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false\n }\n if (length && value.length !== 2 + 2 * length) { return false; }\n return true;\n}\n\nconst HexCharacters: string = \"0123456789abcdef\";\n\nexport function hexlify(value: BytesLike | Hexable | number, options?: DataOptions): string {\n if (!options) { options = { }; }\n\n if (typeof(value) === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0x0f] + hex;\n value = Math.floor(value / 16);\n }\n\n if (hex.length) {\n if (hex.length % 2) { hex = \"0\" + hex; }\n return \"0x\" + hex;\n }\n\n return \"0x00\";\n }\n\n if (options.allowMissingPrefix && typeof(value) === \"string\" && value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n\n if (isHexable(value)) { 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 } else if (options.hexPad === \"right\") {\n value += \"0\";\n } else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return (value).toLowerCase();\n }\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\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\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: BytesLike) {\n if (typeof(data) !== \"string\") {\n data = hexlify(data);\n } else if (!isHexString(data) || (data.length % 2)) {\n return null;\n }\n\n return (data.length - 2) / 2;\n}\n\nexport function hexDataSlice(data: BytesLike, offset: number, endOffset?: number): string {\n if (typeof(data) !== \"string\") {\n data = hexlify(data);\n } else if (!isHexString(data) || (data.length % 2)) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data );\n }\n\n offset = 2 + 2 * offset;\n\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n\n return \"0x\" + data.substring(offset);\n}\n\nexport function hexConcat(items: Array): string {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\n\nexport function hexValue(value: BytesLike | Hexable | number): string {\n const trimmed = hexStripZeros(hexlify(value, { hexPad: \"left\" }));\n if (trimmed === \"0x\") { return \"0x0\"; }\n return trimmed;\n}\n\nexport function hexStripZeros(value: BytesLike): string {\n if (typeof(value) !== \"string\") { 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\") { offset++; }\n return \"0x\" + value.substring(offset);\n}\n\nexport function hexZeroPad(value: BytesLike, length: number): string {\n if (typeof(value) !== \"string\") {\n value = hexlify(value);\n } else if (!isHexString(value)) {\n logger.throwArgumentError(\"invalid hex string\", \"value\", value);\n }\n\n if (value.length > 2 * length + 2) {\n logger.throwArgumentError(\"value out of range\", \"value\", arguments[1]);\n }\n\n while (value.length < 2 * length + 2) {\n value = \"0x0\" + value.substring(2);\n }\n\n return value;\n}\n\nexport function splitSignature(signature: SignatureLike): Signature {\n const result = {\n r: \"0x\",\n s: \"0x\",\n _vs: \"0x\",\n recoveryParam: 0,\n v: 0\n };\n\n if (isBytesLike(signature)) {\n const bytes: Uint8Array = arrayify(signature);\n if (bytes.length !== 65) {\n logger.throwArgumentError(\"invalid signature string; must be 65 bytes\", \"signature\", signature);\n }\n\n // Get the r, s and v\n result.r = hexlify(bytes.slice(0, 32));\n result.s = hexlify(bytes.slice(32, 64));\n result.v = bytes[64];\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 } else {\n logger.throwArgumentError(\"signature invalid v byte\", \"signature\", signature);\n }\n }\n\n // Compute recoveryParam from v\n result.recoveryParam = 1 - (result.v % 2);\n\n // Compute _vs from recoveryParam and s\n if (result.recoveryParam) { bytes[32] |= 0x80; }\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\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\n // Set or check the recid\n const recoveryParam = ((vs[0] >= 128) ? 1: 0);\n if (result.recoveryParam == null) {\n result.recoveryParam = recoveryParam;\n } else if (result.recoveryParam !== recoveryParam) {\n logger.throwArgumentError(\"signature recoveryParam mismatch _vs\", \"signature\", signature);\n }\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 } else if (result.s !== s) {\n logger.throwArgumentError(\"signature v mismatch _vs\", \"signature\", signature);\n }\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 } else {\n result.recoveryParam = 1 - (result.v % 2);\n }\n } else {\n if (result.v == null) {\n result.v = 27 + result.recoveryParam;\n } else if (result.recoveryParam !== (1 - (result.v % 2))) {\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 } else {\n result.r = hexZeroPad(result.r, 32);\n }\n\n if (result.s == null || !isHexString(result.s)) {\n logger.throwArgumentError(\"signature missing or invalid s\", \"signature\", signature);\n } else {\n result.s = hexZeroPad(result.s, 32);\n }\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) { vs[0] |= 0x80; }\n const _vs = hexlify(vs);\n\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\n // Set or check the _vs\n if (result._vs == null) {\n result._vs = _vs;\n } else if (result._vs !== _vs) {\n logger.throwArgumentError(\"signature _vs mismatch v and s\", \"signature\", signature);\n }\n }\n\n return result;\n}\n\nexport function joinSignature(signature: SignatureLike): string {\n signature = splitSignature(signature);\n\n return hexlify(concat([\n signature.r,\n signature.s,\n (signature.recoveryParam ? \"0x1c\": \"0x1b\")\n ]));\n}\n\n","export const version = \"bignumber/5.0.10\";\n","\"use strict\";\n\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 */\n\nimport _BN from \"bn.js\";\nimport BN = _BN.BN;\n\nimport { Bytes, Hexable, hexlify, isBytes, isHexString } from \"@ethersproject/bytes\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nconst _constructorGuard = { };\n\nconst MAX_SAFE = 0x1fffffffffffff;\n\n\nexport type BigNumberish = BigNumber | Bytes | string | number;\n\nexport function isBigNumberish(value: any): value is BigNumberish {\n return (value != null) && (\n 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}\n\nexport class BigNumber implements Hexable {\n readonly _hex: string;\n readonly _isBigNumber: boolean;\n\n constructor(constructorGuard: any, hex: string) {\n logger.checkNew(new.target, BigNumber);\n\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\n this._hex = hex;\n this._isBigNumber = true;\n\n Object.freeze(this);\n }\n\n fromTwos(value: number): BigNumber {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n\n toTwos(value: number): BigNumber {\n return toBigNumber(toBN(this).toTwos(value));\n }\n\n abs(): BigNumber {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n\n add(other: BigNumberish): BigNumber {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n\n sub(other: BigNumberish): BigNumber {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n\n div(other: BigNumberish): BigNumber {\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\n mul(other: BigNumberish): BigNumber {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n\n mod(other: BigNumberish): BigNumber {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot modulo negative values\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n\n pow(other: BigNumberish): BigNumber {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot raise to negative values\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n\n and(other: BigNumberish): BigNumber {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'and' negative values\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n\n or(other: BigNumberish): BigNumber {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'or' negative values\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n\n xor(other: BigNumberish): BigNumber {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'xor' negative values\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n\n mask(value: number): BigNumber {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot mask negative values\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n\n shl(value: number): BigNumber {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n\n shr(value: number): BigNumber {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n\n eq(other: BigNumberish): boolean {\n return toBN(this).eq(toBN(other));\n }\n\n lt(other: BigNumberish): boolean {\n return toBN(this).lt(toBN(other));\n }\n\n lte(other: BigNumberish): boolean {\n return toBN(this).lte(toBN(other));\n }\n\n gt(other: BigNumberish): boolean {\n return toBN(this).gt(toBN(other));\n }\n\n gte(other: BigNumberish): boolean {\n return toBN(this).gte(toBN(other));\n }\n\n isNegative(): boolean {\n return (this._hex[0] === \"-\");\n }\n\n isZero(): boolean {\n return toBN(this).isZero();\n }\n\n toNumber(): number {\n try {\n return toBN(this).toNumber();\n } catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n return null;\n }\n\n toString(): string {\n // Lots of people expect this, which we do not support, so check\n if (arguments.length !== 0) {\n logger.throwError(\"bigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, { });\n }\n return toBN(this).toString(10);\n }\n\n toHexString(): string {\n return this._hex;\n }\n\n toJSON(key?: string): any {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n\n static from(value: any): BigNumber {\n if (value instanceof BigNumber) { 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\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n\n if (typeof(value) === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n\n return BigNumber.from(String(value));\n }\n\n const anyValue = value;\n\n if (typeof(anyValue) === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n\n if (anyValue) {\n\n // Hexable interface (takes piority)\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\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\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\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n\n static isBigNumber(value: any): value is BigNumber {\n return !!(value && value._isBigNumber);\n }\n}\n\n// Normalize the hex string\nfunction toHex(value: string | BN): string {\n\n // For BN, call on the hex string\n if (typeof(value) !== \"string\") {\n return toHex(value.toString(16));\n }\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\n // Cannot have mulitple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") { logger.throwArgumentError(\"invalid hex\", \"value\", value); }\n\n // Call toHex on the positive component\n value = toHex(value);\n\n // Do not allow \"-0x00\"\n if (value === \"0x00\") { return value; }\n\n // Negate the value\n return \"-\" + value;\n }\n\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") { value = \"0x\" + value; }\n\n // Normalize zero\n if (value === \"0x\") { return \"0x00\"; }\n\n // Make the string even length\n if (value.length % 2) { 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\n return value;\n}\n\nfunction toBigNumber(value: BN): BigNumber {\n return BigNumber.from(toHex(value));\n}\n\nfunction toBN(value: BigNumberish): BN {\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}\n\nfunction throwFault(fault: string, operation: string, value?: any): never {\n const params: any = { fault: fault, operation: operation };\n if (value != null) { params.value = value; }\n\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n\n// value should have no prefix\nexport function _base36To16(value: string): string {\n return (new BN(value, 36)).toString(16);\n}\n\n// value should have no prefix\nexport function _base16To36(value: string): string {\n return (new BN(value, 16)).toString(36);\n}\n","\"use strict\";\n\nimport { arrayify, BytesLike, hexZeroPad, isBytes } from \"@ethersproject/bytes\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { BigNumber, BigNumberish, isBigNumberish } from \"./bignumber\";\n\nconst _constructorGuard = { };\n\nconst Zero = BigNumber.from(0);\nconst NegativeOne = BigNumber.from(-1);\n\nfunction throwFault(message: string, fault: string, operation: string, value?: any): never {\n const params: any = { fault: fault, operation: operation };\n if (value !== undefined) { params.value = value; }\n return logger.throwError(message, Logger.errors.NUMERIC_FAULT, params);\n}\n\n// Constant to pull zeros from for multipliers\nlet zeros = \"0\";\nwhile (zeros.length < 256) { zeros += zeros; }\n\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getMultiplier(decimals: BigNumberish): string {\n\n if (typeof(decimals) !== \"number\") {\n try {\n decimals = BigNumber.from(decimals).toNumber();\n } catch (e) { }\n }\n\n if (typeof(decimals) === \"number\" && decimals >= 0 && decimals <= 256 && !(decimals % 1)) {\n return (\"1\" + zeros.substring(0, decimals));\n }\n\n return logger.throwArgumentError(\"invalid decimal size\", \"decimals\", decimals);\n}\n\nexport function formatFixed(value: BigNumberish, decimals?: string | BigNumberish): string {\n if (decimals == null) { decimals = 0; }\n const multiplier = getMultiplier(decimals);\n\n // Make sure wei is a big number (convert as necessary)\n value = BigNumber.from(value);\n\n const negative = value.lt(Zero);\n if (negative) { value = value.mul(NegativeOne); }\n\n let fraction = value.mod(multiplier).toString();\n while (fraction.length < multiplier.length - 1) { fraction = \"0\" + fraction; }\n\n // Strip training 0\n fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1];\n\n const whole = value.div(multiplier).toString();\n\n value = whole + \".\" + fraction;\n\n if (negative) { value = \"-\" + value; }\n\n return value;\n}\n\nexport function parseFixed(value: string, decimals?: BigNumberish): BigNumber {\n if (decimals == null) { decimals = 0; }\n const multiplier = getMultiplier(decimals);\n\n if (typeof(value) !== \"string\" || !value.match(/^-?[0-9.,]+$/)) {\n logger.throwArgumentError(\"invalid decimal value\", \"value\", value);\n }\n\n if (multiplier.length - 1 === 0) {\n return BigNumber.from(value);\n }\n\n // Is it negative?\n const negative = (value.substring(0, 1) === \"-\");\n if (negative) { value = value.substring(1); }\n\n if (value === \".\") {\n logger.throwArgumentError(\"missing value\", \"value\", value);\n }\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\n let whole = comps[0], fraction = comps[1];\n if (!whole) { whole = \"0\"; }\n if (!fraction) { fraction = \"0\"; }\n\n // Prevent underflow\n if (fraction.length > multiplier.length - 1) {\n throwFault(\"fractional component exceeds decimals\", \"underflow\", \"parseFixed\");\n }\n\n // Fully pad the string with zeros to get to wei\n while (fraction.length < multiplier.length - 1) { fraction += \"0\"; }\n\n const wholeValue = BigNumber.from(whole);\n const fractionValue = BigNumber.from(fraction);\n\n let wei = (wholeValue.mul(multiplier)).add(fractionValue);\n\n if (negative) { wei = wei.mul(NegativeOne); }\n\n return wei;\n}\n\nexport class FixedFormat {\n readonly signed: boolean;\n readonly width: number;\n readonly decimals: number;\n readonly name: string;\n readonly _multiplier: string;\n\n constructor(constructorGuard: any, signed: boolean, width: number, decimals: number) {\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\n this.signed = signed;\n this.width = width;\n this.decimals = decimals;\n\n this.name = (signed ? \"\": \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n\n this._multiplier = getMultiplier(decimals);\n\n Object.freeze(this);\n }\n\n static from(value: any): FixedFormat {\n if (value instanceof FixedFormat) { return value; }\n\n let signed = true;\n let width = 128;\n let decimals = 18;\n\n if (typeof(value) === \"string\") {\n if (value === \"fixed\") {\n // defaults...\n } else if (value === \"ufixed\") {\n signed = false;\n } else if (value != null) {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n if (!match) { logger.throwArgumentError(\"invalid fixed format\", \"format\", value); }\n signed = (match[1] !== \"u\");\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n } else if (value) {\n const check = (key: string, type: string, defaultValue: any): any => {\n if (value[key] == null) { return defaultValue; }\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\n if (width % 8) {\n logger.throwArgumentError(\"invalid fixed format width (not byte aligned)\", \"format.width\", width);\n }\n\n if (decimals > 80) {\n logger.throwArgumentError(\"invalid fixed format (decimals too large)\", \"format.decimals\", decimals);\n }\n\n return new FixedFormat(_constructorGuard, signed, width, decimals);\n }\n}\n\nexport class FixedNumber {\n readonly format: FixedFormat;\n readonly _hex: string;\n readonly _value: string;\n\n readonly _isFixedNumber: boolean;\n\n constructor(constructorGuard: any, hex: string, value: string, format?: FixedFormat) {\n logger.checkNew(new.target, FixedNumber);\n\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\n this.format = format;\n this._hex = hex;\n this._value = value;\n\n this._isFixedNumber = true;\n\n Object.freeze(this);\n }\n\n _checkFormat(other: FixedNumber): void {\n if (this.format.name !== other.format.name) {\n logger.throwArgumentError(\"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n }\n\n addUnsafe(other: FixedNumber): FixedNumber {\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\n subUnsafe(other: FixedNumber): FixedNumber {\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\n mulUnsafe(other: FixedNumber): FixedNumber {\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\n divUnsafe(other: FixedNumber): FixedNumber {\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\n floor(): FixedNumber {\n let comps = this.toString().split(\".\");\n\n let result = FixedNumber.from(comps[0], this.format);\n\n const hasFraction = !comps[1].match(/^(0*)$/);\n if (this.isNegative() && hasFraction) {\n result = result.subUnsafe(ONE);\n }\n\n return result;\n }\n\n ceiling(): FixedNumber {\n let comps = this.toString().split(\".\");\n\n let result = FixedNumber.from(comps[0], this.format);\n\n const hasFraction = !comps[1].match(/^(0*)$/);\n if (!this.isNegative() && hasFraction) {\n result = result.addUnsafe(ONE);\n }\n\n return result;\n }\n\n // @TODO: Support other rounding algorithms\n round(decimals?: number): FixedNumber {\n if (decimals == null) { decimals = 0; }\n\n // If we are already in range, we're done\n let comps = this.toString().split(\".\");\n\n if (decimals < 0 || decimals > 80 || (decimals % 1)) {\n logger.throwArgumentError(\"invalid decimal count\", \"decimals\", decimals);\n }\n\n if (comps[1].length <= decimals) { return this; }\n\n const factor = FixedNumber.from(\"1\" + zeros.substring(0, decimals));\n return this.mulUnsafe(factor).addUnsafe(BUMP).floor().divUnsafe(factor);\n }\n\n isZero(): boolean {\n return (this._value === \"0.0\");\n }\n\n isNegative(): boolean {\n return (this._value[0] === \"-\");\n }\n\n toString(): string { return this._value; }\n\n toHexString(width?: number): string {\n if (width == null) { return this._hex; }\n if (width % 8) { logger.throwArgumentError(\"invalid byte width\", \"width\", width); }\n const hex = BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();\n return hexZeroPad(hex, width / 8);\n }\n\n toUnsafeFloat(): number { return parseFloat(this.toString()); }\n\n toFormat(format: FixedFormat | string): FixedNumber {\n return FixedNumber.fromString(this._value, format);\n }\n\n\n static fromValue(value: BigNumber, decimals?: BigNumberish, format?: FixedFormat | string): FixedNumber {\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\n if (decimals == null) { decimals = 0; }\n if (format == null) { format = \"fixed\"; }\n\n return FixedNumber.fromString(formatFixed(value, decimals), FixedFormat.from(format));\n }\n\n\n static fromString(value: string, format?: FixedFormat | string): FixedNumber {\n if (format == null) { format = \"fixed\"; }\n\n const fixedFormat = FixedFormat.from(format);\n\n const numeric = parseFixed(value, fixedFormat.decimals);\n\n if (!fixedFormat.signed && numeric.lt(Zero)) {\n throwFault(\"unsigned value cannot be negative\", \"overflow\", \"value\", value);\n }\n\n let hex: string = null;\n if (fixedFormat.signed) {\n hex = numeric.toTwos(fixedFormat.width).toHexString();\n } else {\n hex = numeric.toHexString();\n hex = hexZeroPad(hex, fixedFormat.width / 8);\n }\n\n const decimal = formatFixed(numeric, fixedFormat.decimals);\n\n return new FixedNumber(_constructorGuard, hex, decimal, fixedFormat);\n }\n\n static fromBytes(value: BytesLike, format?: FixedFormat | string): FixedNumber {\n if (format == null) { format = \"fixed\"; }\n\n const fixedFormat = FixedFormat.from(format);\n\n if (arrayify(value).length > fixedFormat.width / 8) {\n throw new Error(\"overflow\");\n }\n\n let numeric = BigNumber.from(value);\n if (fixedFormat.signed) { 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\n return new FixedNumber(_constructorGuard, hex, decimal, fixedFormat);\n }\n\n static from(value: any, format?: FixedFormat | string) {\n if (typeof(value) === \"string\") {\n return FixedNumber.fromString(value, format);\n }\n\n if (isBytes(value)) {\n return FixedNumber.fromBytes(value, format);\n }\n\n try {\n return FixedNumber.fromValue(value, 0, format);\n } catch (error) {\n // Allow NUMERIC_FAULT to bubble up\n if (error.code !== Logger.errors.INVALID_ARGUMENT) {\n throw error;\n }\n }\n\n return logger.throwArgumentError(\"invalid FixedNumber value\", \"value\", value);\n }\n\n static isFixedNumber(value: any): value is FixedNumber {\n return !!(value && value._isFixedNumber);\n }\n}\n\nconst ONE = FixedNumber.from(1);\nconst BUMP = FixedNumber.from(\"0.5\");\n","export { BigNumber, BigNumberish } from \"./bignumber\";\nexport { formatFixed, FixedFormat, FixedNumber, parseFixed } from \"./fixednumber\";\n\n// Internal methods used by address\nexport { _base16To36, _base36To16 } from \"./bignumber\";\n","export const version = \"properties/5.0.5\";\n","\"use strict\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nexport function defineReadOnly(object: T, name: K, value: T[K]): void {\n Object.defineProperty(object, name, {\n enumerable: true,\n value: value,\n writable: false,\n });\n}\n\n// Crawl up the constructor chain to find a static method\nexport function getStatic(ctor: any, key: string): T {\n for (let i = 0; i < 32; i++) {\n if (ctor[key]) { return ctor[key]; }\n if (!ctor.prototype || typeof(ctor.prototype) !== \"object\") { break; }\n ctor = Object.getPrototypeOf(ctor.prototype).constructor;\n }\n return null;\n}\n\nexport type Deferrable = {\n [ K in keyof T ]: T[K] | Promise;\n}\n\n\ntype Result = { key: string, value: any};\n\nexport async function resolveProperties(object: Readonly>): Promise {\n const promises: Array> = Object.keys(object).map((key) => {\n const value = object[>key];\n return Promise.resolve(value).then((v) => ({ key: key, value: v }));\n });\n\n const results = await Promise.all(promises);\n\n return results.reduce((accum, result) => {\n accum[(result.key)] = result.value;\n return accum;\n }, { });\n}\n\nexport function checkProperties(object: any, properties: { [ name: string ]: boolean }): void {\n if (!object || typeof(object) !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\n\nexport function shallowCopy(object: T): T {\n const result: any = {};\n for (const key in object) { result[key] = object[key]; }\n return result;\n}\n\nconst opaque: { [key: string]: boolean } = { bigint: true, boolean: true, \"function\": true, number: true, string: true };\n\nfunction _isFrozen(object: any): boolean {\n\n // Opaque objects are not mutable, so safe to copy by assignment\n if (object === undefined || object === null || opaque[typeof(object)]) { return true; }\n\n if (Array.isArray(object) || typeof(object) === \"object\") {\n if (!Object.isFrozen(object)) { return false; }\n\n const keys = Object.keys(object);\n for (let i = 0; i < keys.length; i++) {\n if (!_isFrozen(object[keys[i]])) { return false; }\n }\n\n return true;\n }\n\n return logger.throwArgumentError(`Cannot deepCopy ${ typeof(object) }`, \"object\", object);\n}\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: any): any {\n\n if (_isFrozen(object)) { 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\n if (typeof(object) === \"object\") {\n const result: { [ key: string ]: any } = {};\n for (const key in object) {\n const value = object[key];\n if (value === undefined) { continue; }\n defineReadOnly(result, key, deepCopy(value));\n }\n\n return result;\n }\n\n return logger.throwArgumentError(`Cannot deepCopy ${ typeof(object) }`, \"object\", object);\n}\n\nexport function deepCopy(object: T): T {\n return _deepCopy(object);\n}\n\nexport class Description {\n constructor(info: { [ K in keyof T ]: T[K] }) {\n for (const key in info) {\n (this)[key] = deepCopy(info[key]);\n }\n }\n}\n","export const version = \"abi/5.0.8\";\n","\"use strict\";\n\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nexport interface JsonFragmentType {\n name?: string;\n indexed?: boolean;\n type?: string;\n components?: Array;\n}\n\nexport interface JsonFragment {\n name?: string;\n type?: string;\n\n anonymous?: boolean;\n\n payable?: boolean;\n constant?: boolean;\n stateMutability?: string;\n\n inputs?: Array;\n outputs?: Array;\n\n gas?: string;\n};\n\n\nconst _constructorGuard = { };\n\n// AST Node parser state\ntype ParseState = {\n allowArray?: boolean,\n allowName?: boolean,\n allowParams?: boolean,\n allowType?: boolean,\n readArray?: boolean,\n};\n\n// AST Node\ntype ParseNode = {\n parent?: any,\n type?: string,\n name?: string,\n state?: ParseState,\n indexed?: boolean,\n components?: Array\n};\n\nlet ModifiersBytes: { [ name: string ]: boolean } = { calldata: true, memory: true, storage: true };\nlet ModifiersNest: { [ name: string ]: boolean } = { calldata: true, memory: true };\nfunction checkModifier(type: string, name: string): boolean {\n if (type === \"bytes\" || type === \"string\") {\n if (ModifiersBytes[name]) { return true; }\n } else if (type === \"address\") {\n if (name === \"payable\") { return true; }\n } else if (type.indexOf(\"[\") >= 0 || type === \"tuple\") {\n if (ModifiersNest[name]) { return true; }\n }\n if (ModifiersBytes[name] || name === \"payable\") {\n logger.throwArgumentError(\"invalid modifier\", \"name\", name);\n }\n return false;\n}\n\n// @TODO: Make sure that children of an indexed tuple are marked with a null indexed\nfunction parseParamType(param: string, allowIndexed: boolean): ParseNode {\n\n let originalParam = param;\n function throwError(i: number) {\n logger.throwArgumentError(`unexpected character at position ${ i }`, \"param\", param);\n }\n param = param.replace(/\\s/g, \" \");\n\n function newNode(parent: ParseNode): ParseNode {\n let node: ParseNode = { type: \"\", name: \"\", parent: parent, state: { allowType: true } };\n if (allowIndexed) { node.indexed = false; }\n return node\n }\n\n let parent: ParseNode = { type: \"\", name: \"\", state: { allowType: true } };\n let node = parent;\n\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 } 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\n case \")\":\n delete node.state;\n\n if (node.name === \"indexed\") {\n if (!allowIndexed) { throwError(i); }\n node.indexed = true;\n node.name = \"\";\n }\n\n if (checkModifier(node.type, node.name)) { node.name = \"\"; }\n\n node.type = verifyType(node.type);\n\n let child = node;\n node = node.parent;\n if (!node) { throwError(i); }\n delete child.parent;\n node.state.allowParams = false;\n node.state.allowName = true;\n node.state.allowArray = true;\n break;\n\n case \",\":\n delete node.state;\n\n if (node.name === \"indexed\") {\n if (!allowIndexed) { throwError(i); }\n node.indexed = true;\n node.name = \"\";\n }\n\n if (checkModifier(node.type, node.name)) { node.name = \"\"; }\n\n node.type = verifyType(node.type);\n\n let sibling: ParseNode = 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\n // Hit a space...\n case \" \":\n\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\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) { throwError(i); }\n if (node.indexed) { throwError(i); }\n node.indexed = true;\n node.name = \"\";\n } else if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n } else {\n node.state.allowName = false;\n }\n }\n }\n\n break;\n\n case \"[\":\n if (!node.state.allowArray) { throwError(i); }\n\n node.type += c;\n\n node.state.allowArray = false;\n node.state.allowName = false;\n node.state.readArray = true;\n break;\n\n case \"]\":\n if (!node.state.readArray) { throwError(i); }\n\n node.type += c;\n\n node.state.readArray = false;\n node.state.allowArray = true;\n node.state.allowName = true;\n break;\n\n default:\n if (node.state.allowType) {\n node.type += c;\n node.state.allowParams = true;\n node.state.allowArray = true;\n } else if (node.state.allowName) {\n node.name += c;\n delete node.state.allowArray;\n } else if (node.state.readArray) {\n node.type += c;\n } else {\n throwError(i);\n }\n }\n }\n\n if (node.parent) { logger.throwArgumentError(\"unexpected eof\", \"param\", param); }\n\n delete parent.state;\n\n if (node.name === \"indexed\") {\n if (!allowIndexed) { throwError(originalParam.length - 7); }\n if (node.indexed) { throwError(originalParam.length - 7); }\n node.indexed = true;\n node.name = \"\";\n } else if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n\n parent.type = verifyType(parent.type);\n\n return parent;\n}\n\nfunction populate(object: any, params: any) {\n for (let key in params) { defineReadOnly(object, key, params[key]); }\n}\n\nexport const FormatTypes: { [ name: string ]: string } = Object.freeze({\n // Bare formatting, as is needed for computing a sighash of an event or function\n sighash: \"sighash\",\n\n // Human-Readable with Minimal spacing and without names (compact human-readable)\n minimal: \"minimal\",\n\n // Human-Readble with nice spacing, including all names\n full: \"full\",\n\n // JSON-format a la Solidity\n json: \"json\"\n});\n\nconst paramTypeArray = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\n\nexport class ParamType {\n\n // The local name of the parameter (of null if unbound)\n readonly name: string;\n\n // The fully qualified type (e.g. \"address\", \"tuple(address)\", \"uint256[3][]\"\n readonly type: string;\n\n // The base type (e.g. \"address\", \"tuple\", \"array\")\n readonly baseType: string;\n\n // Indexable Paramters ONLY (otherwise null)\n readonly indexed: boolean;\n\n // Tuples ONLY: (otherwise null)\n // - sub-components\n readonly components: Array;\n\n // Arrays ONLY: (otherwise null)\n // - length of the array (-1 for dynamic length)\n // - child type\n readonly arrayLength: number;\n readonly arrayChildren: ParamType;\n\n readonly _isParamType: boolean;\n\n constructor(constructorGuard: any, params: any) {\n if (constructorGuard !== _constructorGuard) { logger.throwError(\"use fromString\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new ParamType()\"\n }); }\n populate(this, params);\n\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 } else {\n populate(this, {\n arrayLength: null,\n arrayChildren: null,\n baseType: ((this.components != null) ? \"tuple\": this.type)\n });\n }\n\n this._isParamType = true;\n\n Object.freeze(this);\n }\n\n // Format the parameter fragment\n // - sighash: \"(uint256,address)\"\n // - minimal: \"tuple(uint256,address) indexed\"\n // - full: \"tuple(uint256 foo, addres bar) indexed baz\"\n format(format?: string): string {\n if (!format) { format = FormatTypes.sighash; }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n\n if (format === FormatTypes.json) {\n let result: any = {\n type: ((this.baseType === \"tuple\") ? \"tuple\": this.type),\n name: (this.name || undefined)\n };\n if (typeof(this.indexed) === \"boolean\") { result.indexed = this.indexed; }\n if (this.components) {\n result.components = this.components.map((comp) => JSON.parse(comp.format(format)));\n }\n return JSON.stringify(result);\n }\n\n let result = \"\";\n\n // Array\n if (this.baseType === \"array\") {\n result += this.arrayChildren.format(format);\n result += \"[\" + (this.arrayLength < 0 ? \"\": String(this.arrayLength)) + \"]\";\n } else {\n if (this.baseType === \"tuple\") {\n if (format !== FormatTypes.sighash) {\n result += this.type;\n }\n result += \"(\" + this.components.map(\n (comp) => comp.format(format)\n ).join((format === FormatTypes.full) ? \", \": \",\") + \")\";\n } else {\n result += this.type;\n }\n }\n\n if (format !== FormatTypes.sighash) {\n if (this.indexed === true) { result += \" indexed\"; }\n if (format === FormatTypes.full && this.name) {\n result += \" \" + this.name;\n }\n }\n\n return result;\n }\n\n static from(value: string | JsonFragmentType | ParamType, allowIndexed?: boolean): ParamType {\n if (typeof(value) === \"string\") {\n return ParamType.fromString(value, allowIndexed);\n }\n return ParamType.fromObject(value);\n }\n\n static fromObject(value: JsonFragmentType | ParamType): ParamType {\n if (ParamType.isParamType(value)) { 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\n static fromString(value: string, allowIndexed?: boolean): ParamType {\n function ParamTypify(node: ParseNode): ParamType {\n return ParamType.fromObject({\n name: node.name,\n type: node.type,\n indexed: node.indexed,\n components: node.components\n });\n }\n\n return ParamTypify(parseParamType(value, !!allowIndexed));\n }\n\n static isParamType(value: any): value is ParamType {\n return !!(value != null && value._isParamType);\n }\n};\n\nfunction parseParams(value: string, allowIndex: boolean): Array {\n return splitNesting(value).map((param) => ParamType.fromString(param, allowIndex));\n}\n\ntype TypeCheck = { -readonly [ K in keyof T ]: T[K] };\n\ninterface _Fragment {\n readonly type: string;\n readonly name: string;\n readonly inputs: Array;\n}\n\nexport abstract class Fragment {\n\n readonly type: string;\n readonly name: string;\n readonly inputs: Array;\n\n readonly _isFragment: boolean;\n\n constructor(constructorGuard: any, params: any) {\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\n this._isFragment = true;\n\n Object.freeze(this);\n }\n\n abstract format(format?: string): string;\n\n static from(value: Fragment | JsonFragment | string): Fragment {\n if (Fragment.isFragment(value)) { return value; }\n\n if (typeof(value) === \"string\") {\n return Fragment.fromString(value);\n }\n\n return Fragment.fromObject(value);\n }\n\n static fromObject(value: Fragment | JsonFragment): Fragment {\n if (Fragment.isFragment(value)) { 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 \"fallback\":\n case \"receive\":\n // @TODO: Something? Maybe return a FunctionFragment? A custom DefaultFunctionFragment?\n return null;\n }\n\n return logger.throwArgumentError(\"invalid fragment object\", \"value\", value);\n }\n\n static fromString(value: string): Fragment {\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\n if (value.split(\" \")[0] === \"event\") {\n return EventFragment.fromString(value.substring(5).trim());\n } else if (value.split(\" \")[0] === \"function\") {\n return FunctionFragment.fromString(value.substring(8).trim());\n } else if (value.split(\"(\")[0].trim() === \"constructor\") {\n return ConstructorFragment.fromString(value.trim());\n }\n\n return logger.throwArgumentError(\"unsupported fragment\", \"value\", value);\n }\n\n static isFragment(value: any): value is Fragment {\n return !!(value && value._isFragment);\n }\n}\n\ninterface _EventFragment extends _Fragment {\n readonly anonymous: boolean;\n}\n\nexport class EventFragment extends Fragment {\n readonly anonymous: boolean;\n\n format(format?: string): string {\n if (!format) { format = FormatTypes.sighash; }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\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\n let result = \"\";\n\n if (format !== FormatTypes.sighash) {\n result += \"event \";\n }\n\n result += this.name + \"(\" + this.inputs.map(\n (input) => input.format(format)\n ).join((format === FormatTypes.full) ? \", \": \",\") + \") \";\n\n if (format !== FormatTypes.sighash) {\n if (this.anonymous) {\n result += \"anonymous \";\n }\n }\n\n return result.trim();\n }\n\n static from(value: EventFragment | JsonFragment | string): EventFragment {\n if (typeof(value) === \"string\") {\n return EventFragment.fromString(value);\n }\n return EventFragment.fromObject(value);\n }\n\n static fromObject(value: JsonFragment | EventFragment): EventFragment {\n if (EventFragment.isEventFragment(value)) { return value; }\n\n if (value.type !== \"event\") {\n logger.throwArgumentError(\"invalid event object\", \"value\", value);\n }\n\n const params: TypeCheck<_EventFragment> = {\n name: verifyIdentifier(value.name),\n anonymous: value.anonymous,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n type: \"event\"\n };\n\n return new EventFragment(_constructorGuard, params);\n }\n\n static fromString(value: string): EventFragment {\n\n let match = value.match(regexParen);\n if (!match) {\n logger.throwArgumentError(\"invalid event string\", \"value\", value);\n }\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\n return EventFragment.fromObject({\n name: match[1].trim(),\n anonymous: anonymous,\n inputs: parseParams(match[2], true),\n type: \"event\"\n });\n }\n\n static isEventFragment(value: any): value is EventFragment {\n return (value && value._isFragment && value.type === \"event\");\n }\n}\n\nfunction parseGas(value: string, params: any): string {\n params.gas = null;\n\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\n return value;\n}\n\nfunction parseModifiers(value: string, params: any): void {\n params.constant = false;\n params.payable = false;\n params.stateMutability = \"nonpayable\";\n\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}\n\ntype StateInputValue = {\n constant?: boolean;\n payable?: boolean;\n stateMutability?: string;\n type?: string;\n};\n\ntype StateOutputValue = {\n constant: boolean;\n payable: boolean;\n stateMutability: string;\n};\n\nfunction verifyState(value: StateInputValue): StateOutputValue {\n let result: any = {\n constant: false,\n payable: true,\n stateMutability: \"payable\"\n };\n\n if (value.stateMutability != null) {\n result.stateMutability = value.stateMutability;\n\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\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\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\n result.constant = !!value.constant;\n\n if (result.constant) {\n result.stateMutability = \"view\";\n } else {\n result.stateMutability = (result.payable ? \"payable\": \"nonpayable\");\n }\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\n return result;\n}\n\ninterface _ConstructorFragment extends _Fragment {\n stateMutability: string;\n payable: boolean;\n gas?: BigNumber;\n}\n\nexport class ConstructorFragment extends Fragment {\n stateMutability: string;\n payable: boolean;\n gas?: BigNumber;\n\n format(format?: string): string {\n if (!format) { format = FormatTypes.sighash; }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: ((this.stateMutability !== \"nonpayable\") ? this.stateMutability: undefined),\n payble: this.payable,\n gas: (this.gas ? this.gas.toNumber(): undefined),\n inputs: this.inputs.map((input) => JSON.parse(input.format(format)))\n });\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\n let result = \"constructor(\" + this.inputs.map(\n (input) => input.format(format)\n ).join((format === FormatTypes.full) ? \", \": \",\") + \") \";\n\n if (this.stateMutability && this.stateMutability !== \"nonpayable\") {\n result += this.stateMutability + \" \";\n }\n\n return result.trim();\n }\n\n static from(value: ConstructorFragment | JsonFragment | string): ConstructorFragment {\n if (typeof(value) === \"string\") {\n return ConstructorFragment.fromString(value);\n }\n return ConstructorFragment.fromObject(value);\n }\n\n static fromObject(value: ConstructorFragment | JsonFragment): ConstructorFragment {\n if (ConstructorFragment.isConstructorFragment(value)) { return value; }\n\n if (value.type !== \"constructor\") {\n logger.throwArgumentError(\"invalid constructor object\", \"value\", value);\n }\n\n let state = verifyState(value);\n if (state.constant) {\n logger.throwArgumentError(\"constructor cannot be constant\", \"value\", value);\n }\n\n const params: TypeCheck<_ConstructorFragment> = {\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\n return new ConstructorFragment(_constructorGuard, params);\n }\n\n static fromString(value: string): ConstructorFragment {\n let params: any = { type: \"constructor\" };\n\n value = parseGas(value, params);\n\n let parens = value.match(regexParen);\n if (!parens || parens[1].trim() !== \"constructor\") {\n logger.throwArgumentError(\"invalid constructor string\", \"value\", value);\n }\n\n params.inputs = parseParams(parens[2].trim(), false);\n\n parseModifiers(parens[3].trim(), params);\n\n return ConstructorFragment.fromObject(params);\n }\n\n static isConstructorFragment(value: any): value is ConstructorFragment {\n return (value && value._isFragment && value.type === \"constructor\");\n }\n}\n\ninterface _FunctionFragment extends _ConstructorFragment {\n constant: boolean;\n outputs?: Array;\n}\n\nexport class FunctionFragment extends ConstructorFragment {\n constant: boolean;\n outputs?: Array;\n\n format(format?: string): string {\n if (!format) { format = FormatTypes.sighash; }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\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 payble: this.payable,\n gas: (this.gas ? this.gas.toNumber(): undefined),\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n ouputs: this.outputs.map((output) => JSON.parse(output.format(format))),\n });\n }\n\n let result = \"\";\n\n if (format !== FormatTypes.sighash) {\n result += \"function \";\n }\n\n result += this.name + \"(\" + this.inputs.map(\n (input) => input.format(format)\n ).join((format === FormatTypes.full) ? \", \": \",\") + \") \";\n\n if (format !== FormatTypes.sighash) {\n if (this.stateMutability) {\n if (this.stateMutability !== \"nonpayable\") {\n result += (this.stateMutability + \" \");\n }\n } else if (this.constant) {\n result += \"view \";\n }\n\n if (this.outputs && this.outputs.length) {\n result += \"returns (\" + this.outputs.map(\n (output) => output.format(format)\n ).join(\", \") + \") \";\n }\n\n if (this.gas != null) {\n result += \"@\" + this.gas.toString() + \" \";\n }\n }\n\n return result.trim();\n }\n\n static from(value: FunctionFragment | JsonFragment | string): FunctionFragment {\n if (typeof(value) === \"string\") {\n return FunctionFragment.fromString(value);\n }\n return FunctionFragment.fromObject(value);\n }\n\n static fromObject(value: FunctionFragment | JsonFragment): FunctionFragment {\n if (FunctionFragment.isFunctionFragment(value)) { return value; }\n\n if (value.type !== \"function\") {\n logger.throwArgumentError(\"invalid function object\", \"value\", value);\n }\n\n let state = verifyState(value);\n\n const params: TypeCheck<_FunctionFragment> = {\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\n return new FunctionFragment(_constructorGuard, params);\n }\n\n static fromString(value: string): FunctionFragment {\n let params: any = { type: \"function\" };\n value = parseGas(value, params);\n\n let comps = value.split(\" returns \");\n if (comps.length > 2) {\n logger.throwArgumentError(\"invalid function string\", \"value\", value);\n }\n\n let parens = comps[0].match(regexParen);\n if (!parens) {\n logger.throwArgumentError(\"invalid function signature\", \"value\", value);\n }\n\n params.name = parens[1].trim();\n if (params.name) { verifyIdentifier(params.name); }\n\n params.inputs = parseParams(parens[2], false);\n\n parseModifiers(parens[3].trim(), params);\n\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 } else {\n params.outputs = [ ];\n }\n\n return FunctionFragment.fromObject(params);\n }\n\n static isFunctionFragment(value: any): value is FunctionFragment {\n return (value && value._isFragment && value.type === \"function\");\n }\n}\n\n//export class ErrorFragment extends Fragment {\n//}\n\n//export class StructFragment extends Fragment {\n//}\n\nfunction verifyType(type: string): string {\n\n // These need to be transformed to their full description\n if (type.match(/^uint($|[^1-9])/)) {\n type = \"uint256\" + type.substring(4);\n } else if (type.match(/^int($|[^1-9])/)) {\n type = \"int256\" + type.substring(3);\n }\n\n // @TODO: more verification\n\n return type;\n}\n\nconst regexIdentifier = new RegExp(\"^[A-Za-z_][A-Za-z0-9_]*$\");\nfunction verifyIdentifier(value: string): string {\n if (!value || !value.match(regexIdentifier)) {\n logger.throwArgumentError(`invalid identifier \"${ value }\"`, \"value\", value);\n }\n return value;\n}\n\nconst regexParen = new RegExp(\"^([^)(]*)\\\\((.*)\\\\)([^)(]*)$\");\n\nfunction splitNesting(value: string): Array {\n value = value.trim();\n\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 } else {\n accum += c;\n if (c === \"(\") {\n depth++;\n } else if (c === \")\") {\n depth--;\n if (depth === -1) {\n logger.throwArgumentError(\"unbalanced parenthesis\", \"value\", value);\n }\n }\n }\n }\n if (accum) { result.push(accum); }\n\n return result;\n}\n\n","\"use strict\";\n\nimport { arrayify, BytesLike, concat, hexConcat, hexlify } from \"@ethersproject/bytes\";\nimport { BigNumber, BigNumberish } from \"@ethersproject/bignumber\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"../_version\";\nconst logger = new Logger(version);\n\nexport interface Result extends ReadonlyArray {\n readonly [key: string]: any;\n}\n\nexport function checkResultErrors(result: Result): Array<{ path: Array, error: Error }> {\n // Find the first error (if any)\n const errors: Array<{ path: Array, error: Error }> = [ ];\n\n const checkErrors = function(path: Array, object: any): void {\n if (!Array.isArray(object)) { return; }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n\n try {\n checkErrors(childPath, object[key]);\n } catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n }\n checkErrors([ ], result);\n\n return errors;\n\n}\n\nexport type CoerceFunc = (type: string, value: any) => any;\n\nexport abstract class Coder {\n\n // The coder name:\n // - address, uint256, tuple, array, etc.\n readonly name: string;\n\n // The fully expanded type, including composite types:\n // - address, uint256, tuple(address,bytes), uint256[3][4][], etc.\n readonly type: string;\n\n // The localName bound in the signature, in this example it is \"baz\":\n // - tuple(address foo, uint bar) baz\n readonly localName: string;\n\n // Whether this type is dynamic:\n // - Dynamic: bytes, string, address[], tuple(boolean[]), etc.\n // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)\n readonly dynamic: boolean;\n\n constructor(name: string, type: string, localName: string, dynamic: boolean) {\n // @TODO: defineReadOnly these\n this.name = name;\n this.type = type;\n this.localName = localName;\n this.dynamic = dynamic;\n }\n\n _throwError(message: string, value: any): void {\n logger.throwArgumentError(message, this.localName, value);\n }\n\n abstract encode(writer: Writer, value: any): number;\n abstract decode(reader: Reader): any;\n}\n\nexport class Writer {\n readonly wordSize: number;\n\n _data: Array;\n _dataLength: number;\n _padding: Uint8Array;\n\n constructor(wordSize?: number) {\n defineReadOnly(this, \"wordSize\", wordSize || 32);\n this._data = [ ];\n this._dataLength = 0;\n this._padding = new Uint8Array(wordSize);\n }\n\n get data(): string {\n return hexConcat(this._data);\n }\n get length(): number { return this._dataLength; }\n\n _writeData(data: Uint8Array): number {\n this._data.push(data);\n this._dataLength += data.length;\n return data.length;\n }\n\n appendWriter(writer: Writer): number {\n return this._writeData(concat(writer._data));\n }\n\n // Arrayish items; padded on the right to wordSize\n writeBytes(value: BytesLike): number {\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\n _getValue(value: BigNumberish): Uint8Array {\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\n // BigNumberish items; padded on the left to wordSize\n writeValue(value: BigNumberish): number {\n return this._writeData(this._getValue(value));\n }\n\n writeUpdatableValue(): (value: BigNumberish) => void {\n const offset = this._data.length;\n this._data.push(this._padding);\n this._dataLength += this.wordSize;\n return (value: BigNumberish) => {\n this._data[offset] = this._getValue(value);\n };\n }\n}\n\nexport class Reader {\n readonly wordSize: number;\n readonly allowLoose: boolean;\n\n readonly _data: Uint8Array;\n readonly _coerceFunc: CoerceFunc;\n\n _offset: number;\n\n constructor(data: BytesLike, wordSize?: number, coerceFunc?: CoerceFunc, allowLoose?: boolean) {\n defineReadOnly(this, \"_data\", arrayify(data));\n defineReadOnly(this, \"wordSize\", wordSize || 32);\n defineReadOnly(this, \"_coerceFunc\", coerceFunc);\n defineReadOnly(this, \"allowLoose\", allowLoose);\n\n this._offset = 0;\n }\n\n get data(): string { return hexlify(this._data); }\n get consumed(): number { return this._offset; }\n\n // The default Coerce function\n static coerce(name: string, value: any): any {\n let match = name.match(\"^u?int([0-9]+)$\");\n if (match && parseInt(match[1]) <= 48) { value = value.toNumber(); }\n return value;\n }\n\n coerce(name: string, value: any): any {\n if (this._coerceFunc) { return this._coerceFunc(name, value); }\n return Reader.coerce(name, value);\n }\n\n _peekBytes(offset: number, length: number, loose?: boolean): Uint8Array {\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 } 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\n subReader(offset: number): Reader {\n return new Reader(this._data.slice(this._offset + offset), this.wordSize, this._coerceFunc, this.allowLoose);\n }\n\n readBytes(length: number, loose?: boolean): Uint8Array {\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\n readValue(): BigNumber {\n return BigNumber.from(this.readBytes(this.wordSize));\n }\n}\n","/**\r\n * [js-sha3]{@link https://github.com/emn178/js-sha3}\r\n *\r\n * @version 0.5.7\r\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\r\n * @copyright Chen, Yi-Cyuan 2015-2016\r\n * @license MIT\r\n */\r\n/*jslint bitwise: true */\r\n(function () {\r\n 'use strict';\r\n\r\n var root = typeof window === 'object' ? window : {};\r\n var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\r\n if (NODE_JS) {\r\n root = global;\r\n }\r\n var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && typeof module === 'object' && module.exports;\r\n var HEX_CHARS = '0123456789abcdef'.split('');\r\n var SHAKE_PADDING = [31, 7936, 2031616, 520093696];\r\n var KECCAK_PADDING = [1, 256, 65536, 16777216];\r\n var PADDING = [6, 1536, 393216, 100663296];\r\n var SHIFT = [0, 8, 16, 24];\r\n var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,\r\n 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,\r\n 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,\r\n 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,\r\n 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\r\n var BITS = [224, 256, 384, 512];\r\n var SHAKE_BITS = [128, 256];\r\n var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array'];\r\n\r\n var createOutputMethod = function (bits, padding, outputType) {\r\n return function (message) {\r\n return new Keccak(bits, padding, bits).update(message)[outputType]();\r\n };\r\n };\r\n\r\n var createShakeOutputMethod = function (bits, padding, outputType) {\r\n return function (message, outputBits) {\r\n return new Keccak(bits, padding, outputBits).update(message)[outputType]();\r\n };\r\n };\r\n\r\n var createMethod = function (bits, padding) {\r\n var method = createOutputMethod(bits, padding, 'hex');\r\n method.create = function () {\r\n return new Keccak(bits, padding, bits);\r\n };\r\n method.update = function (message) {\r\n return method.create().update(message);\r\n };\r\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\r\n var type = OUTPUT_TYPES[i];\r\n method[type] = createOutputMethod(bits, padding, type);\r\n }\r\n return method;\r\n };\r\n\r\n var createShakeMethod = function (bits, padding) {\r\n var method = createShakeOutputMethod(bits, padding, 'hex');\r\n method.create = function (outputBits) {\r\n return new Keccak(bits, padding, outputBits);\r\n };\r\n method.update = function (message, outputBits) {\r\n return method.create(outputBits).update(message);\r\n };\r\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\r\n var type = OUTPUT_TYPES[i];\r\n method[type] = createShakeOutputMethod(bits, padding, type);\r\n }\r\n return method;\r\n };\r\n\r\n var algorithms = [\r\n {name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod},\r\n {name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod},\r\n {name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod}\r\n ];\r\n\r\n var methods = {}, methodNames = [];\r\n\r\n for (var i = 0; i < algorithms.length; ++i) {\r\n var algorithm = algorithms[i];\r\n var bits = algorithm.bits;\r\n for (var j = 0; j < bits.length; ++j) {\r\n var methodName = algorithm.name +'_' + bits[j];\r\n methodNames.push(methodName);\r\n methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);\r\n }\r\n }\r\n\r\n function Keccak(bits, padding, outputBits) {\r\n this.blocks = [];\r\n this.s = [];\r\n this.padding = padding;\r\n this.outputBits = outputBits;\r\n this.reset = true;\r\n this.block = 0;\r\n this.start = 0;\r\n this.blockCount = (1600 - (bits << 1)) >> 5;\r\n this.byteCount = this.blockCount << 2;\r\n this.outputBlocks = outputBits >> 5;\r\n this.extraBytes = (outputBits & 31) >> 3;\r\n\r\n for (var i = 0; i < 50; ++i) {\r\n this.s[i] = 0;\r\n }\r\n }\r\n\r\n Keccak.prototype.update = function (message) {\r\n var notString = typeof message !== 'string';\r\n if (notString && message.constructor === ArrayBuffer) {\r\n message = new Uint8Array(message);\r\n }\r\n var length = message.length, blocks = this.blocks, byteCount = this.byteCount,\r\n blockCount = this.blockCount, index = 0, s = this.s, i, code;\r\n\r\n while (index < length) {\r\n if (this.reset) {\r\n this.reset = false;\r\n blocks[0] = this.block;\r\n for (i = 1; i < blockCount + 1; ++i) {\r\n blocks[i] = 0;\r\n }\r\n }\r\n if (notString) {\r\n for (i = this.start; index < length && i < byteCount; ++index) {\r\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\r\n }\r\n } else {\r\n for (i = this.start; index < length && i < byteCount; ++index) {\r\n code = message.charCodeAt(index);\r\n if (code < 0x80) {\r\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\r\n } else if (code < 0x800) {\r\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\r\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\r\n } else if (code < 0xd800 || code >= 0xe000) {\r\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\r\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\r\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\r\n } else {\r\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\r\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\r\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\r\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\r\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\r\n }\r\n }\r\n }\r\n this.lastByteIndex = i;\r\n if (i >= byteCount) {\r\n this.start = i - byteCount;\r\n this.block = blocks[blockCount];\r\n for (i = 0; i < blockCount; ++i) {\r\n s[i] ^= blocks[i];\r\n }\r\n f(s);\r\n this.reset = true;\r\n } else {\r\n this.start = i;\r\n }\r\n }\r\n return this;\r\n };\r\n\r\n Keccak.prototype.finalize = function () {\r\n var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;\r\n blocks[i >> 2] |= this.padding[i & 3];\r\n if (this.lastByteIndex === this.byteCount) {\r\n blocks[0] = blocks[blockCount];\r\n for (i = 1; i < blockCount + 1; ++i) {\r\n blocks[i] = 0;\r\n }\r\n }\r\n blocks[blockCount - 1] |= 0x80000000;\r\n for (i = 0; i < blockCount; ++i) {\r\n s[i] ^= blocks[i];\r\n }\r\n f(s);\r\n };\r\n\r\n Keccak.prototype.toString = Keccak.prototype.hex = function () {\r\n this.finalize();\r\n\r\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\r\n extraBytes = this.extraBytes, i = 0, j = 0;\r\n var hex = '', block;\r\n while (j < outputBlocks) {\r\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\r\n block = s[i];\r\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +\r\n HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +\r\n HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +\r\n HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];\r\n }\r\n if (j % blockCount === 0) {\r\n f(s);\r\n i = 0;\r\n }\r\n }\r\n if (extraBytes) {\r\n block = s[i];\r\n if (extraBytes > 0) {\r\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];\r\n }\r\n if (extraBytes > 1) {\r\n hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];\r\n }\r\n if (extraBytes > 2) {\r\n hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];\r\n }\r\n }\r\n return hex;\r\n };\r\n\r\n Keccak.prototype.arrayBuffer = function () {\r\n this.finalize();\r\n\r\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\r\n extraBytes = this.extraBytes, i = 0, j = 0;\r\n var bytes = this.outputBits >> 3;\r\n var buffer;\r\n if (extraBytes) {\r\n buffer = new ArrayBuffer((outputBlocks + 1) << 2);\r\n } else {\r\n buffer = new ArrayBuffer(bytes);\r\n }\r\n var array = new Uint32Array(buffer);\r\n while (j < outputBlocks) {\r\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\r\n array[j] = s[i];\r\n }\r\n if (j % blockCount === 0) {\r\n f(s);\r\n }\r\n }\r\n if (extraBytes) {\r\n array[i] = s[i];\r\n buffer = buffer.slice(0, bytes);\r\n }\r\n return buffer;\r\n };\r\n\r\n Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;\r\n\r\n Keccak.prototype.digest = Keccak.prototype.array = function () {\r\n this.finalize();\r\n\r\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\r\n extraBytes = this.extraBytes, i = 0, j = 0;\r\n var array = [], offset, block;\r\n while (j < outputBlocks) {\r\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\r\n offset = j << 2;\r\n block = s[i];\r\n array[offset] = block & 0xFF;\r\n array[offset + 1] = (block >> 8) & 0xFF;\r\n array[offset + 2] = (block >> 16) & 0xFF;\r\n array[offset + 3] = (block >> 24) & 0xFF;\r\n }\r\n if (j % blockCount === 0) {\r\n f(s);\r\n }\r\n }\r\n if (extraBytes) {\r\n offset = j << 2;\r\n block = s[i];\r\n if (extraBytes > 0) {\r\n array[offset] = block & 0xFF;\r\n }\r\n if (extraBytes > 1) {\r\n array[offset + 1] = (block >> 8) & 0xFF;\r\n }\r\n if (extraBytes > 2) {\r\n array[offset + 2] = (block >> 16) & 0xFF;\r\n }\r\n }\r\n return array;\r\n };\r\n\r\n var f = function (s) {\r\n var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,\r\n b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,\r\n b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,\r\n b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\r\n for (n = 0; n < 48; n += 2) {\r\n c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\r\n c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\r\n c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\r\n c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\r\n c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\r\n c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\r\n c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\r\n c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\r\n c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\r\n c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\r\n\r\n h = c8 ^ ((c2 << 1) | (c3 >>> 31));\r\n l = c9 ^ ((c3 << 1) | (c2 >>> 31));\r\n s[0] ^= h;\r\n s[1] ^= l;\r\n s[10] ^= h;\r\n s[11] ^= l;\r\n s[20] ^= h;\r\n s[21] ^= l;\r\n s[30] ^= h;\r\n s[31] ^= l;\r\n s[40] ^= h;\r\n s[41] ^= l;\r\n h = c0 ^ ((c4 << 1) | (c5 >>> 31));\r\n l = c1 ^ ((c5 << 1) | (c4 >>> 31));\r\n s[2] ^= h;\r\n s[3] ^= l;\r\n s[12] ^= h;\r\n s[13] ^= l;\r\n s[22] ^= h;\r\n s[23] ^= l;\r\n s[32] ^= h;\r\n s[33] ^= l;\r\n s[42] ^= h;\r\n s[43] ^= l;\r\n h = c2 ^ ((c6 << 1) | (c7 >>> 31));\r\n l = c3 ^ ((c7 << 1) | (c6 >>> 31));\r\n s[4] ^= h;\r\n s[5] ^= l;\r\n s[14] ^= h;\r\n s[15] ^= l;\r\n s[24] ^= h;\r\n s[25] ^= l;\r\n s[34] ^= h;\r\n s[35] ^= l;\r\n s[44] ^= h;\r\n s[45] ^= l;\r\n h = c4 ^ ((c8 << 1) | (c9 >>> 31));\r\n l = c5 ^ ((c9 << 1) | (c8 >>> 31));\r\n s[6] ^= h;\r\n s[7] ^= l;\r\n s[16] ^= h;\r\n s[17] ^= l;\r\n s[26] ^= h;\r\n s[27] ^= l;\r\n s[36] ^= h;\r\n s[37] ^= l;\r\n s[46] ^= h;\r\n s[47] ^= l;\r\n h = c6 ^ ((c0 << 1) | (c1 >>> 31));\r\n l = c7 ^ ((c1 << 1) | (c0 >>> 31));\r\n s[8] ^= h;\r\n s[9] ^= l;\r\n s[18] ^= h;\r\n s[19] ^= l;\r\n s[28] ^= h;\r\n s[29] ^= l;\r\n s[38] ^= h;\r\n s[39] ^= l;\r\n s[48] ^= h;\r\n s[49] ^= l;\r\n\r\n b0 = s[0];\r\n b1 = s[1];\r\n b32 = (s[11] << 4) | (s[10] >>> 28);\r\n b33 = (s[10] << 4) | (s[11] >>> 28);\r\n b14 = (s[20] << 3) | (s[21] >>> 29);\r\n b15 = (s[21] << 3) | (s[20] >>> 29);\r\n b46 = (s[31] << 9) | (s[30] >>> 23);\r\n b47 = (s[30] << 9) | (s[31] >>> 23);\r\n b28 = (s[40] << 18) | (s[41] >>> 14);\r\n b29 = (s[41] << 18) | (s[40] >>> 14);\r\n b20 = (s[2] << 1) | (s[3] >>> 31);\r\n b21 = (s[3] << 1) | (s[2] >>> 31);\r\n b2 = (s[13] << 12) | (s[12] >>> 20);\r\n b3 = (s[12] << 12) | (s[13] >>> 20);\r\n b34 = (s[22] << 10) | (s[23] >>> 22);\r\n b35 = (s[23] << 10) | (s[22] >>> 22);\r\n b16 = (s[33] << 13) | (s[32] >>> 19);\r\n b17 = (s[32] << 13) | (s[33] >>> 19);\r\n b48 = (s[42] << 2) | (s[43] >>> 30);\r\n b49 = (s[43] << 2) | (s[42] >>> 30);\r\n b40 = (s[5] << 30) | (s[4] >>> 2);\r\n b41 = (s[4] << 30) | (s[5] >>> 2);\r\n b22 = (s[14] << 6) | (s[15] >>> 26);\r\n b23 = (s[15] << 6) | (s[14] >>> 26);\r\n b4 = (s[25] << 11) | (s[24] >>> 21);\r\n b5 = (s[24] << 11) | (s[25] >>> 21);\r\n b36 = (s[34] << 15) | (s[35] >>> 17);\r\n b37 = (s[35] << 15) | (s[34] >>> 17);\r\n b18 = (s[45] << 29) | (s[44] >>> 3);\r\n b19 = (s[44] << 29) | (s[45] >>> 3);\r\n b10 = (s[6] << 28) | (s[7] >>> 4);\r\n b11 = (s[7] << 28) | (s[6] >>> 4);\r\n b42 = (s[17] << 23) | (s[16] >>> 9);\r\n b43 = (s[16] << 23) | (s[17] >>> 9);\r\n b24 = (s[26] << 25) | (s[27] >>> 7);\r\n b25 = (s[27] << 25) | (s[26] >>> 7);\r\n b6 = (s[36] << 21) | (s[37] >>> 11);\r\n b7 = (s[37] << 21) | (s[36] >>> 11);\r\n b38 = (s[47] << 24) | (s[46] >>> 8);\r\n b39 = (s[46] << 24) | (s[47] >>> 8);\r\n b30 = (s[8] << 27) | (s[9] >>> 5);\r\n b31 = (s[9] << 27) | (s[8] >>> 5);\r\n b12 = (s[18] << 20) | (s[19] >>> 12);\r\n b13 = (s[19] << 20) | (s[18] >>> 12);\r\n b44 = (s[29] << 7) | (s[28] >>> 25);\r\n b45 = (s[28] << 7) | (s[29] >>> 25);\r\n b26 = (s[38] << 8) | (s[39] >>> 24);\r\n b27 = (s[39] << 8) | (s[38] >>> 24);\r\n b8 = (s[48] << 14) | (s[49] >>> 18);\r\n b9 = (s[49] << 14) | (s[48] >>> 18);\r\n\r\n s[0] = b0 ^ (~b2 & b4);\r\n s[1] = b1 ^ (~b3 & b5);\r\n s[10] = b10 ^ (~b12 & b14);\r\n s[11] = b11 ^ (~b13 & b15);\r\n s[20] = b20 ^ (~b22 & b24);\r\n s[21] = b21 ^ (~b23 & b25);\r\n s[30] = b30 ^ (~b32 & b34);\r\n s[31] = b31 ^ (~b33 & b35);\r\n s[40] = b40 ^ (~b42 & b44);\r\n s[41] = b41 ^ (~b43 & b45);\r\n s[2] = b2 ^ (~b4 & b6);\r\n s[3] = b3 ^ (~b5 & b7);\r\n s[12] = b12 ^ (~b14 & b16);\r\n s[13] = b13 ^ (~b15 & b17);\r\n s[22] = b22 ^ (~b24 & b26);\r\n s[23] = b23 ^ (~b25 & b27);\r\n s[32] = b32 ^ (~b34 & b36);\r\n s[33] = b33 ^ (~b35 & b37);\r\n s[42] = b42 ^ (~b44 & b46);\r\n s[43] = b43 ^ (~b45 & b47);\r\n s[4] = b4 ^ (~b6 & b8);\r\n s[5] = b5 ^ (~b7 & b9);\r\n s[14] = b14 ^ (~b16 & b18);\r\n s[15] = b15 ^ (~b17 & b19);\r\n s[24] = b24 ^ (~b26 & b28);\r\n s[25] = b25 ^ (~b27 & b29);\r\n s[34] = b34 ^ (~b36 & b38);\r\n s[35] = b35 ^ (~b37 & b39);\r\n s[44] = b44 ^ (~b46 & b48);\r\n s[45] = b45 ^ (~b47 & b49);\r\n s[6] = b6 ^ (~b8 & b0);\r\n s[7] = b7 ^ (~b9 & b1);\r\n s[16] = b16 ^ (~b18 & b10);\r\n s[17] = b17 ^ (~b19 & b11);\r\n s[26] = b26 ^ (~b28 & b20);\r\n s[27] = b27 ^ (~b29 & b21);\r\n s[36] = b36 ^ (~b38 & b30);\r\n s[37] = b37 ^ (~b39 & b31);\r\n s[46] = b46 ^ (~b48 & b40);\r\n s[47] = b47 ^ (~b49 & b41);\r\n s[8] = b8 ^ (~b0 & b2);\r\n s[9] = b9 ^ (~b1 & b3);\r\n s[18] = b18 ^ (~b10 & b12);\r\n s[19] = b19 ^ (~b11 & b13);\r\n s[28] = b28 ^ (~b20 & b22);\r\n s[29] = b29 ^ (~b21 & b23);\r\n s[38] = b38 ^ (~b30 & b32);\r\n s[39] = b39 ^ (~b31 & b33);\r\n s[48] = b48 ^ (~b40 & b42);\r\n s[49] = b49 ^ (~b41 & b43);\r\n\r\n s[0] ^= RC[n];\r\n s[1] ^= RC[n + 1];\r\n }\r\n };\r\n\r\n if (COMMON_JS) {\r\n module.exports = methods;\r\n } else {\r\n for (var i = 0; i < methodNames.length; ++i) {\r\n root[methodNames[i]] = methods[methodNames[i]];\r\n }\r\n }\r\n})();\r\n","\"use strict\";\n\nimport sha3 from \"js-sha3\";\n\nimport { arrayify, BytesLike } from \"@ethersproject/bytes\";\n\nexport function keccak256(data: BytesLike): string {\n return '0x' + sha3.keccak_256(arrayify(data));\n}\n","export const version = \"rlp/5.0.5\";\n","\"use strict\";\n\n//See: https://github.com/ethereum/wiki/wiki/RLP\n\nimport { arrayify, BytesLike, hexlify, isBytesLike } from \"@ethersproject/bytes\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nfunction arrayifyInteger(value: number): Array {\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return result;\n}\n\nfunction unarrayifyInteger(data: Uint8Array, offset: number, length: number): number {\n let result = 0;\n for (let i = 0; i < length; i++) {\n result = (result * 256) + data[offset + i];\n }\n return result;\n}\n\nfunction _encode(object: Array | string): Array {\n if (Array.isArray(object)) {\n let payload: Array = [];\n object.forEach(function(child) {\n payload = payload.concat(_encode(child));\n });\n\n if (payload.length <= 55) {\n payload.unshift(0xc0 + payload.length)\n return payload;\n }\n\n const length = arrayifyInteger(payload.length);\n length.unshift(0xf7 + length.length);\n\n return length.concat(payload);\n\n }\n\n if (!isBytesLike(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n\n const data: Array = Array.prototype.slice.call(arrayify(object));\n\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\n const length = arrayifyInteger(data.length);\n length.unshift(0xb7 + length.length);\n\n return length.concat(data);\n}\n\nexport function encode(object: any): string {\n return hexlify(_encode(object));\n}\n\ntype Decoded = {\n result: any;\n consumed: number;\n};\n\nfunction _decodeChildren(data: Uint8Array, offset: number, childOffset: number, length: number): Decoded {\n const result = [];\n\n while (childOffset < offset + 1 + length) {\n const decoded = _decode(data, childOffset);\n\n result.push(decoded.result);\n\n childOffset += decoded.consumed;\n if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", Logger.errors.BUFFER_OVERRUN, { });\n }\n }\n\n return {consumed: (1 + length), result: result};\n}\n\n// returns { consumed: number, result: Object }\nfunction _decode(data: Uint8Array, offset: number): { consumed: number, result: any } {\n if (data.length === 0) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, { });\n }\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\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\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\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\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\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\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}\n\nexport function decode(data: BytesLike): any {\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\n","export const version = \"address/5.0.6\";\n","\"use strict\";\n\nimport { arrayify, BytesLike, concat, hexDataLength, hexDataSlice, isHexString, stripZeros } from \"@ethersproject/bytes\";\nimport { BigNumber, BigNumberish, _base16To36, _base36To16 } from \"@ethersproject/bignumber\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { encode } from \"@ethersproject/rlp\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nfunction getChecksumAddress(address: string): string {\n if (!isHexString(address, 20)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n\n address = address.toLowerCase();\n\n const chars = address.substring(2).split(\"\");\n\n const expanded = new Uint8Array(40);\n for (let i = 0; i < 40; i++) {\n expanded[i] = chars[i].charCodeAt(0);\n }\n\n const hashed = arrayify(keccak256(expanded));\n\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\n return \"0x\" + chars.join(\"\");\n}\n\n// Shims for environments that are missing some required constants and functions\nconst MAX_SAFE_INTEGER: number = 0x1fffffffffffff;\n\nfunction log10(x: number): number {\n if (Math.log10) { return Math.log10(x); }\n return Math.log(x) / Math.LN10;\n}\n\n\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n\n// Create lookup table\nconst ibanLookup: { [character: string]: string } = { };\nfor (let i = 0; i < 10; i++) { ibanLookup[String(i)] = String(i); }\nfor (let i = 0; i < 26; i++) { 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));\n\nfunction ibanChecksum(address: string): string {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n\n let expanded = address.split(\"\").map((c) => { return ibanLookup[c]; }).join(\"\");\n\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\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) { checksum = \"0\" + checksum; }\n\n return checksum;\n};\n\nexport function getAddress(address: string): string {\n let result = null;\n\n if (typeof(address) !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n\n if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {\n\n // Missing the 0x prefix\n if (address.substring(0, 2) !== \"0x\") { address = \"0x\" + address; }\n\n result = getChecksumAddress(address);\n\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\n // Maybe ICAP? (we only support direct mode)\n } else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {\n\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\n result = _base36To16(address.substring(4));\n while (result.length < 40) { result = \"0\" + result; }\n result = getChecksumAddress(\"0x\" + result);\n\n } else {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n\n return result;\n}\n\nexport function isAddress(address: string): boolean {\n try {\n getAddress(address);\n return true;\n } catch (error) { }\n return false;\n}\n\nexport function getIcapAddress(address: string): string {\n let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n while (base36.length < 30) { base36 = \"0\" + base36; }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\n\n// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed\nexport function getContractAddress(transaction: { from: string, nonce: BigNumberish }) {\n let from: string = null;\n try {\n from = getAddress(transaction.from);\n } catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n\n const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));\n\n return getAddress(hexDataSlice(keccak256(encode([ from, nonce ])), 12));\n}\n\nexport function getCreate2Address(from: string, salt: BytesLike, initCodeHash: BytesLike): string {\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","\"use strict\";\n\nimport { getAddress } from \"@ethersproject/address\";\nimport { hexZeroPad } from \"@ethersproject/bytes\";\n\nimport { Coder, Reader, Writer } from \"./abstract-coder\";\n\nexport class AddressCoder extends Coder {\n\n constructor(localName: string) {\n super(\"address\", \"address\", localName, false);\n }\n\n encode(writer: Writer, value: string): number {\n try {\n getAddress(value);\n } catch (error) {\n this._throwError(error.message, value);\n }\n return writer.writeValue(value);\n }\n\n decode(reader: Reader): any {\n return getAddress(hexZeroPad(reader.readValue().toHexString(), 20));\n }\n}\n\n","\"use strict\";\n\nimport { Coder, Reader, Writer } from \"./abstract-coder\";\n\n// Clones the functionality of an existing Coder, but without a localName\nexport class AnonymousCoder extends Coder {\n private coder: Coder;\n\n constructor(coder: Coder) {\n super(coder.name, coder.type, undefined, coder.dynamic);\n this.coder = coder;\n }\n\n encode(writer: Writer, value: any): number {\n return this.coder.encode(writer, value);\n }\n\n decode(reader: Reader): any {\n return this.coder.decode(reader);\n }\n}\n","\"use strict\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"../_version\";\nconst logger = new Logger(version);\n\nimport { Coder, Reader, Result, Writer } from \"./abstract-coder\";\nimport { AnonymousCoder } from \"./anonymous\";\n\nexport function pack(writer: Writer, coders: ReadonlyArray, values: Array | { [ name: string ]: any }): number {\n let arrayValues: Array = null;\n\n if (Array.isArray(values)) {\n arrayValues = values;\n\n } else if (values && typeof(values) === \"object\") {\n let unique: { [ name: string ]: boolean } = { };\n\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\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\n unique[name] = true;\n\n return values[name];\n });\n\n } else {\n logger.throwArgumentError(\"invalid tuple value\", \"tuple\", values);\n }\n\n if (coders.length !== arrayValues.length) {\n logger.throwArgumentError(\"types/value length mismatch\", \"tuple\", values);\n }\n\n let staticWriter = new Writer(writer.wordSize);\n let dynamicWriter = new Writer(writer.wordSize);\n\n let updateFuncs: Array<(baseOffset: number) => void> = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset: number) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n\n } else {\n coder.encode(staticWriter, value);\n }\n });\n\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => { func(staticWriter.length); });\n\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\n\nexport function unpack(reader: Reader, coders: Array): Result {\n let values: any = [];\n\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n\n coders.forEach((coder) => {\n let value: any = null;\n\n if (coder.dynamic) {\n let offset = reader.readValue();\n let offsetReader = baseReader.subReader(offset.toNumber());\n try {\n value = coder.decode(offsetReader);\n } catch (error) {\n // Cannot recover from this\n if (error.code === Logger.errors.BUFFER_OVERRUN) { throw error; }\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 } catch (error) {\n // Cannot recover from this\n if (error.code === Logger.errors.BUFFER_OVERRUN) { throw error; }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n\n if (value != undefined) {\n values.push(value);\n }\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]) { accum[name] = 0; }\n accum[name]++;\n }\n return accum;\n }, <{ [ name: string ]: number }>{ });\n\n // Add any named parameters (i.e. tuples)\n coders.forEach((coder: Coder, index: number) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) { return; }\n\n if (name === \"length\") { name = \"_length\"; }\n\n if (values[name] != null) { return; }\n\n const value = values[index];\n\n if (value instanceof Error) {\n Object.defineProperty(values, name, {\n get: () => { throw value; }\n });\n } else {\n values[name] = value;\n }\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 get: () => { throw value; }\n });\n }\n }\n\n return Object.freeze(values);\n}\n\n\nexport class ArrayCoder extends Coder {\n readonly coder: Coder;\n readonly length: number;\n\n constructor(coder: Coder, length: number, localName: string) {\n const type = (coder.type + \"[\" + (length >= 0 ? length: \"\") + \"]\");\n const dynamic = (length === -1 || coder.dynamic);\n super(\"array\", type, localName, dynamic);\n\n this.coder = coder;\n this.length = length;\n }\n\n encode(writer: Writer, value: Array): number {\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n\n let count = this.length;\n\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n\n logger.checkArgumentCount(value.length, count, \"coder array\" + (this.localName? (\" \"+ this.localName): \"\"));\n\n let coders = [];\n for (let i = 0; i < value.length; i++) { coders.push(this.coder); }\n\n return pack(writer, coders, value);\n }\n\n decode(reader: Reader): any {\n let count = this.length;\n if (count === -1) {\n count = reader.readValue().toNumber();\n }\n\n let coders = [];\n for (let i = 0; i < count; i++) { coders.push(new AnonymousCoder(this.coder)); }\n\n return reader.coerce(this.name, unpack(reader, coders));\n }\n}\n\n","\"use strict\";\n\nimport { Coder, Reader, Writer } from \"./abstract-coder\";\n\nexport class BooleanCoder extends Coder {\n\n constructor(localName: string) {\n super(\"bool\", \"bool\", localName, false);\n }\n\n encode(writer: Writer, value: boolean): number {\n return writer.writeValue(value ? 1: 0);\n }\n\n decode(reader: Reader): any {\n return reader.coerce(this.type, !reader.readValue().isZero());\n }\n}\n\n","\"use strict\";\n\nimport { arrayify, hexlify } from \"@ethersproject/bytes\";\n\nimport { Coder, Reader, Writer } from \"./abstract-coder\";\n\nexport class DynamicBytesCoder extends Coder {\n constructor(type: string, localName: string) {\n super(type, type, localName, true);\n }\n\n encode(writer: Writer, value: any): number {\n value = arrayify(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n\n decode(reader: Reader): any {\n return reader.readBytes(reader.readValue().toNumber(), true);\n }\n}\n\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName: string) {\n super(\"bytes\", localName);\n }\n\n decode(reader: Reader): any {\n return reader.coerce(this.name, hexlify(super.decode(reader)));\n }\n}\n\n\n","\"use strict\";\n\nimport { arrayify, BytesLike, hexlify } from \"@ethersproject/bytes\";\n\nimport { Coder, Reader, Writer } from \"./abstract-coder\";\n\n// @TODO: Merge this with bytes\nexport class FixedBytesCoder extends Coder {\n readonly size: number;\n\n constructor(size: number, localName: string) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n this.size = size;\n }\n\n encode(writer: Writer, value: BytesLike): number {\n let data = arrayify(value);\n if (data.length !== this.size) { this._throwError(\"incorrect data length\", value); }\n return writer.writeBytes(data);\n }\n\n decode(reader: Reader): any {\n return reader.coerce(this.name, hexlify(reader.readBytes(this.size)));\n }\n}\n","\"use strict\";\n\nimport { Coder, Reader, Writer } from \"./abstract-coder\";\n\nexport class NullCoder extends Coder {\n\n constructor(localName: string) {\n super(\"null\", \"\", localName, false);\n }\n\n encode(writer: Writer, value: any): number {\n if (value != null) { this._throwError(\"not null\", value); }\n return writer.writeBytes([ ]);\n }\n\n decode(reader: Reader): any {\n reader.readBytes(0);\n return reader.coerce(this.name, null);\n }\n}\n","export const AddressZero = \"0x0000000000000000000000000000000000000000\";\n\n","import { BigNumber } from \"@ethersproject/bignumber\";\n\nconst NegativeOne: BigNumber = (/*#__PURE__*/BigNumber.from(-1));\nconst Zero: BigNumber = (/*#__PURE__*/BigNumber.from(0));\nconst One: BigNumber = (/*#__PURE__*/BigNumber.from(1));\nconst Two: BigNumber = (/*#__PURE__*/BigNumber.from(2));\nconst WeiPerEther: BigNumber = (/*#__PURE__*/BigNumber.from(\"1000000000000000000\"));\nconst MaxUint256: BigNumber = (/*#__PURE__*/BigNumber.from(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\n\nexport {\n NegativeOne,\n Zero,\n One,\n Two,\n WeiPerEther,\n MaxUint256\n};\n","export const HashZero = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n\n","// NFKC (composed) // (decomposed)\nexport const EtherSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n","\"use strict\";\n\nexport { AddressZero } from \"./addresses\";\nexport {\n NegativeOne,\n Zero,\n One,\n Two,\n WeiPerEther,\n MaxUint256\n} from \"./bignumbers\";\nexport { HashZero } from \"./hashes\";\nexport { EtherSymbol } from \"./strings\";\n\n","\"use strict\";\n\nimport { BigNumber, BigNumberish } from \"@ethersproject/bignumber\";\nimport { MaxUint256, NegativeOne, One, Zero } from \"@ethersproject/constants\";\n\nimport { Coder, Reader, Writer } from \"./abstract-coder\";\n\nexport class NumberCoder extends Coder {\n readonly size: number;\n readonly signed: boolean;\n\n constructor(size: number, signed: boolean, localName: string) {\n const name = ((signed ? \"int\": \"uint\") + (size * 8));\n super(name, name, localName, false);\n\n this.size = size;\n this.signed = signed;\n }\n\n encode(writer: Writer, value: BigNumberish): number {\n let v = BigNumber.from(value);\n\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 } else if (v.lt(Zero) || v.gt(maxUintValue.mask(this.size * 8))) {\n this._throwError(\"value out-of-bounds\", value);\n }\n\n v = v.toTwos(this.size * 8).mask(this.size * 8);\n\n if (this.signed) {\n v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize);\n }\n\n return writer.writeValue(v);\n }\n\n decode(reader: Reader): any {\n let value = reader.readValue().mask(this.size * 8);\n\n if (this.signed) {\n value = value.fromTwos(this.size * 8);\n }\n\n return reader.coerce(this.name, value);\n }\n}\n\n","export const version = \"strings/5.0.6\";\n","\"use strict\";\n\nimport { arrayify, BytesLike } from \"@ethersproject/bytes\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\n///////////////////////////////\n\nexport enum UnicodeNormalizationForm {\n current = \"\",\n NFC = \"NFC\",\n NFD = \"NFD\",\n NFKC = \"NFKC\",\n NFKD = \"NFKD\"\n};\n\nexport enum Utf8ErrorReason {\n // A continuation byte was present where there was nothing to continue\n // - offset = the index the codepoint began in\n UNEXPECTED_CONTINUE = \"unexpected continuation byte\",\n\n // An invalid (non-continuation) byte to start a UTF-8 codepoint was found\n // - offset = the index the codepoint began in\n BAD_PREFIX = \"bad codepoint prefix\",\n\n // The string is too short to process the expected codepoint\n // - offset = the index the codepoint began in\n OVERRUN = \"string overrun\",\n\n // A missing continuation byte was expected but not found\n // - offset = the index the continuation byte was expected at\n MISSING_CONTINUE = \"missing continuation byte\",\n\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 OUT_OF_RANGE = \"out of UTF-8 range\",\n\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 UTF16_SURROGATE = \"UTF-16 surrogate\",\n\n // The string is an overlong reperesentation\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; already bounds checked\n OVERLONG = \"overlong representation\",\n};\n\n\nexport type Utf8ErrorFunc = (reason: Utf8ErrorReason, offset: number, bytes: ArrayLike, output: Array, badCodepoint?: number) => number;\n\nfunction errorFunc(reason: Utf8ErrorReason, offset: number, bytes: ArrayLike, output: Array, badCodepoint?: number): number {\n return logger.throwArgumentError(`invalid codepoint at offset ${ offset }; ${ reason }`, \"bytes\", bytes);\n}\n\nfunction ignoreFunc(reason: Utf8ErrorReason, offset: number, bytes: ArrayLike, output: Array, badCodepoint?: number): number {\n\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) { break; }\n i++;\n }\n return i;\n }\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\n // Nothing to skip\n return 0;\n}\n\nfunction replaceFunc(reason: Utf8ErrorReason, offset: number, bytes: ArrayLike, output: Array, badCodepoint?: number): number {\n\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\n // Put the replacement character into the output\n output.push(0xfffd);\n\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n\n// Common error handing strategies\nexport const Utf8ErrorFuncs: { [ name: string ]: Utf8ErrorFunc } = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc\n});\n\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(bytes: BytesLike, onError?: Utf8ErrorFunc): Array {\n if (onError == null) { onError = Utf8ErrorFuncs.error; }\n\n bytes = arrayify(bytes);\n\n const result: Array = [];\n let i = 0;\n\n // Invalid bytes are ignored\n while(i < bytes.length) {\n\n const c = bytes[i++];\n\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n\n // 1110 xxxx 10xx xxxx 10xx xxxx\n } else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\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 } else {\n i += onError(Utf8ErrorReason.BAD_PREFIX, i - 1, bytes, result);\n }\n continue;\n }\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\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n\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\n // See above loop for invalid contimuation byte\n if (res === null) { 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\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\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\n result.push(res);\n }\n\n return result;\n}\n\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\nexport function toUtf8Bytes(str: string, form: UnicodeNormalizationForm = UnicodeNormalizationForm.current): Uint8Array {\n\n if (form != UnicodeNormalizationForm.current) {\n logger.checkNormalize();\n str = str.normalize(form);\n }\n\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n\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\n if (i >= str.length || (c2 & 0xfc00) !== 0xdc00) {\n throw new Error(\"invalid utf-8 string\");\n }\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\n return arrayify(result);\n};\n\nfunction escapeChar(value: number) {\n const hex = (\"0000\" + value.toString(16));\n return \"\\\\u\" + hex.substring(hex.length - 4);\n}\n\nexport function _toEscapedUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc): string {\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\n if (codePoint >= 32 && codePoint < 127) {\n return String.fromCharCode(codePoint);\n }\n }\n\n if (codePoint <= 0xffff) {\n return escapeChar(codePoint);\n }\n\n codePoint -= 0x10000;\n return escapeChar(((codePoint >> 10) & 0x3ff) + 0xd800) + escapeChar((codePoint & 0x3ff) + 0xdc00);\n }).join(\"\") + '\"';\n}\n\nexport function _toUtf8String(codePoints: Array): string {\n return codePoints.map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode(\n (((codePoint >> 10) & 0x3ff) + 0xd800),\n ((codePoint & 0x3ff) + 0xdc00)\n );\n }).join(\"\");\n}\n\nexport function toUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc): string {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n\nexport function toUtf8CodePoints(str: string, form: UnicodeNormalizationForm = UnicodeNormalizationForm.current): Array {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n","\"use strict\";\n\nimport { HashZero } from \"@ethersproject/constants\";\nimport { arrayify, BytesLike, concat, hexlify } from \"@ethersproject/bytes\";\n\nimport { toUtf8Bytes, toUtf8String } from \"./utf8\";\n\n\nexport function formatBytes32String(text: string): string {\n\n // Get the bytes\n const bytes = toUtf8Bytes(text);\n\n // Check we have room for null-termination\n if (bytes.length > 31) { 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}\n\nexport function parseBytes32String(bytes: BytesLike): string {\n const data = arrayify(bytes);\n\n // Must be 32 bytes with a null-termination\n if (data.length !== 32) { throw new Error(\"invalid bytes32 - not 32 bytes long\"); }\n if (data[31] !== 0) { 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) { length--; }\n\n // Determine the string value\n return toUtf8String(data.slice(0, length));\n}\n\n","\"use strict\";\n\nimport { toUtf8CodePoints, _toUtf8String, UnicodeNormalizationForm } from \"./utf8\";\n\ntype Ranged = {\n l: number, // Lo value\n h: number, // High value (less the lo)\n d?: number, // Delta/stride (default: 1)\n s?: number, // Shift (default: 1)\n e?: Array // Exceptions to skip\n};\n\ntype Table = { [ src: number ]: Array };\n\nfunction bytes2(data: string): Array {\n if ((data.length % 4) !== 0) { throw new Error(\"bad data\"); }\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}\n\nfunction createTable(data: string, func?: (value: string) => Array): Table {\n if (!func) {\n func = function(value: string) { return [ parseInt(value, 16) ]; }\n }\n\n let lo = 0;\n\n let result: Table = { };\n data.split(\",\").forEach((pair) => {\n let comps = pair.split(\":\");\n lo += parseInt(comps[0], 16);\n result[lo] = func(comps[1]);\n });\n\n return result;\n}\n\nfunction createRangeTable(data: string): Array {\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 } else if (comps[1] === \"\") {\n comps[1] = \"1\";\n }\n\n let lo = hi + parseInt(comps[0], 16);\n hi = parseInt(comps[1], 16);\n return { l: lo, h: hi };\n });\n}\n\nfunction matchMap(value: number, ranges: Array): Ranged {\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) { continue; }\n return range;\n }\n }\n return null;\n}\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\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));\n\nconst Table_B_2_ranges: Array = [\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);\n\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\");\n\n\nfunction flatten(values: Array>): Array {\n return values.reduce((accum, value) => {\n value.forEach((value) => { accum.push(value); });\n return accum;\n }, [ ]);\n}\n\nexport function _nameprepTableA1(codepoint: number): boolean {\n return !!matchMap(codepoint, Table_A_1_ranges);\n}\n\nexport function _nameprepTableB2(codepoint: number): Array {\n let range = matchMap(codepoint, Table_B_2_ranges);\n if (range) { return [ codepoint + range.s ]; }\n\n let codes = Table_B_2_lut_abs[codepoint];\n if (codes) { return codes; }\n\n let shift = Table_B_2_lut_rel[codepoint];\n if (shift) { return [ codepoint + shift[0] ]; }\n\n let complex = Table_B_2_complex[codepoint];\n if (complex) { return complex; }\n\n return null;\n}\n\nexport function _nameprepTableC(codepoint: number): boolean {\n return !!matchMap(codepoint, Table_C_ranges);\n}\n\nexport function nameprep(value: string): string {\n\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) { return value.toLowerCase(); }\n\n // Get the code points (keeping the current normalization)\n let codes = toUtf8CodePoints(value);\n\n codes = flatten(codes.map((code) => {\n // Substitute Table B.1 (Maps to Nothing)\n if (Table_B_1_flags.indexOf(code) >= 0) { return [ ]; }\n if (code >= 0xfe00 && code <= 0xfe0f) { return [ ]; }\n\n // Substitute Table B.2 (Case Folding)\n let codesTableB2 = _nameprepTableB2(code);\n if (codesTableB2) { return codesTableB2; }\n\n // No Substitution\n return [ code ];\n }));\n\n // Normalize using form KC\n codes = toUtf8CodePoints(_toUtf8String(codes), UnicodeNormalizationForm.NFKC);\n\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\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\n // IDNA extras\n let name = _toUtf8String(codes);\n\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\n // IDNA: 4.2.4\n if (name.length > 63) { throw new Error(\"too long\"); }\n\n\n\n return name;\n}\n\n","\"use strict\";\n\nimport { formatBytes32String, parseBytes32String } from \"./bytes32\";\nimport { nameprep } from \"./idna\";\nimport { _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, UnicodeNormalizationForm, Utf8ErrorFunc, Utf8ErrorFuncs, Utf8ErrorReason } from \"./utf8\";\n\nexport {\n _toEscapedUtf8String,\n toUtf8Bytes,\n toUtf8CodePoints,\n toUtf8String,\n\n Utf8ErrorFunc,\n Utf8ErrorFuncs,\n Utf8ErrorReason,\n\n UnicodeNormalizationForm,\n\n formatBytes32String,\n parseBytes32String,\n\n nameprep\n}\n","\"use strict\";\n\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\n\nimport { Reader, Writer } from \"./abstract-coder\";\nimport { DynamicBytesCoder } from \"./bytes\";\n\nexport class StringCoder extends DynamicBytesCoder {\n\n constructor(localName: string) {\n super(\"string\", localName);\n }\n\n encode(writer: Writer, value: any): number {\n return super.encode(writer, toUtf8Bytes(value));\n }\n\n decode(reader: Reader): any {\n return toUtf8String(super.decode(reader));\n }\n}\n","\"use strict\";\n\nimport { Coder, Reader, Writer } from \"./abstract-coder\";\nimport { pack, unpack } from \"./array\";\n\nexport class TupleCoder extends Coder {\n readonly coders: Array;\n\n constructor(coders: Array, localName: string) {\n let dynamic = false;\n const types: Array = [];\n coders.forEach((coder) => {\n if (coder.dynamic) { dynamic = true; }\n types.push(coder.type);\n });\n const type = (\"tuple(\" + types.join(\",\") + \")\");\n\n super(\"tuple\", type, localName, dynamic);\n this.coders = coders;\n }\n\n encode(writer: Writer, value: Array | { [ name: string ]: any }): number {\n return pack(writer, this.coders, value);\n }\n\n decode(reader: Reader): any {\n return reader.coerce(this.name, unpack(reader, this.coders));\n }\n}\n\n","\"use strict\";\n\n// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI\n\nimport { arrayify, BytesLike } from \"@ethersproject/bytes\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { Coder, Reader, Result, 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\";\n\nimport { ParamType } from \"./fragments\";\n\n\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\n\n\nexport type CoerceFunc = (type: string, value: any) => any;\n\nexport class AbiCoder {\n readonly coerceFunc: CoerceFunc;\n\n constructor(coerceFunc?: CoerceFunc) {\n logger.checkNew(new.target, AbiCoder);\n defineReadOnly(this, \"coerceFunc\", coerceFunc || null);\n }\n\n _getCoder(param: ParamType): Coder {\n\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\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\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\n return logger.throwArgumentError(\"invalid type\", \"type\", param.type);\n }\n\n _getWordSize(): number { return 32; }\n\n _getReader(data: Uint8Array, allowLoose?: boolean): Reader {\n return new Reader(data, this._getWordSize(), this.coerceFunc, allowLoose);\n }\n\n _getWriter(): Writer {\n return new Writer(this._getWordSize());\n }\n\n encode(types: Array, values: Array): string {\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\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = (new TupleCoder(coders, \"_\"));\n\n const writer = this._getWriter();\n coder.encode(writer, values);\n return writer.data;\n }\n\n decode(types: Array, data: BytesLike, loose?: boolean): Result {\n const coders: Array = 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}\n\nexport const defaultAbiCoder: AbiCoder = new AbiCoder();\n\n","import { keccak256 } from \"@ethersproject/keccak256\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\n\nexport function id(text: string): string {\n return keccak256(toUtf8Bytes(text));\n}\n","export const version = \"hash/5.0.7\";\n","import { concat, hexlify } from \"@ethersproject/bytes\";\nimport { nameprep, toUtf8Bytes } from \"@ethersproject/strings\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nconst Zeros = new Uint8Array(32);\nZeros.fill(0);\n\nconst Partition = new RegExp(\"^((.*)\\\\.)?([^.]+)$\");\n\nexport function isValidName(name: string): boolean {\n try {\n const comps = name.split(\".\");\n for (let i = 0; i < comps.length; i++) {\n if (nameprep(comps[i]).length === 0) {\n throw new Error(\"empty\")\n }\n }\n return true;\n } catch (error) { }\n return false;\n}\n\nexport function namehash(name: string): string {\n /* istanbul ignore if */\n if (typeof(name) !== \"string\") {\n logger.throwArgumentError(\"invalid address - \" + String(name), \"name\", name);\n }\n\n let result: string | Uint8Array = Zeros;\n while (name.length) {\n const partition = name.match(Partition);\n const label = toUtf8Bytes(nameprep(partition[3]));\n result = keccak256(concat([result, keccak256(label)]));\n\n name = partition[2] || \"\";\n }\n\n return hexlify(result);\n}\n\n","import { Bytes, concat } from \"@ethersproject/bytes\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\n\nexport const messagePrefix = \"\\x19Ethereum Signed Message:\\n\";\n\nexport function hashMessage(message: Bytes | string): string {\n if (typeof(message) === \"string\") { message = toUtf8Bytes(message); }\n return keccak256(concat([\n toUtf8Bytes(messagePrefix),\n toUtf8Bytes(String(message.length)),\n message\n ]));\n}\n\n","import { TypedDataDomain, TypedDataField } from \"@ethersproject/abstract-signer\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { BigNumber, BigNumberish } from \"@ethersproject/bignumber\";\nimport { arrayify, BytesLike, hexConcat, hexlify, hexValue, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { deepCopy, defineReadOnly, shallowCopy } from \"@ethersproject/properties\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { id } from \"./id\";\n\nconst padding = new Uint8Array(32);\npadding.fill(0);\n\nconst NegativeOne: BigNumber = BigNumber.from(-1);\nconst Zero: BigNumber = BigNumber.from(0);\nconst One: BigNumber = BigNumber.from(1);\nconst MaxUint256: BigNumber = BigNumber.from(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n\nfunction hexPadRight(value: BytesLike) {\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}\n\nconst hexTrue = hexZeroPad(One.toHexString(), 32);\nconst hexFalse = hexZeroPad(Zero.toHexString(), 32);\n\nconst domainFieldTypes: Record = {\n name: \"string\",\n version: \"string\",\n chainId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\"\n};\n\nconst domainFieldNames: Array = [\n \"name\", \"version\", \"chainId\", \"verifyingContract\", \"salt\"\n];\n\nfunction checkString(key: string): (value: any) => string {\n return function (value: any){\n if (typeof(value) !== \"string\") {\n logger.throwArgumentError(`invalid domain value for ${ JSON.stringify(key) }`, `domain.${ key }`, value);\n }\n return value;\n }\n}\n\nconst domainChecks: Record any> = {\n name: checkString(\"name\"),\n version: checkString(\"version\"),\n chainId: function(value: any) {\n try {\n return BigNumber.from(value).toString()\n } catch (error) { }\n return logger.throwArgumentError(`invalid domain value for \"chainId\"`, \"domain.chainId\", value);\n },\n verifyingContract: function(value: any) {\n try {\n return getAddress(value).toLowerCase();\n } catch (error) { }\n return logger.throwArgumentError(`invalid domain value \"verifyingContract\"`, \"domain.verifyingContract\", value);\n },\n salt: function(value: any) {\n try {\n const bytes = arrayify(value);\n if (bytes.length !== 32) { throw new Error(\"bad length\"); }\n return hexlify(bytes);\n } catch (error) { }\n return logger.throwArgumentError(`invalid domain value \"salt\"`, \"domain.salt\", value);\n }\n}\n\nfunction getBaseEncoder(type: string): (value: any) => string {\n // intXX and uintXX\n {\n const match = type.match(/^(u?)int(\\d*)$/);\n if (match) {\n const signed = (match[1] === \"\");\n\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\n const boundsUpper = MaxUint256.mask(signed ? (width - 1): width);\n const boundsLower = signed ? boundsUpper.add(One).mul(NegativeOne): Zero;\n\n return function(value: BigNumberish) {\n const v = BigNumber.from(value);\n\n if (v.lt(boundsLower) || v.gt(boundsUpper)) {\n logger.throwArgumentError(`value out-of-bounds for ${ type }`, \"value\", value);\n }\n\n return hexZeroPad(v.toTwos(256).toHexString(), 32);\n };\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\n return function(value: BytesLike) {\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\n switch (type) {\n case \"address\": return function(value: string) {\n return hexZeroPad(getAddress(value), 32);\n };\n case \"bool\": return function(value: boolean) {\n return ((!value) ? hexFalse: hexTrue);\n };\n case \"bytes\": return function(value: BytesLike) {\n return keccak256(value);\n };\n case \"string\": return function(value: string) {\n return id(value);\n };\n }\n\n return null;\n}\n\nfunction encodeType(name: string, fields: Array): string {\n return `${ name }(${ fields.map(({ name, type }) => (type + \" \" + name)).join(\",\") })`;\n}\n\nexport class TypedDataEncoder {\n readonly primaryType: string;\n readonly types: Record>;\n\n readonly _encoderCache: Record string>;\n readonly _types: Record;\n\n constructor(types: Record>) {\n defineReadOnly(this, \"types\", Object.freeze(deepCopy(types)));\n\n defineReadOnly(this, \"_encoderCache\", { });\n defineReadOnly(this, \"_types\", { });\n\n // Link struct types to their direct child structs\n const links: Record> = { };\n\n // Link structs to structs which contain them as a child\n const parents: Record> = { };\n\n // Link all subtypes within a given struct\n const subtypes: Record> = { };\n\n Object.keys(types).forEach((type) => {\n links[type] = { };\n parents[type] = [ ];\n subtypes[type] = { }\n });\n\n for (const name in types) {\n\n const uniqueNames: Record = { };\n\n types[name].forEach((field) => {\n\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\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\n // Is this a base encoding type?\n const encoder = getBaseEncoder(baseType);\n if (encoder) { return ;}\n\n if (!parents[baseType]) {\n logger.throwArgumentError(`unknown type ${ JSON.stringify(baseType) }`, \"types\", types);\n }\n\n // Add linkage\n parents[baseType].push(name);\n links[name][baseType] = true;\n });\n }\n\n // Deduce the primary type\n const primaryTypes = Object.keys(parents).filter((n) => (parents[n].length === 0));\n\n if (primaryTypes.length === 0) {\n logger.throwArgumentError(\"missing primary type\", \"types\", types);\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\n defineReadOnly(this, \"primaryType\", primaryTypes[0]);\n\n // Check for circular type references\n function checkCircular(type: string, found: Record) {\n if (found[type]) {\n logger.throwArgumentError(`circular type reference to ${ JSON.stringify(type) }`, \"types\", types);\n }\n\n found[type] = true;\n\n Object.keys(links[type]).forEach((child) => {\n if (!parents[child]) { return; }\n\n // Recursively check children\n checkCircular(child, found);\n\n // Mark all ancestors as having this decendant\n Object.keys(found).forEach((subtype) => {\n subtypes[subtype][child] = true;\n });\n });\n\n delete found[type];\n }\n checkCircular(this.primaryType, { });\n\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\n getEncoder(type: string): (value: any) => string {\n let encoder = this._encoderCache[type];\n if (!encoder) {\n encoder = this._encoderCache[type] = this._getEncoder(type);\n }\n return encoder;\n }\n\n _getEncoder(type: string): (value: any) => string {\n\n // Basic encoder type (address, bool, uint256, etc)\n {\n const encoder = getBaseEncoder(type);\n if (encoder) { 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: Array) => {\n if (length >= 0 && value.length !== length) {\n logger.throwArgumentError(\"array length mismatch; expected length ${ arrayLength }\", \"value\", value);\n }\n\n let result = value.map(subEncoder);\n if (this._types[subtype]) {\n result = result.map(keccak256);\n }\n\n return keccak256(hexConcat(result));\n };\n }\n\n // Struct\n const fields = this.types[type];\n if (fields) {\n const encodedType = id(this._types[type]);\n return (value: Record) => {\n const values = fields.map(({ name, type }) => {\n const result = this.getEncoder(type)(value[name]);\n if (this._types[type]) { return keccak256(result); }\n return result;\n });\n values.unshift(encodedType);\n return hexConcat(values);\n }\n }\n\n return logger.throwArgumentError(`unknown type: ${ type }`, \"type\", type);\n }\n\n encodeType(name: string): string {\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\n encodeData(type: string, value: any): string {\n return this.getEncoder(type)(value);\n }\n\n hashStruct(name: string, value: Record): string {\n return keccak256(this.encodeData(name, value));\n }\n\n encode(value: Record): string {\n return this.encodeData(this.primaryType, value);\n }\n\n hash(value: Record): string {\n return this.hashStruct(this.primaryType, value);\n }\n\n _visit(type: string, value: any, callback: (type: string, data: any) => any): any {\n // Basic encoder type (address, bool, uint256, etc)\n {\n const encoder = getBaseEncoder(type);\n if (encoder) { 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: any) => this._visit(subtype, v, callback));\n }\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\n return logger.throwArgumentError(`unknown type: ${ type }`, \"type\", type);\n }\n\n visit(value: Record, callback: (type: string, data: any) => any): any {\n return this._visit(this.primaryType, value, callback);\n }\n\n static from(types: Record>): TypedDataEncoder {\n return new TypedDataEncoder(types);\n }\n\n static getPrimaryType(types: Record>): string {\n return TypedDataEncoder.from(types).primaryType;\n }\n\n static hashStruct(name: string, types: Record>, value: Record): string {\n return TypedDataEncoder.from(types).hashStruct(name, value);\n }\n\n static hashDomain(domain: TypedDataDomain): string {\n const domainFields: Array = [ ];\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\n domainFields.sort((a, b) => {\n return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name);\n });\n\n return TypedDataEncoder.hashStruct(\"EIP712Domain\", { EIP712Domain: domainFields }, domain);\n }\n\n static encode(domain: TypedDataDomain, types: Record>, value: Record): string {\n return hexConcat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value)\n ]);\n }\n\n static hash(domain: TypedDataDomain, types: Record>, value: Record): string {\n return keccak256(TypedDataEncoder.encode(domain, types, value));\n }\n\n // Replaces all address types with ENS names with their looked up address\n static async resolveNames(domain: TypedDataDomain, types: Record>, value: Record, resolveName: (name: string) => Promise): Promise<{ domain: TypedDataDomain, value: any }> {\n // Make a copy to isolate it from the object passed in\n domain = shallowCopy(domain);\n\n // Look up all ENS names\n const ensCache: Record = { };\n\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\n // We are going to use the encoder to visit all the base values\n const encoder = TypedDataEncoder.from(types);\n\n // Get a list of all the addresses\n encoder.visit(value, (type: string, value: any) => {\n if (type === \"address\" && !isHexString(value, 20)) {\n ensCache[value] = \"0x\";\n }\n return value;\n });\n\n // Lookup each name\n for (const name in ensCache) {\n ensCache[name] = await resolveName(name);\n }\n\n // Replace the domain verifyingContract if needed\n if (domain.verifyingContract && ensCache[domain.verifyingContract]) {\n domain.verifyingContract = ensCache[domain.verifyingContract];\n }\n\n // Replace all ENS names with their address\n value = encoder.visit(value, (type: string, value: any) => {\n if (type === \"address\" && ensCache[value]) { return ensCache[value]; }\n return value;\n });\n\n return { domain, value };\n }\n\n static getPayload(domain: TypedDataDomain, types: Record>, value: Record): any {\n // Validate the domain fields\n TypedDataEncoder.hashDomain(domain);\n\n // Derive the EIP712Domain Struct reference type\n const domainValues: Record = { };\n const domainTypes: Array<{ name: string, type:string }> = [ ];\n\n domainFieldNames.forEach((name) => {\n const value = (domain)[name];\n if (value == null) { return; }\n domainValues[name] = domainChecks[name](value);\n domainTypes.push({ name, type: domainFieldTypes[name] });\n });\n\n const encoder = TypedDataEncoder.from(types);\n\n const typesWithDomain = shallowCopy(types);\n if (typesWithDomain.EIP712Domain) {\n typesWithDomain.EIP712Domain = domainTypes;\n }\n\n // Validate the data structures and types\n encoder.encode(value);\n\n return {\n types: typesWithDomain,\n domain: domainValues,\n primaryType: encoder.primaryType,\n message: encoder.visit(value, (type: string, value: any) => {\n\n // bytes\n if (type.match(/^bytes(\\d*)/)) {\n return hexlify(arrayify(value));\n }\n\n // uint or int\n if (type.match(/^u?int/)) {\n let prefix = \"\";\n let v = BigNumber.from(value);\n if (v.isNegative()) {\n prefix = \"-\";\n v = v.mul(-1);\n }\n return prefix + hexValue(v.toHexString());\n }\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\n return logger.throwArgumentError(\"unsupported type\", \"type\", type);\n })\n };\n }\n}\n\n","\"use strict\";\n\nimport { id } from \"./id\";\nimport { isValidName, namehash } from \"./namehash\";\nimport { hashMessage, messagePrefix } from \"./message\";\n\nimport { TypedDataEncoder as _TypedDataEncoder } from \"./typed-data\";\n\nexport {\n id,\n\n namehash,\n isValidName,\n\n messagePrefix,\n hashMessage,\n\n _TypedDataEncoder,\n}\n","\"use strict\";\n\nimport { getAddress } from \"@ethersproject/address\";\nimport { BigNumber, BigNumberish } from \"@ethersproject/bignumber\";\nimport { arrayify, BytesLike, 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\";\n\nimport { AbiCoder, defaultAbiCoder } from \"./abi-coder\";\nimport { checkResultErrors, Result } from \"./coders/abstract-coder\";\nimport { ConstructorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, JsonFragment, ParamType } from \"./fragments\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nexport { checkResultErrors, Result };\n\nexport class LogDescription extends Description {\n readonly eventFragment: EventFragment;\n readonly name: string;\n readonly signature: string;\n readonly topic: string;\n readonly args: Result\n}\n\nexport class TransactionDescription extends Description {\n readonly functionFragment: FunctionFragment;\n readonly name: string;\n readonly args: Result;\n readonly signature: string;\n readonly sighash: string;\n readonly value: BigNumber;\n}\n\nexport class Indexed extends Description {\n readonly hash: string;\n readonly _isIndexed: boolean;\n\n static isIndexed(value: any): value is Indexed {\n return !!(value && value._isIndexed);\n }\n}\n\nfunction wrapAccessError(property: string, error: Error): Error {\n const wrap = new Error(`deferred error during ABI decoding triggered accessing ${ property }`);\n (wrap).error = error;\n return wrap;\n}\n\n/*\nfunction checkNames(fragment: Fragment, type: \"input\" | \"output\", params: Array): 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 readonly fragments: Array;\n\n readonly errors: { [ name: string ]: any };\n readonly events: { [ name: string ]: EventFragment };\n readonly functions: { [ name: string ]: FunctionFragment };\n readonly structs: { [ name: string ]: any };\n\n readonly deploy: ConstructorFragment;\n\n readonly _abiCoder: AbiCoder;\n\n readonly _isInterface: boolean;\n\n constructor(fragments: string | Array) {\n logger.checkNew(new.target, Interface);\n\n let abi: Array = [ ];\n if (typeof(fragments) === \"string\") {\n abi = JSON.parse(fragments);\n } else {\n abi = fragments;\n }\n\n defineReadOnly(this, \"fragments\", abi.map((fragment) => {\n return Fragment.from(fragment);\n }).filter((fragment) => (fragment != null)));\n\n defineReadOnly(this, \"_abiCoder\", getStatic<() => AbiCoder>(new.target, \"getAbiCoder\")());\n\n defineReadOnly(this, \"functions\", { });\n defineReadOnly(this, \"errors\", { });\n defineReadOnly(this, \"events\", { });\n defineReadOnly(this, \"structs\", { });\n\n // Add all fragments by their signature\n this.fragments.forEach((fragment) => {\n let bucket: { [ name: string ]: Fragment } = 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\", (fragment).outputs);\n bucket = this.functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.events;\n break;\n default:\n return;\n }\n\n let signature = fragment.format();\n if (bucket[signature]) {\n logger.warn(\"duplicate definition - \" + signature);\n return;\n }\n\n bucket[signature] = fragment;\n });\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\n defineReadOnly(this, \"_isInterface\", true);\n }\n\n format(format?: string): string | Array {\n if (!format) { format = FormatTypes.full; }\n if (format === FormatTypes.sighash) {\n logger.throwArgumentError(\"interface does not support formatting sighash\", \"format\", format);\n }\n\n const abi = this.fragments.map((fragment) => fragment.format(format));\n\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\n return abi;\n }\n\n // Sub-classes can override these to handle other blockchains\n static getAbiCoder(): AbiCoder {\n return defaultAbiCoder;\n }\n\n static getAddress(address: string): string {\n return getAddress(address);\n }\n\n static getSighash(functionFragment: FunctionFragment): string {\n return hexDataSlice(id(functionFragment.format()), 0, 4);\n }\n\n static getEventTopic(eventFragment: EventFragment): string {\n return id(eventFragment.format());\n }\n\n // Find a function definition by any means necessary (unless it is ambiguous)\n getFunction(nameOrSignatureOrSighash: string): FunctionFragment {\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\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 } else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching functions\", \"name\", name);\n }\n\n return this.functions[matching[0]];\n }\n\n // Normlize 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\n // Find an event definition by any means necessary (unless it is ambiguous)\n getEvent(nameOrSignatureOrTopic: string): EventFragment {\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\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 } else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching events\", \"name\", name);\n }\n\n return this.events[matching[0]];\n }\n\n // Normlize 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\n // Get the sighash (the bytes4 selector) used by Solidity to identify a function\n getSighash(functionFragment: FunctionFragment | string): string {\n if (typeof(functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n\n return getStatic<(f: FunctionFragment) => string>(this.constructor, \"getSighash\")(functionFragment);\n }\n\n // Get the topic (the bytes32 hash) used by Solidity to identify an event\n getEventTopic(eventFragment: EventFragment | string): string {\n if (typeof(eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n\n return getStatic<(e: EventFragment) => string>(this.constructor, \"getEventTopic\")(eventFragment);\n }\n\n\n _decodeParams(params: Array, data: BytesLike): Result {\n return this._abiCoder.decode(params, data)\n }\n\n _encodeParams(params: Array, values: Array): string {\n return this._abiCoder.encode(params, values)\n }\n\n encodeDeploy(values?: Array): string {\n return this._encodeParams(this.deploy.inputs, values || [ ]);\n }\n\n // Decode the data for a function call (e.g. tx.data)\n decodeFunctionData(functionFragment: FunctionFragment | string, data: BytesLike): Result {\n if (typeof(functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n\n const bytes = arrayify(data);\n\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\n return this._decodeParams(functionFragment.inputs, bytes.slice(4));\n }\n\n // Encode the data for a function call (e.g. tx.data)\n encodeFunctionData(functionFragment: FunctionFragment | string, values?: Array): string {\n if (typeof(functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n\n return hexlify(concat([\n this.getSighash(functionFragment),\n this._encodeParams(functionFragment.inputs, values || [ ])\n ]));\n }\n\n // Decode the result from a function call (e.g. from eth_call)\n decodeFunctionResult(functionFragment: FunctionFragment | string, data: BytesLike): Result {\n if (typeof(functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n\n let bytes = arrayify(data);\n\n let reason: string = null;\n let errorSignature: string = null;\n switch (bytes.length % this._abiCoder._getWordSize()) {\n case 0:\n try {\n return this._abiCoder.decode(functionFragment.outputs, bytes);\n } catch (error) { }\n break;\n\n case 4:\n if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n errorSignature = \"Error(string)\";\n reason = this._abiCoder.decode([ \"string\" ], bytes.slice(4))[0];\n }\n break;\n }\n\n return logger.throwError(\"call revert exception\", Logger.errors.CALL_EXCEPTION, {\n method: functionFragment.format(),\n errorSignature: errorSignature,\n errorArgs: [ reason ],\n reason: reason\n });\n }\n\n // Encode the result for a function call (e.g. for eth_call)\n encodeFunctionResult(functionFragment: FunctionFragment | string, values?: Array): string {\n if (typeof(functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n\n return hexlify(this._abiCoder.encode(functionFragment.outputs, values || [ ]));\n }\n\n // Create the filter for the event with search criteria (e.g. for eth_filterLog)\n encodeFilterTopics(eventFragment: EventFragment, values: Array): Array> {\n if (typeof(eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\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\n let topics: Array> = [];\n if (!eventFragment.anonymous) { topics.push(this.getEventTopic(eventFragment)); }\n\n const encodeTopic = (param: ParamType, value: any): string => {\n if (param.type === \"string\") {\n return id(value);\n } else if (param.type === \"bytes\") {\n return keccak256(hexlify(value));\n }\n\n // Check addresses are valid\n if (param.type === \"address\") { this._abiCoder.encode( [ \"address\" ], [ value ]); }\n return hexZeroPad(hexlify(value), 32);\n };\n\n values.forEach((value, index) => {\n\n let param = eventFragment.inputs[index];\n\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\n if (value == null) {\n topics.push(null);\n } else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n } else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n } else {\n topics.push(encodeTopic(param, value));\n }\n });\n\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n\n return topics;\n }\n\n encodeEventLog(eventFragment: EventFragment, values: Array): { data: string, topics: Array } {\n if (typeof(eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n\n const topics: Array = [ ];\n\n const dataTypes: Array = [ ];\n const dataValues: Array = [ ];\n\n if (!eventFragment.anonymous) {\n topics.push(this.getEventTopic(eventFragment));\n }\n\n if (values.length !== eventFragment.inputs.length) {\n logger.throwArgumentError(\"event arguments/values mismatch\", \"values\", values);\n }\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 } else if (param.type === \"bytes\") {\n topics.push(keccak256(value))\n } else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TOOD\n throw new Error(\"not implemented\");\n } else {\n topics.push(this._abiCoder.encode([ param.type] , [ value ]));\n }\n } else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n\n return {\n data: this._abiCoder.encode(dataTypes , dataValues),\n topics: topics\n };\n }\n\n // Decode a filter for the event and the search criteria\n decodeEventLog(eventFragment: EventFragment | string, data: BytesLike, topics?: Array): Result {\n if (typeof(eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\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\n let indexed: Array = [];\n let nonIndexed: Array = [];\n let dynamic: Array = [];\n\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 } else {\n indexed.push(param);\n dynamic.push(false);\n }\n } else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n\n let resultIndexed = (topics != null) ? this._abiCoder.decode(indexed, concat(topics)): null;\n let resultNonIndexed = this._abiCoder.decode(nonIndexed, data, true);\n\n let result: (Array & { [ key: string ]: any }) = [ ];\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 } catch (error) {\n result[index] = error;\n }\n }\n } else {\n try {\n result[index] = resultNonIndexed[nonIndexedIndex++];\n } catch (error) {\n result[index] = error;\n }\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\n // Make error named values throw on access\n if (value instanceof Error) {\n Object.defineProperty(result, param.name, {\n get: () => { throw wrapAccessError(`property ${ JSON.stringify(param.name) }`, value); }\n });\n } else {\n result[param.name] = value;\n }\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 get: () => { throw wrapAccessError(`index ${ i }`, value); }\n });\n }\n }\n\n return Object.freeze(result);\n }\n\n // Given a transaction, find the matching function fragment (if any) and\n // determine all its properties and call parameters\n parseTransaction(tx: { data: string, value?: BigNumberish }): TransactionDescription {\n let fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase())\n\n if (!fragment) { 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\n // Given an event log, find the matching event fragment (if any) and\n // determine all its properties and values\n parseLog(log: { topics: Array, data: string}): LogDescription {\n let fragment = this.getEvent(log.topics[0]);\n\n if (!fragment || fragment.anonymous) { 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 jsut a fragment?\n\n\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\n\n /*\n static from(value: Array | 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\n static isInterface(value: any): value is Interface {\n return !!(value && value._isInterface);\n }\n}\n\n","\"use strict\";\n\nimport { ConstructorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, JsonFragment, JsonFragmentType, ParamType } from \"./fragments\";\nimport { AbiCoder, CoerceFunc, defaultAbiCoder } from \"./abi-coder\";\nimport { checkResultErrors, Indexed, Interface, LogDescription, Result, TransactionDescription } from \"./interface\";\n\nexport {\n ConstructorFragment,\n EventFragment,\n Fragment,\n FunctionFragment,\n ParamType,\n FormatTypes,\n\n AbiCoder,\n defaultAbiCoder,\n\n Interface,\n Indexed,\n\n /////////////////////////\n // Types\n\n CoerceFunc,\n JsonFragment,\n JsonFragmentType,\n\n Result,\n checkResultErrors,\n\n LogDescription,\n TransactionDescription\n};\n","export const version = \"abstract-provider/5.0.6\";\n","\"use strict\";\n\nimport { BigNumber, BigNumberish } from \"@ethersproject/bignumber\";\nimport { BytesLike, isHexString } from \"@ethersproject/bytes\";\nimport { Network } from \"@ethersproject/networks\";\nimport { Deferrable, Description, defineReadOnly } from \"@ethersproject/properties\";\nimport { Transaction } from \"@ethersproject/transactions\";\nimport { OnceBlockable } from \"@ethersproject/web\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\n///////////////////////////////\n// Exported Types\n\n\nexport type TransactionRequest = {\n to?: string,\n from?: string,\n nonce?: BigNumberish,\n\n gasLimit?: BigNumberish,\n gasPrice?: BigNumberish,\n\n data?: BytesLike,\n value?: BigNumberish,\n chainId?: number\n}\n\nexport interface TransactionResponse extends Transaction {\n hash: string;\n\n // Only if a transaction has been mined\n blockNumber?: number,\n blockHash?: string,\n timestamp?: number,\n\n confirmations: number,\n\n // Not optional (as it is in Transaction)\n from: string;\n\n // The raw transaction\n raw?: string,\n\n // This function waits until the transaction has been mined\n wait: (confirmations?: number) => Promise\n};\n\nexport type BlockTag = string | number;\n\ninterface _Block {\n hash: string;\n parentHash: string;\n number: number;\n\n timestamp: number;\n nonce: string;\n difficulty: number;\n\n gasLimit: BigNumber;\n gasUsed: BigNumber;\n\n miner: string;\n extraData: string;\n}\n\nexport interface Block extends _Block {\n transactions: Array;\n}\n\nexport interface BlockWithTransactions extends _Block {\n transactions: Array;\n}\n\n\nexport interface Log {\n blockNumber: number;\n blockHash: string;\n transactionIndex: number;\n\n removed: boolean;\n\n address: string;\n data: string;\n\n topics: Array;\n\n transactionHash: string;\n logIndex: number;\n}\n\nexport interface TransactionReceipt {\n to: string;\n from: string;\n contractAddress: string,\n transactionIndex: number,\n root?: string,\n gasUsed: BigNumber,\n logsBloom: string,\n blockHash: string,\n transactionHash: string,\n logs: Array,\n blockNumber: number,\n confirmations: number,\n cumulativeGasUsed: BigNumber,\n byzantium: boolean,\n status?: number\n};\n\nexport interface EventFilter {\n address?: string;\n topics?: Array>;\n}\n\nexport interface Filter extends EventFilter {\n fromBlock?: BlockTag,\n toBlock?: BlockTag,\n}\n\nexport interface FilterByBlockHash extends EventFilter {\n blockHash?: string;\n}\n\n//export type CallTransactionable = {\n// call(transaction: TransactionRequest): Promise;\n//};\n\nexport abstract class ForkEvent extends Description {\n readonly expiry: number;\n\n readonly _isForkEvent?: boolean;\n\n static isForkEvent(value: any): value is ForkEvent {\n return !!(value && value._isForkEvent);\n }\n}\n\nexport class BlockForkEvent extends ForkEvent {\n readonly blockHash: string;\n\n readonly _isBlockForkEvent?: boolean;\n\n constructor(blockHash: string, expiry?: number) {\n if (!isHexString(blockHash, 32)) {\n logger.throwArgumentError(\"invalid blockHash\", \"blockHash\", blockHash);\n }\n\n super({\n _isForkEvent: true,\n _isBlockForkEvent: true,\n expiry: (expiry || 0),\n blockHash: blockHash\n });\n }\n}\n\nexport class TransactionForkEvent extends ForkEvent {\n readonly hash: string;\n\n readonly _isTransactionOrderForkEvent?: boolean;\n\n constructor(hash: string, expiry?: number) {\n if (!isHexString(hash, 32)) {\n logger.throwArgumentError(\"invalid transaction hash\", \"hash\", hash);\n }\n\n super({\n _isForkEvent: true,\n _isTransactionForkEvent: true,\n expiry: (expiry || 0),\n hash: hash\n });\n }\n}\n\nexport class TransactionOrderForkEvent extends ForkEvent {\n readonly beforeHash: string;\n readonly afterHash: string;\n\n constructor(beforeHash: string, afterHash: string, expiry?: number) {\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\n super({\n _isForkEvent: true,\n _isTransactionOrderForkEvent: true,\n expiry: (expiry || 0),\n beforeHash: beforeHash,\n afterHash: afterHash\n });\n }\n}\n\nexport type EventType = string | Array> | EventFilter | ForkEvent;\n\nexport type Listener = (...args: Array) => void;\n\n///////////////////////////////\n// Exported Abstracts\n\nexport abstract class Provider implements OnceBlockable {\n\n // Network\n abstract getNetwork(): Promise;\n\n // Latest State\n abstract getBlockNumber(): Promise;\n abstract getGasPrice(): Promise;\n\n // Account\n abstract getBalance(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise;\n abstract getTransactionCount(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise;\n abstract getCode(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise ;\n abstract getStorageAt(addressOrName: string | Promise, position: BigNumberish | Promise, blockTag?: BlockTag | Promise): Promise;\n\n // Execution\n abstract sendTransaction(signedTransaction: string | Promise): Promise;\n abstract call(transaction: Deferrable, blockTag?: BlockTag | Promise): Promise;\n abstract estimateGas(transaction: Deferrable): Promise;\n\n // Queries\n abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise): Promise;\n abstract getBlockWithTransactions(blockHashOrBlockTag: BlockTag | string | Promise): Promise;\n abstract getTransaction(transactionHash: string): Promise;\n abstract getTransactionReceipt(transactionHash: string): Promise;\n\n // Bloom-filter Queries\n abstract getLogs(filter: Filter): Promise>;\n\n // ENS\n abstract resolveName(name: string | Promise): Promise;\n abstract lookupAddress(address: string | Promise): Promise;\n\n // Event Emitter (ish)\n abstract on(eventName: EventType, listener: Listener): Provider;\n abstract once(eventName: EventType, listener: Listener): Provider;\n abstract emit(eventName: EventType, ...args: Array): boolean\n abstract listenerCount(eventName?: EventType): number;\n abstract listeners(eventName?: EventType): Array;\n abstract off(eventName: EventType, listener?: Listener): Provider;\n abstract removeAllListeners(eventName?: EventType): Provider;\n\n // Alias for \"on\"\n addListener(eventName: EventType, listener: Listener): Provider {\n return this.on(eventName, listener);\n }\n\n // Alias for \"off\"\n removeListener(eventName: EventType, listener: Listener): Provider {\n return this.off(eventName, listener);\n }\n\n // @TODO: This *could* be implemented here, but would pull in events...\n abstract waitForTransaction(transactionHash: string, confirmations?: number, timeout?: number): Promise;\n\n readonly _isProvider: boolean;\n\n constructor() {\n logger.checkAbstract(new.target, Provider);\n defineReadOnly(this, \"_isProvider\", true);\n }\n\n static isProvider(value: any): value is Provider {\n return !!(value && value._isProvider);\n }\n\n/*\n static getResolver(network: Network, callable: CallTransactionable, namehash: string): string {\n // No ENS...\n if (!network.ensAddress) {\n errors.throwError(\n \"network does support ENS\",\n errors.UNSUPPORTED_OPERATION,\n { operation: \"ENS\", network: network.name }\n );\n }\n\n // Not a namehash\n if (!isHexString(namehash, 32)) {\n errors.throwArgumentError(\"invalid name hash\", \"namehash\", namehash);\n }\n\n // keccak256(\"resolver(bytes32)\")\n let data = \"0x0178b8bf\" + namehash.substring(2);\n let transaction = { to: network.ensAddress, data: data };\n\n return provider.call(transaction).then((data) => {\n return provider.formatter.callAddress(data);\n });\n }\n\n static resolveNamehash(network: Network, callable: CallTransactionable, namehash: string): string {\n return this.getResolver(network, callable, namehash).then((resolverAddress) => {\n if (!resolverAddress) { return null; }\n\n // keccak256(\"addr(bytes32)\")\n let data = \"0x3b3b57de\" + namehash(name).substring(2);\n let transaction = { to: resolverAddress, data: data };\n return callable.call(transaction).then((data) => {\n return this.formatter.callAddress(data);\n });\n\n })\n }\n*/\n}\n","export const version = \"abstract-signer/5.0.8\";\n","\"use strict\";\n\nimport { BlockTag, Provider, TransactionRequest, TransactionResponse } from \"@ethersproject/abstract-provider\";\nimport { BigNumber, BigNumberish } from \"@ethersproject/bignumber\";\nimport { Bytes, BytesLike } from \"@ethersproject/bytes\";\nimport { Deferrable, defineReadOnly, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nconst allowedTransactionKeys: Array = [\n \"chainId\", \"data\", \"from\", \"gasLimit\", \"gasPrice\", \"nonce\", \"to\", \"value\"\n];\n\nconst forwardErrors = [\n Logger.errors.INSUFFICIENT_FUNDS,\n Logger.errors.NONCE_EXPIRED,\n Logger.errors.REPLACEMENT_UNDERPRICED,\n];\n\n// EIP-712 Typed Data\n// See: https://eips.ethereum.org/EIPS/eip-712\n\nexport interface TypedDataDomain {\n name?: string;\n version?: string;\n chainId?: BigNumberish;\n verifyingContract?: string;\n salt?: BytesLike;\n};\n\nexport interface TypedDataField {\n name: string;\n type: string;\n};\n\n// Sub-classes of Signer may optionally extend this interface to indicate\n// they have a private key available synchronously\nexport interface ExternallyOwnedAccount {\n readonly address: string;\n readonly privateKey: string;\n}\n\n// Sub-Class Notes:\n// - A Signer MUST always make sure, that if present, the \"from\" field\n// matches the Signer, before sending or signing a transaction\n// - A Signer SHOULD always wrap private information (such as a private\n// key or mnemonic) in a function, so that console.log does not leak\n// the data\n\n// @TODO: This is a temporary measure to preserse backwards compatibility\n// In v6, the method on TypedDataSigner will be added to Signer\nexport interface TypedDataSigner {\n _signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise;\n}\n\nexport abstract class Signer {\n readonly provider?: Provider;\n\n ///////////////////\n // Sub-classes MUST implement these\n\n // Returns the checksum address\n abstract getAddress(): Promise\n\n // Returns the signed prefixed-message. This MUST treat:\n // - Bytes as a binary message\n // - string as a UTF8-message\n // i.e. \"0x1234\" is a SIX (6) byte string, NOT 2 bytes of data\n abstract signMessage(message: Bytes | string): Promise;\n\n // Signs a transaxction and returns the fully serialized, signed transaction.\n // The EXACT transaction MUST be signed, and NO additional properties to be added.\n // - This MAY throw if signing transactions is not supports, but if\n // it does, sentTransaction MUST be overridden.\n abstract signTransaction(transaction: Deferrable): Promise;\n\n // Returns a new instance of the Signer, connected to provider.\n // This MAY throw if changing providers is not supported.\n abstract connect(provider: Provider): Signer;\n\n readonly _isSigner: boolean;\n\n\n ///////////////////\n // Sub-classes MUST call super\n constructor() {\n logger.checkAbstract(new.target, Signer);\n defineReadOnly(this, \"_isSigner\", true);\n }\n\n\n ///////////////////\n // Sub-classes MAY override these\n\n async getBalance(blockTag?: BlockTag): Promise {\n this._checkProvider(\"getBalance\");\n return await this.provider.getBalance(this.getAddress(), blockTag);\n }\n\n async getTransactionCount(blockTag?: BlockTag): Promise {\n this._checkProvider(\"getTransactionCount\");\n return await this.provider.getTransactionCount(this.getAddress(), blockTag);\n }\n\n // Populates \"from\" if unspecified, and estimates the gas for the transation\n async estimateGas(transaction: Deferrable): Promise {\n this._checkProvider(\"estimateGas\");\n const tx = await resolveProperties(this.checkTransaction(transaction));\n return await this.provider.estimateGas(tx);\n }\n\n // Populates \"from\" if unspecified, and calls with the transation\n async call(transaction: Deferrable, blockTag?: BlockTag): Promise {\n this._checkProvider(\"call\");\n const tx = await resolveProperties(this.checkTransaction(transaction));\n return await 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: Deferrable): Promise {\n this._checkProvider(\"sendTransaction\");\n return this.populateTransaction(transaction).then((tx) => {\n return this.signTransaction(tx).then((signedTx) => {\n return this.provider.sendTransaction(signedTx);\n });\n });\n }\n\n async getChainId(): Promise {\n this._checkProvider(\"getChainId\");\n const network = await this.provider.getNetwork();\n return network.chainId;\n }\n\n async getGasPrice(): Promise {\n this._checkProvider(\"getGasPrice\");\n return await this.provider.getGasPrice();\n }\n\n async resolveName(name: string): Promise {\n this._checkProvider(\"resolveName\");\n return await this.provider.resolveName(name);\n }\n\n\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: Deferrable): Deferrable {\n for (const key in transaction) {\n if (allowedTransactionKeys.indexOf(key) === -1) {\n logger.throwArgumentError(\"invalid transaction key: \" + key, \"transaction\", transaction);\n }\n }\n\n const tx = shallowCopy(transaction);\n\n if (tx.from == null) {\n tx.from = this.getAddress();\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] !== result[1]) {\n logger.throwArgumentError(\"from address mismatch\", \"transaction\", transaction);\n }\n return result[0];\n });\n }\n\n return tx;\n }\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 async populateTransaction(transaction: Deferrable): Promise {\n\n const tx: Deferrable = await resolveProperties(this.checkTransaction(transaction))\n\n if (tx.to != null) { tx.to = Promise.resolve(tx.to).then((to) => this.resolveName(to)); }\n if (tx.gasPrice == null) { tx.gasPrice = this.getGasPrice(); }\n if (tx.nonce == null) { 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\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\n if (tx.chainId == null) {\n tx.chainId = this.getChainId();\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\n return await resolveProperties(tx);\n }\n\n\n ///////////////////\n // Sub-classes SHOULD leave these alone\n\n _checkProvider(operation?: string): void {\n if (!this.provider) { logger.throwError(\"missing provider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: (operation || \"_checkProvider\") });\n }\n }\n\n static isSigner(value: any): value is Signer {\n return !!(value && value._isSigner);\n }\n}\n\nexport class VoidSigner extends Signer implements TypedDataSigner {\n readonly address: string;\n\n constructor(address: string, provider?: Provider) {\n logger.checkNew(new.target, VoidSigner);\n super();\n defineReadOnly(this, \"address\", address);\n defineReadOnly(this, \"provider\", provider || null);\n }\n\n getAddress(): Promise {\n return Promise.resolve(this.address);\n }\n\n _fail(message: string, operation: string): Promise {\n return Promise.resolve().then(() => {\n logger.throwError(message, Logger.errors.UNSUPPORTED_OPERATION, { operation: operation });\n });\n }\n\n signMessage(message: Bytes | string): Promise {\n return this._fail(\"VoidSigner cannot sign messages\", \"signMessage\");\n }\n\n signTransaction(transaction: Deferrable): Promise {\n return this._fail(\"VoidSigner cannot sign transactions\", \"signTransaction\");\n }\n\n _signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise {\n return this._fail(\"VoidSigner cannot sign typed data\", \"signTypedData\");\n }\n\n connect(provider: Provider): VoidSigner {\n return new VoidSigner(this.address, provider);\n }\n}\n\n","export const version = \"contracts/5.0.7\";\n","\"use strict\";\n\nimport { checkResultErrors, EventFragment, Fragment, FunctionFragment, Indexed, Interface, JsonFragment, LogDescription, ParamType, Result } from \"@ethersproject/abi\";\nimport { Block, BlockTag, Filter, FilterByBlockHash, Listener, Log, Provider, TransactionReceipt, TransactionRequest, TransactionResponse } from \"@ethersproject/abstract-provider\";\nimport { Signer, VoidSigner } from \"@ethersproject/abstract-signer\";\nimport { getAddress, getContractAddress } from \"@ethersproject/address\";\nimport { BigNumber, BigNumberish } from \"@ethersproject/bignumber\";\nimport { arrayify, BytesLike, concat, hexlify, isBytes, isHexString } from \"@ethersproject/bytes\";\nimport { Deferrable, defineReadOnly, deepCopy, getStatic, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\n// @TOOD remove dependences transactions\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\n\nconst logger = new Logger(version);\n\nexport interface Overrides {\n gasLimit?: BigNumberish | Promise;\n gasPrice?: BigNumberish | Promise;\n nonce?: BigNumberish | Promise;\n};\n\nexport interface PayableOverrides extends Overrides {\n value?: BigNumberish | Promise;\n}\n\nexport interface CallOverrides extends PayableOverrides {\n blockTag?: BlockTag | Promise;\n from?: string | Promise;\n}\n\n// @TODO: Better hierarchy with: (in v6)\n// - abstract-provider:TransactionRequest\n// - transactions:Transaction\n// - transaction:UnsignedTransaction\n\nexport interface PopulatedTransaction {\n to?: string;\n from?: string;\n nonce?: number;\n\n gasLimit?: BigNumber;\n gasPrice?: BigNumber;\n\n data?: string;\n value?: BigNumber;\n chainId?: number;\n};\n\nexport type EventFilter = {\n address?: string;\n topics?: Array>;\n};\n\n\nexport type ContractFunction = (...args: Array) => Promise;\n\n\n// The (n + 1)th parameter passed to contract event callbacks\nexport interface Event extends Log {\n\n // The event name\n event?: string;\n\n // The event signature\n eventSignature?: string;\n\n // The parsed arguments to the event\n args?: Result;\n\n // If parsing the arguments failed, this is the error\n decodeError?: Error;\n\n // A function that can be used to decode event data and topics\n decode?: (data: string, topics?: Array) => any;\n\n // A function that will remove the listener responsible for this event (if any)\n removeListener: () => void;\n\n // Get blockchain details about this event's block and transaction\n getBlock: () => Promise;\n getTransaction: () => Promise;\n getTransactionReceipt: () => Promise;\n}\n\nexport interface ContractReceipt extends TransactionReceipt {\n events?: Array;\n}\n\nexport interface ContractTransaction extends TransactionResponse {\n wait(confirmations?: number): Promise;\n}\n\n///////////////////////////////\n\nconst allowedTransactionKeys: { [ key: string ]: boolean } = {\n chainId: true, data: true, from: true, gasLimit: true, gasPrice:true, nonce: true, to: true, value: true\n}\n\nasync function resolveName(resolver: Signer | Provider, nameOrPromise: string | Promise): Promise {\n const name = await nameOrPromise;\n\n // If it is already an address, just use it (after adding checksum)\n try {\n return getAddress(name);\n } catch (error) { }\n\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\n const address = await resolver.resolveName(name);\n\n if (address == null) {\n logger.throwArgumentError(\"resolver or addr is not configured for ENS name\", \"name\", name);\n }\n\n return address;\n}\n\n// Recursively replaces ENS names with promises to resolve the name and resolves all properties\nasync function resolveAddresses(resolver: Signer | Provider, value: any, paramType: ParamType | Array): Promise {\n if (Array.isArray(paramType)) {\n return await Promise.all(paramType.map((paramType, index) => {\n return resolveAddresses(\n resolver,\n ((Array.isArray(value)) ? value[index]: value[paramType.name]),\n paramType\n );\n }));\n }\n\n if (paramType.type === \"address\") {\n return await resolveName(resolver, value);\n }\n\n if (paramType.type === \"tuple\") {\n return await resolveAddresses(resolver, value, paramType.components);\n }\n\n if (paramType.baseType === \"array\") {\n if (!Array.isArray(value)) { return Promise.reject(new Error(\"invalid value for array\")); }\n return await Promise.all(value.map((v) => resolveAddresses(resolver, v, paramType.arrayChildren)));\n }\n\n return value;\n}\n\nasync function populateTransaction(contract: Contract, fragment: FunctionFragment, args: Array): Promise {\n // If an extra argument is given, it is overrides\n let overrides: CallOverrides = { };\n if (args.length === fragment.inputs.length + 1 && typeof(args[args.length - 1]) === \"object\") {\n overrides = shallowCopy(args.pop());\n }\n\n // Make sure the parameter count matches\n logger.checkArgumentCount(args.length, fragment.inputs.length, \"passed to contract\");\n\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(async (check) => {\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\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\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\n // Wait for all dependencies to be resolved (prefer the signer over the provider)\n const resolved = await resolveProperties({\n args: resolveAddresses(contract.signer || contract.provider, args, fragment.inputs),\n address: contract.resolvedAddress,\n overrides: (resolveProperties(overrides) || { })\n });\n\n // The ABI coded transaction\n const data = contract.interface.encodeFunctionData(fragment, resolved.args);\n const tx: PopulatedTransaction = {\n data: data,\n to: resolved.address\n };\n\n // Resolved Overrides\n const ro = resolved.overrides;\n\n // Populate simple overrides\n if (ro.nonce != null) { tx.nonce = BigNumber.from(ro.nonce).toNumber(); }\n if (ro.gasLimit != null) { tx.gasLimit = BigNumber.from(ro.gasLimit); }\n if (ro.gasPrice != null) { tx.gasPrice = BigNumber.from(ro.gasPrice); }\n if (ro.from != null) { tx.from = ro.from; }\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 // Conmpute the intrinisic 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]) { intrinsic += 64; }\n }\n tx.gasLimit = BigNumber.from(fragment.gas).add(intrinsic);\n }\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\n // Remvoe the overrides\n delete overrides.nonce;\n delete overrides.gasLimit;\n delete overrides.gasPrice;\n delete overrides.from;\n delete overrides.value;\n\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\n return tx;\n}\n\n\nfunction buildPopulate(contract: Contract, fragment: FunctionFragment): ContractFunction {\n return function(...args: Array): Promise {\n return populateTransaction(contract, fragment, args);\n };\n}\n\nfunction buildEstimate(contract: Contract, fragment: FunctionFragment): ContractFunction {\n const signerOrProvider = (contract.signer || contract.provider);\n return async function(...args: Array): Promise {\n if (!signerOrProvider) {\n logger.throwError(\"estimate require a provider or signer\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"estimateGas\"\n })\n }\n\n const tx = await populateTransaction(contract, fragment, args);\n return await signerOrProvider.estimateGas(tx);\n };\n}\n\nfunction buildCall(contract: Contract, fragment: FunctionFragment, collapseSimple: boolean): ContractFunction {\n const signerOrProvider = (contract.signer || contract.provider);\n\n return async function(...args: Array): Promise {\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 = await overrides.blockTag;\n }\n delete overrides.blockTag;\n args.push(overrides);\n }\n\n // If the contract was just deployed, wait until it is mined\n if (contract.deployTransaction != null) {\n await contract._deployed(blockTag);\n }\n\n // Call a node and get the result\n const tx = await populateTransaction(contract, fragment, args);\n const result = await signerOrProvider.call(tx, blockTag);\n\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: Contract, fragment: FunctionFragment): ContractFunction {\n return async function(...args: Array): Promise {\n if (!contract.signer) {\n logger.throwError(\"sending a transaction requires a signer\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"sendTransaction\"\n })\n }\n\n // If the contract was just deployed, wait until it is minded\n if (contract.deployTransaction != null) {\n await contract._deployed();\n }\n\n const txRequest = await populateTransaction(contract, fragment, args);\n\n const tx = await contract.signer.sendTransaction(txRequest);\n\n // Tweak the tw.wait so the receipt has extra properties\n const wait = tx.wait.bind(tx);\n tx.wait = (confirmations?: number) => {\n return wait(confirmations).then((receipt: ContractReceipt) => {\n receipt.events = receipt.logs.map((log) => {\n let event: Event = (deepCopy(log));\n let parsed: LogDescription = null;\n try {\n parsed = contract.interface.parseLog(log);\n } catch (e){ }\n\n // Successfully parsed the event log; include it\n if (parsed) {\n event.args = parsed.args;\n event.decode = (data: BytesLike, topics?: Array) => {\n return contract.interface.decodeEventLog(parsed.eventFragment, data, topics);\n };\n event.event = parsed.name;\n event.eventSignature = parsed.signature;\n }\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\n return event;\n });\n\n return receipt;\n });\n };\n return tx;\n };\n}\n\nfunction buildDefault(contract: Contract, fragment: FunctionFragment, collapseSimple: boolean): ContractFunction {\n if (fragment.constant) {\n return buildCall(contract, fragment, collapseSimple);\n }\n return buildSend(contract, fragment);\n}\n\nfunction getEventTag(filter: EventFilter): string {\n if (filter.address && (filter.topics == null || filter.topics.length === 0)) {\n return \"*\";\n }\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}\n\nclass RunningEvent {\n readonly tag: string;\n readonly filter: EventFilter;\n private _listeners: Array<{ listener: Listener, once: boolean }>;\n\n constructor(tag: string, filter: EventFilter) {\n defineReadOnly(this, \"tag\", tag);\n defineReadOnly(this, \"filter\", filter);\n this._listeners = [ ];\n }\n\n addListener(listener: Listener, once: boolean): void {\n this._listeners.push({ listener: listener, once: once });\n }\n\n removeListener(listener: Listener): void {\n let done = false;\n this._listeners = this._listeners.filter((item) => {\n if (done || item.listener !== listener) { return true; }\n done = true;\n return false;\n });\n }\n\n removeAllListeners(): void {\n this._listeners = [];\n }\n\n listeners(): Array {\n return this._listeners.map((i) => i.listener);\n }\n\n listenerCount(): number {\n return this._listeners.length;\n }\n\n run(args: Array): number {\n const listenerCount = this.listenerCount();\n this._listeners = this._listeners.filter((item) => {\n\n const argsCopy = args.slice();\n\n // Call the callback in the next event loop\n setTimeout(() => {\n item.listener.apply(this, argsCopy);\n }, 0);\n\n // Reschedule it if it not \"once\"\n return !(item.once);\n });\n\n return listenerCount;\n }\n\n prepareEvent(event: Event): void {\n }\n\n // Returns the array that will be applied to an emit\n getEmit(event: Event): Array {\n return [ event ];\n }\n}\n\nclass ErrorRunningEvent extends RunningEvent {\n constructor() {\n super(\"error\", null);\n }\n}\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\n// A Fragment Event will populate all the properties that Wildcard\n// will, and additioanlly dereference the arguments when emitting\nclass FragmentRunningEvent extends RunningEvent {\n readonly address: string;\n readonly interface: Interface;\n readonly fragment: EventFragment;\n\n constructor(address: string, contractInterface: Interface, fragment: EventFragment, topics?: Array>) {\n const filter: EventFilter = {\n address: address\n }\n\n let topic = contractInterface.getEventTopic(fragment);\n if (topics) {\n if (topic !== topics[0]) { logger.throwArgumentError(\"topic mismatch\", \"topics\", topics); }\n filter.topics = topics.slice();\n } else {\n filter.topics = [ topic ];\n }\n\n super(getEventTag(filter), filter);\n defineReadOnly(this, \"address\", address);\n defineReadOnly(this, \"interface\", contractInterface);\n defineReadOnly(this, \"fragment\", fragment);\n }\n\n\n prepareEvent(event: Event): void {\n super.prepareEvent(event);\n\n event.event = this.fragment.name;\n event.eventSignature = this.fragment.format();\n\n event.decode = (data: BytesLike, topics?: Array) => {\n return this.interface.decodeEventLog(this.fragment, data, topics);\n };\n\n try {\n event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);\n } catch (error) {\n event.args = null;\n event.decodeError = error;\n }\n }\n\n getEmit(event: Event): Array {\n const errors = checkResultErrors(event.args);\n if (errors.length) { throw errors[0].error; }\n\n const args = (event.args || []).slice();\n args.push(event);\n return args;\n }\n}\n\n// A Wildard 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 readonly address: string;\n readonly interface: Interface;\n\n constructor(address: string, contractInterface: Interface) {\n super(\"*\", { address: address });\n defineReadOnly(this, \"address\", address);\n defineReadOnly(this, \"interface\", contractInterface);\n }\n\n prepareEvent(event: Event): void {\n super.prepareEvent(event);\n\n try {\n const parsed = this.interface.parseLog(event);\n event.event = parsed.name;\n event.eventSignature = parsed.signature;\n\n event.decode = (data: BytesLike, topics?: Array) => {\n return this.interface.decodeEventLog(parsed.eventFragment, data, topics);\n };\n\n event.args = parsed.args;\n } catch (error) {\n // No matching event\n }\n }\n}\n\nexport type ContractInterface = string | Array | Interface;\n\ntype InterfaceFunc = (contractInterface: ContractInterface) => Interface;\n\n\nexport class Contract {\n readonly address: string;\n readonly interface: Interface;\n\n readonly signer: Signer;\n readonly provider: Provider;\n\n readonly functions: { [ name: string ]: ContractFunction };\n\n readonly callStatic: { [ name: string ]: ContractFunction };\n readonly estimateGas: { [ name: string ]: ContractFunction };\n readonly populateTransaction: { [ name: string ]: ContractFunction };\n\n readonly filters: { [ name: string ]: (...args: Array) => EventFilter };\n\n // The meta-class properties\n readonly [ key: string ]: ContractFunction | any;\n\n // This will always be an address. This will only differ from\n // address if an ENS name was used in the constructor\n readonly resolvedAddress: Promise;\n\n // This is only set if the contract was created with a call to deploy\n readonly deployTransaction: TransactionResponse;\n\n _deployedPromise: Promise;\n\n // A list of RunningEvents to track listsners for each event tag\n _runningEvents: { [ eventTag: string ]: RunningEvent };\n\n // Wrapped functions to call emit and allow deregistration from the provider\n _wrappedEmits: { [ eventTag: string ]: (...args: Array) => void };\n\n constructor(addressOrName: string, contractInterface: ContractInterface, signerOrProvider?: Signer | Provider) {\n logger.checkNew(new.target, Contract);\n\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\n if (signerOrProvider == null) {\n defineReadOnly(this, \"provider\", null);\n defineReadOnly(this, \"signer\", null);\n } else if (Signer.isSigner(signerOrProvider)) {\n defineReadOnly(this, \"provider\", signerOrProvider.provider || null);\n defineReadOnly(this, \"signer\", signerOrProvider);\n } else if (Provider.isProvider(signerOrProvider)) {\n defineReadOnly(this, \"provider\", signerOrProvider);\n defineReadOnly(this, \"signer\", null);\n } else {\n logger.throwArgumentError(\"invalid signer or provider\", \"signerOrProvider\", signerOrProvider);\n }\n\n defineReadOnly(this, \"callStatic\", { });\n defineReadOnly(this, \"estimateGas\", { });\n defineReadOnly(this, \"functions\", { });\n defineReadOnly(this, \"populateTransaction\", { });\n\n defineReadOnly(this, \"filters\", { });\n\n {\n const uniqueFilters: { [ name: string ]: Array } = { };\n Object.keys(this.interface.events).forEach((eventSignature) => {\n const event = this.interface.events[eventSignature];\n defineReadOnly(this.filters, eventSignature, (...args: Array) => {\n return {\n address: this.address,\n topics: this.interface.encodeFilterTopics(event, args)\n }\n });\n if (!uniqueFilters[event.name]) { uniqueFilters[event.name] = [ ]; }\n uniqueFilters[event.name].push(eventSignature);\n });\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 } else {\n logger.warn(`Duplicate definition of ${ name } (${ filters.join(\", \")})`);\n }\n });\n }\n\n defineReadOnly(this, \"_runningEvents\", { });\n defineReadOnly(this, \"_wrappedEmits\", { });\n\n defineReadOnly(this, \"address\", addressOrName);\n if (this.provider) {\n defineReadOnly(this, \"resolvedAddress\", resolveName(this.provider, addressOrName));\n } else {\n try {\n defineReadOnly(this, \"resolvedAddress\", Promise.resolve(getAddress(addressOrName)));\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\n const uniqueNames: { [ name: string ]: Array } = { };\n const uniqueSignatures: { [ signature: string ]: boolean } = { };\n Object.keys(this.interface.functions).forEach((signature) => {\n const fragment = this.interface.functions[signature];\n\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(name) }`);\n return;\n }\n uniqueSignatures[signature] = true;\n\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]) { uniqueNames[name] = [ ]; }\n uniqueNames[name].push(signature);\n }\n\n if (this[signature] == null) {\n defineReadOnly(this, signature, buildDefault(this, fragment, true));\n }\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\n if (this.callStatic[signature] == null) {\n defineReadOnly(this.callStatic, signature, buildCall(this, fragment, true));\n }\n\n if (this.populateTransaction[signature] == null) {\n defineReadOnly(this.populateTransaction, signature, buildPopulate(this, fragment));\n }\n\n if (this.estimateGas[signature] == null) {\n defineReadOnly(this.estimateGas, signature, buildEstimate(this, fragment));\n }\n });\n\n Object.keys(uniqueNames).forEach((name) => {\n\n // Ambiguous names to not get attached as bare names\n const signatures = uniqueNames[name];\n if (signatures.length > 1) { return; }\n\n const signature = signatures[0];\n\n if (this[name] == null) {\n defineReadOnly(this, name, this[signature]);\n }\n\n if (this.functions[name] == null) {\n defineReadOnly(this.functions, name, this.functions[signature]);\n }\n\n if (this.callStatic[name] == null) {\n defineReadOnly(this.callStatic, name, this.callStatic[signature]);\n }\n\n if (this.populateTransaction[name] == null) {\n defineReadOnly(this.populateTransaction, name, this.populateTransaction[signature]);\n }\n\n if (this.estimateGas[name] == null) {\n defineReadOnly(this.estimateGas, name, this.estimateGas[signature]);\n }\n });\n }\n\n static getContractAddress(transaction: { from: string, nonce: BigNumberish }): string {\n return getContractAddress(transaction);\n }\n\n static getInterface(contractInterface: ContractInterface): Interface {\n if (Interface.isInterface(contractInterface)) {\n return contractInterface;\n }\n return new Interface(contractInterface);\n }\n\n // @TODO: Allow timeout?\n deployed(): Promise {\n return this._deployed();\n }\n\n _deployed(blockTag?: BlockTag): Promise {\n if (!this._deployedPromise) {\n\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\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\n return this._deployedPromise;\n }\n\n // @TODO:\n // estimateFallback(overrides?: TransactionRequest): Promise\n\n // @TODO:\n // estimateDeploy(bytecode: string, ...args): Promise\n\n fallback(overrides?: TransactionRequest): Promise {\n if (!this.signer) {\n logger.throwError(\"sending a transactions require a signer\", Logger.errors.UNSUPPORTED_OPERATION, { operation: \"sendTransaction(fallback)\" })\n }\n\n const tx: Deferrable = shallowCopy(overrides || {});\n\n [\"from\", \"to\"].forEach(function(key) {\n if ((tx)[key] == null) { return; }\n logger.throwError(\"cannot override \" + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key })\n });\n\n tx.to = this.resolvedAddress;\n return this.deployed().then(() => {\n return this.signer.sendTransaction(tx);\n });\n }\n\n // Reconnect to a different signer or provider\n connect(signerOrProvider: Signer | Provider | string): Contract {\n if (typeof(signerOrProvider) === \"string\") {\n signerOrProvider = new VoidSigner(signerOrProvider, this.provider);\n }\n\n const contract = new (<{ new(...args: any[]): Contract }>(this.constructor))(this.address, this.interface, signerOrProvider);\n if (this.deployTransaction) {\n defineReadOnly(contract, \"deployTransaction\", this.deployTransaction);\n }\n return contract;\n }\n\n // Re-attach to a different on-chain instance of this contract\n attach(addressOrName: string): Contract {\n return new (<{ new(...args: any[]): Contract }>(this.constructor))(addressOrName, this.interface, this.signer || this.provider);\n }\n\n static isIndexed(value: any): value is Indexed {\n return Indexed.isIndexed(value);\n }\n\n private _normalizeRunningEvent(runningEvent: RunningEvent): 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\n private _getRunningEvent(eventName: EventFilter | string): RunningEvent {\n if (typeof(eventName) === \"string\") {\n\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\n // Listen for any event that is registered\n if (eventName === \"event\") {\n return this._normalizeRunningEvent(new RunningEvent(\"event\", null));\n }\n\n // Listen for any event\n if (eventName === \"*\") {\n return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));\n }\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\n // We have topics to filter by...\n if (eventName.topics && eventName.topics.length > 0) {\n\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 } catch (error) { }\n\n // Filter by the unknown topichash\n const filter: EventFilter = {\n address: this.address,\n topics: eventName.topics\n }\n\n return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));\n }\n\n return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));\n }\n\n _checkRunningEvents(runningEvent: RunningEvent): void {\n if (runningEvent.listenerCount() === 0) {\n delete this._runningEvents[runningEvent.tag];\n\n // If we have a poller for this, remove it\n const emit = this._wrappedEmits[runningEvent.tag];\n if (emit) {\n this.provider.off(runningEvent.filter, emit);\n delete this._wrappedEmits[runningEvent.tag];\n }\n }\n }\n\n // Subclasses can override this to gracefully recover\n // from parse errors if they wish\n _wrapEvent(runningEvent: RunningEvent, log: Log, listener: Listener): Event {\n const event = deepCopy(log);\n\n event.removeListener = () => {\n if (!listener) { return; }\n runningEvent.removeListener(listener);\n this._checkRunningEvents(runningEvent);\n };\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\n // This may throw if the topics and data mismatch the signature\n runningEvent.prepareEvent(event);\n\n return event;\n }\n\n private _addEventListener(runningEvent: RunningEvent, listener: Listener, once: boolean): void {\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\n runningEvent.addListener(listener, once);\n\n // Track this running event and its listeners (may already be there; but no hard in updating)\n this._runningEvents[runningEvent.tag] = runningEvent;\n\n // If we are not polling the provider, start polling\n if (!this._wrappedEmits[runningEvent.tag]) {\n const wrappedEmit = (log: Log) => {\n let event = this._wrapEvent(runningEvent, log, listener);\n\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 } catch (error) {\n event.decodeError = error.error;\n }\n }\n\n // Always emit \"event\" for fragment-base events\n if (runningEvent.filter != null) {\n this.emit(\"event\", event);\n }\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\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\n queryFilter(event: EventFilter, fromBlockOrBlockhash?: BlockTag | string, toBlock?: BlockTag): Promise> {\n const runningEvent = this._getRunningEvent(event);\n const filter = shallowCopy(runningEvent.filter);\n\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 } else {\n (filter).fromBlock = ((fromBlockOrBlockhash != null) ? fromBlockOrBlockhash: 0);\n (filter).toBlock = ((toBlock != null) ? toBlock: \"latest\");\n }\n\n return this.provider.getLogs(filter).then((logs) => {\n return logs.map((log) => this._wrapEvent(runningEvent, log, null));\n });\n }\n\n on(event: EventFilter | string, listener: Listener): this {\n this._addEventListener(this._getRunningEvent(event), listener, false);\n return this;\n }\n\n once(event: EventFilter | string, listener: Listener): this {\n this._addEventListener(this._getRunningEvent(event), listener, true);\n return this;\n }\n\n emit(eventName: EventFilter | string, ...args: Array): boolean {\n if (!this.provider) { return false; }\n\n const runningEvent = this._getRunningEvent(eventName);\n const result = (runningEvent.run(args) > 0);\n\n // May have drained all the \"once\" events; check for living events\n this._checkRunningEvents(runningEvent);\n\n return result;\n }\n\n listenerCount(eventName?: EventFilter | string): number {\n if (!this.provider) { return 0; }\n return this._getRunningEvent(eventName).listenerCount();\n }\n\n listeners(eventName?: EventFilter | string): Array {\n if (!this.provider) { return []; }\n\n if (eventName == null) {\n const result: Array = [ ];\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\n return this._getRunningEvent(eventName).listeners();\n }\n\n removeAllListeners(eventName?: EventFilter | string): this {\n if (!this.provider) { 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\n // Delete any listeners\n const runningEvent = this._getRunningEvent(eventName);\n runningEvent.removeAllListeners();\n this._checkRunningEvents(runningEvent);\n\n return this;\n }\n\n off(eventName: EventFilter | string, listener: Listener): this {\n if (!this.provider) { return this; }\n const runningEvent = this._getRunningEvent(eventName);\n runningEvent.removeListener(listener);\n this._checkRunningEvents(runningEvent);\n return this;\n }\n\n removeListener(eventName: EventFilter | string, listener: Listener): this {\n return this.off(eventName, listener);\n }\n\n}\n\nexport class ContractFactory {\n\n readonly interface: Interface;\n readonly bytecode: string;\n readonly signer: Signer;\n\n constructor(contractInterface: ContractInterface, bytecode: BytesLike | { object: string }, signer?: Signer) {\n\n let bytecodeHex: string = null;\n\n if (typeof(bytecode) === \"string\") {\n bytecodeHex = bytecode;\n } else if (isBytes(bytecode)) {\n bytecodeHex = hexlify(bytecode);\n } else if (bytecode && typeof(bytecode.object) === \"string\") {\n // Allow the bytecode object from the Solidity compiler\n bytecodeHex = (bytecode).object;\n } else {\n // Crash in the next verification step\n bytecodeHex = \"!\";\n }\n\n // Make sure it is 0x prefixed\n if (bytecodeHex.substring(0, 2) !== \"0x\") { 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\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\n defineReadOnly(this, \"bytecode\", bytecodeHex);\n defineReadOnly(this, \"interface\", getStatic(new.target, \"getInterface\")(contractInterface));\n defineReadOnly(this, \"signer\", signer || null);\n }\n\n // @TODO: Future; rename to populteTransaction?\n getDeployTransaction(...args: Array): TransactionRequest {\n let tx: TransactionRequest = { };\n\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\n // Do not allow these to be overridden in a deployment transaction\n [\"data\", \"from\", \"to\"].forEach((key) => {\n if ((tx)[key] == null) { return; }\n logger.throwError(\"cannot override \" + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key })\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\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\n return tx\n }\n\n async deploy(...args: Array): Promise {\n\n let overrides: any = { };\n\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\n // Make sure the call matches the constructor signature\n logger.checkArgumentCount(args.length, this.interface.deploy.inputs.length, \" in Contract constructor\");\n\n // Resolve ENS names and promises in the arguments\n const params = await resolveAddresses(this.signer, args, this.interface.deploy.inputs);\n params.push(overrides);\n\n // Get the deployment transaction (with optional overrides)\n const unsignedTx = this.getDeployTransaction(...params);\n\n // Send the deployment transaction\n const tx = await this.signer.sendTransaction(unsignedTx);\n\n const address = getStatic<(tx: TransactionResponse) => string>(this.constructor, \"getContractAddress\")(tx);\n const contract = getStatic<(address: string, contractInterface: ContractInterface, signer?: Signer) => Contract>(this.constructor, \"getContract\")(address, this.interface, this.signer);\n defineReadOnly(contract, \"deployTransaction\", tx);\n return contract;\n }\n\n attach(address: string): Contract {\n return ((this.constructor)).getContract(address, this.interface, this.signer);\n }\n\n connect(signer: Signer) {\n return new (<{ new(...args: any[]): ContractFactory }>(this.constructor))(this.interface, this.bytecode, signer);\n }\n\n static fromSolidity(compilerOutput: any, signer?: Signer): ContractFactory {\n if (compilerOutput == null) {\n logger.throwError(\"missing compiler output\", Logger.errors.MISSING_ARGUMENT, { argument: \"compilerOutput\" });\n }\n\n if (typeof(compilerOutput) === \"string\") {\n compilerOutput = JSON.parse(compilerOutput);\n }\n\n const abi = compilerOutput.abi;\n\n let bytecode: any = null;\n if (compilerOutput.bytecode) {\n bytecode = compilerOutput.bytecode;\n } else if (compilerOutput.evm && compilerOutput.evm.bytecode) {\n bytecode = compilerOutput.evm.bytecode;\n }\n\n return new this(abi, bytecode, signer);\n }\n\n static getInterface(contractInterface: ContractInterface) {\n return Contract.getInterface(contractInterface);\n }\n\n static getContractAddress(tx: { from: string, nonce: BytesLike | BigNumber | number }): string {\n return getContractAddress(tx);\n }\n\n static getContract(address: string, contractInterface: ContractInterface, signer?: Signer): Contract {\n return new Contract(address, contractInterface, signer);\n }\n}\n","/**\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 */\n\nimport { arrayify, BytesLike } from \"@ethersproject/bytes\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\n\nexport class BaseX {\n readonly alphabet: string;\n readonly base: number;\n\n _alphabetMap: { [ character: string ]: number };\n _leader: string;\n\n constructor(alphabet: string) {\n defineReadOnly(this, \"alphabet\", alphabet);\n defineReadOnly(this, \"base\", alphabet.length);\n\n defineReadOnly(this, \"_alphabetMap\", { });\n defineReadOnly(this, \"_leader\", alphabet.charAt(0));\n\n // pre-compute lookup table\n for (let i = 0; i < alphabet.length; i++) {\n this._alphabetMap[alphabet.charAt(i)] = i;\n }\n }\n\n encode(value: BytesLike): string {\n let source = arrayify(value);\n\n if (source.length === 0) { 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\n while (carry > 0) {\n digits.push(carry % this.base);\n carry = (carry / this.base) | 0;\n }\n }\n\n let string = \"\"\n\n // deal with leading zeros\n for (let k = 0; source[k] === 0 && k < source.length - 1; ++k) {\n string += this._leader;\n }\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\n return string;\n }\n\n decode(value: string): Uint8Array {\n if (typeof(value) !== \"string\") {\n throw new TypeError(\"Expected String\");\n }\n\n let bytes: Array = [];\n if (value.length === 0) { 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\n if (byte === undefined) {\n throw new Error(\"Non-base\" + this.base + \" character\");\n }\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\n while (carry > 0) {\n bytes.push(carry & 0xff);\n carry >>= 8;\n }\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\n return arrayify(new Uint8Array(bytes.reverse()))\n }\n}\n\nconst Base32 = new BaseX(\"abcdefghijklmnopqrstuvwxyz234567\");\nconst Base58 = new BaseX(\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\");\n\nexport { Base32, Base58 };\n\n//console.log(Base58.decode(\"Qmd2V777o5XvJbYMeMb8k2nU5f8d3ciUQ5YpYuWhzv8iDj\"))\n//console.log(Base58.encode(Base58.decode(\"Qmd2V777o5XvJbYMeMb8k2nU5f8d3ciUQ5YpYuWhzv8iDj\")))\n","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 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 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 } 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","export enum SupportedAlgorithm { sha256 = \"sha256\", sha512 = \"sha512\" };\n\n","export const version = \"sha2/5.0.5\";\n","\"use strict\";\n\nimport hash from \"hash.js\";\n//const _ripemd160 = _hash.ripemd160;\n\nimport { arrayify, BytesLike } from \"@ethersproject/bytes\";\n\nimport { SupportedAlgorithm } from \"./types\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nexport function ripemd160(data: BytesLike): string {\n return \"0x\" + (hash.ripemd160().update(arrayify(data)).digest(\"hex\"));\n}\n\nexport function sha256(data: BytesLike): string {\n return \"0x\" + (hash.sha256().update(arrayify(data)).digest(\"hex\"));\n}\n\nexport function sha512(data: BytesLike): string {\n return \"0x\" + (hash.sha512().update(arrayify(data)).digest(\"hex\"));\n}\n\nexport function computeHmac(algorithm: SupportedAlgorithm, key: BytesLike, data: BytesLike): string {\n if (!SupportedAlgorithm[algorithm]) {\n logger.throwError(\"unsupported algorithm \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"hmac\",\n algorithm: algorithm\n });\n }\n\n return \"0x\" + hash.hmac((hash)[algorithm], arrayify(key)).update(arrayify(data)).digest(\"hex\");\n}\n\n","import { computeHmac, ripemd160, sha256, sha512 } from \"./sha2\";\n\nimport { SupportedAlgorithm } from \"./types\";\n\nexport {\n computeHmac,\n\n ripemd160,\n\n sha256,\n sha512,\n\n SupportedAlgorithm\n}\n","\"use strict\";\n\nimport { arrayify, BytesLike, hexlify } from \"@ethersproject/bytes\";\nimport { computeHmac, SupportedAlgorithm } from \"@ethersproject/sha2\";\n\nexport function pbkdf2(password: BytesLike, salt: BytesLike, iterations: number, keylen: number, hashAlgorithm: string): string {\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\n let r: number;\n let T: Uint8Array;\n\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\n //let U = createHmac(password).update(block1).digest();\n let U = arrayify(computeHmac(hashAlgorithm, password, block1));\n\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\n //U.copy(T, 0, 0, hLen)\n T.set(U);\n\n\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++) T[k] ^= U[k]\n }\n\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\n return hexlify(DK)\n}\n\n","\nexport { pbkdf2 } from \"./pbkdf2\";\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","'use strict';\n\nvar utils = exports;\nvar BN = require('bn.js');\nvar minAssert = require('minimalistic-assert');\nvar minUtils = require('minimalistic-crypto-utils');\n\nutils.assert = minAssert;\nutils.toArray = minUtils.toArray;\nutils.zero2 = minUtils.zero2;\nutils.toHex = minUtils.toHex;\nutils.encode = minUtils.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 while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n\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 var 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 var 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","'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar getNAF = utils.getNAF;\nvar getJSF = utils.getJSF;\nvar assert = utils.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}\nmodule.exports = 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(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 for (var j = 0; j < naf.length; j += doubles.step) {\n var nafW = 0;\n for (var k = j + doubles.step - 1; k >= j; k--)\n nafW = (nafW << 1) + naf[k];\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 (var j = 0; j < repr.length; j++) {\n var 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 k = 0; i >= 0 && naf[i] === 0; i--)\n k++;\n if (i >= 0)\n k++;\n acc = acc.dblp(k);\n\n if (i < 0)\n break;\n var z = naf[i];\n assert(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 for (var i = 0; i < len; i++) {\n var 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 (var 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 (var 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 (var i = max; i >= 0; i--) {\n var k = 0;\n\n while (i >= 0) {\n var zero = true;\n for (var 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 (var j = 0; j < len; j++) {\n var z = tmp[j];\n var 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 (var 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.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(bytes[bytes.length - 1] % 2 === 0);\n else if (bytes[0] === 0x07)\n assert(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.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","'use strict';\n\nvar utils = require('../utils');\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = require('./base');\n\nvar assert = utils.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(ShortCurve, Base);\nmodule.exports = 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(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(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 '';\n return '';\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(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 if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (var 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 (var 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 '';\n return '';\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","'use strict';\n\nvar curve = exports;\n\ncurve.base = require('./base');\ncurve.short = require('./short');\ncurve.mont = require('./mont');\ncurve.edwards = require('./edwards');\n","'use strict';\n\nvar curves = exports;\n\nvar hash = require('hash.js');\nvar curve = require('./curve');\nvar utils = require('./utils');\n\nvar assert = utils.assert;\n\nfunction PresetCurve(options) {\n if (options.type === 'short')\n this.curve = new curve.short(options);\n else if (options.type === 'edwards')\n this.curve = new curve.edwards(options);\n else\n this.curve = new curve.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 = require('./precomputed/secp256k1');\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","'use strict';\n\nvar hash = require('hash.js');\nvar utils = require('minimalistic-crypto-utils');\nvar assert = require('minimalistic-assert');\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.toArray(options.entropy, options.entropyEnc || 'hex');\n var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');\n var pers = utils.toArray(options.pers, options.persEnc || 'hex');\n assert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n this._init(entropy, nonce, pers);\n}\nmodule.exports = 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.toArray(entropy, entropyEnc);\n add = utils.toArray(add, addEnc);\n\n assert(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.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.encode(res, enc);\n};\n","'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar assert = utils.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}\nmodule.exports = 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(key.x, 'Need x coordinate');\n } else if (this.ec.curve.type === 'short' ||\n this.ec.curve.type === 'edwards') {\n assert(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 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 '';\n};\n","'use strict';\n\nvar BN = require('bn.js');\n\nvar utils = require('../utils');\nvar assert = utils.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(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}\nmodule.exports = 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.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.encode(res, enc);\n};\n","'use strict';\n\nvar BN = require('bn.js');\nvar HmacDRBG = require('hmac-drbg');\nvar utils = require('../utils');\nvar curves = require('../curves');\nvar rand = require('brorand');\nvar assert = utils.assert;\n\nvar KeyPair = require('./key');\nvar Signature = require('./signature');\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(curves.hasOwnProperty(options), 'Unknown curve ' + options);\n\n options = curves[options];\n }\n\n // Shortcut for `elliptic.ec(elliptic.curves.curveName)`\n if (options instanceof curves.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}\nmodule.exports = EC;\n\nEC.prototype.keyPair = function keyPair(options) {\n return new KeyPair(this, options);\n};\n\nEC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\n return KeyPair.fromPrivate(this, priv, enc);\n};\n\nEC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\n return KeyPair.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 do {\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 } while (true);\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; true; 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, key, enc) {\n msg = this._truncateToN(new BN(msg, 16));\n key = this.keyFromPublic(key, enc);\n signature = new Signature(signature, 'hex');\n\n // Perform primitive values validation\n var r = signature.r;\n var s = signature.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\n if (!this.curve._maxwellTrick) {\n var 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 var 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, j, enc) {\n assert((3 & j) === j, 'The recovery param is more than two bits');\n signature = new Signature(signature, enc);\n\n var n = this.n;\n var e = new BN(msg);\n var r = signature.r;\n var s = signature.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.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, Q, enc) {\n signature = new Signature(signature, enc);\n if (signature.recoveryParam !== null)\n return signature.recoveryParam;\n\n for (var i = 0; i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature, 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","'use strict';\n\nvar elliptic = exports;\n\nelliptic.version = require('../package.json').version;\nelliptic.utils = require('./elliptic/utils');\nelliptic.rand = require('brorand');\nelliptic.curve = require('./elliptic/curve');\nelliptic.curves = require('./elliptic/curves');\n\n// Protocols\nelliptic.ec = require('./elliptic/ec');\nelliptic.eddsa = require('./elliptic/eddsa');\n","import _ec from \"elliptic\";\nimport EC = _ec.ec;\n\nexport { EC }\n","export const version = \"signing-key/5.0.6\";\n","\"use strict\";\n\nimport { EC } from \"./elliptic\";\n\nimport { arrayify, BytesLike, hexlify, hexZeroPad, Signature, SignatureLike, splitSignature } from \"@ethersproject/bytes\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nlet _curve: EC = null\nfunction getCurve() {\n if (!_curve) {\n _curve = new EC(\"secp256k1\");\n }\n return _curve;\n}\n\nexport class SigningKey {\n\n readonly curve: string;\n\n readonly privateKey: string;\n readonly publicKey: string;\n readonly compressedPublicKey: string;\n\n //readonly address: string;\n\n readonly _isSigningKey: boolean;\n\n constructor(privateKey: BytesLike) {\n defineReadOnly(this, \"curve\", \"secp256k1\");\n\n defineReadOnly(this, \"privateKey\", hexlify(privateKey));\n\n const keyPair = getCurve().keyFromPrivate(arrayify(this.privateKey));\n\n defineReadOnly(this, \"publicKey\", \"0x\" + keyPair.getPublic(false, \"hex\"));\n defineReadOnly(this, \"compressedPublicKey\", \"0x\" + keyPair.getPublic(true, \"hex\"));\n\n defineReadOnly(this, \"_isSigningKey\", true);\n }\n\n _addPoint(other: BytesLike): string {\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\n signDigest(digest: BytesLike): Signature {\n const keyPair = getCurve().keyFromPrivate(arrayify(this.privateKey));\n const signature = keyPair.sign(arrayify(digest), { 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\n computeSharedSecret(otherKey: BytesLike): string {\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\n static isSigningKey(value: any): value is SigningKey {\n return !!(value && value._isSigningKey);\n }\n}\n\nexport function recoverPublicKey(digest: BytesLike, signature: SignatureLike): string {\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}\n\nexport function computePublicKey(key: BytesLike, compressed?: boolean): string {\n const bytes = arrayify(key);\n\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) { return hexlify(bytes); }\n return \"0x\" + getCurve().keyFromPublic(bytes).getPublic(false, \"hex\");\n\n } else if (bytes.length === 65) {\n if (!compressed) { return hexlify(bytes); }\n return \"0x\" + getCurve().keyFromPublic(bytes).getPublic(true, \"hex\");\n }\n\n return logger.throwArgumentError(\"invalid public or private key\", \"key\", \"[REDACTED]\");\n}\n\n","export const version = \"transactions/5.0.7\";\n","\"use strict\";\n\nimport { getAddress } from \"@ethersproject/address\";\nimport { BigNumber, BigNumberish } from \"@ethersproject/bignumber\";\nimport { arrayify, BytesLike, DataOptions, hexDataSlice, hexlify, hexZeroPad, isBytesLike, SignatureLike, 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\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\n///////////////////////////////\n// Exported Types\n\nexport type UnsignedTransaction = {\n to?: string;\n nonce?: number;\n\n gasLimit?: BigNumberish;\n gasPrice?: BigNumberish;\n\n data?: BytesLike;\n value?: BigNumberish;\n chainId?: number;\n}\n\nexport interface Transaction {\n hash?: string;\n\n to?: string;\n from?: string;\n nonce: number;\n\n gasLimit: BigNumber;\n gasPrice: BigNumber;\n\n data: string;\n value: BigNumber;\n chainId: number;\n\n r?: string;\n s?: string;\n v?: number;\n}\n\n///////////////////////////////\n\nfunction handleAddress(value: string): string {\n if (value === \"0x\") { return null; }\n return getAddress(value);\n}\n\nfunction handleNumber(value: string): BigNumber {\n if (value === \"0x\") { return Zero; }\n return BigNumber.from(value);\n}\n\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];\n\nconst allowedTransactionKeys: { [ key: string ]: boolean } = {\n chainId: true, data: true, gasLimit: true, gasPrice:true, nonce: true, to: true, value: true\n}\n\nexport function computeAddress(key: BytesLike | string): string {\n const publicKey = computePublicKey(key);\n return getAddress(hexDataSlice(keccak256(hexDataSlice(publicKey, 1)), 12));\n}\n\nexport function recoverAddress(digest: BytesLike, signature: SignatureLike): string {\n return computeAddress(recoverPublicKey(arrayify(digest), signature));\n}\n\n\nexport function serialize(transaction: UnsignedTransaction, signature?: SignatureLike): string {\n checkProperties(transaction, allowedTransactionKeys);\n\n const raw: Array = [];\n\n transactionFields.forEach(function(fieldInfo) {\n let value = (transaction)[fieldInfo.name] || ([]);\n const options: DataOptions = { };\n if (fieldInfo.numeric) { options.hexPad = \"left\"; }\n value = arrayify(hexlify(value, options));\n\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\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\n raw.push(hexlify(value));\n });\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\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\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\n // Requesting an unsigned transation\n if (!signature) {\n return RLP.encode(raw);\n }\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\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\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 } else if (sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n\n raw.push(hexlify(v));\n raw.push(stripZeros(arrayify(sig.r)));\n raw.push(stripZeros(arrayify(sig.s)));\n\n return RLP.encode(raw);\n}\n\nexport function parse(rawTransaction: BytesLike): Transaction {\n const transaction = RLP.decode(rawTransaction);\n\n if (transaction.length !== 9 && transaction.length !== 6) {\n logger.throwArgumentError(\"invalid raw transaction\", \"rawTransaction\", rawTransaction);\n }\n\n const tx: Transaction = {\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\n // Legacy unsigned transaction\n if (transaction.length === 6) { return tx; }\n\n try {\n tx.v = BigNumber.from(transaction[6]).toNumber();\n\n } catch (error) {\n console.log(error);\n return tx;\n }\n\n tx.r = hexZeroPad(transaction[7], 32);\n tx.s = hexZeroPad(transaction[8], 32);\n\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 Tranasaction\n\n tx.chainId = Math.floor((tx.v - 35) / 2);\n if (tx.chainId < 0) { tx.chainId = 0; }\n\n let recoveryParam = tx.v - 27;\n\n const raw = transaction.slice(0, 6);\n\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\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 } catch (error) {\n console.log(error);\n }\n\n tx.hash = keccak256(rawTransaction);\n }\n\n return tx;\n}\n\n","export const version = \"wordlists/5.0.6\";\n","\"use strict\";\n\n// This gets overridden by rollup\nconst exportWordlist = false;\n\nimport { id } from \"@ethersproject/hash\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nexport const logger = new Logger(version);\n\nexport abstract class Wordlist {\n readonly locale: string;\n\n constructor(locale: string) {\n logger.checkAbstract(new.target, Wordlist);\n defineReadOnly(this, \"locale\", locale);\n }\n\n abstract getWord(index: number): string;\n abstract getWordIndex(word: string): number;\n\n // Subclasses may override this\n split(mnemonic: string): Array {\n return mnemonic.toLowerCase().split(/ +/g)\n }\n\n // Subclasses may override this\n join(words: Array): string {\n return words.join(\" \");\n }\n\n static check(wordlist: Wordlist): string {\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)) { return \"0x\"; }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n\n static register(lang: Wordlist, name?: string): void {\n if (!name) { name = lang.locale; }\n\n /* istanbul ignore if */\n if (exportWordlist) {\n try {\n const anyGlobal = (window as any)\n if (anyGlobal._ethers && anyGlobal._ethers.wordlists) {\n if (!anyGlobal._ethers.wordlists[name]) {\n defineReadOnly(anyGlobal._ethers.wordlists, name, lang);\n }\n }\n } catch (error) { }\n }\n }\n\n}\n\n","\"use strict\";\n\nimport { Wordlist } from \"./wordlist\";\n\nconst words = \"AbdikaceAbecedaAdresaAgreseAkceAktovkaAlejAlkoholAmputaceAnanasAndulkaAnekdotaAnketaAntikaAnulovatArchaAroganceAsfaltAsistentAspiraceAstmaAstronomAtlasAtletikaAtolAutobusAzylBabkaBachorBacilBaculkaBadatelBagetaBagrBahnoBakterieBaladaBaletkaBalkonBalonekBalvanBalzaBambusBankomatBarbarBaretBarmanBarokoBarvaBaterkaBatohBavlnaBazalkaBazilikaBazukaBednaBeranBesedaBestieBetonBezinkaBezmocBeztakBicyklBidloBiftekBikinyBilanceBiografBiologBitvaBizonBlahobytBlatouchBlechaBleduleBleskBlikatBliznaBlokovatBlouditBludBobekBobrBodlinaBodnoutBohatostBojkotBojovatBokorysBolestBorecBoroviceBotaBoubelBouchatBoudaBouleBouratBoxerBradavkaBramboraBrankaBratrBreptaBriketaBrkoBrlohBronzBroskevBrunetkaBrusinkaBrzdaBrzyBublinaBubnovatBuchtaBuditelBudkaBudovaBufetBujarostBukviceBuldokBulvaBundaBunkrBurzaButikBuvolBuzolaBydletBylinaBytovkaBzukotCapartCarevnaCedrCeduleCejchCejnCelaCelerCelkemCelniceCeninaCennostCenovkaCentrumCenzorCestopisCetkaChalupaChapadloCharitaChataChechtatChemieChichotChirurgChladChlebaChlubitChmelChmuraChobotChocholChodbaCholeraChomoutChopitChorobaChovChrapotChrlitChrtChrupChtivostChudinaChutnatChvatChvilkaChvostChybaChystatChytitCibuleCigaretaCihelnaCihlaCinkotCirkusCisternaCitaceCitrusCizinecCizostClonaCokolivCouvatCtitelCtnostCudnostCuketaCukrCupotCvaknoutCvalCvikCvrkotCyklistaDalekoDarebaDatelDatumDceraDebataDechovkaDecibelDeficitDeflaceDeklDekretDemokratDepreseDerbyDeskaDetektivDikobrazDiktovatDiodaDiplomDiskDisplejDivadloDivochDlahaDlouhoDluhopisDnesDobroDobytekDocentDochutitDodnesDohledDohodaDohraDojemDojniceDokladDokolaDoktorDokumentDolarDolevaDolinaDomaDominantDomluvitDomovDonutitDopadDopisDoplnitDoposudDoprovodDopustitDorazitDorostDortDosahDoslovDostatekDosudDosytaDotazDotekDotknoutDoufatDoutnatDovozceDozaduDoznatDozorceDrahotaDrakDramatikDravecDrazeDrdolDrobnostDrogerieDrozdDrsnostDrtitDrzostDubenDuchovnoDudekDuhaDuhovkaDusitDusnoDutostDvojiceDvorecDynamitEkologEkonomieElektronElipsaEmailEmiseEmoceEmpatieEpizodaEpochaEpopejEposEsejEsenceEskortaEskymoEtiketaEuforieEvoluceExekuceExkurzeExpediceExplozeExportExtraktFackaFajfkaFakultaFanatikFantazieFarmacieFavoritFazoleFederaceFejetonFenkaFialkaFigurantFilozofFiltrFinanceFintaFixaceFjordFlanelFlirtFlotilaFondFosforFotbalFotkaFotonFrakceFreskaFrontaFukarFunkceFyzikaGalejeGarantGenetikaGeologGilotinaGlazuraGlejtGolemGolfistaGotikaGrafGramofonGranuleGrepGrilGrogGroteskaGumaHadiceHadrHalaHalenkaHanbaHanopisHarfaHarpunaHavranHebkostHejkalHejnoHejtmanHektarHelmaHematomHerecHernaHesloHezkyHistorikHladovkaHlasivkyHlavaHledatHlenHlodavecHlohHloupostHltatHlubinaHluchotaHmatHmotaHmyzHnisHnojivoHnoutHoblinaHobojHochHodinyHodlatHodnotaHodovatHojnostHokejHolinkaHolkaHolubHomoleHonitbaHonoraceHoralHordaHorizontHorkoHorlivecHormonHorninaHoroskopHorstvoHospodaHostinaHotovostHoubaHoufHoupatHouskaHovorHradbaHraniceHravostHrazdaHrbolekHrdinaHrdloHrdostHrnekHrobkaHromadaHrotHroudaHrozenHrstkaHrubostHryzatHubenostHubnoutHudbaHukotHumrHusitaHustotaHvozdHybnostHydrantHygienaHymnaHysterikIdylkaIhnedIkonaIluzeImunitaInfekceInflaceInkasoInovaceInspekceInternetInvalidaInvestorInzerceIronieJablkoJachtaJahodaJakmileJakostJalovecJantarJarmarkJaroJasanJasnoJatkaJavorJazykJedinecJedleJednatelJehlanJekotJelenJelitoJemnostJenomJepiceJeseterJevitJezdecJezeroJinakJindyJinochJiskraJistotaJitrniceJizvaJmenovatJogurtJurtaKabaretKabelKabinetKachnaKadetKadidloKahanKajakKajutaKakaoKaktusKalamitaKalhotyKalibrKalnostKameraKamkolivKamnaKanibalKanoeKantorKapalinaKapelaKapitolaKapkaKapleKapotaKaprKapustaKapybaraKaramelKarotkaKartonKasaKatalogKatedraKauceKauzaKavalecKazajkaKazetaKazivostKdekolivKdesiKedlubenKempKeramikaKinoKlacekKladivoKlamKlapotKlasikaKlaunKlecKlenbaKlepatKlesnoutKlidKlimaKlisnaKloboukKlokanKlopaKloubKlubovnaKlusatKluzkostKmenKmitatKmotrKnihaKnotKoaliceKoberecKobkaKoblihaKobylaKocourKohoutKojenecKokosKoktejlKolapsKoledaKolizeKoloKomandoKometaKomikKomnataKomoraKompasKomunitaKonatKonceptKondiceKonecKonfeseKongresKoninaKonkursKontaktKonzervaKopanecKopieKopnoutKoprovkaKorbelKorektorKormidloKoroptevKorpusKorunaKorytoKorzetKosatecKostkaKotelKotletaKotoulKoukatKoupelnaKousekKouzloKovbojKozaKozorohKrabiceKrachKrajinaKralovatKrasopisKravataKreditKrejcarKresbaKrevetaKriketKritikKrizeKrkavecKrmelecKrmivoKrocanKrokKronikaKropitKroupaKrovkaKrtekKruhadloKrupiceKrutostKrvinkaKrychleKryptaKrystalKrytKudlankaKufrKujnostKuklaKulajdaKulichKulkaKulometKulturaKunaKupodivuKurtKurzorKutilKvalitaKvasinkaKvestorKynologKyselinaKytaraKyticeKytkaKytovecKyvadloLabradorLachtanLadnostLaikLakomecLamelaLampaLanovkaLasiceLasoLasturaLatinkaLavinaLebkaLeckdyLedenLedniceLedovkaLedvinaLegendaLegieLegraceLehceLehkostLehnoutLektvarLenochodLentilkaLepenkaLepidloLetadloLetecLetmoLetokruhLevhartLevitaceLevobokLibraLichotkaLidojedLidskostLihovinaLijavecLilekLimetkaLinieLinkaLinoleumListopadLitinaLitovatLobistaLodivodLogikaLogopedLokalitaLoketLomcovatLopataLopuchLordLososLotrLoudalLouhLoukaLouskatLovecLstivostLucernaLuciferLumpLuskLustraceLviceLyraLyrikaLysinaMadamMadloMagistrMahagonMajetekMajitelMajoritaMakakMakoviceMakrelaMalbaMalinaMalovatMalviceMaminkaMandleMankoMarnostMasakrMaskotMasopustMaticeMatrikaMaturitaMazanecMazivoMazlitMazurkaMdlobaMechanikMeditaceMedovinaMelasaMelounMentolkaMetlaMetodaMetrMezeraMigraceMihnoutMihuleMikinaMikrofonMilenecMilimetrMilostMimikaMincovnaMinibarMinometMinulostMiskaMistrMixovatMladostMlhaMlhovinaMlokMlsatMluvitMnichMnohemMobilMocnostModelkaModlitbaMohylaMokroMolekulaMomentkaMonarchaMonoklMonstrumMontovatMonzunMosazMoskytMostMotivaceMotorkaMotykaMouchaMoudrostMozaikaMozekMozolMramorMravenecMrkevMrtvolaMrzetMrzutostMstitelMudrcMuflonMulatMumieMuniceMusetMutaceMuzeumMuzikantMyslivecMzdaNabouratNachytatNadaceNadbytekNadhozNadobroNadpisNahlasNahnatNahodileNahraditNaivitaNajednouNajistoNajmoutNaklonitNakonecNakrmitNalevoNamazatNamluvitNanometrNaokoNaopakNaostroNapadatNapevnoNaplnitNapnoutNaposledNaprostoNaroditNarubyNarychloNasaditNasekatNaslepoNastatNatolikNavenekNavrchNavzdoryNazvatNebeNechatNeckyNedalekoNedbatNeduhNegaceNehetNehodaNejenNejprveNeklidNelibostNemilostNemocNeochotaNeonkaNepokojNerostNervNesmyslNesouladNetvorNeuronNevinaNezvykleNicotaNijakNikamNikdyNiklNikterakNitroNoclehNohaviceNominaceNoraNorekNositelNosnostNouzeNovinyNovotaNozdraNudaNudleNugetNutitNutnostNutrieNymfaObalObarvitObavaObdivObecObehnatObejmoutObezitaObhajobaObilniceObjasnitObjektObklopitOblastOblekOblibaOblohaObludaObnosObohatitObojekOboutObrazecObrnaObrubaObrysObsahObsluhaObstaratObuvObvazObvinitObvodObvykleObyvatelObzorOcasOcelOcenitOchladitOchotaOchranaOcitnoutOdbojOdbytOdchodOdcizitOdebratOdeslatOdevzdatOdezvaOdhadceOdhoditOdjetOdjinudOdkazOdkoupitOdlivOdlukaOdmlkaOdolnostOdpadOdpisOdploutOdporOdpustitOdpykatOdrazkaOdsouditOdstupOdsunOdtokOdtudOdvahaOdvetaOdvolatOdvracetOdznakOfinaOfsajdOhlasOhniskoOhradaOhrozitOhryzekOkapOkeniceOklikaOknoOkouzlitOkovyOkrasaOkresOkrsekOkruhOkupantOkurkaOkusitOlejninaOlizovatOmakOmeletaOmezitOmladinaOmlouvatOmluvaOmylOnehdyOpakovatOpasekOperaceOpiceOpilostOpisovatOporaOpoziceOpravduOprotiOrbitalOrchestrOrgieOrliceOrlojOrtelOsadaOschnoutOsikaOsivoOslavaOslepitOslnitOslovitOsnovaOsobaOsolitOspalecOstenOstrahaOstudaOstychOsvojitOteplitOtiskOtopOtrhatOtrlostOtrokOtrubyOtvorOvanoutOvarOvesOvlivnitOvoceOxidOzdobaPachatelPacientPadouchPahorekPaktPalandaPalecPalivoPalubaPamfletPamlsekPanenkaPanikaPannaPanovatPanstvoPantoflePaprikaParketaParodiePartaParukaParybaPasekaPasivitaPastelkaPatentPatronaPavoukPaznehtPazourekPeckaPedagogPejsekPekloPelotonPenaltaPendrekPenzePeriskopPeroPestrostPetardaPeticePetrolejPevninaPexesoPianistaPihaPijavicePiklePiknikPilinaPilnostPilulkaPinzetaPipetaPisatelPistolePitevnaPivnicePivovarPlacentaPlakatPlamenPlanetaPlastikaPlatitPlavidloPlazPlechPlemenoPlentaPlesPletivoPlevelPlivatPlnitPlnoPlochaPlodinaPlombaPloutPlukPlynPobavitPobytPochodPocitPoctivecPodatPodcenitPodepsatPodhledPodivitPodkladPodmanitPodnikPodobaPodporaPodrazPodstataPodvodPodzimPoeziePohankaPohnutkaPohovorPohromaPohybPointaPojistkaPojmoutPokazitPoklesPokojPokrokPokutaPokynPolednePolibekPolknoutPolohaPolynomPomaluPominoutPomlkaPomocPomstaPomysletPonechatPonorkaPonurostPopadatPopelPopisekPoplachPoprositPopsatPopudPoradcePorcePorodPoruchaPoryvPosaditPosedPosilaPoskokPoslanecPosouditPospoluPostavaPosudekPosypPotahPotkanPotleskPotomekPotravaPotupaPotvoraPoukazPoutoPouzdroPovahaPovidlaPovlakPovozPovrchPovstatPovykPovzdechPozdravPozemekPoznatekPozorPozvatPracovatPrahoryPraktikaPralesPraotecPraporekPrasePravdaPrincipPrknoProbuditProcentoProdejProfeseProhraProjektProlomitPromilePronikatPropadProrokProsbaProtonProutekProvazPrskavkaPrstenPrudkostPrutPrvekPrvohoryPsanecPsovodPstruhPtactvoPubertaPuchPudlPukavecPuklinaPukrlePultPumpaPuncPupenPusaPusinkaPustinaPutovatPutykaPyramidaPyskPytelRacekRachotRadiaceRadniceRadonRaftRagbyRaketaRakovinaRamenoRampouchRandeRarachRaritaRasovnaRastrRatolestRazanceRazidloReagovatReakceReceptRedaktorReferentReflexRejnokReklamaRekordRekrutRektorReputaceRevizeRevmaRevolverRezervaRiskovatRizikoRobotikaRodokmenRohovkaRokleRokokoRomanetoRopovodRopuchaRorejsRosolRostlinaRotmistrRotopedRotundaRoubenkaRouchoRoupRouraRovinaRovniceRozborRozchodRozdatRozeznatRozhodceRozinkaRozjezdRozkazRozlohaRozmarRozpadRozruchRozsahRoztokRozumRozvodRubrikaRuchadloRukaviceRukopisRybaRybolovRychlostRydloRypadloRytinaRyzostSadistaSahatSakoSamecSamizdatSamotaSanitkaSardinkaSasankaSatelitSazbaSazeniceSborSchovatSebrankaSeceseSedadloSedimentSedloSehnatSejmoutSekeraSektaSekundaSekvojeSemenoSenoServisSesaditSeshoraSeskokSeslatSestraSesuvSesypatSetbaSetinaSetkatSetnoutSetrvatSeverSeznamShodaShrnoutSifonSilniceSirkaSirotekSirupSituaceSkafandrSkaliskoSkanzenSkautSkeptikSkicaSkladbaSkleniceSkloSkluzSkobaSkokanSkoroSkriptaSkrzSkupinaSkvostSkvrnaSlabikaSladidloSlaninaSlastSlavnostSledovatSlepecSlevaSlezinaSlibSlinaSlizniceSlonSloupekSlovoSluchSluhaSlunceSlupkaSlzaSmaragdSmetanaSmilstvoSmlouvaSmogSmradSmrkSmrtkaSmutekSmyslSnadSnahaSnobSobotaSochaSodovkaSokolSopkaSotvaSoubojSoucitSoudceSouhlasSouladSoumrakSoupravaSousedSoutokSouvisetSpalovnaSpasitelSpisSplavSpodekSpojenecSpoluSponzorSpornostSpoustaSprchaSpustitSrandaSrazSrdceSrnaSrnecSrovnatSrpenSrstSrubStaniceStarostaStatikaStavbaStehnoStezkaStodolaStolekStopaStornoStoupatStrachStresStrhnoutStromStrunaStudnaStupniceStvolStykSubjektSubtropySucharSudostSuknoSundatSunoutSurikataSurovinaSvahSvalstvoSvetrSvatbaSvazekSvisleSvitekSvobodaSvodidloSvorkaSvrabSykavkaSykotSynekSynovecSypatSypkostSyrovostSyselSytostTabletkaTabuleTahounTajemnoTajfunTajgaTajitTajnostTaktikaTamhleTamponTancovatTanecTankerTapetaTaveninaTazatelTechnikaTehdyTekutinaTelefonTemnotaTendenceTenistaTenorTeplotaTepnaTeprveTerapieTermoskaTextilTichoTiskopisTitulekTkadlecTkaninaTlapkaTleskatTlukotTlupaTmelToaletaTopinkaTopolTorzoTouhaToulecTradiceTraktorTrampTrasaTraverzaTrefitTrestTrezorTrhavinaTrhlinaTrochuTrojiceTroskaTroubaTrpceTrpitelTrpkostTrubecTruchlitTruhliceTrusTrvatTudyTuhnoutTuhostTundraTuristaTurnajTuzemskoTvarohTvorbaTvrdostTvrzTygrTykevUbohostUbozeUbratUbrousekUbrusUbytovnaUchoUctivostUdivitUhraditUjednatUjistitUjmoutUkazatelUklidnitUklonitUkotvitUkrojitUliceUlitaUlovitUmyvadloUnavitUniformaUniknoutUpadnoutUplatnitUplynoutUpoutatUpravitUranUrazitUsednoutUsilovatUsmrtitUsnadnitUsnoutUsouditUstlatUstrnoutUtahovatUtkatUtlumitUtonoutUtopenecUtrousitUvalitUvolnitUvozovkaUzdravitUzelUzeninaUzlinaUznatVagonValchaValounVanaVandalVanilkaVaranVarhanyVarovatVcelkuVchodVdovaVedroVegetaceVejceVelbloudVeletrhVelitelVelmocVelrybaVenkovVerandaVerzeVeselkaVeskrzeVesniceVespoduVestaVeterinaVeverkaVibraceVichrVideohraVidinaVidleVilaViniceVisetVitalitaVizeVizitkaVjezdVkladVkusVlajkaVlakVlasecVlevoVlhkostVlivVlnovkaVloupatVnucovatVnukVodaVodivostVodoznakVodstvoVojenskyVojnaVojskoVolantVolbaVolitVolnoVoskovkaVozidloVozovnaVpravoVrabecVracetVrahVrataVrbaVrcholekVrhatVrstvaVrtuleVsaditVstoupitVstupVtipVybavitVybratVychovatVydatVydraVyfotitVyhledatVyhnoutVyhoditVyhraditVyhubitVyjasnitVyjetVyjmoutVyklopitVykonatVylekatVymazatVymezitVymizetVymysletVynechatVynikatVynutitVypadatVyplatitVypravitVypustitVyrazitVyrovnatVyrvatVyslovitVysokoVystavitVysunoutVysypatVytasitVytesatVytratitVyvinoutVyvolatVyvrhelVyzdobitVyznatVzaduVzbuditVzchopitVzdorVzduchVzdychatVzestupVzhledemVzkazVzlykatVznikVzorekVzpouraVztahVztekXylofonZabratZabydletZachovatZadarmoZadusitZafoukatZahltitZahoditZahradaZahynoutZajatecZajetZajistitZaklepatZakoupitZalepitZamezitZamotatZamysletZanechatZanikatZaplatitZapojitZapsatZarazitZastavitZasunoutZatajitZatemnitZatknoutZaujmoutZavalitZaveletZavinitZavolatZavrtatZazvonitZbavitZbrusuZbudovatZbytekZdalekaZdarmaZdatnostZdivoZdobitZdrojZdvihZdymadloZeleninaZemanZeminaZeptatZezaduZezdolaZhatitZhltnoutZhlubokaZhotovitZhrubaZimaZimniceZjemnitZklamatZkoumatZkratkaZkumavkaZlatoZlehkaZlobaZlomZlostZlozvykZmapovatZmarZmatekZmijeZmizetZmocnitZmodratZmrzlinaZmutovatZnakZnalostZnamenatZnovuZobrazitZotavitZoubekZoufaleZploditZpomalitZpravaZprostitZprudkaZprvuZradaZranitZrcadloZrnitostZrnoZrovnaZrychlitZrzavostZtichaZtratitZubovinaZubrZvednoutZvenkuZveselaZvonZvratZvukovodZvyk\";\n\nlet wordlist: Array = null;\n\nfunction loadWords(lang: Wordlist): void {\n if (wordlist != null) { return; }\n wordlist = words.replace(/([A-Z])/g, \" $1\").toLowerCase().substring(1).split(\" \");\n\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n if (Wordlist.check(lang) !== \"0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a\") {\n wordlist = null;\n throw new Error(\"BIP39 Wordlist for en (English) FAILED\");\n }\n}\n\nclass LangCz extends Wordlist {\n constructor() {\n super(\"cz\");\n }\n\n getWord(index: number): string {\n loadWords(this);\n return wordlist[index];\n }\n\n getWordIndex(word: string): number {\n loadWords(this);\n return wordlist.indexOf(word);\n }\n}\n\nconst langCz = new LangCz();\nWordlist.register(langCz);\n\nexport { langCz };\n\n","\"use strict\";\n\nimport { Wordlist } from \"./wordlist\";\n\n\nconst words = \"AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo\";\n\nlet wordlist: Array = null;\n\n\nfunction loadWords(lang: Wordlist): void {\n if (wordlist != null) { return; }\n wordlist = words.replace(/([A-Z])/g, \" $1\").toLowerCase().substring(1).split(\" \");\n\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}\n\nclass LangEn extends Wordlist {\n constructor() {\n super(\"en\");\n }\n\n getWord(index: number): string {\n loadWords(this);\n return wordlist[index];\n }\n\n getWordIndex(word: string): number {\n loadWords(this);\n return wordlist.indexOf(word);\n }\n}\n\nconst langEn = new LangEn();\nWordlist.register(langEn);\n\nexport { langEn };\n","\"use strict\";\n\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\n\nimport { logger, Wordlist } from \"./wordlist\";\n\n\nconst words = \"A/bacoAbdomenAbejaAbiertoAbogadoAbonoAbortoAbrazoAbrirAbueloAbusoAcabarAcademiaAccesoAccio/nAceiteAcelgaAcentoAceptarA/cidoAclararAcne/AcogerAcosoActivoActoActrizActuarAcudirAcuerdoAcusarAdictoAdmitirAdoptarAdornoAduanaAdultoAe/reoAfectarAficio/nAfinarAfirmarA/gilAgitarAgoni/aAgostoAgotarAgregarAgrioAguaAgudoA/guilaAgujaAhogoAhorroAireAislarAjedrezAjenoAjusteAlacra/nAlambreAlarmaAlbaA/lbumAlcaldeAldeaAlegreAlejarAlertaAletaAlfilerAlgaAlgodo/nAliadoAlientoAlivioAlmaAlmejaAlmi/barAltarAltezaAltivoAltoAlturaAlumnoAlzarAmableAmanteAmapolaAmargoAmasarA/mbarA/mbitoAmenoAmigoAmistadAmorAmparoAmplioAnchoAncianoAnclaAndarAnde/nAnemiaA/nguloAnilloA/nimoAni/sAnotarAntenaAntiguoAntojoAnualAnularAnuncioA~adirA~ejoA~oApagarAparatoApetitoApioAplicarApodoAporteApoyoAprenderAprobarApuestaApuroAradoAra~aArarA/rbitroA/rbolArbustoArchivoArcoArderArdillaArduoA/reaA/ridoAriesArmoni/aArne/sAromaArpaArpo/nArregloArrozArrugaArteArtistaAsaAsadoAsaltoAscensoAsegurarAseoAsesorAsientoAsiloAsistirAsnoAsombroA/speroAstillaAstroAstutoAsumirAsuntoAtajoAtaqueAtarAtentoAteoA/ticoAtletaA/tomoAtraerAtrozAtu/nAudazAudioAugeAulaAumentoAusenteAutorAvalAvanceAvaroAveAvellanaAvenaAvestruzAvio/nAvisoAyerAyudaAyunoAzafra/nAzarAzoteAzu/carAzufreAzulBabaBaborBacheBahi/aBaileBajarBalanzaBalco/nBaldeBambu/BancoBandaBa~oBarbaBarcoBarnizBarroBa/sculaBasto/nBasuraBatallaBateri/aBatirBatutaBau/lBazarBebe/BebidaBelloBesarBesoBestiaBichoBienBingoBlancoBloqueBlusaBoaBobinaBoboBocaBocinaBodaBodegaBoinaBolaBoleroBolsaBombaBondadBonitoBonoBonsa/iBordeBorrarBosqueBoteBoti/nBo/vedaBozalBravoBrazoBrechaBreveBrilloBrincoBrisaBrocaBromaBronceBroteBrujaBruscoBrutoBuceoBucleBuenoBueyBufandaBufo/nBu/hoBuitreBultoBurbujaBurlaBurroBuscarButacaBuzo/nCaballoCabezaCabinaCabraCacaoCada/verCadenaCaerCafe/Cai/daCaima/nCajaCajo/nCalCalamarCalcioCaldoCalidadCalleCalmaCalorCalvoCamaCambioCamelloCaminoCampoCa/ncerCandilCanelaCanguroCanicaCantoCa~aCa~o/nCaobaCaosCapazCapita/nCapoteCaptarCapuchaCaraCarbo/nCa/rcelCaretaCargaCari~oCarneCarpetaCarroCartaCasaCascoCaseroCaspaCastorCatorceCatreCaudalCausaCazoCebollaCederCedroCeldaCe/lebreCelosoCe/lulaCementoCenizaCentroCercaCerdoCerezaCeroCerrarCertezaCe/spedCetroChacalChalecoChampu/ChanclaChapaCharlaChicoChisteChivoChoqueChozaChuletaChuparCiclo/nCiegoCieloCienCiertoCifraCigarroCimaCincoCineCintaCipre/sCircoCiruelaCisneCitaCiudadClamorClanClaroClaseClaveClienteClimaCli/nicaCobreCoccio/nCochinoCocinaCocoCo/digoCodoCofreCogerCoheteCoji/nCojoColaColchaColegioColgarColinaCollarColmoColumnaCombateComerComidaCo/modoCompraCondeConejoCongaConocerConsejoContarCopaCopiaCorazo/nCorbataCorchoCordo/nCoronaCorrerCoserCosmosCostaCra/neoCra/terCrearCrecerCrei/doCremaCri/aCrimenCriptaCrisisCromoCro/nicaCroquetaCrudoCruzCuadroCuartoCuatroCuboCubrirCucharaCuelloCuentoCuerdaCuestaCuevaCuidarCulebraCulpaCultoCumbreCumplirCunaCunetaCuotaCupo/nCu/pulaCurarCuriosoCursoCurvaCutisDamaDanzaDarDardoDa/tilDeberDe/bilDe/cadaDecirDedoDefensaDefinirDejarDelfi/nDelgadoDelitoDemoraDensoDentalDeporteDerechoDerrotaDesayunoDeseoDesfileDesnudoDestinoDesvi/oDetalleDetenerDeudaDi/aDiabloDiademaDiamanteDianaDiarioDibujoDictarDienteDietaDiezDifi/cilDignoDilemaDiluirDineroDirectoDirigirDiscoDise~oDisfrazDivaDivinoDobleDoceDolorDomingoDonDonarDoradoDormirDorsoDosDosisDrago/nDrogaDuchaDudaDueloDue~oDulceDu/oDuqueDurarDurezaDuroE/banoEbrioEcharEcoEcuadorEdadEdicio/nEdificioEditorEducarEfectoEficazEjeEjemploElefanteElegirElementoElevarElipseE/liteElixirElogioEludirEmbudoEmitirEmocio/nEmpateEmpe~oEmpleoEmpresaEnanoEncargoEnchufeEnci/aEnemigoEneroEnfadoEnfermoEnga~oEnigmaEnlaceEnormeEnredoEnsayoEnse~arEnteroEntrarEnvaseEnvi/oE/pocaEquipoErizoEscalaEscenaEscolarEscribirEscudoEsenciaEsferaEsfuerzoEspadaEspejoEspi/aEsposaEspumaEsqui/EstarEsteEstiloEstufaEtapaEternoE/ticaEtniaEvadirEvaluarEventoEvitarExactoExamenExcesoExcusaExentoExigirExilioExistirE/xitoExpertoExplicarExponerExtremoFa/bricaFa/bulaFachadaFa/cilFactorFaenaFajaFaldaFalloFalsoFaltarFamaFamiliaFamosoFarao/nFarmaciaFarolFarsaFaseFatigaFaunaFavorFaxFebreroFechaFelizFeoFeriaFerozFe/rtilFervorFesti/nFiableFianzaFiarFibraFiccio/nFichaFideoFiebreFielFieraFiestaFiguraFijarFijoFilaFileteFilialFiltroFinFincaFingirFinitoFirmaFlacoFlautaFlechaFlorFlotaFluirFlujoFlu/orFobiaFocaFogataFogo/nFolioFolletoFondoFormaForroFortunaForzarFosaFotoFracasoFra/gilFranjaFraseFraudeFrei/rFrenoFresaFri/oFritoFrutaFuegoFuenteFuerzaFugaFumarFuncio/nFundaFurgo/nFuriaFusilFu/tbolFuturoGacelaGafasGaitaGajoGalaGaleri/aGalloGambaGanarGanchoGangaGansoGarajeGarzaGasolinaGastarGatoGavila/nGemeloGemirGenGe/neroGenioGenteGeranioGerenteGermenGestoGiganteGimnasioGirarGiroGlaciarGloboGloriaGolGolfoGolosoGolpeGomaGordoGorilaGorraGotaGoteoGozarGradaGra/ficoGranoGrasaGratisGraveGrietaGrilloGripeGrisGritoGrosorGru/aGruesoGrumoGrupoGuanteGuapoGuardiaGuerraGui/aGui~oGuionGuisoGuitarraGusanoGustarHaberHa/bilHablarHacerHachaHadaHallarHamacaHarinaHazHaza~aHebillaHebraHechoHeladoHelioHembraHerirHermanoHe/roeHervirHieloHierroHi/gadoHigieneHijoHimnoHistoriaHocicoHogarHogueraHojaHombreHongoHonorHonraHoraHormigaHornoHostilHoyoHuecoHuelgaHuertaHuesoHuevoHuidaHuirHumanoHu/medoHumildeHumoHundirHuraca/nHurtoIconoIdealIdiomaI/doloIglesiaIglu/IgualIlegalIlusio/nImagenIma/nImitarImparImperioImponerImpulsoIncapazI/ndiceInerteInfielInformeIngenioInicioInmensoInmuneInnatoInsectoInstanteIntere/sI/ntimoIntuirInu/tilInviernoIraIrisIroni/aIslaIsloteJabali/Jabo/nJamo/nJarabeJardi/nJarraJaulaJazmi/nJefeJeringaJineteJornadaJorobaJovenJoyaJuergaJuevesJuezJugadorJugoJugueteJuicioJuncoJunglaJunioJuntarJu/piterJurarJustoJuvenilJuzgarKiloKoalaLabioLacioLacraLadoLadro/nLagartoLa/grimaLagunaLaicoLamerLa/minaLa/mparaLanaLanchaLangostaLanzaLa/pizLargoLarvaLa/stimaLataLa/texLatirLaurelLavarLazoLealLeccio/nLecheLectorLeerLegio/nLegumbreLejanoLenguaLentoLe~aLeo/nLeopardoLesio/nLetalLetraLeveLeyendaLibertadLibroLicorLi/derLidiarLienzoLigaLigeroLimaLi/miteLimo/nLimpioLinceLindoLi/neaLingoteLinoLinternaLi/quidoLisoListaLiteraLitioLitroLlagaLlamaLlantoLlaveLlegarLlenarLlevarLlorarLloverLluviaLoboLocio/nLocoLocuraLo/gicaLogroLombrizLomoLonjaLoteLuchaLucirLugarLujoLunaLunesLupaLustroLutoLuzMacetaMachoMaderaMadreMaduroMaestroMafiaMagiaMagoMai/zMaldadMaletaMallaMaloMama/MamboMamutMancoMandoManejarMangaManiqui/ManjarManoMansoMantaMa~anaMapaMa/quinaMarMarcoMareaMarfilMargenMaridoMa/rmolMarro/nMartesMarzoMasaMa/scaraMasivoMatarMateriaMatizMatrizMa/ximoMayorMazorcaMechaMedallaMedioMe/dulaMejillaMejorMelenaMelo/nMemoriaMenorMensajeMenteMenu/MercadoMerengueMe/ritoMesMeso/nMetaMeterMe/todoMetroMezclaMiedoMielMiembroMigaMilMilagroMilitarMillo/nMimoMinaMineroMi/nimoMinutoMiopeMirarMisaMiseriaMisilMismoMitadMitoMochilaMocio/nModaModeloMohoMojarMoldeMolerMolinoMomentoMomiaMonarcaMonedaMonjaMontoMo~oMoradaMorderMorenoMorirMorroMorsaMortalMoscaMostrarMotivoMoverMo/vilMozoMuchoMudarMuebleMuelaMuerteMuestraMugreMujerMulaMuletaMultaMundoMu~ecaMuralMuroMu/sculoMuseoMusgoMu/sicaMusloNa/carNacio/nNadarNaipeNaranjaNarizNarrarNasalNatalNativoNaturalNa/useaNavalNaveNavidadNecioNe/ctarNegarNegocioNegroNeo/nNervioNetoNeutroNevarNeveraNichoNidoNieblaNietoNi~ezNi~oNi/tidoNivelNoblezaNocheNo/minaNoriaNormaNorteNotaNoticiaNovatoNovelaNovioNubeNucaNu/cleoNudilloNudoNueraNueveNuezNuloNu/meroNutriaOasisObesoObispoObjetoObraObreroObservarObtenerObvioOcaOcasoOce/anoOchentaOchoOcioOcreOctavoOctubreOcultoOcuparOcurrirOdiarOdioOdiseaOesteOfensaOfertaOficioOfrecerOgroOi/doOi/rOjoOlaOleadaOlfatoOlivoOllaOlmoOlorOlvidoOmbligoOndaOnzaOpacoOpcio/nO/peraOpinarOponerOptarO/pticaOpuestoOracio/nOradorOralO/rbitaOrcaOrdenOrejaO/rganoOrgi/aOrgulloOrienteOrigenOrillaOroOrquestaOrugaOsadi/aOscuroOseznoOsoOstraOto~oOtroOvejaO/vuloO/xidoOxi/genoOyenteOzonoPactoPadrePaellaPa/ginaPagoPai/sPa/jaroPalabraPalcoPaletaPa/lidoPalmaPalomaPalparPanPanalPa/nicoPanteraPa~ueloPapa/PapelPapillaPaquetePararParcelaParedParirParoPa/rpadoParquePa/rrafoPartePasarPaseoPasio/nPasoPastaPataPatioPatriaPausaPautaPavoPayasoPeato/nPecadoPeceraPechoPedalPedirPegarPeinePelarPelda~oPeleaPeligroPellejoPeloPelucaPenaPensarPe~o/nPeo/nPeorPepinoPeque~oPeraPerchaPerderPerezaPerfilPericoPerlaPermisoPerroPersonaPesaPescaPe/simoPesta~aPe/taloPetro/leoPezPezu~aPicarPicho/nPiePiedraPiernaPiezaPijamaPilarPilotoPimientaPinoPintorPinzaPi~aPiojoPipaPirataPisarPiscinaPisoPistaPito/nPizcaPlacaPlanPlataPlayaPlazaPleitoPlenoPlomoPlumaPluralPobrePocoPoderPodioPoemaPoesi/aPoetaPolenPolici/aPolloPolvoPomadaPomeloPomoPompaPonerPorcio/nPortalPosadaPoseerPosiblePostePotenciaPotroPozoPradoPrecozPreguntaPremioPrensaPresoPrevioPrimoPri/ncipePrisio/nPrivarProaProbarProcesoProductoProezaProfesorProgramaProlePromesaProntoPropioPro/ximoPruebaPu/blicoPucheroPudorPuebloPuertaPuestoPulgaPulirPulmo/nPulpoPulsoPumaPuntoPu~alPu~oPupaPupilaPure/QuedarQuejaQuemarQuererQuesoQuietoQui/micaQuinceQuitarRa/banoRabiaRaboRacio/nRadicalRai/zRamaRampaRanchoRangoRapazRa/pidoRaptoRasgoRaspaRatoRayoRazaRazo/nReaccio/nRealidadReba~oReboteRecaerRecetaRechazoRecogerRecreoRectoRecursoRedRedondoReducirReflejoReformaRefra/nRefugioRegaloRegirReglaRegresoRehe/nReinoRei/rRejaRelatoRelevoRelieveRellenoRelojRemarRemedioRemoRencorRendirRentaRepartoRepetirReposoReptilResRescateResinaRespetoRestoResumenRetiroRetornoRetratoReunirReve/sRevistaReyRezarRicoRiegoRiendaRiesgoRifaRi/gidoRigorRinco/nRi~o/nRi/oRiquezaRisaRitmoRitoRizoRobleRoceRociarRodarRodeoRodillaRoerRojizoRojoRomeroRomperRonRoncoRondaRopaRoperoRosaRoscaRostroRotarRubi/RuborRudoRuedaRugirRuidoRuinaRuletaRuloRumboRumorRupturaRutaRutinaSa/badoSaberSabioSableSacarSagazSagradoSalaSaldoSaleroSalirSalmo/nSalo/nSalsaSaltoSaludSalvarSambaSancio/nSandi/aSanearSangreSanidadSanoSantoSapoSaqueSardinaSarte/nSastreSata/nSaunaSaxofo/nSeccio/nSecoSecretoSectaSedSeguirSeisSelloSelvaSemanaSemillaSendaSensorSe~alSe~orSepararSepiaSequi/aSerSerieSermo/nServirSesentaSesio/nSetaSetentaSeveroSexoSextoSidraSiestaSieteSigloSignoSi/labaSilbarSilencioSillaSi/mboloSimioSirenaSistemaSitioSituarSobreSocioSodioSolSolapaSoldadoSoledadSo/lidoSoltarSolucio/nSombraSondeoSonidoSonoroSonrisaSopaSoplarSoporteSordoSorpresaSorteoSoste/nSo/tanoSuaveSubirSucesoSudorSuegraSueloSue~oSuerteSufrirSujetoSulta/nSumarSuperarSuplirSuponerSupremoSurSurcoSure~oSurgirSustoSutilTabacoTabiqueTablaTabu/TacoTactoTajoTalarTalcoTalentoTallaTalo/nTama~oTamborTangoTanqueTapaTapeteTapiaTapo/nTaquillaTardeTareaTarifaTarjetaTarotTarroTartaTatuajeTauroTazaTazo/nTeatroTechoTeclaTe/cnicaTejadoTejerTejidoTelaTele/fonoTemaTemorTemploTenazTenderTenerTenisTensoTeori/aTerapiaTercoTe/rminoTernuraTerrorTesisTesoroTestigoTeteraTextoTezTibioTiburo/nTiempoTiendaTierraTiesoTigreTijeraTildeTimbreTi/midoTimoTintaTi/oTi/picoTipoTiraTiro/nTita/nTi/tereTi/tuloTizaToallaTobilloTocarTocinoTodoTogaToldoTomarTonoTontoToparTopeToqueTo/raxToreroTormentaTorneoToroTorpedoTorreTorsoTortugaTosToscoToserTo/xicoTrabajoTractorTraerTra/ficoTragoTrajeTramoTranceTratoTraumaTrazarTre/bolTreguaTreintaTrenTreparTresTribuTrigoTripaTristeTriunfoTrofeoTrompaTroncoTropaTroteTrozoTrucoTruenoTrufaTuberi/aTuboTuertoTumbaTumorTu/nelTu/nicaTurbinaTurismoTurnoTutorUbicarU/lceraUmbralUnidadUnirUniversoUnoUntarU~aUrbanoUrbeUrgenteUrnaUsarUsuarioU/tilUtopi/aUvaVacaVaci/oVacunaVagarVagoVainaVajillaValeVa/lidoValleValorVa/lvulaVampiroVaraVariarVaro/nVasoVecinoVectorVehi/culoVeinteVejezVelaVeleroVelozVenaVencerVendaVenenoVengarVenirVentaVenusVerVeranoVerboVerdeVeredaVerjaVersoVerterVi/aViajeVibrarVicioVi/ctimaVidaVi/deoVidrioViejoViernesVigorVilVillaVinagreVinoVi~edoVioli/nViralVirgoVirtudVisorVi/speraVistaVitaminaViudoVivazViveroVivirVivoVolca/nVolumenVolverVorazVotarVotoVozVueloVulgarYacerYateYeguaYemaYernoYesoYodoYogaYogurZafiroZanjaZapatoZarzaZonaZorroZumoZurdo\";\n\nconst lookup: { [word: string]: number } = {};\nlet wordlist: Array = null;\n\nfunction dropDiacritic(word: string): string {\n logger.checkNormalize();\n return toUtf8String(Array.prototype.filter.call(toUtf8Bytes(word.normalize(\"NFD\").toLowerCase()), (c: number) => {\n return ((c >= 65 && c <= 90) || (c >= 97 && c <= 123));\n }));\n}\n\nfunction expand(word: string): string {\n const output: Array = [];\n Array.prototype.forEach.call(toUtf8Bytes(word), (c: number) => {\n // Acute accent\n if (c === 47) {\n output.push(204);\n output.push(129);\n // n-tilde\n } else if (c === 126) {\n output.push(110);\n output.push(204);\n output.push(131);\n } else {\n output.push(c);\n }\n });\n\n return toUtf8String(output);\n}\n\nfunction loadWords(lang: Wordlist): void {\n if (wordlist != null) { return; }\n wordlist = words.replace(/([A-Z])/g, \" $1\").toLowerCase().substring(1).split(\" \").map((w) => expand(w));\n wordlist.forEach((word, index) => {\n lookup[dropDiacritic(word)] = index;\n });\n\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n if (Wordlist.check(lang) !== \"0xf74fb7092aeacdfbf8959557de22098da512207fb9f109cb526994938cf40300\") {\n wordlist = null;\n throw new Error(\"BIP39 Wordlist for es (Spanish) FAILED\");\n }\n}\n\nclass LangEs extends Wordlist {\n constructor() {\n super(\"es\");\n }\n\n getWord(index: number): string {\n loadWords(this);\n return wordlist[index];\n }\n\n getWordIndex(word: string): number {\n loadWords(this);\n return lookup[dropDiacritic(word)];\n }\n}\n\nconst langEs = new LangEs();\nWordlist.register(langEs);\n\nexport { langEs };\n","\"use strict\";\n\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\n\nimport { logger, Wordlist } from \"./wordlist\";\n\n\nconst words = \"AbaisserAbandonAbdiquerAbeilleAbolirAborderAboutirAboyerAbrasifAbreuverAbriterAbrogerAbruptAbsenceAbsoluAbsurdeAbusifAbyssalAcade/mieAcajouAcarienAccablerAccepterAcclamerAccoladeAccrocheAccuserAcerbeAchatAcheterAcidulerAcierAcompteAcque/rirAcronymeActeurActifActuelAdepteAde/quatAdhe/sifAdjectifAdjugerAdmettreAdmirerAdopterAdorerAdoucirAdresseAdroitAdulteAdverbeAe/rerAe/ronefAffaireAffecterAfficheAffreuxAffublerAgacerAgencerAgileAgiterAgraferAgre/ableAgrumeAiderAiguilleAilierAimableAisanceAjouterAjusterAlarmerAlchimieAlerteAlge-breAlgueAlie/nerAlimentAlle/gerAlliageAllouerAllumerAlourdirAlpagaAltesseAlve/oleAmateurAmbiguAmbreAme/nagerAmertumeAmidonAmiralAmorcerAmourAmovibleAmphibieAmpleurAmusantAnalyseAnaphoreAnarchieAnatomieAncienAne/antirAngleAngoisseAnguleuxAnimalAnnexerAnnonceAnnuelAnodinAnomalieAnonymeAnormalAntenneAntidoteAnxieuxApaiserApe/ritifAplanirApologieAppareilAppelerApporterAppuyerAquariumAqueducArbitreArbusteArdeurArdoiseArgentArlequinArmatureArmementArmoireArmureArpenterArracherArriverArroserArsenicArte/rielArticleAspectAsphalteAspirerAssautAsservirAssietteAssocierAssurerAsticotAstreAstuceAtelierAtomeAtriumAtroceAttaqueAttentifAttirerAttraperAubaineAubergeAudaceAudibleAugurerAuroreAutomneAutrucheAvalerAvancerAvariceAvenirAverseAveugleAviateurAvideAvionAviserAvoineAvouerAvrilAxialAxiomeBadgeBafouerBagageBaguetteBaignadeBalancerBalconBaleineBalisageBambinBancaireBandageBanlieueBannie-reBanquierBarbierBarilBaronBarqueBarrageBassinBastionBatailleBateauBatterieBaudrierBavarderBeletteBe/lierBeloteBe/ne/ficeBerceauBergerBerlineBermudaBesaceBesogneBe/tailBeurreBiberonBicycleBiduleBijouBilanBilingueBillardBinaireBiologieBiopsieBiotypeBiscuitBisonBistouriBitumeBizarreBlafardBlagueBlanchirBlessantBlinderBlondBloquerBlousonBobardBobineBoireBoiserBolideBonbonBondirBonheurBonifierBonusBordureBorneBotteBoucleBoueuxBougieBoulonBouquinBourseBoussoleBoutiqueBoxeurBrancheBrasierBraveBrebisBre-cheBreuvageBricolerBrigadeBrillantBriocheBriqueBrochureBroderBronzerBrousseBroyeurBrumeBrusqueBrutalBruyantBuffleBuissonBulletinBureauBurinBustierButinerButoirBuvableBuvetteCabanonCabineCachetteCadeauCadreCafe/ineCaillouCaissonCalculerCalepinCalibreCalmerCalomnieCalvaireCamaradeCame/raCamionCampagneCanalCanetonCanonCantineCanularCapableCaporalCapriceCapsuleCapterCapucheCarabineCarboneCaresserCaribouCarnageCarotteCarreauCartonCascadeCasierCasqueCassureCauserCautionCavalierCaverneCaviarCe/dilleCeintureCe/lesteCelluleCendrierCensurerCentralCercleCe/re/bralCeriseCernerCerveauCesserChagrinChaiseChaleurChambreChanceChapitreCharbonChasseurChatonChaussonChavirerChemiseChenilleChe/quierChercherChevalChienChiffreChignonChime-reChiotChlorureChocolatChoisirChoseChouetteChromeChuteCigareCigogneCimenterCine/maCintrerCirculerCirerCirqueCiterneCitoyenCitronCivilClaironClameurClaquerClasseClavierClientClignerClimatClivageClocheClonageCloporteCobaltCobraCocasseCocotierCoderCodifierCoffreCognerCohe/sionCoifferCoincerCole-reColibriCollineColmaterColonelCombatCome/dieCommandeCompactConcertConduireConfierCongelerConnoterConsonneContactConvexeCopainCopieCorailCorbeauCordageCornicheCorpusCorrectCorte-geCosmiqueCostumeCotonCoudeCoupureCourageCouteauCouvrirCoyoteCrabeCrainteCravateCrayonCre/atureCre/diterCre/meuxCreuserCrevetteCriblerCrierCristalCrite-reCroireCroquerCrotaleCrucialCruelCrypterCubiqueCueillirCuille-reCuisineCuivreCulminerCultiverCumulerCupideCuratifCurseurCyanureCycleCylindreCyniqueDaignerDamierDangerDanseurDauphinDe/battreDe/biterDe/borderDe/briderDe/butantDe/calerDe/cembreDe/chirerDe/ciderDe/clarerDe/corerDe/crireDe/cuplerDe/daleDe/ductifDe/esseDe/fensifDe/filerDe/frayerDe/gagerDe/givrerDe/glutirDe/graferDe/jeunerDe/liceDe/logerDemanderDemeurerDe/molirDe/nicherDe/nouerDentelleDe/nuderDe/partDe/penserDe/phaserDe/placerDe/poserDe/rangerDe/roberDe/sastreDescenteDe/sertDe/signerDe/sobe/irDessinerDestrierDe/tacherDe/testerDe/tourerDe/tresseDevancerDevenirDevinerDevoirDiableDialogueDiamantDicterDiffe/rerDige/rerDigitalDigneDiluerDimancheDiminuerDioxydeDirectifDirigerDiscuterDisposerDissiperDistanceDivertirDiviserDocileDocteurDogmeDoigtDomaineDomicileDompterDonateurDonjonDonnerDopamineDortoirDorureDosageDoseurDossierDotationDouanierDoubleDouceurDouterDoyenDragonDraperDresserDribblerDroitureDuperieDuplexeDurableDurcirDynastieE/blouirE/carterE/charpeE/chelleE/clairerE/clipseE/cloreE/cluseE/coleE/conomieE/corceE/couterE/craserE/cre/merE/crivainE/crouE/cumeE/cureuilE/difierE/duquerEffacerEffectifEffigieEffortEffrayerEffusionE/galiserE/garerE/jecterE/laborerE/largirE/lectronE/le/gantE/le/phantE/le-veE/ligibleE/litismeE/logeE/luciderE/luderEmballerEmbellirEmbryonE/meraudeE/missionEmmenerE/motionE/mouvoirEmpereurEmployerEmporterEmpriseE/mulsionEncadrerEnche-reEnclaveEncocheEndiguerEndosserEndroitEnduireE/nergieEnfanceEnfermerEnfouirEngagerEnginEngloberE/nigmeEnjamberEnjeuEnleverEnnemiEnnuyeuxEnrichirEnrobageEnseigneEntasserEntendreEntierEntourerEntraverE/nume/rerEnvahirEnviableEnvoyerEnzymeE/olienE/paissirE/pargneE/patantE/pauleE/picerieE/pide/mieE/pierE/pilogueE/pineE/pisodeE/pitapheE/poqueE/preuveE/prouverE/puisantE/querreE/quipeE/rigerE/rosionErreurE/ruptionEscalierEspadonEspe-ceEspie-gleEspoirEspritEsquiverEssayerEssenceEssieuEssorerEstimeEstomacEstradeE/tage-reE/talerE/tancheE/tatiqueE/teindreE/tendoirE/ternelE/thanolE/thiqueEthnieE/tirerE/tofferE/toileE/tonnantE/tourdirE/trangeE/troitE/tudeEuphorieE/valuerE/vasionE/ventailE/videnceE/viterE/volutifE/voquerExactExage/rerExaucerExcellerExcitantExclusifExcuseExe/cuterExempleExercerExhalerExhorterExigenceExilerExisterExotiqueExpe/dierExplorerExposerExprimerExquisExtensifExtraireExulterFableFabuleuxFacetteFacileFactureFaiblirFalaiseFameuxFamilleFarceurFarfeluFarineFaroucheFascinerFatalFatigueFauconFautifFaveurFavoriFe/brileFe/conderFe/de/rerFe/linFemmeFe/murFendoirFe/odalFermerFe/roceFerveurFestivalFeuilleFeutreFe/vrierFiascoFicelerFictifFide-leFigureFilatureFiletageFilie-reFilleulFilmerFilouFiltrerFinancerFinirFioleFirmeFissureFixerFlairerFlammeFlasqueFlatteurFle/auFle-cheFleurFlexionFloconFloreFluctuerFluideFluvialFolieFonderieFongibleFontaineForcerForgeronFormulerFortuneFossileFoudreFouge-reFouillerFoulureFourmiFragileFraiseFranchirFrapperFrayeurFre/gateFreinerFrelonFre/mirFre/ne/sieFre-reFriableFrictionFrissonFrivoleFroidFromageFrontalFrotterFruitFugitifFuiteFureurFurieuxFurtifFusionFuturGagnerGalaxieGalerieGambaderGarantirGardienGarnirGarrigueGazelleGazonGe/antGe/latineGe/luleGendarmeGe/ne/ralGe/nieGenouGentilGe/ologieGe/ome-treGe/raniumGermeGestuelGeyserGibierGiclerGirafeGivreGlaceGlaiveGlisserGlobeGloireGlorieuxGolfeurGommeGonflerGorgeGorilleGoudronGouffreGoulotGoupilleGourmandGoutteGraduelGraffitiGraineGrandGrappinGratuitGravirGrenatGriffureGrillerGrimperGrognerGronderGrotteGroupeGrugerGrutierGruye-reGue/pardGuerrierGuideGuimauveGuitareGustatifGymnasteGyrostatHabitudeHachoirHalteHameauHangarHannetonHaricotHarmonieHarponHasardHe/liumHe/matomeHerbeHe/rissonHermineHe/ronHe/siterHeureuxHibernerHibouHilarantHistoireHiverHomardHommageHomoge-neHonneurHonorerHonteuxHordeHorizonHorlogeHormoneHorribleHouleuxHousseHublotHuileuxHumainHumbleHumideHumourHurlerHydromelHygie-neHymneHypnoseIdylleIgnorerIguaneIlliciteIllusionImageImbiberImiterImmenseImmobileImmuableImpactImpe/rialImplorerImposerImprimerImputerIncarnerIncendieIncidentInclinerIncoloreIndexerIndiceInductifIne/ditIneptieInexactInfiniInfligerInformerInfusionInge/rerInhalerInhiberInjecterInjureInnocentInoculerInonderInscrireInsecteInsigneInsoliteInspirerInstinctInsulterIntactIntenseIntimeIntrigueIntuitifInutileInvasionInventerInviterInvoquerIroniqueIrradierIrre/elIrriterIsolerIvoireIvresseJaguarJaillirJambeJanvierJardinJaugerJauneJavelotJetableJetonJeudiJeunesseJoindreJoncherJonglerJoueurJouissifJournalJovialJoyauJoyeuxJubilerJugementJuniorJuponJuristeJusticeJuteuxJuve/nileKayakKimonoKiosqueLabelLabialLabourerLace/rerLactoseLaguneLaineLaisserLaitierLambeauLamelleLampeLanceurLangageLanterneLapinLargeurLarmeLaurierLavaboLavoirLectureLe/galLe/gerLe/gumeLessiveLettreLevierLexiqueLe/zardLiasseLibe/rerLibreLicenceLicorneLie-geLie-vreLigatureLigoterLigueLimerLimiteLimonadeLimpideLine/aireLingotLionceauLiquideLisie-reListerLithiumLitigeLittoralLivreurLogiqueLointainLoisirLombricLoterieLouerLourdLoutreLouveLoyalLubieLucideLucratifLueurLugubreLuisantLumie-reLunaireLundiLuronLutterLuxueuxMachineMagasinMagentaMagiqueMaigreMaillonMaintienMairieMaisonMajorerMalaxerMale/ficeMalheurMaliceMalletteMammouthMandaterManiableManquantManteauManuelMarathonMarbreMarchandMardiMaritimeMarqueurMarronMartelerMascotteMassifMate/rielMatie-reMatraqueMaudireMaussadeMauveMaximalMe/chantMe/connuMe/dailleMe/decinMe/diterMe/duseMeilleurMe/langeMe/lodieMembreMe/moireMenacerMenerMenhirMensongeMentorMercrediMe/riteMerleMessagerMesureMe/talMe/te/oreMe/thodeMe/tierMeubleMiaulerMicrobeMietteMignonMigrerMilieuMillionMimiqueMinceMine/ralMinimalMinorerMinuteMiracleMiroiterMissileMixteMobileModerneMoelleuxMondialMoniteurMonnaieMonotoneMonstreMontagneMonumentMoqueurMorceauMorsureMortierMoteurMotifMoucheMoufleMoulinMoussonMoutonMouvantMultipleMunitionMurailleMure-neMurmureMuscleMuse/umMusicienMutationMuterMutuelMyriadeMyrtilleMyste-reMythiqueNageurNappeNarquoisNarrerNatationNationNatureNaufrageNautiqueNavireNe/buleuxNectarNe/fasteNe/gationNe/gligerNe/gocierNeigeNerveuxNettoyerNeuroneNeutronNeveuNicheNickelNitrateNiveauNobleNocifNocturneNoirceurNoisetteNomadeNombreuxNommerNormatifNotableNotifierNotoireNourrirNouveauNovateurNovembreNoviceNuageNuancerNuireNuisibleNume/roNuptialNuqueNutritifObe/irObjectifObligerObscurObserverObstacleObtenirObturerOccasionOccuperOce/anOctobreOctroyerOctuplerOculaireOdeurOdorantOffenserOfficierOffrirOgiveOiseauOisillonOlfactifOlivierOmbrageOmettreOnctueuxOndulerOne/reuxOniriqueOpaleOpaqueOpe/rerOpinionOpportunOpprimerOpterOptiqueOrageuxOrangeOrbiteOrdonnerOreilleOrganeOrgueilOrificeOrnementOrqueOrtieOscillerOsmoseOssatureOtarieOuraganOursonOutilOutragerOuvrageOvationOxydeOxyge-neOzonePaisiblePalacePalmare-sPalourdePalperPanachePandaPangolinPaniquerPanneauPanoramaPantalonPapayePapierPapoterPapyrusParadoxeParcelleParesseParfumerParlerParoleParrainParsemerPartagerParureParvenirPassionPaste-quePaternelPatiencePatronPavillonPavoiserPayerPaysagePeignePeintrePelagePe/licanPellePelousePeluchePendulePe/ne/trerPe/niblePensifPe/nuriePe/pitePe/plumPerdrixPerforerPe/riodePermuterPerplexePersilPertePeserPe/talePetitPe/trirPeuplePharaonPhobiePhoquePhotonPhrasePhysiquePianoPicturalPie-cePierrePieuvrePilotePinceauPipettePiquerPiroguePiscinePistonPivoterPixelPizzaPlacardPlafondPlaisirPlanerPlaquePlastronPlateauPleurerPlexusPliagePlombPlongerPluiePlumagePochettePoe/siePoe-tePointePoirierPoissonPoivrePolairePolicierPollenPolygonePommadePompierPonctuelPonde/rerPoneyPortiquePositionPosse/derPosturePotagerPoteauPotionPoucePoulainPoumonPourprePoussinPouvoirPrairiePratiquePre/cieuxPre/direPre/fixePre/ludePre/nomPre/sencePre/textePre/voirPrimitifPrincePrisonPriverProble-meProce/derProdigeProfondProgre-sProieProjeterProloguePromenerPropreProspe-reProte/gerProuesseProverbePrudencePruneauPsychosePublicPuceronPuiserPulpePulsarPunaisePunitifPupitrePurifierPuzzlePyramideQuasarQuerelleQuestionQuie/tudeQuitterQuotientRacineRaconterRadieuxRagondinRaideurRaisinRalentirRallongeRamasserRapideRasageRatisserRavagerRavinRayonnerRe/actifRe/agirRe/aliserRe/animerRecevoirRe/citerRe/clamerRe/colterRecruterReculerRecyclerRe/digerRedouterRefaireRe/flexeRe/formerRefrainRefugeRe/galienRe/gionRe/glageRe/gulierRe/ite/rerRejeterRejouerRelatifReleverReliefRemarqueReme-deRemiseRemonterRemplirRemuerRenardRenfortReniflerRenoncerRentrerRenvoiReplierReporterRepriseReptileRequinRe/serveRe/sineuxRe/soudreRespectResterRe/sultatRe/tablirRetenirRe/ticuleRetomberRetracerRe/unionRe/ussirRevancheRevivreRe/volteRe/vulsifRichesseRideauRieurRigideRigolerRincerRiposterRisibleRisqueRituelRivalRivie-reRocheuxRomanceRompreRonceRondinRoseauRosierRotatifRotorRotuleRougeRouilleRouleauRoutineRoyaumeRubanRubisRucheRuelleRugueuxRuinerRuisseauRuserRustiqueRythmeSablerSaboterSabreSacocheSafariSagesseSaisirSaladeSaliveSalonSaluerSamediSanctionSanglierSarcasmeSardineSaturerSaugrenuSaumonSauterSauvageSavantSavonnerScalpelScandaleSce/le/ratSce/narioSceptreSche/maScienceScinderScoreScrutinSculpterSe/anceSe/cableSe/cherSecouerSe/cre/terSe/datifSe/duireSeigneurSe/jourSe/lectifSemaineSemblerSemenceSe/minalSe/nateurSensibleSentenceSe/parerSe/quenceSereinSergentSe/rieuxSerrureSe/rumServiceSe/sameSe/virSevrageSextupleSide/ralSie-cleSie/gerSifflerSigleSignalSilenceSiliciumSimpleSince-reSinistreSiphonSiropSismiqueSituerSkierSocialSocleSodiumSoigneuxSoldatSoleilSolitudeSolubleSombreSommeilSomnolerSondeSongeurSonnetteSonoreSorcierSortirSosieSottiseSoucieuxSoudureSouffleSouleverSoupapeSourceSoutirerSouvenirSpacieuxSpatialSpe/cialSphe-reSpiralStableStationSternumStimulusStipulerStrictStudieuxStupeurStylisteSublimeSubstratSubtilSubvenirSucce-sSucreSuffixeSugge/rerSuiveurSulfateSuperbeSupplierSurfaceSuricateSurmenerSurpriseSursautSurvieSuspectSyllabeSymboleSyme/trieSynapseSyntaxeSyste-meTabacTablierTactileTaillerTalentTalismanTalonnerTambourTamiserTangibleTapisTaquinerTarderTarifTartineTasseTatamiTatouageTaupeTaureauTaxerTe/moinTemporelTenailleTendreTeneurTenirTensionTerminerTerneTerribleTe/tineTexteThe-meThe/orieThe/rapieThoraxTibiaTie-deTimideTirelireTiroirTissuTitaneTitreTituberTobogganTole/rantTomateToniqueTonneauToponymeTorcheTordreTornadeTorpilleTorrentTorseTortueTotemToucherTournageTousserToxineTractionTraficTragiqueTrahirTrainTrancherTravailTre-fleTremperTre/sorTreuilTriageTribunalTricoterTrilogieTriompheTriplerTriturerTrivialTromboneTroncTropicalTroupeauTuileTulipeTumulteTunnelTurbineTuteurTutoyerTuyauTympanTyphonTypiqueTyranUbuesqueUltimeUltrasonUnanimeUnifierUnionUniqueUnitaireUniversUraniumUrbainUrticantUsageUsineUsuelUsureUtileUtopieVacarmeVaccinVagabondVagueVaillantVaincreVaisseauValableValiseVallonValveVampireVanilleVapeurVarierVaseuxVassalVasteVecteurVedetteVe/ge/talVe/hiculeVeinardVe/loceVendrediVe/ne/rerVengerVenimeuxVentouseVerdureVe/rinVernirVerrouVerserVertuVestonVe/te/ranVe/tusteVexantVexerViaducViandeVictoireVidangeVide/oVignetteVigueurVilainVillageVinaigreViolonVipe-reVirementVirtuoseVirusVisageViseurVisionVisqueuxVisuelVitalVitesseViticoleVitrineVivaceVivipareVocationVoguerVoileVoisinVoitureVolailleVolcanVoltigerVolumeVoraceVortexVoterVouloirVoyageVoyelleWagonXe/nonYachtZe-breZe/nithZesteZoologie\";\n\nlet wordlist: Array = null;\nconst lookup: { [word: string]: number } = { }\n\nfunction dropDiacritic(word: string): string {\n logger.checkNormalize();\n return toUtf8String(Array.prototype.filter.call(toUtf8Bytes(word.normalize(\"NFD\").toLowerCase()), (c: number) => {\n return ((c >= 65 && c <= 90) || (c >= 97 && c <= 123));\n }));\n}\n\nfunction expand(word: string): string {\n const output: Array = [];\n\n Array.prototype.forEach.call(toUtf8Bytes(word), (c: number) => {\n // Acute accent\n if (c === 47) {\n output.push(204);\n output.push(129);\n\n // Grave accent\n } else if (c === 45) {\n output.push(204);\n output.push(128);\n\n } else {\n output.push(c);\n }\n });\n\n return toUtf8String(output);\n}\n\nfunction loadWords(lang: Wordlist): void {\n if (wordlist != null) { return; }\n wordlist = words.replace(/([A-Z])/g, \" $1\").toLowerCase().substring(1).split(\" \").map((w) => expand(w));\n wordlist.forEach((word, index) => {\n lookup[dropDiacritic(word)] = index;\n });\n\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n if (Wordlist.check(lang) !== \"0x51deb7ae009149dc61a6bd18a918eb7ac78d2775726c68e598b92d002519b045\") {\n wordlist = null;\n throw new Error(\"BIP39 Wordlist for fr (French) FAILED\");\n }\n}\n\nclass LangFr extends Wordlist {\n constructor() {\n super(\"fr\");\n }\n\n getWord(index: number): string {\n loadWords(this);\n return wordlist[index];\n }\n\n getWordIndex(word: string): number {\n loadWords(this);\n return lookup[dropDiacritic(word)];\n }\n}\n\nconst langFr = new LangFr();\nWordlist.register(langFr);\n\nexport { langFr };\n","\"use strict\";\n\nimport { hexlify } from \"@ethersproject/bytes\";\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\n\nimport { logger, Wordlist } from \"./wordlist\";\n\n\nconst data = [\n\n // 4-kana words\n \"AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAMEAFBAFCBKFBQRBSFBCXBCDBCHBGFBEQBpBBpQBIkBHNBeOBgFBVCBhBBhNBmOBmRBiHBiFBUFBZDBvFBsXBkFBlcBjYBwDBMBBTBBTRBWBBWXXaQXaRXQWXSRXCFXYBXpHXOQXHRXhRXuRXmXXbRXlXXwDXTRXrCXWQXWGaBWaKcaYgasFadQalmaMBacAKaRKKBKKXKKjKQRKDRKCYKCRKIDKeVKHcKlXKjHKrYNAHNBWNaRNKcNIBNIONmXNsXNdXNnBNMBNRBNrXNWDNWMNFOQABQAHQBrQXBQXFQaRQKXQKDQKOQKFQNBQNDQQgQCXQCDQGBQGDQGdQYXQpBQpQQpHQLXQHuQgBQhBQhCQuFQmXQiDQUFQZDQsFQdRQkHQbRQlOQlmQPDQjDQwXQMBQMDQcFQTBQTHQrDDXQDNFDGBDGQDGRDpFDhFDmXDZXDbRDMYDRdDTRDrXSAhSBCSBrSGQSEQSHBSVRShYShkSyQSuFSiBSdcSoESocSlmSMBSFBSFKSFNSFdSFcCByCaRCKcCSBCSRCCrCGbCEHCYXCpBCpQCIBCIHCeNCgBCgFCVECVcCmkCmwCZXCZFCdRClOClmClFCjDCjdCnXCwBCwXCcRCFQCFjGXhGNhGDEGDMGCDGCHGIFGgBGVXGVEGVRGmXGsXGdYGoSGbRGnXGwXGwDGWRGFNGFLGFOGFdGFkEABEBDEBFEXOEaBEKSENBENDEYXEIgEIkEgBEgQEgHEhFEudEuFEiBEiHEiFEZD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XUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD\",\n\n // 10-kana words\n \"IJBEJqXZJ\"\n];\n\n// Maps each character into its kana value (the index)\nconst mapping = \"~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt\"\n\nlet wordlist: Array = null;\n\nfunction hex(word: string) {\n return hexlify(toUtf8Bytes(word));\n}\n\nconst KiYoKu = \"0xe3818de38284e3818f\";\nconst KyoKu = \"0xe3818de38283e3818f\"\n\nfunction loadWords(lang: Wordlist) {\n if (wordlist !== null) { return; }\n\n wordlist = [];\n\n // Transforms for normalizing (sort is a not quite UTF-8)\n const transform: { [key: string]: string | boolean } = {};\n\n // Delete the diacritic marks\n transform[toUtf8String([227, 130, 154])] = false;\n transform[toUtf8String([227, 130, 153])] = false;\n\n // Some simple transforms that sort out most of the order\n transform[toUtf8String([227, 130, 133])] = toUtf8String([227, 130, 134]);\n transform[toUtf8String([227, 129, 163])] = toUtf8String([227, 129, 164]);\n transform[toUtf8String([227, 130, 131])] = toUtf8String([227, 130, 132]);\n transform[toUtf8String([227, 130, 135])] = toUtf8String([227, 130, 136]);\n\n\n // Normalize words using the transform\n function normalize(word: string) {\n let result = \"\";\n for (let i = 0; i < word.length; i++) {\n let kana = word[i];\n const target = transform[kana];\n if (target === false) { continue; }\n if (target) { kana = target; }\n result += kana;\n }\n return result;\n }\n\n // Sort how the Japanese list is sorted\n function sortJapanese(a: string, b: string) {\n a = normalize(a);\n b = normalize(b);\n if (a < b) { return -1; }\n if (a > b) { return 1; }\n return 0;\n }\n\n // Load all the words\n for (let length = 3; length <= 9; length++) {\n const d = data[length - 3];\n for (let offset = 0; offset < d.length; offset += length) {\n const word = [];\n for (let i = 0; i < length; i++) {\n const k = mapping.indexOf(d[offset + i]);\n word.push(227);\n word.push((k & 0x40) ? 130: 129);\n word.push((k & 0x3f) + 128);\n }\n wordlist.push(toUtf8String(word));\n }\n }\n wordlist.sort(sortJapanese);\n\n // For some reason kyoku and kiyoku are flipped in node (!!).\n // The order SHOULD be:\n // - kyoku\n // - kiyoku\n\n // This should ignore \"if\", but that doesn't work here??\n /* istanbul ignore next */\n if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) {\n const tmp = wordlist[442];\n wordlist[442] = wordlist[443];\n wordlist[443] = tmp;\n }\n\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n if (Wordlist.check(lang) !== \"0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600\") {\n wordlist = null;\n throw new Error(\"BIP39 Wordlist for ja (Japanese) FAILED\");\n }\n}\n\nclass LangJa extends Wordlist {\n constructor() {\n super(\"ja\");\n }\n\n getWord(index: number): string {\n loadWords(this);\n return wordlist[index];\n }\n\n getWordIndex(word: string): number {\n loadWords(this);\n return wordlist.indexOf(word);\n }\n\n split(mnemonic: string): Array {\n logger.checkNormalize();\n return mnemonic.split(/(?:\\u3000| )+/g);\n }\n\n join(words: Array): string {\n return words.join(\"\\u3000\");\n }\n}\n\nconst langJa = new LangJa();\nWordlist.register(langJa);\n\nexport { langJa };\n\n","\"use strict\";\n\nimport { toUtf8String } from \"@ethersproject/strings\";\n\nimport { Wordlist } from \"./wordlist\";\n\n\nconst data = [\n \"OYAa\",\n \"ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl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LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg\",\n \"HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb\",\n \"AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl\"\n]\n\nconst codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*\"\n\nfunction getHangul(code: number): string {\n if (code >= 40) {\n code = code + 168 - 40;\n } else if (code >= 19) {\n code = code + 97 - 19;\n }\n\n return toUtf8String([ 225, (code >> 6) + 132, (code & 0x3f) + 128]);\n}\n\nlet wordlist: Array = null;\n\nfunction loadWords(lang: Wordlist): void {\n if (wordlist != null) { return; }\n\n wordlist = [];\n\n data.forEach((data, length) => {\n length += 4;\n for (let i = 0; i < data.length; i += length) {\n let word = \"\";\n for (let j = 0; j < length; j++) {\n word += getHangul(codes.indexOf(data[i + j]));\n }\n wordlist.push(word)\n }\n });\n\n wordlist.sort();\n\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n if (Wordlist.check(lang) !== \"0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a\") {\n wordlist = null;\n throw new Error(\"BIP39 Wordlist for ko (Korean) FAILED\");\n }\n}\n\n\nclass LangKo extends Wordlist {\n constructor() {\n super(\"ko\");\n }\n\n getWord(index: number): string {\n loadWords(this);\n return wordlist[index];\n }\n\n getWordIndex(word: string): number {\n loadWords(this);\n return wordlist.indexOf(word);\n }\n}\n\nconst langKo = new LangKo();\nWordlist.register(langKo);\n\nexport { langKo }\n","\"use strict\";\n\nimport { Wordlist } from \"./wordlist\";\n\nconst words = \"AbacoAbbaglioAbbinatoAbeteAbissoAbolireAbrasivoAbrogatoAccadereAccennoAccusatoAcetoneAchilleAcidoAcquaAcreAcrilicoAcrobataAcutoAdagioAddebitoAddomeAdeguatoAderireAdipeAdottareAdulareAffabileAffettoAffissoAffrantoAforismaAfosoAfricanoAgaveAgenteAgevoleAggancioAgireAgitareAgonismoAgricoloAgrumetoAguzzoAlabardaAlatoAlbatroAlberatoAlboAlbumeAlceAlcolicoAlettoneAlfaAlgebraAlianteAlibiAlimentoAllagatoAllegroAllievoAllodolaAllusivoAlmenoAlogenoAlpacaAlpestreAltalenaAlternoAlticcioAltroveAlunnoAlveoloAlzareAmalgamaAmanitaAmarenaAmbitoAmbratoAmebaAmericaAmetistaAmicoAmmassoAmmendaAmmirareAmmonitoAmoreAmpioAmpliareAmuletoAnacardoAnagrafeAnalistaAnarchiaAnatraAncaAncellaAncoraAndareAndreaAnelloAngeloAngolareAngustoAnimaAnnegareAnnidatoAnnoAnnuncioAnonimoAnticipoAnziApaticoAperturaApodeApparireAppetitoAppoggioApprodoAppuntoAprileArabicaArachideAragostaAraldicaArancioAraturaArazzoArbitroArchivioArditoArenileArgentoArgineArgutoAriaArmoniaArneseArredatoArringaArrostoArsenicoArsoArteficeArzilloAsciuttoAscoltoAsepsiAsetticoAsfaltoAsinoAsolaAspiratoAsproAssaggioAsseAssolutoAssurdoAstaAstenutoAsticeAstrattoAtavicoAteismoAtomicoAtonoAttesaAttivareAttornoAttritoAttualeAusilioAustriaAutistaAutonomoAutunnoAvanzatoAvereAvvenireAvvisoAvvolgereAzioneAzotoAzzimoAzzurroBabeleBaccanoBacinoBacoBadessaBadilataBagnatoBaitaBalconeBaldoBalenaBallataBalzanoBambinoBandireBaraondaBarbaroBarcaBaritonoBarlumeBaroccoBasilicoBassoBatostaBattutoBauleBavaBavosaBeccoBeffaBelgioBelvaBendaBenevoleBenignoBenzinaBereBerlinaBetaBibitaBiciBidoneBifidoBigaBilanciaBimboBinocoloBiologoBipedeBipolareBirbanteBirraBiscottoBisestoBisnonnoBisonteBisturiBizzarroBlandoBlattaBollitoBonificoBordoBoscoBotanicoBottinoBozzoloBraccioBradipoBramaBrancaBravuraBretellaBrevettoBrezzaBrigliaBrillanteBrindareBroccoloBrodoBronzinaBrulloBrunoBubboneBucaBudinoBuffoneBuioBulboBuonoBurloneBurrascaBussolaBustaCadettoCaducoCalamaroCalcoloCalesseCalibroCalmoCaloriaCambusaCamerataCamiciaCamminoCamolaCampaleCanapaCandelaCaneCaninoCanottoCantinaCapaceCapelloCapitoloCapogiroCapperoCapraCapsulaCarapaceCarcassaCardoCarismaCarovanaCarrettoCartolinaCasaccioCascataCasermaCasoCassoneCastelloCasualeCatastaCatenaCatrameCautoCavilloCedibileCedrataCefaloCelebreCellulareCenaCenoneCentesimoCeramicaCercareCertoCerumeCervelloCesoiaCespoCetoChelaChiaroChiccaChiedereChimeraChinaChirurgoChitarraCiaoCiclismoCifrareCignoCilindroCiottoloCircaCirrosiCitricoCittadinoCiuffoCivettaCivileClassicoClinicaCloroCoccoCodardoCodiceCoerenteCognomeCollareColmatoColoreColposoColtivatoColzaComaCometaCommandoComodoComputerComuneConcisoCondurreConfermaCongelareConiugeConnessoConoscereConsumoContinuoConvegnoCopertoCopioneCoppiaCopricapoCorazzaCordataCoricatoCorniceCorollaCorpoCorredoCorsiaCorteseCosmicoCostanteCotturaCovatoCratereCravattaCreatoCredereCremosoCrescitaCretaCricetoCrinaleCrisiCriticoCroceCronacaCrostataCrucialeCruscaCucireCuculoCuginoCullatoCupolaCuratoreCursoreCurvoCuscinoCustodeDadoDainoDalmataDamerinoDanielaDannosoDanzareDatatoDavantiDavveroDebuttoDecennioDecisoDeclinoDecolloDecretoDedicatoDefinitoDeformeDegnoDelegareDelfinoDelirioDeltaDemenzaDenotatoDentroDepositoDerapataDerivareDerogaDescrittoDesertoDesiderioDesumereDetersivoDevotoDiametroDicembreDiedroDifesoDiffusoDigerireDigitaleDiluvioDinamicoDinnanziDipintoDiplomaDipoloDiradareDireDirottoDirupoDisagioDiscretoDisfareDisgeloDispostoDistanzaDisumanoDitoDivanoDiveltoDividereDivoratoDobloneDocenteDoganaleDogmaDolceDomatoDomenicaDominareDondoloDonoDormireDoteDottoreDovutoDozzinaDragoDruidoDubbioDubitareDucaleDunaDuomoDupliceDuraturoEbanoEccessoEccoEclissiEconomiaEderaEdicolaEdileEditoriaEducareEgemoniaEgliEgoismoEgregioElaboratoElargireEleganteElencatoElettoElevareElficoElicaElmoElsaElusoEmanatoEmblemaEmessoEmiroEmotivoEmozioneEmpiricoEmuloEndemicoEnduroEnergiaEnfasiEnotecaEntrareEnzimaEpatiteEpilogoEpisodioEpocaleEppureEquatoreErarioErbaErbosoEredeEremitaErigereErmeticoEroeErosivoErranteEsagonoEsameEsanimeEsaudireEscaEsempioEsercitoEsibitoEsigenteEsistereEsitoEsofagoEsortatoEsosoEspansoEspressoEssenzaEssoEstesoEstimareEstoniaEstrosoEsultareEtilicoEtnicoEtruscoEttoEuclideoEuropaEvasoEvidenzaEvitatoEvolutoEvvivaFabbricaFaccendaFachiroFalcoFamigliaFanaleFanfaraFangoFantasmaFareFarfallaFarinosoFarmacoFasciaFastosoFasulloFaticareFatoFavolosoFebbreFecolaFedeFegatoFelpaFeltroFemminaFendereFenomenoFermentoFerroFertileFessuraFestivoFettaFeudoFiabaFiduciaFifaFiguratoFiloFinanzaFinestraFinireFioreFiscaleFisicoFiumeFlaconeFlamencoFleboFlemmaFloridoFluenteFluoroFobicoFocacciaFocosoFoderatoFoglioFolataFolcloreFolgoreFondenteFoneticoFoniaFontanaForbitoForchettaForestaFormicaFornaioForoFortezzaForzareFosfatoFossoFracassoFranaFrassinoFratelloFreccettaFrenataFrescoFrigoFrollinoFrondeFrugaleFruttaFucilataFucsiaFuggenteFulmineFulvoFumanteFumettoFumosoFuneFunzioneFuocoFurboFurgoneFuroreFusoFutileGabbianoGaffeGalateoGallinaGaloppoGamberoGammaGaranziaGarboGarofanoGarzoneGasdottoGasolioGastricoGattoGaudioGazeboGazzellaGecoGelatinaGelsoGemelloGemmatoGeneGenitoreGennaioGenotipoGergoGhepardoGhiaccioGhisaGialloGildaGineproGiocareGioielloGiornoGioveGiratoGironeGittataGiudizioGiuratoGiustoGlobuloGlutineGnomoGobbaGolfGomitoGommoneGonfioGonnaGovernoGracileGradoGraficoGrammoGrandeGrattareGravosoGraziaGrecaGreggeGrifoneGrigioGrinzaGrottaGruppoGuadagnoGuaioGuantoGuardareGufoGuidareIbernatoIconaIdenticoIdillioIdoloIdraIdricoIdrogenoIgieneIgnaroIgnoratoIlareIllesoIllogicoIlludereImballoImbevutoImboccoImbutoImmaneImmersoImmolatoImpaccoImpetoImpiegoImportoImprontaInalareInarcareInattivoIncantoIncendioInchinoIncisivoInclusoIncontroIncrocioIncuboIndagineIndiaIndoleIneditoInfattiInfilareInflittoIngaggioIngegnoIngleseIngordoIngrossoInnescoInodoreInoltrareInondatoInsanoInsettoInsiemeInsonniaInsulinaIntasatoInteroIntonacoIntuitoInumidireInvalidoInveceInvitoIperboleIpnoticoIpotesiIppicaIrideIrlandaIronicoIrrigatoIrrorareIsolatoIsotopoIstericoIstitutoIstriceItaliaIterareLabbroLabirintoLaccaLaceratoLacrimaLacunaLaddoveLagoLampoLancettaLanternaLardosoLargaLaringeLastraLatenzaLatinoLattugaLavagnaLavoroLegaleLeggeroLemboLentezzaLenzaLeoneLepreLesivoLessatoLestoLetteraleLevaLevigatoLiberoLidoLievitoLillaLimaturaLimitareLimpidoLineareLinguaLiquidoLiraLiricaLiscaLiteLitigioLivreaLocandaLodeLogicaLombareLondraLongevoLoquaceLorenzoLotoLotteriaLuceLucidatoLumacaLuminosoLungoLupoLuppoloLusingaLussoLuttoMacabroMacchinaMaceroMacinatoMadamaMagicoMagliaMagneteMagroMaiolicaMalafedeMalgradoMalintesoMalsanoMaltoMalumoreManaManciaMandorlaMangiareManifestoMannaroManovraMansardaMantideManubrioMappaMaratonaMarcireMarettaMarmoMarsupioMascheraMassaiaMastinoMaterassoMatricolaMattoneMaturoMazurcaMeandroMeccanicoMecenateMedesimoMeditareMegaMelassaMelisMelodiaMeningeMenoMensolaMercurioMerendaMerloMeschinoMeseMessereMestoloMetalloMetodoMettereMiagolareMicaMicelioMicheleMicroboMidolloMieleMiglioreMilanoMiliteMimosaMineraleMiniMinoreMirinoMirtilloMiscelaMissivaMistoMisurareMitezzaMitigareMitraMittenteMnemonicoModelloModificaModuloMoganoMogioMoleMolossoMonasteroMoncoMondinaMonetarioMonileMonotonoMonsoneMontatoMonvisoMoraMordereMorsicatoMostroMotivatoMotosegaMottoMovenzaMovimentoMozzoMuccaMucosaMuffaMughettoMugnaioMulattoMulinelloMultiploMummiaMuntoMuovereMuraleMusaMuscoloMusicaMutevoleMutoNababboNaftaNanometroNarcisoNariceNarratoNascereNastrareNaturaleNauticaNaviglioNebulosaNecrosiNegativoNegozioNemmenoNeofitaNerettoNervoNessunoNettunoNeutraleNeveNevroticoNicchiaNinfaNitidoNobileNocivoNodoNomeNominaNordicoNormaleNorvegeseNostranoNotareNotiziaNotturnoNovellaNucleoNullaNumeroNuovoNutrireNuvolaNuzialeOasiObbedireObbligoObeliscoOblioOboloObsoletoOccasioneOcchioOccidenteOccorrereOccultareOcraOculatoOdiernoOdorareOffertaOffrireOffuscatoOggettoOggiOgnunoOlandeseOlfattoOliatoOlivaOlogrammaOltreOmaggioOmbelicoOmbraOmegaOmissioneOndosoOnereOniceOnnivoroOnorevoleOntaOperatoOpinioneOppostoOracoloOrafoOrdineOrecchinoOreficeOrfanoOrganicoOrigineOrizzonteOrmaOrmeggioOrnativoOrologioOrrendoOrribileOrtensiaOrticaOrzataOrzoOsareOscurareOsmosiOspedaleOspiteOssaOssidareOstacoloOsteOtiteOtreOttagonoOttimoOttobreOvaleOvestOvinoOviparoOvocitoOvunqueOvviareOzioPacchettoPacePacificoPadellaPadronePaesePagaPaginaPalazzinaPalesarePallidoPaloPaludePandoroPannelloPaoloPaonazzoPapricaParabolaParcellaParerePargoloPariParlatoParolaPartireParvenzaParzialePassivoPasticcaPataccaPatologiaPattumePavonePeccatoPedalarePedonalePeggioPelosoPenarePendicePenisolaPennutoPenombraPensarePentolaPepePepitaPerbenePercorsoPerdonatoPerforarePergamenaPeriodoPermessoPernoPerplessoPersuasoPertugioPervasoPesatorePesistaPesoPestiferoPetaloPettinePetulantePezzoPiacerePiantaPiattinoPiccinoPicozzaPiegaPietraPifferoPigiamaPigolioPigroPilaPiliferoPillolaPilotaPimpantePinetaPinnaPinoloPioggiaPiomboPiramidePireticoPiritePirolisiPitonePizzicoPlaceboPlanarePlasmaPlatanoPlenarioPochezzaPoderosoPodismoPoesiaPoggiarePolentaPoligonoPollicePolmonitePolpettaPolsoPoltronaPolverePomicePomodoroPontePopolosoPorfidoPorosoPorporaPorrePortataPosaPositivoPossessoPostulatoPotassioPoterePranzoPrassiPraticaPreclusoPredicaPrefissoPregiatoPrelievoPremerePrenotarePreparatoPresenzaPretestoPrevalsoPrimaPrincipePrivatoProblemaProcuraProdurreProfumoProgettoProlungaPromessaPronomePropostaProrogaProtesoProvaPrudentePrugnaPruritoPsichePubblicoPudicaPugilatoPugnoPulcePulitoPulsantePuntarePupazzoPupillaPuroQuadroQualcosaQuasiQuerelaQuotaRaccoltoRaddoppioRadicaleRadunatoRafficaRagazzoRagioneRagnoRamarroRamingoRamoRandagioRantolareRapatoRapinaRappresoRasaturaRaschiatoRasenteRassegnaRastrelloRataRavvedutoRealeRecepireRecintoReclutaReconditoRecuperoRedditoRedimereRegalatoRegistroRegolaRegressoRelazioneRemareRemotoRennaReplicaReprimereReputareResaResidenteResponsoRestauroReteRetinaRetoricaRettificaRevocatoRiassuntoRibadireRibelleRibrezzoRicaricaRiccoRicevereRiciclatoRicordoRicredutoRidicoloRidurreRifasareRiflessoRiformaRifugioRigareRigettatoRighelloRilassatoRilevatoRimanereRimbalzoRimedioRimorchioRinascitaRincaroRinforzoRinnovoRinomatoRinsavitoRintoccoRinunciaRinvenireRiparatoRipetutoRipienoRiportareRipresaRipulireRisataRischioRiservaRisibileRisoRispettoRistoroRisultatoRisvoltoRitardoRitegnoRitmicoRitrovoRiunioneRivaRiversoRivincitaRivoltoRizomaRobaRoboticoRobustoRocciaRocoRodaggioRodereRoditoreRogitoRollioRomanticoRompereRonzioRosolareRospoRotanteRotondoRotulaRovescioRubizzoRubricaRugaRullinoRumineRumorosoRuoloRupeRussareRusticoSabatoSabbiareSabotatoSagomaSalassoSaldaturaSalgemmaSalivareSalmoneSaloneSaltareSalutoSalvoSapereSapidoSaporitoSaracenoSarcasmoSartoSassosoSatelliteSatiraSatolloSaturnoSavanaSavioSaziatoSbadiglioSbalzoSbancatoSbarraSbattereSbavareSbendareSbirciareSbloccatoSbocciatoSbrinareSbruffoneSbuffareScabrosoScadenzaScalaScambiareScandaloScapolaScarsoScatenareScavatoSceltoScenicoScettroSchedaSchienaSciarpaScienzaScindereScippoSciroppoScivoloSclerareScodellaScolpitoScompartoSconfortoScoprireScortaScossoneScozzeseScribaScrollareScrutinioScuderiaScultoreScuolaScuroScusareSdebitareSdoganareSeccaturaSecondoSedanoSeggiolaSegnalatoSegregatoSeguitoSelciatoSelettivoSellaSelvaggioSemaforoSembrareSemeSeminatoSempreSensoSentireSepoltoSequenzaSerataSerbatoSerenoSerioSerpenteSerraglioServireSestinaSetolaSettimanaSfaceloSfaldareSfamatoSfarzosoSfaticatoSferaSfidaSfilatoSfingeSfocatoSfoderareSfogoSfoltireSforzatoSfrattoSfruttatoSfuggitoSfumareSfusoSgabelloSgarbatoSgonfiareSgorbioSgrassatoSguardoSibiloSiccomeSierraSiglaSignoreSilenzioSillabaSimboloSimpaticoSimulatoSinfoniaSingoloSinistroSinoSintesiSinusoideSiparioSismaSistoleSituatoSlittaSlogaturaSlovenoSmarritoSmemoratoSmentitoSmeraldoSmilzoSmontareSmottatoSmussatoSnellireSnervatoSnodoSobbalzoSobrioSoccorsoSocialeSodaleSoffittoSognoSoldatoSolenneSolidoSollazzoSoloSolubileSolventeSomaticoSommaSondaSonettoSonniferoSopireSoppesoSopraSorgereSorpassoSorrisoSorsoSorteggioSorvolatoSospiroSostaSottileSpadaSpallaSpargereSpatolaSpaventoSpazzolaSpecieSpedireSpegnereSpelaturaSperanzaSpessoreSpettraleSpezzatoSpiaSpigolosoSpillatoSpinosoSpiraleSplendidoSportivoSposoSprangaSprecareSpronatoSpruzzoSpuntinoSquilloSradicareSrotolatoStabileStaccoStaffaStagnareStampatoStantioStarnutoStaseraStatutoSteloSteppaSterzoStilettoStimaStirpeStivaleStizzosoStonatoStoricoStrappoStregatoStriduloStrozzareStruttoStuccareStufoStupendoSubentroSuccosoSudoreSuggeritoSugoSultanoSuonareSuperboSupportoSurgelatoSurrogatoSussurroSuturaSvagareSvedeseSveglioSvelareSvenutoSveziaSviluppoSvistaSvizzeraSvoltaSvuotareTabaccoTabulatoTacciareTaciturnoTaleTalismanoTamponeTanninoTaraTardivoTargatoTariffaTarpareTartarugaTastoTatticoTavernaTavolataTazzaTecaTecnicoTelefonoTemerarioTempoTemutoTendoneTeneroTensioneTentacoloTeoremaTermeTerrazzoTerzettoTesiTesseratoTestatoTetroTettoiaTifareTigellaTimbroTintoTipicoTipografoTiraggioTiroTitanioTitoloTitubanteTizioTizzoneToccareTollerareToltoTombolaTomoTonfoTonsillaTopazioTopologiaToppaTorbaTornareTorroneTortoraToscanoTossireTostaturaTotanoTraboccoTracheaTrafilaTragediaTralcioTramontoTransitoTrapanoTrarreTraslocoTrattatoTraveTrecciaTremolioTrespoloTributoTrichecoTrifoglioTrilloTrinceaTrioTristezzaTrituratoTrivellaTrombaTronoTroppoTrottolaTrovareTruccatoTubaturaTuffatoTulipanoTumultoTunisiaTurbareTurchinoTutaTutelaUbicatoUccelloUccisoreUdireUditivoUffaUfficioUgualeUlisseUltimatoUmanoUmileUmorismoUncinettoUngereUnghereseUnicornoUnificatoUnisonoUnitarioUnteUovoUpupaUraganoUrgenzaUrloUsanzaUsatoUscitoUsignoloUsuraioUtensileUtilizzoUtopiaVacanteVaccinatoVagabondoVagliatoValangaValgoValicoVallettaValorosoValutareValvolaVampataVangareVanitosoVanoVantaggioVanveraVaporeVaranoVarcatoVarianteVascaVedettaVedovaVedutoVegetaleVeicoloVelcroVelinaVellutoVeloceVenatoVendemmiaVentoVeraceVerbaleVergognaVerificaVeroVerrucaVerticaleVescicaVessilloVestaleVeteranoVetrinaVetustoViandanteVibranteVicendaVichingoVicinanzaVidimareVigiliaVignetoVigoreVileVillanoViminiVincitoreViolaViperaVirgolaVirologoVirulentoViscosoVisioneVispoVissutoVisuraVitaVitelloVittimaVivandaVividoViziareVoceVogaVolatileVolereVolpeVoragineVulcanoZampognaZannaZappatoZatteraZavorraZefiroZelanteZeloZenzeroZerbinoZibettoZincoZirconeZittoZollaZoticoZuccheroZufoloZuluZuppa\";\n\nlet wordlist: Array = null;\n\nfunction loadWords(lang: Wordlist): void {\n if (wordlist != null) { return; }\n wordlist = words.replace(/([A-Z])/g, \" $1\").toLowerCase().substring(1).split(\" \");\n\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n if (Wordlist.check(lang) !== \"0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620\") {\n wordlist = null;\n throw new Error(\"BIP39 Wordlist for it (Italian) FAILED\");\n }\n}\n\nclass LangIt extends Wordlist {\n constructor() {\n super(\"it\");\n }\n\n getWord(index: number): string {\n loadWords(this);\n return wordlist[index];\n }\n\n getWordIndex(word: string): number {\n loadWords(this);\n return wordlist.indexOf(word);\n }\n}\n\nconst langIt = new LangIt();\nWordlist.register(langIt);\n\nexport { langIt }\n","\"use strict\";\n\nimport { toUtf8String } from \"@ethersproject/strings\";\n\nimport { Wordlist } from \"./wordlist\";\n\n\nconst data = \"}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN } = {\n zh_cn: null,\n zh_tw: null\n}\n\nconst Checks: { [key: string]: string } = {\n zh_cn: \"0x17bcc4d8547e5a7135e365d1ab443aaae95e76d8230c2782c67305d4f21497a1\",\n zh_tw: \"0x51e720e90c7b87bec1d70eb6e74a21a449bd3ec9c020b01d3a40ed991b60ce5d\"\n}\n\nconst codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nconst style = \"~!@#$%^&*_-=[]{}|;:,.()<>?\"\n\nfunction loadWords(lang: Wordlist) {\n if (wordlist[lang.locale] !== null) { return; }\n\n wordlist[lang.locale] = [];\n\n let deltaOffset = 0;\n for (let i = 0; i < 2048; i++) {\n const s = style.indexOf(data[i * 3]);\n const bytes = [\n 228 + (s >> 2),\n 128 + codes.indexOf(data[i * 3 + 1]),\n 128 + codes.indexOf(data[i * 3 + 2]),\n ];\n\n if (lang.locale === \"zh_tw\") {\n const common = s % 4;\n for (let i = common; i < 3; i++) {\n bytes[i] = codes.indexOf(deltaData[deltaOffset++]) + ((i == 0) ? 228: 128);\n }\n }\n\n wordlist[lang.locale].push(toUtf8String(bytes));\n }\n\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n if (Wordlist.check(lang) !== Checks[lang.locale]) {\n wordlist[lang.locale] = null;\n throw new Error(\"BIP39 Wordlist for \" + lang.locale + \" (Chinese) FAILED\");\n }\n}\n\nclass LangZh extends Wordlist {\n constructor(country: string) {\n super(\"zh_\" + country);\n }\n\n getWord(index: number): string {\n loadWords(this);\n return wordlist[this.locale][index];\n }\n\n getWordIndex(word: string): number {\n loadWords(this);\n return wordlist[this.locale].indexOf(word);\n }\n\n split(mnemonic: string): Array {\n mnemonic = mnemonic.replace(/(?:\\u3000| )+/g, \"\");\n return mnemonic.split(\"\");\n }\n}\n\nconst langZhCn = new LangZh(\"cn\");\nWordlist.register(langZhCn);\nWordlist.register(langZhCn, \"zh\");\n\nconst langZhTw = new LangZh(\"tw\");\nWordlist.register(langZhTw);\n\nexport { langZhCn, langZhTw };\n","import { Wordlist } from \"./wordlist\";\n\nimport { langCz as cz } from \"./lang-cz\";\nimport { langEn as en } from \"./lang-en\";\nimport { langEs as es } from \"./lang-es\";\nimport { langFr as fr } from \"./lang-fr\";\nimport { langJa as ja } from \"./lang-ja\";\nimport { langKo as ko } from \"./lang-ko\";\nimport { langIt as it } from \"./lang-it\";\nimport { langZhCn as zh_cn, langZhTw as zh_tw } from \"./lang-zh\";\n\nexport const wordlists: { [ locale: string ]: Wordlist } = {\n cz: cz,\n en: en,\n es: es,\n fr: fr,\n it: it,\n ja: ja,\n ko: ko,\n zh: zh_cn,\n zh_cn: zh_cn,\n zh_tw: zh_tw\n};\n\n\n","\"use strict\";\n\n// Wordlists\n// See: https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md\n\nimport { logger, Wordlist } from \"./wordlist\";\n\nimport { wordlists } from \"./wordlists\";\n\nexport {\n logger,\n Wordlist,\n wordlists\n}\n","export const version = \"hdnode/5.0.6\";\n","\"use strict\";\n\n// See: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki\n// See: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki\n\n\nimport { ExternallyOwnedAccount } from \"@ethersproject/abstract-signer\";\nimport { Base58 } from \"@ethersproject/basex\";\nimport { arrayify, BytesLike, 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 { Wordlist, wordlists } from \"@ethersproject/wordlists\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nconst N = BigNumber.from(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n\n\n// \"Bitcoin seed\"\nconst MasterSecret = toUtf8Bytes(\"Bitcoin seed\");\n\nconst HardenedBit = 0x80000000;\n\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits: number): number {\n return ((1 << bits) - 1) << (8 - bits);\n}\n\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits: number): number {\n return (1 << bits) - 1;\n}\n\nfunction bytes32(value: BigNumber | Uint8Array): string {\n return hexZeroPad(hexlify(value), 32);\n}\n\nfunction base58check(data: Uint8Array): string {\n return Base58.encode(concat([ data, hexDataSlice(sha256(sha256(data)), 0, 4) ]));\n}\n\nfunction getWordlist(wordlist: string | Wordlist): Wordlist {\n if (wordlist == null) {\n return wordlists[\"en\"];\n }\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\n return wordlist;\n}\n\nconst _constructorGuard: any = {};\n\nexport const defaultPath = \"m/44'/60'/0'/0/0\";\n\nexport interface Mnemonic {\n readonly phrase: string;\n readonly path: string;\n readonly locale: string;\n};\n\nexport class HDNode implements ExternallyOwnedAccount {\n readonly privateKey: string;\n readonly publicKey: string;\n\n readonly fingerprint: string;\n readonly parentFingerprint: string;\n\n readonly address: string;\n\n readonly mnemonic?: Mnemonic;\n readonly path: string;\n\n readonly chainCode: string;\n\n readonly index: number;\n readonly depth: number;\n\n /**\n * This constructor should not be called directly.\n *\n * Please use:\n * - fromMnemonic\n * - fromSeed\n */\n constructor(constructorGuard: any, privateKey: string, publicKey: string, parentFingerprint: string, chainCode: string, index: number, depth: number, mnemonicOrPath: Mnemonic | string) {\n logger.checkNew(new.target, HDNode);\n\n /* istanbul ignore if */\n if (constructorGuard !== _constructorGuard) {\n throw new Error(\"HDNode constructor cannot be called directly\");\n }\n\n if (privateKey) {\n const signingKey = new SigningKey(privateKey);\n defineReadOnly(this, \"privateKey\", signingKey.privateKey);\n defineReadOnly(this, \"publicKey\", signingKey.compressedPublicKey);\n } else {\n defineReadOnly(this, \"privateKey\", null);\n defineReadOnly(this, \"publicKey\", hexlify(publicKey));\n }\n\n defineReadOnly(this, \"parentFingerprint\", parentFingerprint);\n defineReadOnly(this, \"fingerprint\", hexDataSlice(ripemd160(sha256(this.publicKey)), 0, 4));\n\n defineReadOnly(this, \"address\", computeAddress(this.publicKey));\n\n defineReadOnly(this, \"chainCode\", chainCode);\n\n defineReadOnly(this, \"index\", index);\n defineReadOnly(this, \"depth\", depth);\n\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\n get extendedKey(): string {\n // We only support the mainnet values for now, but if anyone needs\n // testnet values, let me know. I believe current senitment 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\n if (this.depth >= 256) { 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\n neuter(): HDNode {\n return new HDNode(_constructorGuard, null, this.publicKey, this.parentFingerprint, this.chainCode, this.index, this.depth, this.path);\n }\n\n private _derive(index: number): HDNode {\n if (index > 0xffffffff) { throw new Error(\"invalid index - \" + String(index)); }\n\n // Base path\n let path = this.path;\n if (path) { path += \"/\" + (index & ~HardenedBit); }\n\n const data = new Uint8Array(37);\n\n if (index & HardenedBit) {\n if (!this.privateKey) {\n throw new Error(\"cannot derive child of neutered node\");\n }\n\n // Data = 0x00 || ser_256(k_par)\n data.set(arrayify(this.privateKey), 1);\n\n // Hardened path\n if (path) { path += \"'\"; }\n\n } else {\n // Data = ser_p(point(k_par))\n data.set(arrayify(this.publicKey));\n }\n\n // Data += ser_32(i)\n for (let i = 24; i >= 0; i -= 8) { 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\n // The private key\n let ki: string = null\n\n // The public key\n let Ki: string = null;\n\n if (this.privateKey) {\n ki = bytes32(BigNumber.from(IL).add(this.privateKey).mod(N));\n } else {\n const ek = new SigningKey(hexlify(IL));\n Ki = ek._addPoint(this.publicKey);\n }\n\n let mnemonicOrPath: Mnemonic | string = path;\n\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\n return new HDNode(_constructorGuard, ki, Ki, this.fingerprint, bytes32(IR), index, this.depth + 1, mnemonicOrPath);\n }\n\n derivePath(path: string): HDNode {\n const components = path.split(\"/\");\n\n if (components.length === 0 || (components[0] === \"m\" && this.depth !== 0)) {\n throw new Error(\"invalid path - \" + path);\n }\n\n if (components[0] === \"m\") { components.shift(); }\n\n let result: HDNode = 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) { throw new Error(\"invalid path index - \" + component); }\n result = result._derive(HardenedBit + index);\n } else if (component.match(/^[0-9]+$/)) {\n const index = parseInt(component);\n if (index >= HardenedBit) { throw new Error(\"invalid path index - \" + component); }\n result = result._derive(index);\n } else {\n throw new Error(\"invalid path component - \" + component);\n }\n }\n\n return result;\n }\n\n\n static _fromSeed(seed: BytesLike, mnemonic: Mnemonic): HDNode {\n const seedArray: Uint8Array = arrayify(seed);\n if (seedArray.length < 16 || seedArray.length > 64) { throw new Error(\"invalid seed\"); }\n\n const I: Uint8Array = arrayify(computeHmac(SupportedAlgorithm.sha512, MasterSecret, seedArray));\n\n return new HDNode(_constructorGuard, bytes32(I.slice(0, 32)), null, \"0x00000000\", bytes32(I.slice(32)), 0, 0, mnemonic);\n }\n\n static fromMnemonic(mnemonic: string, password?: string, wordlist?: string | Wordlist): HDNode {\n\n // If a locale name was passed in, find the associated wordlist\n wordlist = getWordlist(wordlist);\n\n // Normalize the case and spacing in the mnemonic (throws if the mnemonic is invalid)\n mnemonic = entropyToMnemonic(mnemonicToEntropy(mnemonic, wordlist), wordlist);\n\n return HDNode._fromSeed(mnemonicToSeed(mnemonic, password), {\n phrase: mnemonic,\n path: \"m\",\n locale: wordlist.locale\n });\n }\n\n static fromSeed(seed: BytesLike): HDNode {\n return HDNode._fromSeed(seed, null);\n }\n\n static fromExtendedKey(extendedKey: string): HDNode {\n const bytes = Base58.decode(extendedKey);\n\n if (bytes.length !== 82 || base58check(bytes.slice(0, 78)) !== extendedKey) {\n logger.throwArgumentError(\"invalid extended key\", \"extendedKey\", \"[REDACTED]\");\n }\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\n switch (hexlify(bytes.slice(0, 4))) {\n // Public Key\n case \"0x0488b21e\": case \"0x043587cf\":\n return new HDNode(_constructorGuard, null, hexlify(key), parentFingerprint, chainCode, index, depth, null);\n\n // Private Key\n case \"0x0488ade4\": case \"0x04358394 \":\n if (key[0] !== 0) { break; }\n return new HDNode(_constructorGuard, hexlify(key.slice(1)), null, parentFingerprint, chainCode, index, depth, null);\n }\n\n return logger.throwArgumentError(\"invalid extended key\", \"extendedKey\", \"[REDACTED]\");\n }\n}\n\nexport function mnemonicToSeed(mnemonic: string, password?: string): string {\n if (!password) { password = \"\"; }\n\n const salt = toUtf8Bytes(\"mnemonic\" + password, UnicodeNormalizationForm.NFKD);\n\n return pbkdf2(toUtf8Bytes(mnemonic, UnicodeNormalizationForm.NFKD), salt, 2048, 64, \"sha512\");\n}\n\nexport function mnemonicToEntropy(mnemonic: string, wordlist?: string | Wordlist): string {\n wordlist = getWordlist(wordlist);\n\n logger.checkNormalize();\n\n const words = wordlist.split(mnemonic);\n if ((words.length % 3) !== 0) { throw new Error(\"invalid mnemonic\"); }\n\n const entropy = arrayify(new Uint8Array(Math.ceil(11 * words.length / 8)));\n\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) { 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\n const entropyBits = 32 * words.length / 3;\n\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n\n const checksum = arrayify(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n\n if (checksum !== (entropy[entropy.length - 1] & checksumMask)) {\n throw new Error(\"invalid checksum\");\n }\n\n return hexlify(entropy.slice(0, entropyBits / 8));\n}\n\nexport function entropyToMnemonic(entropy: BytesLike, wordlist?: string | Wordlist): string {\n wordlist = getWordlist(wordlist);\n\n entropy = arrayify(entropy);\n\n if ((entropy.length % 4) !== 0 || entropy.length < 16 || entropy.length > 32) {\n throw new Error(\"invalid entropy\");\n }\n\n const indices: Array = [ 0 ];\n\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i++) {\n\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\n remainingBits -= 8;\n\n // This byte will complete an 11-bit index\n } else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n\n remainingBits += 3;\n }\n }\n\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = arrayify(sha256(entropy))[0] & getUpperMask(checksumBits);\n\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= (checksum >> (8 - checksumBits));\n\n return wordlist.join(indices.map((index) => (wordlist).getWord(index)));\n}\n\nexport function isValidMnemonic(mnemonic: string, wordlist?: Wordlist): boolean {\n try {\n mnemonicToEntropy(mnemonic, wordlist);\n return true;\n } catch (error) { }\n return false;\n}\n","export const version = \"random/5.0.5\";\n","\"use strict\";\n\nimport { arrayify } from \"@ethersproject/bytes\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nlet anyGlobal: any = null;\ntry {\n anyGlobal = (window as any);\n if (anyGlobal == null) { throw new Error(\"try next\"); }\n} catch (error) {\n try {\n anyGlobal = (global as any);\n if (anyGlobal == null) { throw new Error(\"try next\"); }\n } catch (error) {\n anyGlobal = { };\n }\n}\n\nlet crypto: any = anyGlobal.crypto || anyGlobal.msCrypto;\nif (!crypto || !crypto.getRandomValues) {\n\n logger.warn(\"WARNING: Missing strong random number source\");\n\n crypto = {\n getRandomValues: function(buffer: Uint8Array): Uint8Array {\n return logger.throwError(\"no secure random source avaialble\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"crypto.getRandomValues\"\n });\n }\n };\n}\n\nexport function randomBytes(length: number): Uint8Array {\n if (length <= 0 || length > 1024 || (length % 1)) {\n logger.throwArgumentError(\"invalid length\", \"length\", length);\n }\n\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return arrayify(result);\n};\n","\"use strict\";\n\nexport function shuffled(array: Array): Array {\n array = array.slice();\n\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\n return array;\n}\n","\"use strict\";\n\nexport { randomBytes } from \"./random\";\nexport { shuffled } from \"./shuffle\";\n","\"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,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, 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.0.8\";\n","\"use strict\";\n\nimport { arrayify, Bytes, BytesLike, hexlify } from \"@ethersproject/bytes\";\nimport { toUtf8Bytes, UnicodeNormalizationForm } from '@ethersproject/strings';\n\nexport function looseArrayify(hexString: string): Uint8Array {\n if (typeof(hexString) === 'string' && hexString.substring(0, 2) !== '0x') {\n hexString = '0x' + hexString;\n }\n return arrayify(hexString);\n}\n\nexport function zpad(value: String | number, length: number): String {\n value = String(value);\n while (value.length < length) { value = '0' + value; }\n return value;\n}\n\nexport function getPassword(password: Bytes | string): Uint8Array {\n if (typeof(password) === 'string') {\n return toUtf8Bytes(password, UnicodeNormalizationForm.NFKC);\n }\n return arrayify(password);\n}\n\nexport function searchPath(object: any, path: string): string {\n let currentChild = object;\n\n const comps = path.toLowerCase().split('/');\n for (let i = 0; i < comps.length; i++) {\n\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\n // Didn't find one. :'(\n if (matchingChild === null) {\n return null;\n }\n\n // Now check this child...\n currentChild = matchingChild;\n }\n\n return currentChild;\n}\n\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\nexport function uuidV4(randomBytes: BytesLike): string {\n const bytes = arrayify(randomBytes);\n\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n\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\n const value = hexlify(bytes);\n\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\n","\"use strict\";\n\nimport aes from \"aes-js\";\n\nimport { ExternallyOwnedAccount } from \"@ethersproject/abstract-signer\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { arrayify, Bytes } from \"@ethersproject/bytes\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { pbkdf2 } from \"@ethersproject/pbkdf2\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nimport { Description } from \"@ethersproject/properties\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { getPassword, looseArrayify, searchPath } from \"./utils\";\n\nexport interface _CrowdsaleAccount {\n address: string;\n privateKey: string;\n\n _isCrowdsaleAccount: boolean;\n}\n\nexport class CrowdsaleAccount extends Description<_CrowdsaleAccount> implements ExternallyOwnedAccount {\n readonly address: string;\n readonly privateKey: string;\n readonly mnemonic?: string;\n readonly path?: string;\n\n readonly _isCrowdsaleAccount: boolean;\n\n isCrowdsaleAccount(value: any): value is CrowdsaleAccount {\n return !!(value && value._isCrowdsaleAccount);\n }\n}\n\n// See: https://github.com/ethereum/pyethsaletool\nexport function decrypt(json: string, password: Bytes | string): ExternallyOwnedAccount {\n const data = JSON.parse(json);\n\n password = getPassword(password);\n\n // Ethereum Address\n const ethaddr = getAddress(searchPath(data, \"ethaddr\"));\n\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\n const key = arrayify(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n\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\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\n const seedHexBytes = toUtf8Bytes(seedHex);\n\n const privateKey = keccak256(seedHexBytes);\n\n return new CrowdsaleAccount ({\n _isCrowdsaleAccount: true,\n address: ethaddr,\n privateKey: privateKey\n });\n}\n\n","\"use strict\";\n\nimport { getAddress } from \"@ethersproject/address\";\n\n\nexport function isCrowdsaleWallet(json: string): boolean {\n let data: any = null;\n try {\n data = JSON.parse(json);\n } catch (error) { return false; }\n\n return (data.encseed && data.ethaddr);\n}\n\nexport function isKeystoreWallet(json: string): boolean {\n let data: any = null;\n try {\n data = JSON.parse(json);\n } catch (error) { return false; }\n\n if (!data.version || parseInt(data.version) !== data.version || parseInt(data.version) !== 3) {\n return false;\n }\n\n // @TODO: Put more checks to make sure it has kdf, iv and all that good stuff\n return true;\n}\n\n//export function isJsonWallet(json: string): boolean {\n// return (isSecretStorageWallet(json) || isCrowdsaleWallet(json));\n//}\n\nexport function getJsonWalletAddress(json: string): string {\n if (isCrowdsaleWallet(json)) {\n try {\n return getAddress(JSON.parse(json).ethaddr);\n } catch (error) { return null; }\n }\n\n if (isKeystoreWallet(json)) {\n try {\n return getAddress(JSON.parse(json).address);\n } catch (error) { return null; }\n }\n\n return null;\n}\n\n","\"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\";\n\nimport aes from \"aes-js\";\nimport scrypt from \"scrypt-js\";\n\nimport { ExternallyOwnedAccount } from \"@ethersproject/abstract-signer\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { arrayify, Bytes, BytesLike, concat, hexlify } from \"@ethersproject/bytes\";\nimport { defaultPath, entropyToMnemonic, HDNode, Mnemonic, 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\";\n\nimport { getPassword, looseArrayify, searchPath, uuidV4, zpad } from \"./utils\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\n// Exported Types\n\nfunction hasMnemonic(value: any): value is { mnemonic: Mnemonic } {\n return (value != null && value.mnemonic && value.mnemonic.phrase);\n}\n\nexport interface _KeystoreAccount {\n address: string;\n privateKey: string;\n mnemonic?: Mnemonic;\n\n _isKeystoreAccount: boolean;\n}\n\nexport class KeystoreAccount extends Description<_KeystoreAccount> implements ExternallyOwnedAccount {\n readonly address: string;\n readonly privateKey: string;\n readonly mnemonic?: Mnemonic;\n\n readonly _isKeystoreAccount: boolean;\n\n isKeystoreAccount(value: any): value is KeystoreAccount {\n return !!(value && value._isKeystoreAccount);\n }\n}\n\nexport type ProgressCallback = (percent: number) => void;\n\nexport type EncryptOptions = {\n iv?: BytesLike;\n entropy?: BytesLike;\n client?: string;\n salt?: BytesLike;\n uuid?: string;\n scrypt?: {\n N?: number;\n r?: number;\n p?: number;\n }\n}\n\nfunction _decrypt(data: any, key: Uint8Array, ciphertext: Uint8Array): Uint8Array {\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\n const aesCtr = new aes.ModeOfOperation.ctr(key, counter);\n\n return arrayify(aesCtr.decrypt(ciphertext));\n }\n\n return null;\n}\n\nfunction _getAccount(data: any, key: Uint8Array): KeystoreAccount {\n const ciphertext = looseArrayify(searchPath(data, \"crypto/ciphertext\"));\n\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\n const privateKey = _decrypt(data, key.slice(0, 16), ciphertext);\n\n if (!privateKey) {\n logger.throwError(\"unsupported cipher\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"decrypt\"\n });\n }\n\n const mnemonicKey = key.slice(32, 64);\n\n const address = computeAddress(privateKey);\n if (data.address) {\n let check = data.address.toLowerCase();\n if (check.substring(0, 2) !== \"0x\") { check = \"0x\" + check; }\n\n if (getAddress(check) !== address) {\n throw new Error(\"address mismatch\");\n }\n }\n\n const account: _KeystoreAccount = {\n _isKeystoreAccount: true,\n address: address,\n privateKey: hexlify(privateKey)\n };\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\n const mnemonicCounter = new aes.Counter(mnemonicIv);\n const mnemonicAesCtr = new aes.ModeOfOperation.ctr(mnemonicKey, mnemonicCounter);\n\n const path = searchPath(data, \"x-ethers/path\") || defaultPath;\n const locale = searchPath(data, \"x-ethers/locale\") || \"en\";\n\n const entropy = arrayify(mnemonicAesCtr.decrypt(mnemonicCiphertext));\n\n try {\n const mnemonic = entropyToMnemonic(entropy, locale);\n const node = HDNode.fromMnemonic(mnemonic, null, locale).derivePath(path);\n\n if (node.privateKey != account.privateKey) {\n throw new Error(\"mnemonic mismatch\");\n }\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\n return new KeystoreAccount(account);\n}\n\ntype ScryptFunc = (pw: Uint8Array, salt: Uint8Array, n: number, r: number, p: number, dkLen: number, callback?: ProgressCallback) => T;\ntype Pbkdf2Func = (pw: Uint8Array, salt: Uint8Array, c: number, dkLen: number, prfFunc: string) => T;\n\nfunction pbkdf2Sync(passwordBytes: Uint8Array, salt: Uint8Array, count: number, dkLen: number, prfFunc: string): Uint8Array {\n return arrayify(_pbkdf2(passwordBytes, salt, count, dkLen, prfFunc));\n}\n\nfunction pbkdf2(passwordBytes: Uint8Array, salt: Uint8Array, count: number, dkLen: number, prfFunc: string): Promise {\n return Promise.resolve(pbkdf2Sync(passwordBytes, salt, count, dkLen, prfFunc));\n}\n\nfunction _computeKdfKey(data: any, password: Bytes | string, pbkdf2Func: Pbkdf2Func, scryptFunc: ScryptFunc, progressCallback?: ProgressCallback): T {\n const passwordBytes = getPassword(password);\n\n const kdf = searchPath(data, \"crypto/kdf\");\n\n if (kdf && typeof(kdf) === \"string\") {\n const throwError = function(name: string, value: any): never {\n return logger.throwArgumentError(\"invalid key-derivation function parameters\", name, value);\n }\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\n // Check for all required parameters\n if (!N || !r || !p) { throwError(\"kdf\", kdf); }\n\n // Make sure N is a power of 2\n if ((N & (N - 1)) !== 0) { throwError(\"N\", N); }\n\n const dkLen = parseInt(searchPath(data, \"crypto/kdfparams/dklen\"));\n if (dkLen !== 32) { throwError(\"dklen\", dkLen); }\n\n return scryptFunc(passwordBytes, salt, N, r, p, 64, progressCallback);\n\n } else if (kdf.toLowerCase() === \"pbkdf2\") {\n\n const salt = looseArrayify(searchPath(data, \"crypto/kdfparams/salt\"));\n\n let prfFunc: string = null;\n const prf = searchPath(data, \"crypto/kdfparams/prf\");\n if (prf === \"hmac-sha256\") {\n prfFunc = \"sha256\";\n } else if (prf === \"hmac-sha512\") {\n prfFunc = \"sha512\";\n } else {\n throwError(\"prf\", prf);\n }\n\n const count = parseInt(searchPath(data, \"crypto/kdfparams/c\"));\n\n const dkLen = parseInt(searchPath(data, \"crypto/kdfparams/dklen\"));\n if (dkLen !== 32) { throwError(\"dklen\", dkLen); }\n\n return pbkdf2Func(passwordBytes, salt, count, dkLen, prfFunc);\n }\n }\n\n return logger.throwArgumentError(\"unsupported key-derivation function\", \"kdf\", kdf);\n}\n\n\nexport function decryptSync(json: string, password: Bytes | string): KeystoreAccount {\n const data = JSON.parse(json);\n\n const key = _computeKdfKey(data, password, pbkdf2Sync, scrypt.syncScrypt);\n return _getAccount(data, key);\n}\n\nexport async function decrypt(json: string, password: Bytes | string, progressCallback?: ProgressCallback): Promise {\n const data = JSON.parse(json);\n\n const key = await _computeKdfKey(data, password, pbkdf2, scrypt.scrypt, progressCallback);\n return _getAccount(data, key);\n}\n\n\nexport function encrypt(account: ExternallyOwnedAccount, password: Bytes | string, options?: EncryptOptions, progressCallback?: ProgressCallback): Promise {\n\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\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\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\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) { options = {}; }\n\n const privateKey: Uint8Array = arrayify(account.privateKey);\n const passwordBytes = getPassword(password);\n\n let entropy: Uint8Array = null\n let path: string = null;\n let locale: string = 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\n let client = options.client;\n if (!client) { client = \"ethers.js\"; }\n\n // Check/generate the salt\n let salt: Uint8Array = null;\n if (options.salt) {\n salt = arrayify(options.salt);\n } else {\n salt = randomBytes(32);;\n }\n\n // Override initialization vector\n let iv: Uint8Array = null;\n if (options.iv) {\n iv = arrayify(options.iv);\n if (iv.length !== 16) { throw new Error(\"invalid iv\"); }\n } else {\n iv = randomBytes(16);\n }\n\n // Override the uuid\n let uuidRandom: Uint8Array = null;\n if (options.uuid) {\n uuidRandom = arrayify(options.uuid);\n if (uuidRandom.length !== 16) { throw new Error(\"invalid uuid\"); }\n } else {\n uuidRandom = randomBytes(16);\n }\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 = options.scrypt.N; }\n if (options.scrypt.r) { r = options.scrypt.r; }\n if (options.scrypt.p) { 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\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\n // This will be used to encrypt the mnemonic phrase (if any)\n const mnemonicKey = key.slice(32, 64);\n\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\n // Compute the message authentication code, used to check the password\n const mac = keccak256(concat([macPrefix, ciphertext]))\n\n // See: https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition\n const data: { [key: string]: any } = {\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\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 );\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\n return JSON.stringify(data);\n });\n}\n","\"use strict\";\n\nimport { Bytes } from \"@ethersproject/bytes\";\nimport { ExternallyOwnedAccount } from \"@ethersproject/abstract-signer\";\n\nimport { decrypt as decryptCrowdsale } from \"./crowdsale\";\nimport { getJsonWalletAddress, isCrowdsaleWallet, isKeystoreWallet } from \"./inspect\";\nimport { decrypt as decryptKeystore, decryptSync as decryptKeystoreSync, encrypt as encryptKeystore, EncryptOptions, ProgressCallback } from \"./keystore\";\n\nfunction decryptJsonWallet(json: string, password: Bytes | string, progressCallback?: ProgressCallback): Promise {\n if (isCrowdsaleWallet(json)) {\n if (progressCallback) { progressCallback(0); }\n const account = decryptCrowdsale(json, password)\n if (progressCallback) { progressCallback(1); }\n return Promise.resolve(account);\n }\n\n if (isKeystoreWallet(json)) {\n return decryptKeystore(json, password, progressCallback);\n }\n\n return Promise.reject(new Error(\"invalid JSON wallet\"));\n}\n\nfunction decryptJsonWalletSync(json: string, password: Bytes | string): ExternallyOwnedAccount {\n if (isCrowdsaleWallet(json)) {\n return decryptCrowdsale(json, password)\n }\n\n if (isKeystoreWallet(json)) {\n return decryptKeystoreSync(json, password);\n }\n\n throw new Error(\"invalid JSON wallet\");\n}\n\nexport {\n decryptCrowdsale,\n\n decryptKeystore,\n decryptKeystoreSync,\n encryptKeystore,\n\n isCrowdsaleWallet,\n isKeystoreWallet,\n getJsonWalletAddress,\n\n decryptJsonWallet,\n decryptJsonWalletSync,\n\n ProgressCallback,\n EncryptOptions,\n};\n","export const version = \"wallet/5.0.8\";\n","\"use strict\";\n\nimport { getAddress } from \"@ethersproject/address\";\nimport { Provider, TransactionRequest } from \"@ethersproject/abstract-provider\";\nimport { ExternallyOwnedAccount, Signer, TypedDataDomain, TypedDataField, TypedDataSigner } from \"@ethersproject/abstract-signer\";\nimport { arrayify, Bytes, BytesLike, concat, hexDataSlice, isHexString, joinSignature, SignatureLike } from \"@ethersproject/bytes\";\nimport { hashMessage, _TypedDataEncoder } from \"@ethersproject/hash\";\nimport { defaultPath, HDNode, entropyToMnemonic, Mnemonic } 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, ProgressCallback } from \"@ethersproject/json-wallets\";\nimport { computeAddress, recoverAddress, serialize, UnsignedTransaction } from \"@ethersproject/transactions\";\nimport { Wordlist } from \"@ethersproject/wordlists\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nfunction isAccount(value: any): value is ExternallyOwnedAccount {\n return (value != null && isHexString(value.privateKey, 32) && value.address != null);\n}\n\nfunction hasMnemonic(value: any): value is { mnemonic: Mnemonic } {\n const mnemonic = value.mnemonic;\n return (mnemonic && mnemonic.phrase);\n}\n\nexport class Wallet extends Signer implements ExternallyOwnedAccount, TypedDataSigner {\n\n readonly address: string;\n readonly provider: Provider;\n\n // Wrapping the _signingKey and _mnemonic in a getter function prevents\n // leaking the private key in console.log; still, be careful! :)\n readonly _signingKey: () => SigningKey;\n readonly _mnemonic: () => Mnemonic;\n\n constructor(privateKey: BytesLike | ExternallyOwnedAccount | SigningKey, provider?: Provider) {\n logger.checkNew(new.target, Wallet);\n\n super();\n\n if (isAccount(privateKey)) {\n const signingKey = new SigningKey(privateKey.privateKey);\n defineReadOnly(this, \"_signingKey\", () => signingKey);\n defineReadOnly(this, \"address\", computeAddress(this.publicKey));\n\n if (this.address !== getAddress(privateKey.address)) {\n logger.throwArgumentError(\"privateKey/address mismatch\", \"privateKey\", \"[REDACTED]\");\n }\n\n if (hasMnemonic(privateKey)) {\n const srcMnemonic = privateKey.mnemonic;\n defineReadOnly(this, \"_mnemonic\", () => (\n {\n phrase: srcMnemonic.phrase,\n path: srcMnemonic.path || defaultPath,\n locale: srcMnemonic.locale || \"en\"\n }\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 } else {\n defineReadOnly(this, \"_mnemonic\", (): Mnemonic => null);\n }\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 } else {\n const signingKey = new SigningKey(privateKey);\n defineReadOnly(this, \"_signingKey\", () => signingKey);\n }\n defineReadOnly(this, \"_mnemonic\", (): Mnemonic => null);\n defineReadOnly(this, \"address\", computeAddress(this.publicKey));\n }\n\n /* istanbul ignore if */\n if (provider && !Provider.isProvider(provider)) {\n logger.throwArgumentError(\"invalid provider\", \"provider\", provider);\n }\n\n defineReadOnly(this, \"provider\", provider || null);\n }\n\n get mnemonic(): Mnemonic { return this._mnemonic(); }\n get privateKey(): string { return this._signingKey().privateKey; }\n get publicKey(): string { return this._signingKey().publicKey; }\n\n getAddress(): Promise {\n return Promise.resolve(this.address);\n }\n\n connect(provider: Provider): Wallet {\n return new Wallet(this, provider);\n }\n\n signTransaction(transaction: TransactionRequest): Promise {\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\n const signature = this._signingKey().signDigest(keccak256(serialize(tx)));\n return serialize(tx, signature);\n });\n }\n\n async signMessage(message: Bytes | string): Promise {\n return joinSignature(this._signingKey().signDigest(hashMessage(message)));\n }\n\n async _signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise {\n // Populate any ENS names\n const populated = await _TypedDataEncoder.resolveNames(domain, types, value, (name: string) => {\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\n return joinSignature(this._signingKey().signDigest(_TypedDataEncoder.hash(populated.domain, types, populated.value)));\n }\n\n encrypt(password: Bytes | string, options?: any, progressCallback?: ProgressCallback): Promise {\n if (typeof(options) === \"function\" && !progressCallback) {\n progressCallback = options;\n options = {};\n }\n\n if (progressCallback && typeof(progressCallback) !== \"function\") {\n throw new Error(\"invalid callback\");\n }\n\n if (!options) { options = {}; }\n\n return encryptKeystore(this, password, options, progressCallback);\n }\n\n\n /**\n * Static methods to create Wallet instances.\n */\n static createRandom(options?: any): Wallet {\n let entropy: Uint8Array = randomBytes(16);\n\n if (!options) { options = { }; }\n\n if (options.extraEntropy) {\n entropy = arrayify(hexDataSlice(keccak256(concat([ entropy, options.extraEntropy ])), 0, 16));\n }\n\n const mnemonic = entropyToMnemonic(entropy, options.locale);\n return Wallet.fromMnemonic(mnemonic, options.path, options.locale);\n }\n\n static fromEncryptedJson(json: string, password: Bytes | string, progressCallback?: ProgressCallback): Promise {\n return decryptJsonWallet(json, password, progressCallback).then((account) => {\n return new Wallet(account);\n });\n }\n\n static fromEncryptedJsonSync(json: string, password: Bytes | string): Wallet {\n return new Wallet(decryptJsonWalletSync(json, password));\n }\n\n static fromMnemonic(mnemonic: string, path?: string, wordlist?: Wordlist): Wallet {\n if (!path) { path = defaultPath; }\n return new Wallet(HDNode.fromMnemonic(mnemonic, null, wordlist).derivePath(path));\n }\n}\n\nexport function verifyMessage(message: Bytes | string, signature: SignatureLike): string {\n return recoverAddress(hashMessage(message), signature);\n}\n\nexport function verifyTypedData(domain: TypedDataDomain, types: Record>, value: Record, signature: SignatureLike): string {\n return recoverAddress(_TypedDataEncoder.hash(domain, types, value), signature);\n}\n","export const version = \"networks/5.0.5\";\n","\"use strict\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { Network, Networkish } from \"./types\";\n\nexport {\n Network,\n Networkish\n};\n\ntype DefaultProviderFunc = (providers: any, options?: any) => any;\n\ninterface Renetworkable extends DefaultProviderFunc {\n renetwork: (network: Network) => DefaultProviderFunc;\n};\n\nfunction isRenetworkable(value: any): value is Renetworkable {\n return (value && typeof(value.renetwork) === \"function\");\n}\n\nfunction ethDefaultProvider(network: string | Network): Renetworkable {\n const func = function(providers: any, options?: any): any {\n if (options == null) { options = { }; }\n const providerList: Array = [];\n\n if (providers.InfuraProvider) {\n try {\n providerList.push(new providers.InfuraProvider(network, options.infura));\n } catch(error) { }\n }\n\n if (providers.EtherscanProvider) {\n try {\n providerList.push(new providers.EtherscanProvider(network, options.etherscan));\n } catch(error) { }\n }\n\n if (providers.AlchemyProvider) {\n try {\n providerList.push(new providers.AlchemyProvider(network, options.alchemy));\n } catch(error) { }\n }\n\n if (providers.CloudflareProvider) {\n try {\n providerList.push(new providers.CloudflareProvider(network));\n } catch(error) { }\n }\n\n if (providerList.length === 0) { return null; }\n\n if (providers.FallbackProvider) {\n let quorum = 1;\n if (options.quorum != null) {\n quorum = options.quorum;\n } else if (network === \"homestead\") {\n quorum = 2;\n }\n return new providers.FallbackProvider(providerList, quorum);\n }\n\n return providerList[0];\n };\n\n func.renetwork = function(network: Network) {\n return ethDefaultProvider(network);\n };\n\n return func;\n}\n\nfunction etcDefaultProvider(url: string, network: string | Network): Renetworkable {\n const func = function(providers: any, options?: any): any {\n if (providers.JsonRpcProvider) {\n return new providers.JsonRpcProvider(url, network);\n }\n\n return null;\n };\n\n func.renetwork = function(network: Network) {\n return etcDefaultProvider(url, network);\n };\n\n return func;\n}\n\nconst homestead: Network = {\n chainId: 1,\n ensAddress: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\",\n name: \"homestead\",\n _defaultProvider: ethDefaultProvider(\"homestead\")\n};\n\nconst ropsten: Network = {\n chainId: 3,\n ensAddress: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\",\n name: \"ropsten\",\n _defaultProvider: ethDefaultProvider(\"ropsten\")\n};\n\nconst classicMordor: Network = {\n chainId: 63,\n name: \"classicMordor\",\n _defaultProvider: etcDefaultProvider(\"https://www.ethercluster.com/mordor\", \"classicMordor\")\n};\n\nconst networks: { [name: string]: Network } = {\n unspecified: {\n chainId: 0,\n name: \"unspecified\"\n },\n\n homestead: homestead,\n mainnet: homestead,\n\n morden: {\n chainId: 2,\n name: \"morden\"\n },\n\n ropsten: ropsten,\n testnet: ropsten,\n\n rinkeby: {\n chainId: 4,\n ensAddress: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\",\n name: \"rinkeby\",\n _defaultProvider: ethDefaultProvider(\"rinkeby\")\n },\n\n kovan: {\n chainId: 42,\n name: \"kovan\",\n _defaultProvider: ethDefaultProvider(\"kovan\")\n },\n\n goerli: {\n chainId: 5,\n ensAddress: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\",\n name: \"goerli\",\n _defaultProvider: ethDefaultProvider(\"goerli\")\n },\n\n\n // ETC (See: #351)\n classic: {\n chainId: 61,\n name: \"classic\",\n _defaultProvider: etcDefaultProvider(\"https://www.ethercluster.com/etc\", \"classic\")\n },\n\n classicMorden: {\n chainId: 62,\n name: \"classicMorden\",\n },\n\n classicMordor: classicMordor,\n classicTestnet: classicMordor,\n\n classicKotti: {\n chainId: 6,\n name: \"classicKotti\",\n _defaultProvider: etcDefaultProvider(\"https://www.ethercluster.com/kotti\", \"classicKotti\")\n },\n}\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: Networkish): Network {\n // No network (null)\n if (network == null) { 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\n return {\n chainId: network,\n name: \"unknown\"\n };\n }\n\n if (typeof(network) === \"string\") {\n const standard = networks[network];\n if (standard == null) { return null; }\n return {\n name: standard.name,\n chainId: standard.chainId,\n ensAddress: standard.ensAddress,\n _defaultProvider: (standard._defaultProvider || null)\n };\n }\n\n const standard = networks[network.name];\n\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\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\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: DefaultProviderFunc = network._defaultProvider || null;\n if (defaultProvider == null && standard._defaultProvider) {\n if (isRenetworkable(standard._defaultProvider)) {\n defaultProvider = standard._defaultProvider.renetwork(network);\n } else {\n defaultProvider = standard._defaultProvider;\n }\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","\"use strict\";\n\nimport { arrayify, BytesLike } from \"@ethersproject/bytes\";\n\nexport function decode(textData: string): Uint8Array {\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}\n\nexport function encode(data: BytesLike): string {\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\n\n","\"use strict\";\n\nexport { decode, encode } from \"./base64\";\n","export const version = \"web/5.0.10\";\n","\"use strict\";\n\nimport { arrayify } from \"@ethersproject/bytes\";\n\nimport type { GetUrlResponse, Options } from \"./types\";\n\nexport { GetUrlResponse, Options };\n\nexport async function getUrl(href: string, options?: Options): Promise {\n if (options == null) { options = { }; }\n\n const request = {\n method: (options.method || \"GET\"),\n headers: (options.headers || { }),\n body: (options.body || undefined),\n\n mode: \"cors\", // no-cors, cors, *same-origin\n cache: \"no-cache\", // *default, no-cache, reload, force-cache, only-if-cached\n credentials: \"same-origin\", // include, *same-origin, omit\n redirect: \"follow\", // manual, *follow, error\n referrer: \"client\", // no-referrer, *client\n };\n\n const response = await fetch(href, request);\n const body = await response.arrayBuffer();\n\n const headers: { [ name: string ]: string } = { };\n if (response.headers.forEach) {\n response.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n } else {\n (<() => Array>(((response.headers)).keys))().forEach((key) => {\n headers[key.toLowerCase()] = response.headers.get(key);\n });\n }\n\n return {\n headers: headers,\n statusCode: response.status,\n statusMessage: response.statusText,\n body: arrayify(new Uint8Array(body)),\n }\n}\n","\"use strict\";\n\nimport { encode as base64Encode } from \"@ethersproject/base64\";\nimport { hexlify, isBytesLike } from \"@ethersproject/bytes\";\nimport { shallowCopy } from \"@ethersproject/properties\";\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { getUrl, GetUrlResponse, Options } from \"./geturl\";\n\nfunction staller(duration: number): Promise {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\n\nfunction bodyify(value: any, type: string): string {\n if (value == null) { return null; }\n\n if (typeof(value) === \"string\") { 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 } catch (error) { };\n }\n return hexlify(value);\n }\n\n return value;\n}\n\n// Exported Types\nexport type ConnectionInfo = {\n url: string,\n headers?: { [key: string]: string | number }\n\n user?: string,\n password?: string,\n\n allowInsecureAuthentication?: boolean,\n allowGzip?: boolean,\n\n throttleLimit?: number,\n throttleSlotInterval?: number;\n throttleCallback?: (attempt: number, url: string) => Promise,\n\n timeout?: number,\n};\n\nexport interface OnceBlockable {\n once(eventName: \"block\", handler: () => void): void;\n}\n\nexport interface OncePollable {\n once(eventName: \"poll\", handler: () => void): void;\n}\n\nexport type PollOptions = {\n timeout?: number,\n floor?: number,\n ceiling?: number,\n interval?: number,\n retryLimit?: number,\n onceBlock?: OnceBlockable\n oncePoll?: OncePollable\n};\n\nexport type FetchJsonResponse = {\n statusCode: number;\n headers: { [ header: string ]: string };\n};\n\n\ntype Header = { key: string, value: string };\n\n// This API is still a work in progress; the future changes will likely be:\n// - ConnectionInfo => FetchDataRequest\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: string | ConnectionInfo, body?: Uint8Array, processFunc?: (value: Uint8Array, response: FetchJsonResponse) => T): Promise {\n\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),\n \"invalid connection throttle limit\", \"connection.throttleLimit\", attemptLimit);\n\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),\n \"invalid connection throttle slot interval\", \"connection.throttleSlotInterval\", throttleSlotInterval);\n\n const headers: { [key: string]: Header } = { };\n\n let url: string = null;\n\n // @TODO: Allow ConnectionInfo to override some of these values\n const options: Options = {\n method: \"GET\",\n };\n\n let allow304 = false;\n\n let timeout = 2 * 60 * 1000;\n\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\n url = connection.url;\n\n if (typeof(connection.timeout) === \"number\" && connection.timeout > 0) {\n timeout = connection.timeout;\n }\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\n options.allowGzip = !!connection.allowGzip;\n\n if (connection.user != null && connection.password != null) {\n if (url.substring(0, 6) !== \"https:\" && connection.allowInsecureAuthentication !== true) {\n logger.throwError(\n \"basic authentication requires a secure https url\",\n Logger.errors.INVALID_ARGUMENT,\n { argument: \"url\", url: url, user: connection.user, password: \"[REDACTED]\" }\n );\n }\n\n const authorization = connection.user + \":\" + connection.password;\n headers[\"authorization\"] = {\n key: \"Authorization\",\n value: \"Basic \" + base64Encode(toUtf8Bytes(authorization))\n };\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\n const flatHeaders: { [ key: string ]: string } = { };\n Object.keys(headers).forEach((key) => {\n const header = headers[key];\n flatHeaders[header.key] = header.value;\n });\n options.headers = flatHeaders;\n\n const runningTimeout = (function() {\n let timer: NodeJS.Timer = null;\n const promise: Promise = new Promise(function(resolve, reject) {\n if (timeout) {\n timer = setTimeout(() => {\n if (timer == null) { return; }\n timer = null;\n\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\n const cancel = function() {\n if (timer == null) { return; }\n clearTimeout(timer);\n timer = null;\n }\n\n return { promise, cancel };\n })();\n\n const runningFetch = (async function() {\n\n for (let attempt = 0; attempt < attemptLimit; attempt++) {\n let response: GetUrlResponse = null;\n\n try {\n response = await getUrl(url, options);\n\n // Exponential back-off throttling\n if (response.statusCode === 429 && attempt < attemptLimit) {\n let tryAgain = true;\n if (throttleCallback) {\n tryAgain = await throttleCallback(attempt, url);\n }\n\n if (tryAgain) {\n let stall = 0;\n\n const retryAfter = response.headers[\"retry-after\"];\n if (typeof(retryAfter) === \"string\" && retryAfter.match(/^[1-9][0-9]*$/)) {\n stall = parseInt(retryAfter) * 1000;\n } else {\n stall = throttleSlotInterval * parseInt(String(Math.random() * Math.pow(2, attempt)));\n }\n\n //console.log(\"Stalling 429\");\n await staller(stall);\n continue;\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\n\n let body = response.body;\n\n if (allow304 && response.statusCode === 304) {\n body = null;\n\n } else if (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\n if (processFunc) {\n try {\n const result = await 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 = await throttleCallback(attempt, url);\n }\n\n if (tryAgain) {\n const timeout = throttleSlotInterval * parseInt(String(Math.random() * Math.pow(2, attempt)));\n //console.log(\"Stalling callback\");\n await staller(timeout);\n continue;\n }\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\n runningTimeout.cancel();\n\n // If we had a processFunc, it eitehr returned a T or threw above.\n // The \"body\" is now a Uint8Array.\n return (body);\n }\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}\n\nexport function fetchJson(connection: string | ConnectionInfo, json?: string, processFunc?: (value: any, response: FetchJsonResponse) => any): Promise {\n let processJsonFunc = (value: Uint8Array, response: FetchJsonResponse) => {\n let result: any = null;\n if (value != null) {\n try {\n result = JSON.parse(toUtf8String(value));\n } catch (error) {\n logger.throwError(\"invalid JSON\", Logger.errors.SERVER_ERROR, {\n body: value,\n error: error\n });\n }\n }\n\n if (processFunc) {\n result = processFunc(result, response);\n }\n\n return result;\n }\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: Uint8Array = null;\n if (json != null) {\n body = toUtf8Bytes(json);\n\n // Create a connection with the content-type set for JSON\n const updated: ConnectionInfo = (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 } else {\n updated.headers = { \"content-type\": \"application/json\" };\n }\n connection = updated;\n }\n\n return _fetchData(connection, body, processJsonFunc);\n}\n\nexport function poll(func: () => Promise, options?: PollOptions): Promise {\n if (!options) { options = {}; }\n options = shallowCopy(options);\n if (options.floor == null) { options.floor = 0; }\n if (options.ceiling == null) { options.ceiling = 10000; }\n if (options.interval == null) { options.interval = 250; }\n\n return new Promise(function(resolve, reject) {\n\n let timer: NodeJS.Timer = null;\n let done: boolean = false;\n\n // Returns true if cancel was successful. Unsuccessful cancel means we're already done.\n const cancel = (): boolean => {\n if (done) { return false; }\n done = true;\n if (timer) { clearTimeout(timer); }\n return true;\n };\n\n if (options.timeout) {\n timer = setTimeout(() => {\n if (cancel()) { reject(new Error(\"timeout\")); }\n }, options.timeout)\n }\n\n const retryLimit = options.retryLimit;\n\n let attempt = 0;\n function check() {\n return func().then(function(result) {\n\n // If we have a result, or are allowed null then we're done\n if (result !== undefined) {\n if (cancel()) { resolve(result); }\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\n // Otherwise, exponential back-off (up to 10s) our next request\n } else if (!done) {\n attempt++;\n if (attempt > retryLimit) {\n if (cancel()) { reject(new Error(\"retry limit reached\")); }\n return;\n }\n\n let timeout = options.interval * parseInt(String(Math.random() * Math.pow(2, attempt)));\n if (timeout < options.floor) { timeout = options.floor; }\n if (timeout > options.ceiling) { timeout = options.ceiling; }\n\n setTimeout(check, timeout);\n }\n\n return null;\n }, function(error) {\n if (cancel()) { reject(error); }\n });\n }\n check();\n });\n}\n\n","'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.0.15\";\n","\"use strict\";\n\nimport { Block, TransactionReceipt, TransactionResponse } from \"@ethersproject/abstract-provider\";\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 { parse as parseTransaction } from \"@ethersproject/transactions\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nexport type FormatFunc = (value: any) => any;\n\nexport type FormatFuncs = { [ key: string ]: FormatFunc };\n\nexport type Formats = {\n transaction: FormatFuncs,\n transactionRequest: FormatFuncs,\n receipt: FormatFuncs,\n receiptLog: FormatFuncs,\n block: FormatFuncs,\n blockWithTransactions: FormatFuncs,\n filter: FormatFuncs,\n filterLog: FormatFuncs,\n};\n\nexport class Formatter {\n readonly formats: Formats;\n\n constructor() {\n logger.checkNew(new.target, Formatter);\n this.formats = this.getDefaultFormats();\n }\n\n getDefaultFormats(): Formats {\n const formats: Formats = ({ });\n\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\n const strictData = (v: any) => { return this.data(v, true); };\n\n formats.transaction = {\n hash: hash,\n\n blockHash: Formatter.allowNull(hash, null),\n blockNumber: Formatter.allowNull(number, null),\n transactionIndex: Formatter.allowNull(number, null),\n\n confirmations: Formatter.allowNull(number, null),\n\n from: address,\n\n gasPrice: bigNumber,\n gasLimit: bigNumber,\n to: Formatter.allowNull(address, null),\n value: bigNumber,\n nonce: number,\n data: data,\n\n r: Formatter.allowNull(this.uint256),\n s: Formatter.allowNull(this.uint256),\n v: Formatter.allowNull(number),\n\n creates: Formatter.allowNull(address, null),\n\n raw: Formatter.allowNull(data),\n };\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 to: Formatter.allowNull(address),\n value: Formatter.allowNull(bigNumber),\n data: Formatter.allowNull(strictData),\n };\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\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 root: Formatter.allowNull(hash),\n gasUsed: bigNumber,\n logsBloom: Formatter.allowNull(data),// @TODO: should this be 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 status: Formatter.allowNull(number)\n };\n\n formats.block = {\n hash: hash,\n parentHash: hash,\n number: number,\n\n timestamp: number,\n nonce: Formatter.allowNull(hex),\n difficulty: this.difficulty.bind(this),\n\n gasLimit: bigNumber,\n gasUsed: bigNumber,\n\n miner: address,\n extraData: data,\n\n transactions: Formatter.allowNull(Formatter.arrayOf(hash)),\n };\n\n formats.blockWithTransactions = shallowCopy(formats.block);\n formats.blockWithTransactions.transactions = Formatter.allowNull(Formatter.arrayOf(this.transactionResponse.bind(this)));\n\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\n formats.filterLog = {\n blockNumber: Formatter.allowNull(number),\n blockHash: Formatter.allowNull(hash),\n transactionIndex: number,\n\n removed: Formatter.allowNull(this.boolean.bind(this)),\n\n address: address,\n data: Formatter.allowFalsish(data, \"0x\"),\n\n topics: Formatter.arrayOf(hash),\n\n transactionHash: hash,\n logIndex: number,\n };\n\n return formats;\n }\n\n // Requires a BigNumberish that is within the IEEE754 safe integer range; returns a number\n // Strict! Used on input.\n number(number: any): number {\n if (number === \"0x\") { return 0; }\n return BigNumber.from(number).toNumber();\n }\n\n // Strict! Used on input.\n bigNumber(value: any): BigNumber {\n return BigNumber.from(value);\n }\n\n // Requires a boolean, \"true\" or \"false\"; returns a boolean\n boolean(value: any): boolean {\n if (typeof(value) === \"boolean\") { return value; }\n if (typeof(value) === \"string\") {\n value = value.toLowerCase();\n if (value === \"true\") { return true; }\n if (value === \"false\") { return false; }\n }\n throw new Error(\"invalid boolean - \" + value);\n }\n\n hex(value: any, strict?: boolean): string {\n if (typeof(value) === \"string\") {\n if (!strict && value.substring(0, 2) !== \"0x\") { value = \"0x\" + value; }\n if (isHexString(value)) {\n return value.toLowerCase();\n }\n }\n return logger.throwArgumentError(\"invalid hash\", \"value\", value);\n }\n\n data(value: any, strict?: boolean): string {\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\n // Requires an address\n // Strict! Used on input.\n address(value: any): string {\n return getAddress(value);\n }\n\n callAddress(value: any): string {\n if (!isHexString(value, 32)) { return null; }\n const address = getAddress(hexDataSlice(value, 12));\n return (address === AddressZero) ? null: address;\n }\n\n contractAddress(value: any): string {\n return getContractAddress(value);\n }\n\n // Strict! Used on input.\n blockTag(blockTag: any): string {\n if (blockTag == null) { return \"latest\"; }\n\n if (blockTag === \"earliest\") { return \"0x0\"; }\n\n if (blockTag === \"latest\" || blockTag === \"pending\") {\n return blockTag;\n }\n\n if (typeof(blockTag) === \"number\" || isHexString(blockTag)) {\n return hexValue(blockTag);\n }\n\n throw new Error(\"invalid blockTag\");\n }\n\n // Requires a hash, optionally requires 0x prefix; returns prefixed lowercase hash.\n hash(value: any, strict?: boolean): string {\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\n // Returns the difficulty as a number, or if too large (i.e. PoA network) null\n difficulty(value: any): number {\n if (value == null) { return null; }\n\n const v = BigNumber.from(value);\n\n try {\n return v.toNumber();\n } catch (error) { }\n\n return null;\n }\n\n uint256(value: any): string {\n if (!isHexString(value)) {\n throw new Error(\"invalid uint256\");\n }\n return hexZeroPad(value, 32);\n }\n\n _block(value: any, format: any): Block {\n if (value.author != null && value.miner == null) {\n value.miner = value.author;\n }\n return Formatter.check(format, value);\n }\n\n block(value: any): Block {\n return this._block(value, this.formats.block);\n }\n\n blockWithTransactions(value: any): Block {\n return this._block(value, this.formats.blockWithTransactions);\n }\n\n // Strict! Used on input.\n transactionRequest(value: any): any {\n return Formatter.check(this.formats.transactionRequest, value);\n }\n\n transactionResponse(transaction: any): TransactionResponse {\n\n // Rename gas to gasLimit\n if (transaction.gas != null && transaction.gasLimit == null) {\n transaction.gasLimit = transaction.gas;\n }\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\n // Rename input to data\n if (transaction.input != null && transaction.data == null) {\n transaction.data = transaction.input;\n }\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\n // @TODO: use transaction.serialize? Have to add support for including v, r, and s...\n /*\n if (!transaction.raw) {\n\n // Very loose providers (e.g. TestRPC) do not provide a signature or raw\n if (transaction.v && transaction.r && transaction.s) {\n let raw = [\n stripZeros(hexlify(transaction.nonce)),\n stripZeros(hexlify(transaction.gasPrice)),\n stripZeros(hexlify(transaction.gasLimit)),\n (transaction.to || \"0x\"),\n stripZeros(hexlify(transaction.value || \"0x\")),\n hexlify(transaction.data || \"0x\"),\n stripZeros(hexlify(transaction.v || \"0x\")),\n stripZeros(hexlify(transaction.r)),\n stripZeros(hexlify(transaction.s)),\n ];\n\n transaction.raw = rlpEncode(raw);\n }\n }\n */\n\n const result: TransactionResponse = Formatter.check(this.formats.transaction, transaction);\n\n if (transaction.chainId != null) {\n let chainId = transaction.chainId;\n\n if (isHexString(chainId)) {\n chainId = BigNumber.from(chainId).toNumber();\n }\n\n result.chainId = chainId;\n\n } else {\n let chainId = transaction.networkId;\n\n // geth-etc returns chainId\n if (chainId == null && result.v == null) {\n chainId = transaction.chainId;\n }\n\n if (isHexString(chainId)) {\n chainId = BigNumber.from(chainId).toNumber();\n }\n\n if (typeof(chainId) !== \"number\" && result.v != null) {\n chainId = (result.v - 35) / 2;\n if (chainId < 0) { chainId = 0; }\n chainId = parseInt(chainId);\n }\n\n if (typeof(chainId) !== \"number\") { chainId = 0; }\n\n result.chainId = chainId;\n }\n\n // 0x0000... should actually be null\n if (result.blockHash && result.blockHash.replace(/0/g, \"\") === \"x\") {\n result.blockHash = null;\n }\n\n return result;\n }\n\n transaction(value: any): any {\n return parseTransaction(value);\n }\n\n receiptLog(value: any): any {\n return Formatter.check(this.formats.receiptLog, value);\n }\n\n receipt(value: any): TransactionReceipt {\n const result: TransactionReceipt = Formatter.check(this.formats.receipt, value);\n\n if (value.status != null) {\n result.byzantium = true;\n }\n\n return result;\n }\n\n topics(value: any): any {\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\n return null;\n }\n\n filter(value: any): any {\n return Formatter.check(this.formats.filter, value);\n }\n\n filterLog(value: any): any {\n return Formatter.check(this.formats.filterLog, value);\n }\n\n static check(format: { [ name: string ]: FormatFunc }, object: any): any {\n const result: any = {};\n for (const key in format) {\n try {\n const value = format[key](object[key]);\n if (value !== undefined) { result[key] = value; }\n } catch (error) {\n error.checkKey = key;\n error.checkValue = object[key];\n throw error;\n }\n }\n return result;\n }\n\n // if value is null-ish, nullValue is returned\n static allowNull(format: FormatFunc, nullValue?: any): FormatFunc {\n return (function(value: any) {\n if (value == null) { return nullValue; }\n return format(value);\n });\n }\n\n // If value is false-ish, replaceValue is returned\n static allowFalsish(format: FormatFunc, replaceValue: any): FormatFunc {\n return (function(value: any) {\n if (!value) { return replaceValue; }\n return format(value);\n });\n }\n\n // Requires an Array satisfying check\n static arrayOf(format: FormatFunc): FormatFunc {\n return (function(array: any): Array {\n if (!Array.isArray(array)) { throw new Error(\"not an array\"); }\n\n const result: any = [];\n\n array.forEach(function(value) {\n result.push(format(value));\n });\n\n return result;\n });\n }\n}\n\nexport interface CommunityResourcable {\n isCommunityResource(): boolean;\n}\n\nexport function isCommunityResourcable(value: any): value is CommunityResourcable {\n return (value && typeof(value.isCommunityResource) === \"function\");\n}\n\nexport function isCommunityResource(value: any): boolean {\n return (isCommunityResourcable(value) && value.isCommunityResource());\n}\n\n// Show the throttle message only once\nlet throttleMessage = false;\nexport function showThrottleMessage() {\n if (throttleMessage) { return; }\n throttleMessage = true;\n\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\n","\"use strict\";\n\nimport {\n Block, BlockTag, BlockWithTransactions, EventType, Filter, FilterByBlockHash, ForkEvent,\n Listener, Log, Provider, TransactionReceipt, TransactionRequest, TransactionResponse\n} from \"@ethersproject/abstract-provider\";\nimport { Base58 } from \"@ethersproject/basex\";\nimport { BigNumber, BigNumberish } from \"@ethersproject/bignumber\";\nimport { arrayify, concat, hexConcat, hexDataLength, hexDataSlice, hexlify, hexValue, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { HashZero } from \"@ethersproject/constants\";\nimport { namehash } from \"@ethersproject/hash\";\nimport { getNetwork, Network, Networkish } from \"@ethersproject/networks\";\nimport { Deferrable, defineReadOnly, getStatic, resolveProperties } from \"@ethersproject/properties\";\nimport { Transaction } from \"@ethersproject/transactions\";\nimport { sha256 } from \"@ethersproject/sha2\";\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\nimport { poll } from \"@ethersproject/web\";\n\nimport bech32 from \"bech32\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { Formatter } from \"./formatter\";\n\n\n//////////////////////////////\n// Event Serializeing\n\nfunction checkTopic(topic: string): string {\n if (topic == null) { return \"null\"; }\n if (hexDataLength(topic) !== 32) {\n logger.throwArgumentError(\"invalid topic\", \"topic\", topic);\n }\n return topic.toLowerCase();\n}\n\nfunction serializeTopics(topics: Array>): string {\n // Remove trailing null AND-topics; they are redundant\n topics = topics.slice();\n while (topics.length > 0 && topics[topics.length - 1] == null) { topics.pop(); }\n\n return topics.map((topic) => {\n if (Array.isArray(topic)) {\n\n // Only track unique OR-topics\n const unique: { [ topic: string ]: boolean } = { }\n topic.forEach((topic) => {\n unique[checkTopic(topic)] = true;\n });\n\n // The order of OR-topics does not matter\n const sorted = Object.keys(unique);\n sorted.sort();\n\n return sorted.join(\"|\");\n\n } else {\n return checkTopic(topic);\n }\n }).join(\"&\");\n}\n\nfunction deserializeTopics(data: string): Array> {\n if (data === \"\") { return [ ]; }\n\n return data.split(/&/g).map((topic) => {\n if (topic === \"\") { return [ ]; }\n\n const comps = topic.split(\"|\").map((topic) => {\n return ((topic === \"null\") ? null: topic);\n });\n\n return ((comps.length === 1) ? comps[0]: comps);\n });\n}\n\nfunction getEventTag(eventName: EventType): string {\n if (typeof(eventName) === \"string\") {\n eventName = eventName.toLowerCase();\n\n if (hexDataLength(eventName) === 32) {\n return \"tx:\" + eventName;\n }\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\n throw new Error(\"invalid event - \" + eventName);\n}\n\n//////////////////////////////\n// Helper Object\n\nfunction getTime() {\n return (new Date()).getTime();\n}\n\nfunction stall(duration: number): Promise {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\n\n//////////////////////////////\n// Provider Object\n\n\n/**\n * EventType\n * - \"block\"\n * - \"poll\"\n * - \"didPoll\"\n * - \"pending\"\n * - \"error\"\n * - \"network\"\n * - filter\n * - topics array\n * - transaction hash\n */\n\nconst PollableEvents = [ \"block\", \"network\", \"pending\", \"poll\" ];\n\nexport class Event {\n readonly listener: Listener;\n readonly once: boolean;\n readonly tag: string;\n\n constructor(tag: string, listener: Listener, once: boolean) {\n defineReadOnly(this, \"tag\", tag);\n defineReadOnly(this, \"listener\", listener);\n defineReadOnly(this, \"once\", once);\n }\n\n get event(): EventType {\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\n get type(): string {\n return this.tag.split(\":\")[0]\n }\n\n get hash(): string {\n const comps = this.tag.split(\":\");\n if (comps[0] !== \"tx\") { return null; }\n return comps[1];\n }\n\n get filter(): Filter {\n const comps = this.tag.split(\":\");\n if (comps[0] !== \"filter\") { return null; }\n const address = comps[1];\n\n const topics = deserializeTopics(comps[2]);\n const filter: Filter = { };\n\n if (topics.length > 0) { filter.topics = topics; }\n if (address && address !== \"*\") { filter.address = address; }\n\n return filter;\n }\n\n pollable(): boolean {\n return (this.tag.indexOf(\":\") >= 0 || PollableEvents.indexOf(this.tag) >= 0);\n }\n}\n\nexport interface EnsResolver {\n\n // Name this Resolver is associated with\n readonly name: string;\n\n // The address of the resolver\n readonly address: string;\n\n // Multichain address resolution (also normal address resolution)\n // See: https://eips.ethereum.org/EIPS/eip-2304\n getAddress(coinType?: 60): Promise\n\n // Contenthash field\n // See: https://eips.ethereum.org/EIPS/eip-1577\n getContentHash(): Promise;\n\n // Storage of text records\n // See: https://eips.ethereum.org/EIPS/eip-634\n getText(key: string): Promise;\n};\n\nexport interface EnsProvider {\n resolveName(name: string): Promise;\n lookupAddress(address: string): Promise;\n getResolver(name: string): Promise;\n}\n\ntype CoinInfo = {\n symbol: string,\n ilk?: string, // General family\n prefix?: string, // Bech32 prefix\n p2pkh?: number, // Pay-to-Public-Key-Hash Version\n p2sh?: number, // Pay-to-Script-Hash Version\n};\n\n// https://github.com/satoshilabs/slips/blob/master/slip-0044.md\nconst coinInfos: { [ coinType: string ]: CoinInfo } = {\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};\n\nfunction bytes32ify(value: number): string {\n return hexZeroPad(BigNumber.from(value).toHexString(), 32);\n}\n\n// Compute the Base58Check encoded data (checksum is first 4 bytes of sha256d)\nfunction base58Encode(data: Uint8Array): string {\n return Base58.encode(concat([ data, hexDataSlice(sha256(sha256(data)), 0, 4) ]));\n}\n\nexport class Resolver implements EnsResolver {\n readonly provider: BaseProvider;\n\n readonly name: string;\n readonly address: string;\n\n constructor(provider: BaseProvider, address: string, name: string) {\n defineReadOnly(this, \"provider\", provider);\n defineReadOnly(this, \"name\", name);\n defineReadOnly(this, \"address\", provider.formatter.address(address));\n }\n\n async _fetchBytes(selector: string, parameters?: string): Promise {\n\n // keccak256(\"addr(bytes32,uint256)\")\n const transaction = {\n to: this.address,\n data: hexConcat([ selector, namehash(this.name), (parameters || \"0x\") ])\n };\n\n const result = await this.provider.call(transaction);\n if (result === \"0x\") { return null; }\n\n const offset = BigNumber.from(hexDataSlice(result, 0, 32)).toNumber();\n const length = BigNumber.from(hexDataSlice(result, offset, offset + 32)).toNumber();\n return hexDataSlice(result, offset + 32, offset + 32 + length);\n }\n\n _getAddress(coinType: number, hexBytes: string): string {\n const coinInfo = coinInfos[String(coinType)];\n\n if (coinInfo == null) {\n logger.throwError(`unsupported coin type: ${ coinType }`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: `getAddress(${ coinType })`\n });\n }\n\n if (coinInfo.ilk === \"eth\") {\n return this.provider.formatter.address(hexBytes);\n }\n\n const bytes = arrayify(hexBytes);\n\n // P2PKH: OP_DUP OP_HASH160 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\n // P2SH: OP_HASH160 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\n // Bech32\n if (coinInfo.prefix != null) {\n const length = bytes[1];\n\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 } else {\n version = -1;\n }\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\n return null;\n }\n\n\n async getAddress(coinType?: number): Promise {\n if (coinType == null) { coinType = 60; }\n\n // If Ethereum, use the standard `addr(bytes32)`\n if (coinType === 60) {\n // keccak256(\"addr(bytes32)\")\n const transaction = {\n to: this.address,\n data: (\"0x3b3b57de\" + namehash(this.name).substring(2))\n };\n const hexBytes = await this.provider.call(transaction);\n\n // No address\n if (hexBytes === \"0x\" || hexBytes === HashZero) { return null; }\n\n return this.provider.formatter.callAddress(hexBytes);\n }\n\n // keccak256(\"addr(bytes32,uint256\")\n const hexBytes = await this._fetchBytes(\"0xf1cb7e06\", bytes32ify(coinType));\n\n // No address\n if (hexBytes == null || hexBytes === \"0x\") { return null; }\n\n // Compute the address\n const address = this._getAddress(coinType, hexBytes);\n\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\n return address;\n }\n\n async getContentHash(): Promise {\n\n // keccak256(\"contenthash()\")\n const hexBytes = await this._fetchBytes(\"0xbc1c58d1\");\n\n // No contenthash\n if (hexBytes == null || hexBytes === \"0x\") { 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\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\n return logger.throwError(`invalid or unsupported content hash data`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"getContentHash()\",\n data: hexBytes\n });\n }\n\n async getText(key: string): Promise {\n\n // The key encoded as parameter to fetchBytes\n let keyBytes = toUtf8Bytes(key);\n\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\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\n const hexBytes = await this._fetchBytes(\"0x59d1d43c\", hexlify(keyBytes));\n if (hexBytes == null || hexBytes === \"0x\") { return null; }\n\n return toUtf8String(hexBytes);\n }\n}\n\nlet defaultFormatter: Formatter = null;\n\nlet nextPollId = 1;\n\n\nexport class BaseProvider extends Provider implements EnsProvider {\n _networkPromise: Promise;\n _network: Network;\n\n _events: Array;\n\n formatter: Formatter;\n\n // To help mitigate the eventually consistent nature of the blockchain\n // we keep a mapping of events we emit. If we emit an event X, we expect\n // that a user should be able to query for that event in the callback,\n // if the node returns null, we stall the response until we get back a\n // meaningful value, since we may be hitting a re-org, or a node that\n // has not indexed the event yet.\n // Events:\n // - t:{hash} - Transaction hash\n // - b:{hash} - BlockHash\n // - block - The most recent emitted block\n _emitted: { [ eventName: string ]: number | \"pending\" };\n\n _pollingInterval: number;\n _poller: NodeJS.Timer;\n _bootstrapPoll: NodeJS.Timer;\n\n _lastBlockNumber: number;\n\n _fastBlockNumber: number;\n _fastBlockNumberPromise: Promise;\n _fastQueryDate: number;\n\n _maxInternalBlockNumber: number;\n _internalBlockNumber: Promise<{ blockNumber: number, reqTime: number, respTime: number }>;\n\n readonly anyNetwork: boolean;\n\n\n /**\n * ready\n *\n * A Promise 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\n constructor(network: Networkish | Promise) {\n logger.checkNew(new.target, Provider);\n\n super();\n\n // Events being listened to\n this._events = [];\n\n this._emitted = { block: -2 };\n\n this.formatter = new.target.getFormatter();\n\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) { network = this.detectNetwork(); }\n\n if (network instanceof Promise) {\n this._networkPromise = network;\n\n // Squash any \"unhandled promise\" errors; that do not need to be handled\n network.catch((error) => { });\n\n // Trigger initial network setting (async)\n this._ready().catch((error) => { });\n\n } else {\n const knownNetwork = getStatic<(network: Networkish) => Network>(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\n this._maxInternalBlockNumber = -1024;\n\n this._lastBlockNumber = -2;\n\n this._pollingInterval = 4000;\n\n this._fastQueryDate = 0;\n }\n\n async _ready(): Promise {\n if (this._network == null) {\n let network: Network = null;\n if (this._networkPromise) {\n try {\n network = await this._networkPromise;\n } catch (error) { }\n }\n\n // Try the Provider's network detection (this MUST throw if it cannot)\n if (network == null) {\n network = await this.detectNetwork();\n }\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\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 } else {\n defineReadOnly(this, \"_network\", network);\n }\n this.emit(\"network\", network, null);\n }\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 refelcted); otherwise this cannot change\n get ready(): Promise {\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\n // @TODO: Remove this and just create a singleton formatter\n static getFormatter(): Formatter {\n if (defaultFormatter == null) {\n defaultFormatter = new Formatter();\n }\n return defaultFormatter;\n }\n\n // @TODO: Remove this and just use getNetwork\n static getNetwork(network: Networkish): Network {\n return getNetwork((network == null) ? \"homestead\": network);\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 async _getInternalBlockNumber(maxAge: number): Promise {\n await this._ready();\n\n const internalBlockNumber = this._internalBlockNumber;\n\n if (maxAge > 0 && this._internalBlockNumber) {\n const result = await internalBlockNumber;\n if ((getTime() - result.respTime) <= maxAge) {\n return result.blockNumber;\n }\n }\n\n const reqTime = getTime();\n\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\n const respTime = getTime();\n\n blockNumber = BigNumber.from(blockNumber).toNumber();\n if (blockNumber < this._maxInternalBlockNumber) { blockNumber = this._maxInternalBlockNumber; }\n\n this._maxInternalBlockNumber = blockNumber;\n this._setFastBlockNumber(blockNumber); // @TODO: Still need this?\n return { blockNumber, reqTime, respTime };\n });\n\n this._internalBlockNumber = checkInternalBlockNumber;\n\n return (await checkInternalBlockNumber).blockNumber;\n }\n\n async poll(): Promise {\n const pollId = nextPollId++;\n\n // Track all running promises, so we can trigger a post-poll once they are complete\n const runners: Array> = [];\n\n const blockNumber = await this._getInternalBlockNumber(100 + this.pollingInterval / 2);\n this._setFastBlockNumber(blockNumber);\n\n // Emit a poll event after we have the latest (fast) block number\n this.emit(\"poll\", pollId, blockNumber);\n\n // If the block has not changed, meh.\n if (blockNumber === this._lastBlockNumber) {\n this.emit(\"didPoll\", pollId);\n return;\n }\n\n // First polling cycle, trigger a \"block\" events\n if (this._emitted.block === -2) {\n this._emitted.block = blockNumber - 1;\n }\n\n if (Math.abs(((this._emitted.block)) - blockNumber) > 1000) {\n logger.warn(\"network block skew detected; skipping block events\");\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\n // The emitted block was updated, check for obsolete events\n if ((this._emitted.block) !== blockNumber) {\n this._emitted.block = blockNumber;\n\n Object.keys(this._emitted).forEach((key) => {\n // The block event does not expire\n if (key === \"block\") { return; }\n\n // The block we were at when we emitted this event\n const eventBlockNumber = this._emitted[key];\n\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\") { 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\n // First polling cycle\n if (this._lastBlockNumber === -2) {\n this._lastBlockNumber = blockNumber - 1;\n }\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) { return null; }\n this._emitted[\"t:\" + hash] = receipt.blockNumber;\n this.emit(hash, receipt);\n return null;\n }).catch((error: Error) => { this.emit(\"error\", error); });\n\n runners.push(runner);\n\n break;\n }\n\n case \"filter\": {\n const filter = event.filter;\n filter.fromBlock = this._lastBlockNumber + 1;\n filter.toBlock = blockNumber;\n\n const runner = this.getLogs(filter).then((logs) => {\n if (logs.length === 0) { return; }\n logs.forEach((log: Log) => {\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: Error) => { this.emit(\"error\", error); });\n runners.push(runner);\n\n break;\n }\n }\n });\n\n this._lastBlockNumber = blockNumber;\n\n // Once all events for this loop have been processed, emit \"didPoll\"\n Promise.all(runners).then(() => {\n this.emit(\"didPoll\", pollId);\n });\n\n return null;\n }\n\n // Deprecated; do not use this\n resetEventsBlock(blockNumber: number): void {\n this._lastBlockNumber = blockNumber - 1;\n if (this.polling) { this.poll(); }\n }\n\n get network(): Network {\n return this._network;\n }\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 async detectNetwork(): Promise {\n return logger.throwError(\"provider does not support network detection\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"provider.detectNetwork\"\n });\n }\n\n async getNetwork(): Promise {\n const network = await this._ready();\n\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 = await this.detectNetwork();\n if (network.chainId !== currentNetwork.chainId) {\n\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\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\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 await stall(0);\n\n return this._network;\n }\n\n const error = logger.makeError(\"underlying network changed\", Logger.errors.NETWORK_ERROR, {\n event: \"changed\",\n network: network,\n detectedNetwork: currentNetwork\n });\n\n this.emit(\"error\", error);\n throw error;\n }\n\n return network;\n }\n\n get blockNumber(): number {\n this._getInternalBlockNumber(100 + this.pollingInterval / 2).then((blockNumber) => {\n this._setFastBlockNumber(blockNumber);\n });\n\n return (this._fastBlockNumber != null) ? this._fastBlockNumber: -1;\n }\n\n get polling(): boolean {\n return (this._poller != null);\n }\n\n set polling(value: boolean) {\n if (value && !this._poller) {\n this._poller = setInterval(this.poll.bind(this), this.pollingInterval);\n\n if (!this._bootstrapPoll) {\n this._bootstrapPoll = setTimeout(() => {\n this.poll();\n\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) { 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\n get pollingInterval(): number {\n return this._pollingInterval;\n }\n\n set pollingInterval(value: number) {\n if (typeof(value) !== \"number\" || value <= 0 || parseInt(String(value)) != value) {\n throw new Error(\"invalid polling interval\");\n }\n\n this._pollingInterval = value;\n\n if (this._poller) {\n clearInterval(this._poller);\n this._poller = setInterval(() => { this.poll() }, this._pollingInterval);\n }\n }\n\n _getFastBlockNumber(): Promise {\n const now = getTime();\n\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\n return this._fastBlockNumberPromise;\n }\n\n _setFastBlockNumber(blockNumber: number): void {\n // Older block, maybe a stale request\n if (this._fastBlockNumber != null && blockNumber < this._fastBlockNumber) { return; }\n\n // Update the time we updated the blocknumber\n this._fastQueryDate = getTime();\n\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\n async waitForTransaction(transactionHash: string, confirmations?: number, timeout?: number): Promise {\n if (confirmations == null) { confirmations = 1; }\n\n const receipt = await this.getTransactionReceipt(transactionHash);\n\n // Receipt is already good\n if ((receipt ? receipt.confirmations: 0) >= confirmations) { return receipt; }\n\n // Poll until the receipt is good...\n return new Promise((resolve, reject) => {\n let timer: NodeJS.Timer = null;\n let done = false;\n\n const handler = (receipt: TransactionReceipt) => {\n if (receipt.confirmations < confirmations) { return; }\n\n if (timer) { clearTimeout(timer); }\n if (done) { return; }\n done = true;\n\n this.removeListener(transactionHash, handler);\n resolve(receipt);\n }\n this.on(transactionHash, handler);\n\n if (typeof(timeout) === \"number\" && timeout > 0) {\n timer = setTimeout(() => {\n if (done) { return; }\n timer = null;\n done = true;\n\n this.removeListener(transactionHash, handler);\n reject(logger.makeError(\"timeout exceeded\", Logger.errors.TIMEOUT, { timeout: timeout }));\n }, timeout);\n if (timer.unref) { timer.unref(); }\n }\n });\n }\n\n async getBlockNumber(): Promise {\n return this._getInternalBlockNumber(0);\n }\n\n async getGasPrice(): Promise {\n await this.getNetwork();\n return BigNumber.from(await this.perform(\"getGasPrice\", { }));\n }\n\n async getBalance(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise {\n await this.getNetwork();\n const params = await resolveProperties({\n address: this._getAddress(addressOrName),\n blockTag: this._getBlockTag(blockTag)\n });\n return BigNumber.from(await this.perform(\"getBalance\", params));\n }\n\n async getTransactionCount(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise {\n await this.getNetwork();\n const params = await resolveProperties({\n address: this._getAddress(addressOrName),\n blockTag: this._getBlockTag(blockTag)\n });\n return BigNumber.from(await this.perform(\"getTransactionCount\", params)).toNumber();\n }\n\n async getCode(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise {\n await this.getNetwork();\n const params = await resolveProperties({\n address: this._getAddress(addressOrName),\n blockTag: this._getBlockTag(blockTag)\n });\n return hexlify(await this.perform(\"getCode\", params));\n }\n\n async getStorageAt(addressOrName: string | Promise, position: BigNumberish | Promise, blockTag?: BlockTag | Promise): Promise {\n await this.getNetwork();\n const params = await resolveProperties({\n address: this._getAddress(addressOrName),\n blockTag: this._getBlockTag(blockTag),\n position: Promise.resolve(position).then((p) => hexValue(p))\n });\n return hexlify(await this.perform(\"getStorageAt\", params));\n }\n\n // This should be called by any subclass wrapping a TransactionResponse\n _wrapTransaction(tx: Transaction, hash?: string): TransactionResponse {\n if (hash != null && hexDataLength(hash) !== 32) { throw new Error(\"invalid response - sendTransaction\"); }\n\n const result = tx;\n\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\n // @TODO: (confirmations? number, timeout? number)\n result.wait = async (confirmations?: number) => {\n\n // We know this transaction *must* exist (whether it gets mined is\n // another story), so setting an emitted value forces us to\n // wait even if the node returns null for the receipt\n if (confirmations !== 0) {\n this._emitted[\"t:\" + tx.hash] = \"pending\";\n }\n\n const receipt = await this.waitForTransaction(tx.hash, confirmations)\n if (receipt == null && confirmations === 0) { return null; }\n\n // No longer pending, allow the polling loop to garbage collect this\n this._emitted[\"t:\" + tx.hash] = receipt.blockNumber;\n\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\n return result;\n }\n\n async sendTransaction(signedTransaction: string | Promise): Promise {\n await this.getNetwork();\n const hexTx = await Promise.resolve(signedTransaction).then(t => hexlify(t));\n const tx = this.formatter.transaction(signedTransaction);\n try {\n const hash = await this.perform(\"sendTransaction\", { signedTransaction: hexTx });\n return this._wrapTransaction(tx, hash);\n } catch (error) {\n (error).transaction = tx;\n (error).transactionHash = tx.hash;\n throw error;\n }\n }\n\n async _getTransactionRequest(transaction: Deferrable): Promise {\n const values: any = await transaction;\n\n const tx: any = { };\n\n [\"from\", \"to\"].forEach((key) => {\n if (values[key] == null) { return; }\n tx[key] = Promise.resolve(values[key]).then((v) => (v ? this._getAddress(v): null))\n });\n\n [\"gasLimit\", \"gasPrice\", \"value\"].forEach((key) => {\n if (values[key] == null) { return; }\n tx[key] = Promise.resolve(values[key]).then((v) => (v ? BigNumber.from(v): null));\n });\n\n [\"data\"].forEach((key) => {\n if (values[key] == null) { return; }\n tx[key] = Promise.resolve(values[key]).then((v) => (v ? hexlify(v): null));\n });\n\n return this.formatter.transactionRequest(await resolveProperties(tx));\n }\n\n async _getFilter(filter: Filter | FilterByBlockHash | Promise): Promise {\n filter = await filter;\n\n const result: any = { };\n\n if (filter.address != null) {\n result.address = this._getAddress(filter.address);\n }\n\n [\"blockHash\", \"topics\"].forEach((key) => {\n if ((filter)[key] == null) { return; }\n result[key] = (filter)[key];\n });\n\n [\"fromBlock\", \"toBlock\"].forEach((key) => {\n if ((filter)[key] == null) { return; }\n result[key] = this._getBlockTag((filter)[key]);\n });\n\n return this.formatter.filter(await resolveProperties(result));\n }\n\n async call(transaction: Deferrable, blockTag?: BlockTag | Promise): Promise {\n await this.getNetwork();\n const params = await resolveProperties({\n transaction: this._getTransactionRequest(transaction),\n blockTag: this._getBlockTag(blockTag)\n });\n return hexlify(await this.perform(\"call\", params));\n }\n\n async estimateGas(transaction: Deferrable): Promise {\n await this.getNetwork();\n const params = await resolveProperties({\n transaction: this._getTransactionRequest(transaction)\n });\n return BigNumber.from(await this.perform(\"estimateGas\", params));\n }\n\n async _getAddress(addressOrName: string | Promise): Promise {\n const address = await 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 async _getBlock(blockHashOrBlockTag: BlockTag | string | Promise, includeTransactions?: boolean): Promise {\n await this.getNetwork();\n\n blockHashOrBlockTag = await blockHashOrBlockTag;\n\n // If blockTag is a number (not \"latest\", etc), this is the block number\n let blockNumber = -128;\n\n const params: { [key: string]: any } = {\n includeTransactions: !!includeTransactions\n };\n\n if (isHexString(blockHashOrBlockTag, 32)) {\n params.blockHash = blockHashOrBlockTag;\n } else {\n try {\n params.blockTag = this.formatter.blockTag(await this._getBlockTag(blockHashOrBlockTag));\n if (isHexString(params.blockTag)) {\n blockNumber = parseInt(params.blockTag.substring(2), 16);\n }\n } catch (error) {\n logger.throwArgumentError(\"invalid block hash or block tag\", \"blockHashOrBlockTag\", blockHashOrBlockTag);\n }\n }\n\n return poll(async () => {\n const block = await this.perform(\"getBlock\", params);\n\n // Block was not found\n if (block == null) {\n\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) { 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) { return null; }\n }\n\n // Retry on the next block\n return undefined;\n }\n\n // Add transactions\n if (includeTransactions) {\n let blockNumber: number = 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 = await this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n }\n\n // Add the confirmations using the fast block number (pessimistic)\n let confirmations = (blockNumber - tx.blockNumber) + 1;\n if (confirmations <= 0) { confirmations = 1; }\n tx.confirmations = confirmations;\n }\n }\n return this.formatter.blockWithTransactions(block);\n }\n\n return this.formatter.block(block);\n }, { oncePoll: this });\n }\n\n getBlock(blockHashOrBlockTag: BlockTag | string | Promise): Promise {\n return >(this._getBlock(blockHashOrBlockTag, false));\n }\n\n getBlockWithTransactions(blockHashOrBlockTag: BlockTag | string | Promise): Promise {\n return >(this._getBlock(blockHashOrBlockTag, true));\n }\n\n async getTransaction(transactionHash: string | Promise): Promise {\n await this.getNetwork();\n transactionHash = await transactionHash;\n\n const params = { transactionHash: this.formatter.hash(transactionHash, true) };\n\n return poll(async () => {\n const result = await this.perform(\"getTransaction\", params);\n\n if (result == null) {\n if (this._emitted[\"t:\" + transactionHash] == null) {\n return null;\n }\n return undefined;\n }\n\n const tx = this.formatter.transactionResponse(result);\n\n if (tx.blockNumber == null) {\n tx.confirmations = 0;\n\n } else if (tx.confirmations == null) {\n const blockNumber = await 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) { confirmations = 1; }\n tx.confirmations = confirmations;\n }\n\n return this._wrapTransaction(tx);\n }, { oncePoll: this });\n }\n\n async getTransactionReceipt(transactionHash: string | Promise): Promise {\n await this.getNetwork();\n\n transactionHash = await transactionHash;\n\n const params = { transactionHash: this.formatter.hash(transactionHash, true) };\n\n return poll(async () => {\n const result = await this.perform(\"getTransactionReceipt\", params);\n\n if (result == null) {\n if (this._emitted[\"t:\" + transactionHash] == null) {\n return null;\n }\n return undefined;\n }\n\n // \"geth-etc\" returns receipts before they are ready\n if (result.blockHash == null) { return undefined; }\n\n const receipt = this.formatter.receipt(result);\n\n if (receipt.blockNumber == null) {\n receipt.confirmations = 0;\n\n } else if (receipt.confirmations == null) {\n const blockNumber = await this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n\n // Add the confirmations using the fast block number (pessimistic)\n let confirmations = (blockNumber - receipt.blockNumber) + 1;\n if (confirmations <= 0) { confirmations = 1; }\n receipt.confirmations = confirmations;\n }\n\n return receipt;\n }, { oncePoll: this });\n }\n\n async getLogs(filter: Filter | FilterByBlockHash | Promise): Promise> {\n await this.getNetwork();\n const params = await resolveProperties({ filter: this._getFilter(filter) });\n const logs: Array = await this.perform(\"getLogs\", params);\n logs.forEach((log) => {\n if (log.removed == null) { log.removed = false; }\n });\n return Formatter.arrayOf(this.formatter.filterLog.bind(this.formatter))(logs);\n }\n\n async getEtherPrice(): Promise {\n await this.getNetwork();\n return this.perform(\"getEtherPrice\", { });\n }\n\n async _getBlockTag(blockTag: BlockTag | Promise): Promise {\n blockTag = await blockTag;\n\n if (typeof(blockTag) === \"number\" && blockTag < 0) {\n if (blockTag % 1) {\n logger.throwArgumentError(\"invalid BlockTag\", \"blockTag\", blockTag);\n }\n\n let blockNumber = await this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n blockNumber += blockTag;\n if (blockNumber < 0) { blockNumber = 0; }\n return this.formatter.blockTag(blockNumber)\n }\n\n return this.formatter.blockTag(blockTag);\n }\n\n\n async getResolver(name: string): Promise {\n const address = await this._getResolver(name);\n if (address == null) { return null; }\n return new Resolver(this, address, name);\n }\n\n async _getResolver(name: string): Promise {\n // Get the resolver from the blockchain\n const network = await this.getNetwork();\n\n // No ENS...\n if (!network.ensAddress) {\n logger.throwError(\n \"network does not support ENS\",\n Logger.errors.UNSUPPORTED_OPERATION,\n { operation: \"ENS\", network: network.name }\n );\n }\n\n // keccak256(\"resolver(bytes32)\")\n const transaction = {\n to: network.ensAddress,\n data: (\"0x0178b8bf\" + namehash(name).substring(2))\n };\n\n return this.formatter.callAddress(await this.call(transaction));\n }\n\n async resolveName(name: string | Promise): Promise {\n name = await name;\n\n // If it is already an address, nothing to resolve\n try {\n return Promise.resolve(this.formatter.address(name));\n } catch (error) {\n // If is is a hexstring, the address is bad (See #694)\n if (isHexString(name)) { throw error; }\n }\n\n if (typeof(name) !== \"string\") {\n logger.throwArgumentError(\"invalid ENS name\", \"name\", name);\n }\n\n // Get the addr from the resovler\n const resolver = await this.getResolver(name);\n if (!resolver) { return null; }\n\n return await resolver.getAddress();\n }\n\n async lookupAddress(address: string | Promise): Promise {\n address = await address;\n address = this.formatter.address(address);\n\n const reverseName = address.substring(2).toLowerCase() + \".addr.reverse\";\n\n const resolverAddress = await this._getResolver(reverseName);\n if (!resolverAddress) { return null; }\n\n // keccak(\"name(bytes32)\")\n let bytes = arrayify(await this.call({\n to: resolverAddress,\n data: (\"0x691f3431\" + namehash(reverseName).substring(2))\n }));\n\n // Strip off the dynamic string pointer (0x20)\n if (bytes.length < 32 || !BigNumber.from(bytes.slice(0, 32)).eq(32)) { return null; }\n bytes = bytes.slice(32);\n\n // Not a length-prefixed string\n if (bytes.length < 32) { return null; }\n\n // Get the length of the string (from the length-prefix)\n const length = BigNumber.from(bytes.slice(0, 32)).toNumber();\n bytes = bytes.slice(32);\n\n // Length longer than available data\n if (length > bytes.length) { return null; }\n\n const name = toUtf8String(bytes.slice(0, length));\n\n // Make sure the reverse record matches the foward record\n const addr = await this.resolveName(name);\n if (addr != address) { return null; }\n\n return name;\n }\n\n perform(method: string, params: any): Promise {\n return logger.throwError(method + \" not implemented\", Logger.errors.NOT_IMPLEMENTED, { operation: method });\n }\n\n _startEvent(event: Event): void {\n this.polling = (this._events.filter((e) => e.pollable()).length > 0);\n }\n\n _stopEvent(event: Event): void {\n this.polling = (this._events.filter((e) => e.pollable()).length > 0);\n }\n\n _addEventListener(eventName: EventType, listener: Listener, once: boolean): this {\n const event = new Event(getEventTag(eventName), listener, once)\n this._events.push(event);\n this._startEvent(event);\n\n return this;\n }\n\n on(eventName: EventType, listener: Listener): this {\n return this._addEventListener(eventName, listener, false);\n }\n\n once(eventName: EventType, listener: Listener): this {\n return this._addEventListener(eventName, listener, true);\n }\n\n\n emit(eventName: EventType, ...args: Array): boolean {\n let result = false;\n\n let stopped: Array = [ ];\n\n let eventTag = getEventTag(eventName);\n this._events = this._events.filter((event) => {\n if (event.tag !== eventTag) { return true; }\n\n setTimeout(() => {\n event.listener.apply(this, args);\n }, 0);\n\n result = true;\n\n if (event.once) {\n stopped.push(event);\n return false;\n }\n\n return true;\n });\n\n stopped.forEach((event) => { this._stopEvent(event); });\n\n return result;\n }\n\n listenerCount(eventName?: EventType): number {\n if (!eventName) { 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\n listeners(eventName?: EventType): Array {\n if (eventName == null) {\n return this._events.map((event) => event.listener);\n }\n\n let eventTag = getEventTag(eventName);\n return this._events\n .filter((event) => (event.tag === eventTag))\n .map((event) => event.listener);\n }\n\n off(eventName: EventType, listener?: Listener): this {\n if (listener == null) {\n return this.removeAllListeners(eventName);\n }\n\n const stopped: Array = [ ];\n\n let found = false;\n\n let eventTag = getEventTag(eventName);\n this._events = this._events.filter((event) => {\n if (event.tag !== eventTag || event.listener != listener) { return true; }\n if (found) { return true; }\n found = true;\n stopped.push(event);\n return false;\n });\n\n stopped.forEach((event) => { this._stopEvent(event); });\n\n return this;\n }\n\n removeAllListeners(eventName?: EventType): this {\n let stopped: Array = [ ];\n if (eventName == null) {\n stopped = this._events;\n\n this._events = [ ];\n } else {\n const eventTag = getEventTag(eventName);\n this._events = this._events.filter((event) => {\n if (event.tag !== eventTag) { return true; }\n stopped.push(event);\n return false;\n });\n }\n\n stopped.forEach((event) => { this._stopEvent(event); });\n\n return this;\n }\n}\n","\"use strict\";\n\n// See: https://github.com/ethereum/wiki/wiki/JSON-RPC\n\nimport { Provider, TransactionRequest, TransactionResponse } from \"@ethersproject/abstract-provider\";\nimport { Signer, TypedDataDomain, TypedDataField, TypedDataSigner } from \"@ethersproject/abstract-signer\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { Bytes, hexlify, hexValue } from \"@ethersproject/bytes\";\nimport { _TypedDataEncoder } from \"@ethersproject/hash\";\nimport { Network, Networkish } from \"@ethersproject/networks\";\nimport { checkProperties, deepCopy, Deferrable, defineReadOnly, getStatic, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nimport { ConnectionInfo, fetchJson, poll } from \"@ethersproject/web\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { BaseProvider, Event } from \"./base-provider\";\n\n\nconst errorGas = [ \"call\", \"estimateGas\" ];\n\nfunction checkError(method: string, error: any, params: any): never {\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 } else if (typeof(error.body) === \"string\") {\n message = error.body;\n } else if (typeof(error.responseText) === \"string\") {\n message = error.responseText;\n }\n message = (message || \"\").toLowerCase();\n\n const transaction = params.transaction || params.signedTransaction;\n\n // \"insufficient funds for gas * price + value + cost(data)\"\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\n // \"nonce too low\"\n if (message.match(/nonce too low/)) {\n logger.throwError(\"nonce has already been used\", Logger.errors.NONCE_EXPIRED, {\n error, method, transaction\n });\n }\n\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction underpriced/)) {\n logger.throwError(\"replacement fee too low\", Logger.errors.REPLACEMENT_UNDERPRICED, {\n error, method, transaction\n });\n }\n\n if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|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\n throw error;\n}\n\nfunction timer(timeout: number): Promise {\n return new Promise(function(resolve) {\n setTimeout(resolve, timeout);\n });\n}\n\nfunction getResult(payload: { error?: { code?: number, data?: any, message?: string }, result?: any }): any {\n if (payload.error) {\n // @TODO: not any\n const error: any = new Error(payload.error.message);\n error.code = payload.error.code;\n error.data = payload.error.data;\n throw error;\n }\n\n return payload.result;\n}\n\nfunction getLowerCase(value: string): string {\n if (value) { return value.toLowerCase(); }\n return value;\n}\n\nconst _constructorGuard = {};\n\nexport class JsonRpcSigner extends Signer implements TypedDataSigner {\n readonly provider: JsonRpcProvider;\n _index: number;\n _address: string;\n\n constructor(constructorGuard: any, provider: JsonRpcProvider, addressOrIndex?: string | number) {\n logger.checkNew(new.target, JsonRpcSigner);\n\n super();\n\n if (constructorGuard !== _constructorGuard) {\n throw new Error(\"do not call the JsonRpcSigner constructor directly; use provider.getSigner\");\n }\n\n defineReadOnly(this, \"provider\", provider);\n\n if (addressOrIndex == null) { 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\n connect(provider: Provider): JsonRpcSigner {\n return logger.throwError(\"cannot alter JSON-RPC Signer connection\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"connect\"\n });\n }\n\n connectUnchecked(): JsonRpcSigner {\n return new UncheckedJsonRpcSigner(_constructorGuard, this.provider, this._address || this._index);\n }\n\n getAddress(): Promise {\n if (this._address) {\n return Promise.resolve(this._address);\n }\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\n sendUncheckedTransaction(transaction: Deferrable): Promise {\n transaction = shallowCopy(transaction);\n\n const fromAddress = this.getAddress().then((address) => {\n if (address) { address = address.toLowerCase(); }\n return address;\n });\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\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 } else {\n tx.from = sender;\n }\n\n const hexTx = (this.provider.constructor).hexlifyTransaction(tx, { from: true });\n\n return this.provider.send(\"eth_sendTransaction\", [ hexTx ]).then((hash) => {\n return hash;\n }, (error) => {\n return checkError(\"sendTransaction\", error, hexTx);\n });\n });\n }\n\n signTransaction(transaction: Deferrable): Promise {\n return logger.throwError(\"signing transactions is unsupported\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"signTransaction\"\n });\n }\n\n sendTransaction(transaction: Deferrable): Promise {\n return this.sendUncheckedTransaction(transaction).then((hash) => {\n return poll(() => {\n return this.provider.getTransaction(hash).then((tx: TransactionResponse) => {\n if (tx === null) { return undefined; }\n return this.provider._wrapTransaction(tx, hash);\n });\n }, { onceBlock: this.provider }).catch((error: Error) => {\n (error).transactionHash = hash;\n throw error;\n });\n });\n }\n\n async signMessage(message: Bytes | string): Promise {\n const data = ((typeof(message) === \"string\") ? toUtf8Bytes(message): message);\n const address = await this.getAddress();\n\n // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign\n return await this.provider.send(\"eth_sign\", [ address.toLowerCase(), hexlify(data) ]);\n }\n\n async _signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise {\n // Populate any ENS names (in-place)\n const populated = await _TypedDataEncoder.resolveNames(domain, types, value, (name: string) => {\n return this.provider.resolveName(name);\n });\n\n const address = await this.getAddress();\n\n return await this.provider.send(\"eth_signTypedData_v4\", [\n address.toLowerCase(),\n JSON.stringify(_TypedDataEncoder.getPayload(populated.domain, types, populated.value))\n ]);\n }\n\n async unlock(password: string): Promise {\n const provider = this.provider;\n\n const address = await this.getAddress();\n\n return provider.send(\"personal_unlockAccount\", [ address.toLowerCase(), password, null ]);\n }\n}\n\nclass UncheckedJsonRpcSigner extends JsonRpcSigner {\n sendTransaction(transaction: Deferrable): Promise {\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?: number) => { return this.provider.waitForTransaction(hash, confirmations); }\n };\n });\n }\n}\n\nconst allowedTransactionKeys: { [ key: string ]: boolean } = {\n chainId: true, data: true, gasLimit: true, gasPrice:true, nonce: true, to: true, value: true\n}\n\nexport class JsonRpcProvider extends BaseProvider {\n readonly connection: ConnectionInfo;\n\n _pendingFilter: Promise;\n _nextId: number;\n\n constructor(url?: ConnectionInfo | string, network?: Networkish) {\n logger.checkNew(new.target, JsonRpcProvider);\n\n let networkOrReady: Networkish | Promise = network;\n\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\n super(networkOrReady);\n\n // Default URL\n if (!url) { url = getStatic<() => string>(this.constructor, \"defaultUrl\")(); }\n\n if (typeof(url) === \"string\") {\n defineReadOnly(this, \"connection\",Object.freeze({\n url: url\n }));\n } else {\n defineReadOnly(this, \"connection\", Object.freeze(shallowCopy(url)));\n }\n\n this._nextId = 42;\n }\n\n static defaultUrl(): string {\n return \"http:/\\/localhost:8545\";\n }\n\n async detectNetwork(): Promise {\n await timer(0);\n\n let chainId = null;\n try {\n chainId = await this.send(\"eth_chainId\", [ ]);\n } catch (error) {\n try {\n chainId = await this.send(\"net_version\", [ ]);\n } catch (error) { }\n }\n\n if (chainId != null) {\n const getNetwork = getStatic<(network: Networkish) => Network>(this.constructor, \"getNetwork\");\n try {\n return getNetwork(BigNumber.from(chainId).toNumber());\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\n return logger.throwError(\"could not detect network\", Logger.errors.NETWORK_ERROR, {\n event: \"noNetwork\"\n });\n }\n\n getSigner(addressOrIndex?: string | number): JsonRpcSigner {\n return new JsonRpcSigner(_constructorGuard, this, addressOrIndex);\n }\n\n getUncheckedSigner(addressOrIndex?: string | number): UncheckedJsonRpcSigner {\n return this.getSigner(addressOrIndex).connectUnchecked();\n }\n\n listAccounts(): Promise> {\n return this.send(\"eth_accounts\", []).then((accounts: Array) => {\n return accounts.map((a) => this.formatter.address(a));\n });\n }\n\n send(method: string, params: Array): Promise {\n const request = {\n method: method,\n params: params,\n id: (this._nextId++),\n jsonrpc: \"2.0\"\n };\n\n this.emit(\"debug\", {\n action: \"request\",\n request: deepCopy(request),\n provider: this\n });\n\n return 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\n return result;\n\n }, (error) => {\n this.emit(\"debug\", {\n action: \"response\",\n error: error,\n request: request,\n provider: this\n });\n\n throw error;\n });\n }\n\n prepareRequest(method: string, params: any): [ string, Array ] {\n switch (method) {\n case \"getBlockNumber\":\n return [ \"eth_blockNumber\", [] ];\n\n case \"getGasPrice\":\n return [ \"eth_gasPrice\", [] ];\n\n case \"getBalance\":\n return [ \"eth_getBalance\", [ getLowerCase(params.address), params.blockTag ] ];\n\n case \"getTransactionCount\":\n return [ \"eth_getTransactionCount\", [ getLowerCase(params.address), params.blockTag ] ];\n\n case \"getCode\":\n return [ \"eth_getCode\", [ getLowerCase(params.address), params.blockTag ] ];\n\n case \"getStorageAt\":\n return [ \"eth_getStorageAt\", [ getLowerCase(params.address), params.position, params.blockTag ] ];\n\n case \"sendTransaction\":\n return [ \"eth_sendRawTransaction\", [ params.signedTransaction ] ]\n\n case \"getBlock\":\n if (params.blockTag) {\n return [ \"eth_getBlockByNumber\", [ params.blockTag, !!params.includeTransactions ] ];\n } else if (params.blockHash) {\n return [ \"eth_getBlockByHash\", [ params.blockHash, !!params.includeTransactions ] ];\n }\n return null;\n\n case \"getTransaction\":\n return [ \"eth_getTransactionByHash\", [ params.transactionHash ] ];\n\n case \"getTransactionReceipt\":\n return [ \"eth_getTransactionReceipt\", [ params.transactionHash ] ];\n\n case \"call\": {\n const hexlifyTransaction = getStatic<(t: TransactionRequest, a?: { [key: string]: boolean }) => { [key: string]: string }>(this.constructor, \"hexlifyTransaction\");\n return [ \"eth_call\", [ hexlifyTransaction(params.transaction, { from: true }), params.blockTag ] ];\n }\n\n case \"estimateGas\": {\n const hexlifyTransaction = getStatic<(t: TransactionRequest, a?: { [key: string]: boolean }) => { [key: string]: string }>(this.constructor, \"hexlifyTransaction\");\n return [ \"eth_estimateGas\", [ hexlifyTransaction(params.transaction, { from: true }) ] ];\n }\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\n default:\n break;\n }\n\n return null;\n }\n\n async perform(method: string, params: any): Promise {\n const args = this.prepareRequest(method, params);\n\n if (args == null) {\n logger.throwError(method + \" not implemented\", Logger.errors.NOT_IMPLEMENTED, { operation: method });\n }\n\n try {\n return await this.send(args[0], args[1])\n } catch (error) {\n return checkError(method, error, params);\n }\n }\n\n _startEvent(event: Event): void {\n if (event.tag === \"pending\") { this._startPending(); }\n super._startEvent(event);\n }\n\n _startPending(): void {\n if (this._pendingFilter != null) { return; }\n const self = this;\n\n const pendingFilter: Promise = this.send(\"eth_newPendingTransactionFilter\", []);\n this._pendingFilter = pendingFilter;\n\n pendingFilter.then(function(filterId) {\n function poll() {\n self.send(\"eth_getFilterChanges\", [ filterId ]).then(function(hashes: Array) {\n if (self._pendingFilter != pendingFilter) { 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\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\n return null;\n }).catch((error: Error) => { });\n }\n poll();\n\n return filterId;\n }).catch((error: Error) => { });\n }\n\n _stopEvent(event: Event): void {\n if (event.tag === \"pending\" && this.listenerCount(\"pending\") === 0) {\n this._pendingFilter = null;\n }\n super._stopEvent(event);\n }\n\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: TransactionRequest, allowExtra?: { [key: string]: boolean }): { [key: string]: string } {\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]) { allowed[key] = true; }\n }\n }\n checkProperties(transaction, allowed);\n\n const result: { [key: string]: string } = {};\n\n // Some nodes (INFURA ropsten; INFURA mainnet is fine) do not like leading zeros.\n [\"gasLimit\", \"gasPrice\", \"nonce\", \"value\"].forEach(function(key) {\n if ((transaction)[key] == null) { return; }\n const value = hexValue((transaction)[key]);\n if (key === \"gasLimit\") { key = \"gas\"; }\n result[key] = value;\n });\n\n [\"from\", \"to\", \"data\"].forEach(function(key) {\n if ((transaction)[key] == null) { return; }\n result[key] = hexlify((transaction)[key]);\n });\n\n return result;\n }\n}\n","\"use strict\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\n\nlet WS: any = null;\n\ntry {\n WS = (WebSocket as any);\n if (WS == null) { throw new Error(\"inject please\"); }\n} catch (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","\"use strict\";\n\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { Network, Networkish } from \"@ethersproject/networks\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\n\nimport { Event } from \"./base-provider\";\nimport { JsonRpcProvider } from \"./json-rpc-provider\";\nimport { WebSocket } from \"./ws\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\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 indicats\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 */\n\nlet NextId = 1;\n\nexport type InflightRequest = {\n callback: (error: Error, result: any) => void;\n payload: string;\n};\n\nexport type Subscription = {\n tag: string;\n processFunc: (payload: any) => void;\n};\n\n\n// For more info about the Real-time Event API see:\n// https://geth.ethereum.org/docs/rpc/pubsub\n\nexport class WebSocketProvider extends JsonRpcProvider {\n readonly _websocket: any;\n readonly _requests: { [ name: string ]: InflightRequest };\n readonly _detectNetwork: Promise;\n\n // Maps event tag to subscription ID (we dedupe identical events)\n readonly _subIds: { [ tag: string ]: Promise };\n\n // Maps Subscription ID to Subscription\n readonly _subs: { [ name: string ]: Subscription };\n\n _wsReady: boolean;\n\n constructor(url: string, network?: Networkish) {\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\n super(url, network);\n this._pollingInterval = -1;\n\n this._wsReady = false;\n\n defineReadOnly(this, \"_websocket\", new WebSocket(this.connection.url));\n defineReadOnly(this, \"_requests\", { });\n defineReadOnly(this, \"_subs\", { });\n defineReadOnly(this, \"_subIds\", { });\n defineReadOnly(this, \"_detectNetwork\", super.detectNetwork());\n\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\n this._websocket.onmessage = (messageEvent: { data: string }) => {\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\n if (result.result !== undefined) {\n request.callback(null, result.result);\n\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: 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 } else {\n error = new Error(\"unknown error\");\n }\n\n request.callback(error, undefined);\n\n this.emit(\"debug\", {\n action: \"response\",\n error: error,\n request: JSON.parse(request.payload),\n provider: this\n });\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\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) { fauxPoll.unref(); }\n }\n\n detectNetwork(): Promise {\n return this._detectNetwork;\n }\n\n get pollingInterval(): number {\n return 0;\n }\n\n resetEventsBlock(blockNumber: number): void {\n logger.throwError(\"cannot reset events block on WebSocketProvider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"resetEventBlock\"\n });\n }\n\n set pollingInterval(value: number) {\n logger.throwError(\"cannot set polling interval on WebSocketProvider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setPollingInterval\"\n });\n }\n\n async poll(): Promise {\n return null;\n }\n\n set polling(value: boolean) {\n if (!value) { return; }\n\n logger.throwError(\"cannot set polling on WebSocketProvider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setPolling\"\n });\n }\n\n send(method: string, params?: Array): Promise {\n const rid = NextId++;\n\n return new Promise((resolve, reject) => {\n function callback(error: Error, result: any) {\n if (error) { return reject(error); }\n return resolve(result);\n }\n\n const payload = JSON.stringify({\n method: method,\n params: params,\n id: rid,\n jsonrpc: \"2.0\"\n });\n\n this.emit(\"debug\", {\n action: \"request\",\n request: JSON.parse(payload),\n provider: this\n });\n\n this._requests[String(rid)] = { callback, payload };\n\n if (this._wsReady) { this._websocket.send(payload); }\n });\n }\n\n static defaultUrl(): string {\n return \"ws:/\\/localhost:8546\";\n }\n\n async _subscribe(tag: string, param: Array, processFunc: (result: any) => void): Promise {\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 = await subIdPromise;\n this._subs[subId] = { tag, processFunc };\n }\n\n _startEvent(event: Event): void {\n switch (event.type) {\n case \"block\":\n this._subscribe(\"block\", [ \"newHeads\" ], (result: any) => {\n const blockNumber = BigNumber.from(result.number).toNumber();\n this._emitted.block = blockNumber;\n this.emit(\"block\", blockNumber);\n });\n break;\n\n case \"pending\":\n this._subscribe(\"pending\", [ \"newPendingTransactions\" ], (result: any) => {\n this.emit(\"pending\", result);\n });\n break;\n\n case \"filter\":\n this._subscribe(event.tag, [ \"logs\", this._getFilter(event.filter) ], (result: any) => {\n if (result.removed == null) { result.removed = false; }\n this.emit(event.filter, this.formatter.filterLog(result));\n });\n break;\n\n case \"tx\": {\n const emitReceipt = (event: Event) => {\n const hash = event.hash;\n this.getTransactionReceipt(hash).then((receipt) => {\n if (!receipt) { return; }\n this.emit(hash, receipt);\n });\n };\n\n // In case it is already mined\n emitReceipt(event);\n\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: any) => {\n this._events.filter((e) => (e.type === \"tx\")).forEach(emitReceipt);\n });\n break;\n }\n\n // Nothing is needed\n case \"debug\":\n case \"poll\":\n case \"willPoll\":\n case \"didPoll\":\n case \"error\":\n break;\n\n default:\n console.log(\"unhandled:\", event);\n break;\n }\n }\n\n _stopEvent(event: Event): void {\n let tag = event.tag;\n\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 } else if (this.listenerCount(event.event)) {\n // There are remaining event listeners\n return;\n }\n\n const subId = this._subIds[tag];\n if (!subId) { return; }\n\n delete this._subIds[tag];\n subId.then((subId) => {\n if (!this._subs[subId]) { return; }\n delete this._subs[subId];\n this.send(\"eth_unsubscribe\", [ subId ]);\n });\n }\n\n async destroy(): Promise {\n // Wait until we have connected before trying to disconnect\n if (this._websocket.readyState === WebSocket.CONNECTING) {\n await (new Promise((resolve) => {\n this._websocket.onopen = function() {\n resolve(true);\n };\n\n this._websocket.onerror = function() {\n resolve(false);\n };\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\"use strict\";\n\nimport { Network, Networkish } from \"@ethersproject/networks\";\nimport { defineReadOnly, getStatic } from \"@ethersproject/properties\";\nimport { ConnectionInfo } from \"@ethersproject/web\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { CommunityResourcable } from \"./formatter\";\nimport { JsonRpcProvider, JsonRpcSigner } from \"./json-rpc-provider\";\n\ntype getUrlFunc = (network: Network, apiKey: string) => string | ConnectionInfo;\n\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 async detectNetwork(): Promise {\n let network = this.network;\n if (network == null) {\n network = await super.detectNetwork();\n\n if (!network) {\n logger.throwError(\"no network detected\", Logger.errors.UNKNOWN_ERROR, { });\n }\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\n this.emit(\"network\", network, null);\n }\n }\n return network;\n }\n}\n\nexport abstract class UrlJsonRpcProvider extends StaticJsonRpcProvider implements CommunityResourcable {\n readonly apiKey: any;\n\n constructor(network?: Networkish, apiKey?: any) {\n logger.checkAbstract(new.target, UrlJsonRpcProvider);\n\n // Normalize the Network and API Key\n network = getStatic<(network: Networkish) => Network>(new.target, \"getNetwork\")(network);\n apiKey = getStatic<(apiKey: string) => string>(new.target, \"getApiKey\")(apiKey);\n\n const connection = getStatic(new.target, \"getUrl\")(network, apiKey);\n\n super(connection, network);\n\n if (typeof(apiKey) === \"string\") {\n defineReadOnly(this, \"apiKey\", apiKey);\n } else if (apiKey != null) {\n Object.keys(apiKey).forEach((key) => {\n defineReadOnly(this, key, apiKey[key]);\n });\n }\n }\n\n _startPending(): void {\n logger.warn(\"WARNING: API provider does not support pending filters\");\n }\n\n isCommunityResource(): boolean {\n return false;\n }\n\n getSigner(address?: string): JsonRpcSigner {\n return logger.throwError(\n \"API provider does not support signing\",\n Logger.errors.UNSUPPORTED_OPERATION,\n { operation: \"getSigner\" }\n );\n }\n\n listAccounts(): Promise> {\n return Promise.resolve([]);\n }\n\n // Return a defaultApiKey if null, otherwise validate the API key\n static getApiKey(apiKey: any): any {\n return apiKey;\n }\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: Network, apiKey: any): string | ConnectionInfo {\n return logger.throwError(\"not implemented; sub-classes must override getUrl\", Logger.errors.NOT_IMPLEMENTED, {\n operation: \"getUrl\"\n });\n }\n}\n","\"use strict\";\n\nimport { Network, Networkish } from \"@ethersproject/networks\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { ConnectionInfo } from \"@ethersproject/web\";\n\nimport { CommunityResourcable, showThrottleMessage } from \"./formatter\";\nimport { WebSocketProvider } from \"./websocket-provider\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\n\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\n\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\"\n\nexport class AlchemyWebSocketProvider extends WebSocketProvider implements CommunityResourcable {\n readonly apiKey: string;\n\n constructor(network?: Networkish, apiKey?: any) {\n const provider = new AlchemyProvider(network, apiKey);\n\n const url = provider.connection.url.replace(/^http/i, \"ws\")\n .replace(\".alchemyapi.\", \".ws.alchemyapi.\");\n\n super(url, provider.network);\n defineReadOnly(this, \"apiKey\", provider.apiKey);\n }\n\n isCommunityResource(): boolean {\n return (this.apiKey === defaultApiKey);\n }\n}\n\nexport class AlchemyProvider extends UrlJsonRpcProvider {\n\n static getWebSocketProvider(network?: Networkish, apiKey?: any): AlchemyWebSocketProvider {\n return new AlchemyWebSocketProvider(network, apiKey);\n }\n\n static getApiKey(apiKey: any): any {\n if (apiKey == null) { return defaultApiKey; }\n if (apiKey && typeof(apiKey) !== \"string\") {\n logger.throwArgumentError(\"invalid apiKey\", \"apiKey\", apiKey);\n }\n return apiKey;\n }\n\n static getUrl(network: Network, apiKey: string): ConnectionInfo {\n let host = null;\n switch (network.name) {\n case \"homestead\":\n host = \"eth-mainnet.alchemyapi.io/v2/\";\n break;\n case \"ropsten\":\n host = \"eth-ropsten.alchemyapi.io/v2/\";\n break;\n case \"rinkeby\":\n host = \"eth-rinkeby.alchemyapi.io/v2/\";\n break;\n case \"goerli\":\n host = \"eth-goerli.alchemyapi.io/v2/\";\n break;\n case \"kovan\":\n host = \"eth-kovan.alchemyapi.io/v2/\";\n break;\n default:\n logger.throwArgumentError(\"unsupported network\", \"network\", arguments[0]);\n }\n\n return {\n allowGzip: true,\n url: (\"https:/\" + \"/\" + host + apiKey),\n throttleCallback: (attempt: number, url: string) => {\n if (apiKey === defaultApiKey) {\n showThrottleMessage();\n }\n return Promise.resolve(true);\n }\n };\n }\n\n isCommunityResource(): boolean {\n return (this.apiKey === defaultApiKey);\n }\n}\n","\"use strict\";\n\nimport { Network } from \"@ethersproject/networks\";\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nexport class CloudflareProvider extends UrlJsonRpcProvider {\n\n static getApiKey(apiKey: any): any {\n if (apiKey != null) {\n logger.throwArgumentError(\"apiKey not supported for cloudflare\", \"apiKey\", apiKey);\n }\n return null;\n }\n\n static getUrl(network: Network, apiKey?: any): string {\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\n return host;\n }\n\n async perform(method: string, params: any): Promise {\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 = await super.perform(\"getBlock\", { blockTag: \"latest\" });\n return block.number;\n }\n\n return super.perform(method, params);\n }\n}\n","\"use strict\";\n\nimport { BlockTag, TransactionRequest, TransactionResponse } from \"@ethersproject/abstract-provider\";\nimport { hexlify, hexValue } from \"@ethersproject/bytes\";\nimport { Network, Networkish } from \"@ethersproject/networks\";\nimport { deepCopy, defineReadOnly } from \"@ethersproject/properties\";\nimport { ConnectionInfo, fetchJson } from \"@ethersproject/web\";\n\nimport { showThrottleMessage } from \"./formatter\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { BaseProvider } from \"./base-provider\";\n\n\n// The transaction has already been sanitized by the calls in Provider\nfunction getTransactionPostData(transaction: TransactionRequest): Record {\n const result: Record = { };\n for (let key in transaction) {\n if ((transaction)[key] == null) { continue; }\n let value = hexlify((transaction)[key]);\n // Quantity-types require no leading zero, unless 0\n if (({ gasLimit: true, gasPrice: true, nonce: true, value: true })[key]) {\n value = hexValue(value);\n }\n result[key] = value;\n }\n return result;\n}\n\nfunction getResult(result: { status?: number, message?: string, result?: any }): any {\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\n if (result.status != 1 || result.message != \"OK\") {\n const error: any = 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\n return result.result;\n}\n\nfunction getJsonResult(result: { jsonrpc: string, result?: any, error?: { code?: number, data?: any, message?: string} } ): any {\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: any = new Error(\"throttled response\");\n error.result = JSON.stringify(result);\n error.throttleRetry = true;\n throw error;\n }\n\n if (result.jsonrpc != \"2.0\") {\n // @TODO: not any\n const error: any = new Error(\"invalid response\");\n error.result = JSON.stringify(result);\n throw error;\n }\n\n if (result.error) {\n // @TODO: not any\n const error: any = new Error(result.error.message || \"unknown error\");\n if (result.error.code) { error.code = result.error.code; }\n if (result.error.data) { error.data = result.error.data; }\n throw error;\n }\n\n return result.result;\n}\n\n// The blockTag was normalized as a string by the Provider pre-perform operations\nfunction checkLogTag(blockTag: string): number | \"latest\" {\n if (blockTag === \"pending\") { throw new Error(\"pending not supported\"); }\n if (blockTag === \"latest\") { return blockTag; }\n\n return parseInt(blockTag.substring(2), 16);\n}\n\n\nconst defaultApiKey = \"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB\";\n\nfunction checkError(method: string, error: any, transaction: any): never {\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 } else if (typeof(error.body) === \"string\") {\n message = error.body;\n } else if (typeof(error.responseText) === \"string\") {\n message = error.responseText;\n }\n }\n message = (message || \"\").toLowerCase();\n\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\n // \"Transaction with the same hash was already imported.\"\n if (message.match(/same hash was already imported|transaction nonce is too low/)) {\n logger.throwError(\"nonce has already been used\", Logger.errors.NONCE_EXPIRED, {\n error, method, transaction\n });\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\n if (message.match(/execution failed due to an exception/)) {\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\n throw error;\n}\n\nexport class EtherscanProvider extends BaseProvider{\n readonly baseUrl: string;\n readonly apiKey: string;\n\n constructor(network?: Networkish, apiKey?: string) {\n logger.checkNew(new.target, EtherscanProvider);\n\n super(network);\n\n let name = \"invalid\";\n if (this.network) { name = this.network.name; }\n\n let baseUrl = null;\n switch(name) {\n case \"homestead\":\n baseUrl = \"https://api.etherscan.io\";\n break;\n case \"ropsten\":\n baseUrl = \"https://api-ropsten.etherscan.io\";\n break;\n case \"rinkeby\":\n baseUrl = \"https://api-rinkeby.etherscan.io\";\n break;\n case \"kovan\":\n baseUrl = \"https://api-kovan.etherscan.io\";\n break;\n case \"goerli\":\n baseUrl = \"https://api-goerli.etherscan.io\";\n break;\n default:\n throw new Error(\"unsupported network\");\n }\n\n defineReadOnly(this, \"baseUrl\", baseUrl);\n defineReadOnly(this, \"apiKey\", apiKey || defaultApiKey);\n }\n\n async detectNetwork(): Promise {\n return this.network;\n }\n\n async perform(method: string, params: any): Promise {\n let url = this.baseUrl + \"/api\";\n\n let apiKey = \"\";\n if (this.apiKey) { apiKey += \"&apikey=\" + this.apiKey; }\n\n const get = async (url: string, payload: Record, procFunc?: (value: any) => any): Promise => {\n this.emit(\"debug\", {\n action: \"request\",\n request: url,\n provider: this\n });\n\n\n const connection: ConnectionInfo = {\n url: url,\n throttleSlotInterval: 1000,\n throttleCallback: (attempt: number, url: string) => {\n if (this.isCommunityResource()) {\n showThrottleMessage();\n }\n return Promise.resolve(true);\n }\n };\n\n let payloadStr: string = 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\n const result = await fetchJson(connection, payloadStr, procFunc || getJsonResult);\n\n this.emit(\"debug\", {\n action: \"response\",\n request: url,\n response: deepCopy(result),\n provider: this\n });\n\n return result;\n };\n\n switch (method) {\n case \"getBlockNumber\":\n url += \"?module=proxy&action=eth_blockNumber\" + apiKey;\n return get(url, null);\n\n case \"getGasPrice\":\n url += \"?module=proxy&action=eth_gasPrice\" + apiKey;\n return get(url, null);\n\n case \"getBalance\":\n // Returns base-10 result\n url += \"?module=account&action=balance&address=\" + params.address;\n url += \"&tag=\" + params.blockTag + apiKey;\n return get(url, null, getResult);\n\n case \"getTransactionCount\":\n url += \"?module=proxy&action=eth_getTransactionCount&address=\" + params.address;\n url += \"&tag=\" + params.blockTag + apiKey;\n return get(url, null);\n\n\n case \"getCode\":\n url += \"?module=proxy&action=eth_getCode&address=\" + params.address;\n url += \"&tag=\" + params.blockTag + apiKey;\n return get(url, null);\n\n case \"getStorageAt\":\n url += \"?module=proxy&action=eth_getStorageAt&address=\" + params.address;\n url += \"&position=\" + params.position;\n url += \"&tag=\" + params.blockTag + apiKey;\n return get(url, null);\n\n\n case \"sendTransaction\":\n return get(url, {\n module: \"proxy\",\n action: \"eth_sendRawTransaction\",\n hex: params.signedTransaction,\n apikey: this.apiKey\n }).catch((error) => {\n return checkError(\"sendTransaction\", error, params.signedTransaction);\n });\n\n case \"getBlock\":\n if (params.blockTag) {\n url += \"?module=proxy&action=eth_getBlockByNumber&tag=\" + params.blockTag;\n if (params.includeTransactions) {\n url += \"&boolean=true\";\n } else {\n url += \"&boolean=false\";\n }\n url += apiKey;\n return get(url, null);\n }\n throw new Error(\"getBlock by blockHash not implemented\");\n\n case \"getTransaction\":\n url += \"?module=proxy&action=eth_getTransactionByHash&txhash=\" + params.transactionHash;\n url += apiKey;\n return get(url, null);\n\n case \"getTransactionReceipt\":\n url += \"?module=proxy&action=eth_getTransactionReceipt&txhash=\" + params.transactionHash;\n url += apiKey;\n return get(url, null);\n\n\n case \"call\": {\n if (params.blockTag !== \"latest\") {\n throw new Error(\"EtherscanProvider does not support blockTag for call\");\n }\n\n const postData = getTransactionPostData(params.transaction);\n postData.module = \"proxy\";\n postData.action = \"eth_call\";\n postData.apikey = this.apiKey;\n\n try {\n return await get(url, postData);\n } catch (error) {\n return checkError(\"call\", error, params.transaction);\n }\n }\n\n case \"estimateGas\": {\n const postData = getTransactionPostData(params.transaction);\n postData.module = \"proxy\";\n postData.action = \"eth_estimateGas\";\n postData.apikey = this.apiKey;\n\n try {\n return await get(url, postData);\n } catch (error) {\n return checkError(\"estimateGas\", error, params.transaction);\n }\n }\n\n case \"getLogs\": {\n url += \"?module=logs&action=getLogs\";\n\n if (params.filter.fromBlock) {\n url += \"&fromBlock=\" + checkLogTag(params.filter.fromBlock);\n }\n\n if (params.filter.toBlock) {\n url += \"&toBlock=\" + checkLogTag(params.filter.toBlock);\n }\n\n if (params.filter.address) {\n url += \"&address=\" + params.filter.address;\n }\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\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 url += \"&topic0=\" + topic0;\n }\n }\n\n url += apiKey;\n\n const logs: Array = await get(url, null, getResult);\n\n // Cache txHash => blockHash\n let blocks: { [tag: string]: string } = {};\n\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) { continue; }\n if (blocks[log.blockNumber] == null) {\n const block = await this.getBlock(log.blockNumber);\n if (block) {\n blocks[log.blockNumber] = block.hash;\n }\n }\n log.blockHash = blocks[log.blockNumber];\n }\n\n return logs;\n }\n\n case \"getEtherPrice\":\n if (this.network.name !== \"homestead\") { return 0.0; }\n url += \"?module=stats&action=ethprice\";\n url += apiKey;\n return parseFloat((await get(url, null, getResult)).ethusd);\n\n default:\n break;\n }\n\n return super.perform(method, params);\n }\n\n // @TODO: Allow startBlock and endBlock to be Promises\n getHistory(addressOrName: string | Promise, startBlock?: BlockTag, endBlock?: BlockTag): Promise> {\n\n let url = this.baseUrl;\n\n let apiKey = \"\";\n if (this.apiKey) { apiKey += \"&apikey=\" + this.apiKey; }\n\n if (startBlock == null) { startBlock = 0; }\n if (endBlock == null) { endBlock = 99999999; }\n\n return this.resolveName(addressOrName).then((address) => {\n url += \"/api?module=account&action=txlist&address=\" + address;\n url += \"&startblock=\" + startBlock;\n url += \"&endblock=\" + endBlock;\n url += \"&sort=asc\" + apiKey;\n\n this.emit(\"debug\", {\n action: \"request\",\n request: url,\n provider: this\n });\n\n const connection = {\n url: url,\n throttleSlotInterval: 1000,\n throttleCallback: (attempt: number, url: string) => {\n if (this.apiKey === defaultApiKey) {\n showThrottleMessage();\n }\n return Promise.resolve(true);\n }\n }\n\n return fetchJson(connection, null, getResult).then((result: Array) => {\n this.emit(\"debug\", {\n action: \"response\",\n request: url,\n response: deepCopy(result),\n provider: this\n });\n\n let output: Array = [];\n result.forEach((tx) => {\n [\"contractAddress\", \"to\"].forEach(function(key) {\n if (tx[key] == \"\") { delete tx[key]; }\n });\n if (tx.creates == null && tx.contractAddress != null) {\n tx.creates = tx.contractAddress;\n }\n let item = this.formatter.transactionResponse(tx);\n if (tx.timeStamp) { item.timestamp = parseInt(tx.timeStamp); }\n output.push(item);\n });\n return output;\n });\n });\n }\n\n isCommunityResource(): boolean {\n return (this.apiKey === defaultApiKey);\n }\n}\n","\"use strict\";\n\nimport { Block, BlockWithTransactions, Provider } from \"@ethersproject/abstract-provider\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { isHexString } from \"@ethersproject/bytes\";\nimport { Network } from \"@ethersproject/networks\";\nimport { deepCopy, defineReadOnly, shallowCopy } from \"@ethersproject/properties\";\nimport { shuffled } from \"@ethersproject/random\";\nimport { poll } from \"@ethersproject/web\";\n\nimport { BaseProvider } from \"./base-provider\";\nimport { isCommunityResource } from \"./formatter\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nfunction now() { return (new Date()).getTime(); }\n\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: Array): Network {\n let result = null;\n\n for (let i = 0; i < networks.length; i++) {\n const network = networks[i];\n\n // Null! We do not know our network; bail.\n if (network == null) { 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\n logger.throwArgumentError(\"provider mismatch\", \"networks\", networks);\n }\n } else {\n result = network;\n }\n }\n\n return result;\n}\n\nfunction median(values: Array, maxDelta?: number): number {\n values = values.slice().sort();\n const middle = Math.floor(values.length / 2);\n\n // Odd length; take the middle\n if (values.length % 2) {\n return values[middle];\n }\n\n // Even length; take the average of the two middle\n const a = values[middle - 1], b = values[middle];\n\n if (maxDelta != null && Math.abs(a - b) > maxDelta) {\n return null;\n }\n\n return (a + b) / 2;\n}\n\nfunction serialize(value: any): string {\n if (value === null) {\n return \"null\";\n } else if (typeof(value) === \"number\" || typeof(value) === \"boolean\") {\n return JSON.stringify(value);\n } else if (typeof(value) === \"string\") {\n return value;\n } else if (BigNumber.isBigNumber(value)) {\n return value.toString();\n } else if (Array.isArray(value)) {\n return JSON.stringify(value.map((i) => serialize(i)));\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 } else {\n v = serialize(v);\n }\n return JSON.stringify(key) + \":\" + v;\n }).join(\",\") + \"}\";\n }\n\n throw new Error(\"unknown value type: \" + typeof(value));\n}\n\n// Next request ID to use for emitting debug info\nlet nextRid = 1;\n\n\nexport interface FallbackProviderConfig {\n // The Provider\n provider: Provider;\n\n // The priority to favour this Provider; higher values are used first\n priority?: number;\n\n // Timeout before also triggering the next provider; this does not stop\n // this provider and if its result comes back before a quorum is reached\n // it will be incorporated into the vote\n // - lower values will cause more network traffic but may result in a\n // faster retult.\n stallTimeout?: number;\n\n // How much this provider contributes to the quorum; sometimes a specific\n // provider may be more reliable or trustworthy than others, but usually\n // this should be left as the default\n weight?: number;\n};\n\n// A Staller is used to provide a delay to give a Provider a chance to response\n// before asking the next Provider to try.\ntype Staller = {\n wait: (func: () => void) => Promise\n getPromise: () => Promise,\n cancel: () => void\n};\n\nfunction stall(duration: number): Staller {\n let cancel: () => void = null;\n\n let timer: NodeJS.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\n const wait = (func: () => void) => {\n promise = promise.then(func);\n return promise;\n }\n\n function getPromise(): Promise {\n return promise;\n }\n\n return { cancel, getPromise, wait };\n}\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];\n\nconst ForwardProperties = [\n \"address\",\n \"args\",\n \"errorArgs\",\n \"errorSignature\",\n \"method\",\n \"transaction\",\n];\n\n\n// @TODO: Make this an object with staller and cancel built-in\ninterface RunningConfig extends FallbackProviderConfig {\n start?: number;\n done?: boolean;\n cancelled?: boolean;\n runner?: Promise;\n staller?: Staller;\n result?: any;\n error?: Error;\n};\n\nfunction exposeDebugConfig(config: RunningConfig, now?: number): any {\n const result: any = {\n weight: config.weight\n };\n Object.defineProperty(result, \"provider\", { get: () => config.provider });\n if (config.start) { result.start = config.start; }\n if (now) { result.duration = (now - config.start); }\n if (config.done) {\n if (config.error) {\n result.error = config.error;\n } else {\n result.result = config.result || null;\n }\n }\n return result;\n}\n\nfunction normalizedTally(normalize: (value: any) => string, quorum: number): (configs: Array) => any {\n return function(configs: Array): any {\n\n // Count the votes for each result\n const tally: { [ key: string]: { count: number, result: any } } = { };\n configs.forEach((c) => {\n const value = normalize(c.result);\n if (!tally[value]) { tally[value] = { count: 0, result: c.result }; }\n tally[value].count++;\n });\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\n // No quroum\n return undefined;\n }\n}\nfunction getProcessFunc(provider: FallbackProvider, method: string, params: { [ key: string ]: any }): (configs: Array) => any {\n\n let normalize = serialize;\n\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: Array): number {\n const values = configs.map((c) => c.result);\n\n // Get the median block number\n let blockNumber = median(configs.map((c) => c.result), 2);\n if (blockNumber == null) { return undefined; }\n\n blockNumber = Math.ceil(blockNumber);\n\n // If the next block height is present, its prolly safe to use\n if (values.indexOf(blockNumber + 1) >= 0) { blockNumber++; }\n\n // Don't ever roll back the blockNumber\n if (blockNumber >= provider._highestBlockNumber) {\n provider._highestBlockNumber = blockNumber;\n }\n\n return provider._highestBlockNumber;\n };\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: Array): BigNumber {\n const values = configs.map((c) => c.result);\n values.sort();\n return values[Math.floor(values.length / 2)];\n }\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: Array): number {\n return median(configs.map((c) => c.result));\n }\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\n // We drop the confirmations from transactions as it is approximate\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n normalize = function(tx: any): string {\n if (tx == null) { return null; }\n\n tx = shallowCopy(tx);\n tx.confirmations = -1;\n return serialize(tx);\n }\n break;\n\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: BlockWithTransactions): string {\n if (block == null) { 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 } else {\n normalize = function(block: Block): string {\n if (block == null) { return null; }\n return serialize(block);\n }\n }\n break;\n\n default:\n throw new Error(\"unknown method: \" + method);\n }\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}\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.\nasync function waitForSync(config: RunningConfig, blockNumber: number): Promise {\n const provider = (config.provider);\n\n if ((provider.blockNumber != null && provider.blockNumber >= blockNumber) || blockNumber === -1) {\n return provider;\n }\n\n return poll(() => {\n return new Promise((resolve, reject) => {\n setTimeout(function() {\n\n // We are synced\n if (provider.blockNumber >= blockNumber) { return resolve(provider); }\n\n // We're done; just quit\n if (config.cancelled) { return resolve(null); }\n\n // Try again, next block\n return resolve(undefined);\n }, 0);\n });\n }, { oncePoll: provider });\n}\n\nasync function getRunner(config: RunningConfig, currentBlockNumber: number, method: string, params: { [ key: string]: any }): Promise {\n let provider = config.provider;\n\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 = await 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 = await 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 = await 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 = await waitForSync(config, currentBlockNumber)\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 = await waitForSync(config, currentBlockNumber)\n }\n return provider.getLogs(filter);\n }\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 readonly providerConfigs: ReadonlyArray;\n readonly quorum: number;\n\n // Due to the highly asyncronous nature of the blockchain, we need\n // to make sure we never unroll the blockNumber due to our random\n // sample of backends\n _highestBlockNumber: number;\n\n constructor(providers: Array, quorum?: number) {\n logger.checkNew(new.target, FallbackProvider);\n\n if (providers.length === 0) {\n logger.throwArgumentError(\"missing providers\", \"providers\", providers);\n }\n\n const providerConfigs: Array = 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\n const config: FallbackProviderConfig = shallowCopy(configOrProvider);\n\n if (config.priority == null) { config.priority = 1; }\n if (config.stallTimeout == null) {\n config.stallTimeout = isCommunityResource(configOrProvider) ? 2000: 750;\n }\n if (config.weight == null) { 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\n return Object.freeze(config);\n });\n\n const total = providerConfigs.reduce((accum, c) => (accum + c.weight), 0);\n\n if (quorum == null) {\n quorum = total / 2;\n } else if (quorum > total) {\n logger.throwArgumentError(\"quorum will always fail; larger than total weight\", \"quorum\", quorum);\n }\n\n // Are all providers' networks are known\n let networkOrReady: Network | Promise = checkNetworks(providerConfigs.map((c) => ((c.provider)).network));\n\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\n super(networkOrReady);\n\n // Preserve a copy, so we do not get mutated\n defineReadOnly(this, \"providerConfigs\", Object.freeze(providerConfigs));\n defineReadOnly(this, \"quorum\", quorum);\n\n this._highestBlockNumber = -1;\n }\n\n async detectNetwork(): Promise {\n const networks = await Promise.all(this.providerConfigs.map((c) => c.provider.getNetwork()));\n return checkNetworks(networks);\n }\n\n async perform(method: string, params: { [name: string]: any }): Promise {\n // Sending transactions is special; always broadcast it to all backends\n if (method === \"sendTransaction\") {\n const results: Array = await 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\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\") { return result; }\n }\n\n // They were all an error; pick the first error\n throw results[0];\n }\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 await this.getBlockNumber();\n }\n\n const processFunc = getProcessFunc(this, method, params);\n\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: Array = shuffled(this.providerConfigs.map(shallowCopy));\n configs.sort((a, b) => (a.priority - b.priority));\n\n const currentBlockNumber = this._highestBlockNumber;\n\n let i = 0;\n let first = true;\n while (true) {\n const t0 = now();\n\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\n // Start running enough to meet quorum\n while (inflightWeight < this.quorum && i < configs.length) {\n const config = configs[i++];\n\n const rid = nextRid++;\n\n config.start = now();\n config.staller = stall(config.stallTimeout);\n config.staller.wait(() => { config.staller = null; });\n\n config.runner = getRunner(config, currentBlockNumber, method, params).then((result) => {\n config.done = true;\n config.result = result;\n\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 }, (error) => {\n config.done = true;\n config.error = error;\n\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\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\n inflightWeight += config.weight;\n }\n\n // Wait for anything meaningful to finish or stall out\n const waiting: Array> = [ ];\n configs.forEach((c) => {\n if (c.done || !c.runner) { return; }\n waiting.push(c.runner);\n if (c.staller) { waiting.push(c.staller.getPromise()); }\n });\n\n if (waiting.length) { await 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) { c.staller.cancel(); }\n c.cancelled = true;\n });\n return result;\n }\n if (!first) { await stall(100).getPromise(); }\n first = false;\n }\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) { return accum; }\n\n const code = ((c.error)).code;\n if (ForwardErrors.indexOf(code) >= 0) {\n if (!accum[code]) { accum[code] = { error: c.error, weight: 0 }; }\n accum[code].weight += c.weight;\n }\n\n return accum;\n }, <{ [ code: string ]: { error: Error, weight: number } }>({ }));\n\n Object.keys(errors).forEach((errorCode: string) => {\n const tally = errors[errorCode];\n if (tally.weight < this.quorum) { return; }\n\n // Shut down any stallers\n configs.forEach(c => {\n if (c.staller) { c.staller.cancel(); }\n c.cancelled = true;\n });\n\n const e = (tally.error);\n\n const props: { [ name: string ]: any } = { };\n ForwardProperties.forEach((name) => {\n if (e[name] == null) { return; }\n props[name] = e[name];\n });\n\n logger.throwError(e.reason || e.message, errorCode, props);\n });\n\n // All configs have run to completion; we will never get more data\n if (configs.filter((c) => !c.done).length === 0) { break; }\n }\n\n // Shut down any stallers; shouldn't be any\n configs.forEach(c => {\n if (c.staller) { c.staller.cancel(); }\n c.cancelled = true;\n });\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","\"use strict\";\n\nconst IpcProvider: any = null;\n\nexport {\n IpcProvider\n};\n","\"use strict\";\n\nimport { Network, Networkish } from \"@ethersproject/networks\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { ConnectionInfo } from \"@ethersproject/web\";\n\nimport { WebSocketProvider } from \"./websocket-provider\";\nimport { CommunityResourcable, showThrottleMessage } from \"./formatter\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\n\n\nconst defaultProjectId = \"84842078b09946638c03157f83405213\"\n\nexport class InfuraWebSocketProvider extends WebSocketProvider implements CommunityResourcable {\n readonly apiKey: string;\n readonly projectId: string;\n readonly projectSecret: string;\n\n constructor(network?: Networkish, apiKey?: any) {\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\n const url = connection.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, network);\n\n defineReadOnly(this, \"apiKey\", provider.projectId);\n defineReadOnly(this, \"projectId\", provider.projectId);\n defineReadOnly(this, \"projectSecret\", provider.projectSecret);\n }\n\n isCommunityResource(): boolean {\n return (this.projectId === defaultProjectId);\n }\n}\n\nexport class InfuraProvider extends UrlJsonRpcProvider {\n readonly projectId: string;\n readonly projectSecret: string;\n\n static getWebSocketProvider(network?: Networkish, apiKey?: any): InfuraWebSocketProvider {\n return new InfuraWebSocketProvider(network, apiKey);\n }\n\n static getApiKey(apiKey: any): any {\n const apiKeyObj: { apiKey: string, projectId: string, projectSecret: string } = {\n apiKey: defaultProjectId,\n projectId: defaultProjectId,\n projectSecret: null\n };\n\n if (apiKey == null) { 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\"),\n \"projectSecret requires a projectId\", \"projectId\", apiKey.projectId);\n logger.assertArgument((typeof(apiKey.projectSecret) === \"string\"),\n \"invalid projectSecret\", \"projectSecret\", \"[REDACTED]\");\n\n apiKeyObj.projectId = apiKey.projectId;\n apiKeyObj.projectSecret = apiKey.projectSecret;\n\n } else if (apiKey.projectId) {\n apiKeyObj.projectId = apiKey.projectId;\n }\n\n apiKeyObj.apiKey = apiKeyObj.projectId;\n\n return apiKeyObj;\n }\n\n static getUrl(network: Network, apiKey: any): ConnectionInfo {\n let host: string = null;\n switch(network ? network.name: \"unknown\") {\n case \"homestead\":\n host = \"mainnet.infura.io\";\n break;\n case \"ropsten\":\n host = \"ropsten.infura.io\";\n break;\n case \"rinkeby\":\n host = \"rinkeby.infura.io\";\n break;\n case \"kovan\":\n host = \"kovan.infura.io\";\n break;\n case \"goerli\":\n host = \"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\n const connection: ConnectionInfo = {\n allowGzip: true,\n url: (\"https:/\" + \"/\" + host + \"/v3/\" + apiKey.projectId),\n throttleCallback: (attempt: number, url: string) => {\n if (apiKey.projectId === defaultProjectId) {\n showThrottleMessage();\n }\n return Promise.resolve(true);\n }\n };\n\n if (apiKey.projectSecret != null) {\n connection.user = \"\";\n connection.password = apiKey.projectSecret\n }\n\n return connection;\n }\n\n isCommunityResource(): boolean {\n return (this.projectId === defaultProjectId);\n }\n}\n","/* istanbul ignore file */\n\n\"use strict\";\n\nimport { Network } from \"@ethersproject/networks\";\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\n// Special API key provided by Nodesmith for ethers.js\nconst defaultApiKey = \"ETHERS_JS_SHARED\";\n\nexport class NodesmithProvider extends UrlJsonRpcProvider {\n\n static getApiKey(apiKey: any): any {\n if (apiKey && typeof(apiKey) !== \"string\") {\n logger.throwArgumentError(\"invalid apiKey\", \"apiKey\", apiKey);\n }\n return apiKey || defaultApiKey;\n }\n\n static getUrl(network: Network, apiKey?: any): string {\n logger.warn(\"NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.\");\n\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\n return (host + \"?apiKey=\" + apiKey);\n }\n}\n","\"use strict\";\n\nimport { Network } from \"@ethersproject/networks\";\nimport { ConnectionInfo } from \"@ethersproject/web\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\n\nconst defaultApplicationId = \"5f7f8547b90218002e9ce9dd\";\n\nexport class PocketProvider extends UrlJsonRpcProvider {\n readonly applicationId: string;\n readonly applicationSecretKey: string;\n\n static getApiKey(apiKey: any): any {\n const apiKeyObj: { applicationId: string, applicationSecretKey: string } = {\n applicationId: defaultApplicationId,\n applicationSecretKey: null\n };\n\n if (apiKey == null) { return apiKeyObj; }\n\n // Parse applicationId and applicationSecretKey\n if (typeof (apiKey) === \"string\") {\n apiKeyObj.applicationId = apiKey;\n\n } else if (apiKey.applicationSecretKey != null) {\n logger.assertArgument((typeof (apiKey.applicationId) === \"string\"),\n \"applicationSecretKey requires an applicationId\", \"applicationId\", apiKey.applicationId);\n logger.assertArgument((typeof (apiKey.applicationSecretKey) === \"string\"),\n \"invalid applicationSecretKey\", \"applicationSecretKey\", \"[REDACTED]\");\n\n apiKeyObj.applicationId = apiKey.applicationId;\n apiKeyObj.applicationSecretKey = apiKey.applicationSecretKey;\n\n } else if (apiKey.applicationId) {\n apiKeyObj.applicationId = apiKey.applicationId;\n }\n\n return apiKeyObj;\n }\n\n static getUrl(network: Network, apiKey: any): ConnectionInfo {\n let host: string = null;\n switch (network ? network.name : \"unknown\") {\n case \"homestead\":\n host = \"eth-mainnet.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\n const connection: ConnectionInfo = {\n url: (`https:/\\/${ host }/v1/${ apiKey.applicationId }`),\n };\n\n // Initialize empty headers\n connection.headers = {}\n\n // Apply application secret key\n if (apiKey.applicationSecretKey != null) {\n connection.user = \"\";\n connection.password = apiKey.applicationSecretKey\n }\n\n return connection;\n }\n\n isCommunityResource(): boolean {\n return (this.applicationId === defaultApplicationId);\n }\n}\n","\"use strict\";\n\nimport { Networkish } from \"@ethersproject/networks\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nimport { JsonRpcProvider } from \"./json-rpc-provider\";\n\n// Exported Types\nexport type ExternalProvider = {\n isMetaMask?: boolean;\n host?: string;\n path?: string;\n sendAsync?: (request: { method: string, params?: Array }, callback: (error: any, response: any) => void) => void\n send?: (request: { method: string, params?: Array }, callback: (error: any, response: any) => void) => void\n request?: (request: { method: string, params?: Array }) => Promise\n}\n\nlet _nextId = 1;\n\nexport type JsonRpcFetchFunc = (method: string, params?: Array) => Promise;\n\ntype Web3LegacySend = (request: any, callback: (error: Error, response: any) => void) => void;\n\nfunction buildWeb3LegacyFetcher(provider: ExternalProvider, sendFunc: Web3LegacySend) : JsonRpcFetchFunc {\n return function(method: string, params: Array): Promise {\n\n // Metamask complains about eth_sign (and on some versions hangs)\n if (method == \"eth_sign\" && provider.isMetaMask) {\n // https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_sign\n method = \"personal_sign\";\n params = [ params[1], params[0] ];\n }\n\n const request = {\n method: method,\n params: params,\n id: (_nextId++),\n jsonrpc: \"2.0\"\n };\n\n return new Promise((resolve, reject) => {\n sendFunc(request, function(error, result) {\n if (error) { return reject(error); }\n\n if (result.error) {\n const error = new Error(result.error.message);\n (error).code = result.error.code;\n (error).data = result.error.data;\n return reject(error);\n }\n\n resolve(result.result);\n });\n });\n }\n}\n\nfunction buildEip1193Fetcher(provider: ExternalProvider): JsonRpcFetchFunc {\n return function(method: string, params: Array): Promise {\n if (params == null) { params = [ ]; }\n\n // Metamask complains about eth_sign (and on some versions hangs)\n if (method == \"eth_sign\" && provider.isMetaMask) {\n // https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_sign\n method = \"personal_sign\";\n params = [ params[1], params[0] ];\n }\n\n return provider.request({ method, params });\n }\n}\n\nexport class Web3Provider extends JsonRpcProvider {\n readonly provider: ExternalProvider;\n readonly jsonRpcFetchFunc: JsonRpcFetchFunc;\n\n constructor(provider: ExternalProvider | JsonRpcFetchFunc, network?: Networkish) {\n logger.checkNew(new.target, Web3Provider);\n\n if (provider == null) {\n logger.throwArgumentError(\"missing provider\", \"provider\", provider);\n }\n\n let path: string = null;\n let jsonRpcFetchFunc: JsonRpcFetchFunc = null;\n let subprovider: ExternalProvider = null;\n\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\n subprovider = provider;\n\n if (provider.request) {\n if (path === \"\") { path = \"eip-1193:\"; }\n jsonRpcFetchFunc = buildEip1193Fetcher(provider);\n } else if (provider.sendAsync) {\n jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.sendAsync.bind(provider));\n } else if (provider.send) {\n jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.send.bind(provider));\n } else {\n logger.throwArgumentError(\"unsupported provider\", \"provider\", provider);\n }\n\n if (!path) { path = \"unknown:\"; }\n }\n\n super(path, network);\n\n defineReadOnly(this, \"jsonRpcFetchFunc\", jsonRpcFetchFunc);\n defineReadOnly(this, \"provider\", subprovider);\n }\n\n send(method: string, params: Array): Promise {\n return this.jsonRpcFetchFunc(method, params);\n }\n}\n","\"use strict\";\n\nimport {\n Block,\n BlockTag,\n EventType,\n Filter,\n Log,\n Listener,\n Provider,\n TransactionReceipt,\n TransactionRequest,\n TransactionResponse\n} from \"@ethersproject/abstract-provider\";\n\nimport { getNetwork } from \"@ethersproject/networks\";\nimport { Network, Networkish } from \"@ethersproject/networks\";\n\nimport { BaseProvider, EnsProvider, EnsResolver, Resolver } from \"./base-provider\";\n\nimport { AlchemyProvider, AlchemyWebSocketProvider } from \"./alchemy-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 { 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 { ExternalProvider, JsonRpcFetchFunc } from \"./web3-provider\";\n\nimport { CommunityResourcable, Formatter, isCommunityResourcable, isCommunityResource, showThrottleMessage } from \"./formatter\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\n////////////////////////\n// Helper Functions\n\nfunction getDefaultProvider(network?: Network | string, options?: any): BaseProvider {\n if (network == null) { 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\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]) {\n case \"http\":\n return new JsonRpcProvider(network);\n case \"ws\":\n return new WebSocketProvider(network);\n default:\n logger.throwArgumentError(\"unsupported URL scheme\", \"network\", network);\n }\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\n return n._defaultProvider({\n FallbackProvider,\n\n AlchemyProvider,\n CloudflareProvider,\n EtherscanProvider,\n InfuraProvider,\n JsonRpcProvider,\n NodesmithProvider,\n PocketProvider,\n Web3Provider,\n\n IpcProvider,\n }, options);\n}\n\n////////////////////////\n// Exports\n\nexport {\n\n // Abstract Providers (or Abstract-ish)\n Provider,\n BaseProvider,\n\n Resolver,\n\n UrlJsonRpcProvider,\n\n ///////////////////////\n // Concreate Providers\n\n FallbackProvider,\n\n AlchemyProvider,\n AlchemyWebSocketProvider,\n CloudflareProvider,\n EtherscanProvider,\n InfuraProvider,\n InfuraWebSocketProvider,\n JsonRpcProvider,\n NodesmithProvider,\n PocketProvider,\n StaticJsonRpcProvider,\n Web3Provider,\n WebSocketProvider,\n\n IpcProvider,\n\n\n ///////////////////////\n // Signer\n\n JsonRpcSigner,\n\n\n ///////////////////////\n // Functions\n\n getDefaultProvider,\n getNetwork,\n isCommunityResource,\n isCommunityResourcable,\n showThrottleMessage,\n\n\n ///////////////////////\n // Objects\n\n Formatter,\n\n\n ///////////////////////\n // Types\n\n Block,\n BlockTag,\n EventType,\n Filter,\n Log,\n Listener,\n TransactionReceipt,\n TransactionRequest,\n TransactionResponse,\n\n ExternalProvider,\n JsonRpcFetchFunc,\n\n Network,\n Networkish,\n\n EnsProvider,\n EnsResolver,\n\n CommunityResourcable\n};\n\n","\"use strict\";\n\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\";\n\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\n\nconst Zeros = \"0000000000000000000000000000000000000000000000000000000000000000\";\n\nfunction _pack(type: string, value: any, isArray?: boolean): Uint8Array {\n switch(type) {\n case \"address\":\n if (isArray) { return zeroPad(value, 32); }\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) { return zeroPad(value, 32); }\n return arrayify(value);\n }\n\n let match = type.match(regexNumber);\n if (match) {\n //let signed = (match[1] === \"int\")\n let size = parseInt(match[2] || \"256\")\n\n if ((match[2] && String(size) !== match[2]) || (size % 8 !== 0) || size === 0 || size > 256) {\n throw new Error(\"invalid number type - \" + type);\n }\n\n if (isArray) { size = 256; }\n\n value = BigNumber.from(value).toTwos(size);\n\n return zeroPad(value, size / 8);\n }\n\n match = type.match(regexBytes);\n if (match) {\n const size = parseInt(match[1]);\n\n if (String(size) !== match[1] || size === 0 || size > 32) {\n throw new Error(\"invalid bytes type - \" + type);\n }\n if (arrayify(value).byteLength !== size) { throw new Error(\"invalid value for \" + type); }\n if (isArray) { return arrayify((value + Zeros).substring(0, 66)); }\n return value;\n }\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) { throw new Error(\"invalid value for \" + type); }\n const result: Array = [];\n value.forEach(function(value) {\n result.push(_pack(baseType, value, true));\n });\n return concat(result);\n }\n\n throw new Error(\"invalid type - \" + type);\n}\n\n// @TODO: Array Enum\n\nexport function pack(types: Array, values: Array) {\n if (types.length != values.length) { throw new Error(\"type/value count mismatch\"); }\n const tight: Array = [];\n types.forEach(function(type, index) {\n tight.push(_pack(type, values[index]));\n });\n return hexlify(concat(tight));\n}\n\nexport function keccak256(types: Array, values: Array) {\n return hashKeccak256(pack(types, values));\n}\n\nexport function sha256(types: Array, values: Array) {\n return hashSha256(pack(types, values));\n}\n","export const version = \"units/5.0.7\";\n","\"use strict\";\n\nimport { BigNumber, BigNumberish } from \"@ethersproject/bignumber\";\nimport { formatFixed, parseFixed } from \"@ethersproject/bignumber\";\n\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n\nconst names = [\n \"wei\",\n \"kwei\",\n \"mwei\",\n \"gwei\",\n \"szabo\",\n \"finney\",\n \"ether\",\n];\n\n\n// Some environments have issues with RegEx that contain back-tracking, so we cannot\n// use them.\nexport function commify(value: string | number): string {\n const comps = String(value).split(\".\");\n\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\n // Make sure we have at least one whole digit (0 if none)\n let whole = comps[0];\n\n let negative = \"\";\n if (whole.substring(0, 1) === \"-\") {\n negative = \"-\";\n whole = whole.substring(1);\n }\n\n // Make sure we have at least 1 whole digit with no leading zeros\n while (whole.substring(0, 1) === \"0\") { whole = whole.substring(1); }\n if (whole === \"\") { whole = \"0\"; }\n\n let suffix = \"\";\n if (comps.length === 2) { suffix = \".\" + (comps[1] || \"0\"); }\n while (suffix.length > 2 && suffix[suffix.length - 1] === \"0\") {\n suffix = suffix.substring(0, suffix.length - 1);\n }\n\n const formatted = [];\n while (whole.length) {\n if (whole.length <= 3) {\n formatted.unshift(whole);\n break;\n } else {\n const index = whole.length - 3;\n formatted.unshift(whole.substring(index));\n whole = whole.substring(0, index);\n }\n }\n\n return negative + formatted.join(\",\") + suffix;\n}\n\nexport function formatUnits(value: BigNumberish, unitName?: string | BigNumberish): string {\n if (typeof(unitName) === \"string\") {\n const index = names.indexOf(unitName);\n if (index !== -1) { unitName = 3 * index; }\n }\n return formatFixed(value, (unitName != null) ? unitName: 18);\n}\n\nexport function parseUnits(value: string, unitName?: BigNumberish): BigNumber {\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) { unitName = 3 * index; }\n }\n return parseFixed(value, (unitName != null) ? unitName: 18);\n}\n\nexport function formatEther(wei: BigNumberish): string {\n return formatUnits(wei, 18);\n}\n\nexport function parseEther(ether: string): BigNumber {\n return parseUnits(ether, 18);\n}\n\n","\"use strict\";\n\nimport { AbiCoder, checkResultErrors, defaultAbiCoder, EventFragment, FormatTypes, Fragment, FunctionFragment, Indexed, Interface, LogDescription, ParamType, Result, TransactionDescription }from \"@ethersproject/abi\";\nimport { getAddress, getCreate2Address, getContractAddress, getIcapAddress, isAddress } from \"@ethersproject/address\";\nimport * as base64 from \"@ethersproject/base64\";\nimport { Base58 as base58 } from \"@ethersproject/basex\";\nimport { arrayify, concat, hexConcat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexValue, hexZeroPad, isBytes, isBytesLike, isHexString, joinSignature, zeroPad, splitSignature, stripZeros } from \"@ethersproject/bytes\";\nimport { _TypedDataEncoder, hashMessage, id, isValidName, namehash } from \"@ethersproject/hash\";\nimport { defaultPath, entropyToMnemonic, HDNode, isValidMnemonic, mnemonicToEntropy, mnemonicToSeed } from \"@ethersproject/hdnode\";\nimport { getJsonWalletAddress } from \"@ethersproject/json-wallets\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { computeHmac, ripemd160, sha256, sha512 } from \"@ethersproject/sha2\";\nimport { keccak256 as solidityKeccak256, pack as solidityPack, sha256 as soliditySha256 } from \"@ethersproject/solidity\";\nimport { randomBytes, shuffled } from \"@ethersproject/random\";\nimport { checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\nimport * as RLP from \"@ethersproject/rlp\";\nimport { computePublicKey, recoverPublicKey, SigningKey } from \"@ethersproject/signing-key\";\nimport { formatBytes32String, nameprep, parseBytes32String, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs } from \"@ethersproject/strings\";\nimport { computeAddress, parse as parseTransaction, recoverAddress, serialize as serializeTransaction } from \"@ethersproject/transactions\";\nimport { commify, formatEther, parseEther, formatUnits, parseUnits } from \"@ethersproject/units\";\nimport { verifyMessage, verifyTypedData } from \"@ethersproject/wallet\";\nimport { _fetchData, fetchJson, poll } from \"@ethersproject/web\";\n\n////////////////////////\n// Enums\n\nimport { SupportedAlgorithm } from \"@ethersproject/sha2\";\nimport { UnicodeNormalizationForm, Utf8ErrorReason } from \"@ethersproject/strings\";\nimport { UnsignedTransaction } from \"@ethersproject/transactions\";\n\n////////////////////////\n// Types and Interfaces\n\nimport { CoerceFunc } from \"@ethersproject/abi\";\nimport { Bytes, BytesLike, Hexable } from \"@ethersproject/bytes\"\nimport { Mnemonic } from \"@ethersproject/hdnode\";\nimport { EncryptOptions, ProgressCallback } from \"@ethersproject/json-wallets\";\nimport { Deferrable } from \"@ethersproject/properties\";\nimport { Utf8ErrorFunc } from \"@ethersproject/strings\";\nimport { ConnectionInfo, FetchJsonResponse, OnceBlockable, OncePollable, PollOptions } from \"@ethersproject/web\";\n\n////////////////////////\n// Exports\n\nexport {\n AbiCoder,\n defaultAbiCoder,\n\n Fragment,\n EventFragment,\n FunctionFragment,\n ParamType,\n FormatTypes,\n\n checkResultErrors,\n Result,\n\n Logger,\n\n RLP,\n\n _fetchData,\n fetchJson,\n poll,\n\n checkProperties,\n deepCopy,\n defineReadOnly,\n getStatic,\n resolveProperties,\n shallowCopy,\n\n arrayify,\n\n concat,\n stripZeros,\n zeroPad,\n\n isBytes,\n isBytesLike,\n\n defaultPath,\n HDNode,\n SigningKey,\n\n Interface,\n\n LogDescription,\n TransactionDescription,\n\n base58,\n base64,\n\n hexlify,\n isHexString,\n hexConcat,\n hexStripZeros,\n hexValue,\n hexZeroPad,\n hexDataLength,\n hexDataSlice,\n\n nameprep,\n _toEscapedUtf8String,\n toUtf8Bytes,\n toUtf8CodePoints,\n toUtf8String,\n Utf8ErrorFuncs,\n\n formatBytes32String,\n parseBytes32String,\n\n hashMessage,\n namehash,\n isValidName,\n id,\n\n _TypedDataEncoder,\n\n getAddress,\n getIcapAddress,\n getContractAddress,\n getCreate2Address,\n isAddress,\n\n formatEther,\n parseEther,\n\n formatUnits,\n parseUnits,\n\n commify,\n\n computeHmac,\n keccak256,\n ripemd160,\n sha256,\n sha512,\n\n randomBytes,\n shuffled,\n\n solidityPack,\n solidityKeccak256,\n soliditySha256,\n\n splitSignature,\n joinSignature,\n\n parseTransaction,\n serializeTransaction,\n\n getJsonWalletAddress,\n\n computeAddress,\n recoverAddress,\n\n computePublicKey,\n recoverPublicKey,\n\n verifyMessage,\n verifyTypedData,\n\n mnemonicToEntropy,\n entropyToMnemonic,\n isValidMnemonic,\n mnemonicToSeed,\n\n\n ////////////////////////\n // Enums\n\n SupportedAlgorithm,\n\n UnicodeNormalizationForm,\n Utf8ErrorReason,\n\n ////////////////////////\n // Types\n\n Bytes,\n BytesLike,\n Hexable,\n\n UnsignedTransaction,\n\n CoerceFunc,\n\n Indexed,\n\n Mnemonic,\n\n Deferrable,\n\n Utf8ErrorFunc,\n\n ConnectionInfo,\n OnceBlockable,\n OncePollable,\n PollOptions,\n FetchJsonResponse,\n\n EncryptOptions,\n ProgressCallback\n}\n\n","export const version = \"ethers/5.0.21\";\n","\"use strict\";\n\nimport { Contract, ContractFactory } from \"@ethersproject/contracts\";\n\nimport { BigNumber, FixedNumber } from \"@ethersproject/bignumber\";\n\nimport { Signer, VoidSigner } from \"@ethersproject/abstract-signer\";\nimport { Wallet } from \"@ethersproject/wallet\";\n\nimport * as constants from \"@ethersproject/constants\";\n\nimport * as providers from \"@ethersproject/providers\";\nimport { getDefaultProvider } from \"@ethersproject/providers\";\n\nimport { Wordlist, wordlists} from \"@ethersproject/wordlists\";\n\nimport * as utils from \"./utils\";\n\nimport { ErrorCode as errors, Logger } from \"@ethersproject/logger\";\n\n////////////////////////\n// Types\n\nimport { BigNumberish } from \"@ethersproject/bignumber\";\nimport { Bytes, BytesLike, Signature } from \"@ethersproject/bytes\";\nimport { Transaction, UnsignedTransaction } from \"@ethersproject/transactions\";\n\n\n////////////////////////\n// Compile-Time Constants\n\n// This is generated by \"npm run dist\"\nimport { version } from \"./_version\";\n\nconst logger = new Logger(version);\n\n////////////////////////\n// Types\n\nimport {\n ContractFunction,\n ContractReceipt,\n ContractTransaction,\n\n Event,\n EventFilter,\n\n Overrides,\n PayableOverrides,\n CallOverrides,\n\n PopulatedTransaction,\n\n ContractInterface\n} from \"@ethersproject/contracts\";\n\n\n////////////////////////\n// Exports\n\nexport {\n Signer,\n\n Wallet,\n VoidSigner,\n\n getDefaultProvider,\n providers,\n\n Contract,\n ContractFactory,\n\n BigNumber,\n FixedNumber,\n\n constants,\n errors,\n\n logger,\n\n utils,\n\n wordlists,\n\n\n ////////////////////////\n // Compile-Time Constants\n\n version,\n\n\n ////////////////////////\n // Types\n\n ContractFunction,\n ContractReceipt,\n ContractTransaction,\n Event,\n EventFilter,\n\n Overrides,\n PayableOverrides,\n CallOverrides,\n\n PopulatedTransaction,\n\n ContractInterface,\n\n BigNumberish,\n\n Bytes,\n BytesLike,\n\n Signature,\n\n Transaction,\n UnsignedTransaction,\n\n Wordlist\n};\n\n","\"use strict\";\n\n// To modify this file, you must update ./misc/admin/lib/cmds/update-exports.js\n\nimport * as ethers from \"./ethers\";\n\ntry {\n const anyGlobal = (window as any);\n\n if (anyGlobal._ethers == null) {\n anyGlobal._ethers = ethers;\n }\n} catch (error) { }\n\nexport { ethers };\n\nexport {\n Signer,\n\n Wallet,\n VoidSigner,\n\n getDefaultProvider,\n providers,\n\n Contract,\n ContractFactory,\n\n BigNumber,\n FixedNumber,\n\n constants,\n errors,\n\n logger,\n\n utils,\n\n wordlists,\n\n\n ////////////////////////\n // Compile-Time Constants\n\n version,\n\n\n ////////////////////////\n // Types\n\n ContractFunction,\n ContractReceipt,\n ContractTransaction,\n Event,\n EventFilter,\n\n Overrides,\n PayableOverrides,\n CallOverrides,\n\n PopulatedTransaction,\n\n ContractInterface,\n\n BigNumberish,\n\n Bytes,\n BytesLike,\n\n Signature,\n\n Transaction,\n UnsignedTransaction,\n\n Wordlist\n} from \"./ethers\";\n"]}