{"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","_warnedToStringRadix","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","defaultChild","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","getDefaultValue","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","digestBytes","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","error_3","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","error_4","_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","_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,MAAM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MAJAz5C,QAAA0d,OA1DkBqC,IAAAA,UAsElB/f,QAAAya,QAxDK+E,WAAAA,QAET,IAAMM,OAAS,IAAIC,IAAAA,OAAOP,WAAAA,SA4CtBxf,QAAA8f,OAAAA,8GC9EJ,2TAIA,IAAAsoE,SAAAl1B,aAAAm1B,QAUSroF,QAAAqoF,OAAAD,SART,IACI,IAAM5zB,UAAajkC,OAEnB,GAAIikC,UAAUC,SAAW,KAAM,CAC3BD,UAAUC,QAAU4zB,UAE1B,MAAOptE,QAIT,IAAAqtE,SAAAD,OACIroF,QAAAgsC,OAAAs8C,SAAAt8C,OAEAhsC,QAAA8oE,OAAAwf,SAAAxf,OACA9oE,QAAAutC,WAAA+6C,SAAA/6C,WAEAvtC,QAAAqlF,mBAAAiD,SAAAjD,mBACArlF,QAAA8pE,UAAAwe,SAAAxe,UAEA9pE,QAAAuxC,SAAA+2C,SAAA/2C,SACAvxC,QAAAwzC,gBAAA80C,SAAA90C,gBAEAxzC,QAAA0jB,UAAA4kE,SAAA5kE,UACA1jB,QAAAimB,YAAAqiE,SAAAriE,YAEAjmB,QAAA+nF,UAAAO,SAAAP,UACA/nF,QAAA0d,OAAA4qE,SAAA5qE,OAEA1d,QAAA8f,OAAAwoE,SAAAxoE,OAEA9f,QAAAy5C,MAAA6uC,SAAA7uC,MAEAz5C,QAAA00D,UAAA4zB,SAAA5zB,UAMA10D,QAAAya,QAAA6tE,SAAA7tE,QA8BAza,QAAAg0D,SAAAs0B,SAAAt0B","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.8\";\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.9\";\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 (typeof(v) !== \"number\" || v < 0 || v >= 256 || (v % 1)) {\n return false;\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.13\";\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\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\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 (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n } else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, { });\n } else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, { });\n }\n }\n return toBN(this).toString(10);\n }\n\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.7\";\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.10\";\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 abstract defaultValue(): 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.7\";\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.9\";\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 defaultValue(): string {\n return \"0x0000000000000000000000000000000000000000\";\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 defaultValue(): any {\n return this.coder.defaultValue();\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 defaultValue(): Array {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n\n const result: Array = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\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 defaultValue(): boolean {\n return 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 defaultValue(): string {\n return \"0x\";\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 defaultValue(): string {\n return (\"0x0000000000000000000000000000000000000000000000000000000000000000\").substring(0, 2 + this.size * 2);\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 defaultValue(): null {\n return null;\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 defaultValue(): number {\n return 0;\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.8\";\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 defaultValue(): string {\n return \"\";\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 defaultValue(): any {\n const values: any = [ ];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) { accum[name] = 0; }\n accum[name]++;\n }\n return accum;\n }, <{ [ name: string ]: number }>{ });\n\n // Add named values\n this.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 values[name] = values[index];\n });\n\n return Object.freeze(values);\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 getDefaultValue(types: Array): Result {\n const coders: Array = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\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.10\";\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 logger.throwArgumentError(\"types must not contain EIP712Domain type\", \"types.EIP712Domain\", types);\n } else {\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.8\";\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.11\";\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].toLowerCase() !== result[1].toLowerCase()) {\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.9\";\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 if (eventName == null) {\n return Object.keys(this._runningEvents).reduce((accum, key) => {\n return accum + this._runningEvents[key].listenerCount();\n }, 0);\n }\n return this._getRunningEvent(eventName).listenerCount();\n }\n\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.7\";\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.8\";\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 digestBytes = arrayify(digest);\n if (digestBytes.length !== 32) {\n logger.throwArgumentError(\"bad digest length\", \"digest\", digest);\n }\n const signature = keyPair.sign(digestBytes, { canonical: true });\n return splitSignature({\n recoveryParam: signature.recoveryParam,\n r: hexZeroPad(\"0x\" + signature.r.toString(16), 32),\n s: hexZeroPad(\"0x\" + signature.s.toString(16), 32),\n })\n }\n\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.9\";\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.8\";\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 \"AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAMEAFBAFCBKFBQRBSFBCXBCDBCHBGFBEQBpBBpQBIkBHNBeOBgFBVCBhBBhNBmOBmRBiHBiFBUFBZDBvFBsXBkFBlcBjYBwDBMB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JFSJQIJFSOPeZtSJFZJHCJXQfXCTDEqFGJBSJFGJBOfXGJBcqXGJHNJDGJRLiJEJfXEqEJFEJPEFpBEJYJBZJFYBwXUJYiJMEBYJZJyTYTONJXpQMFXFpeGIDdpJFstXpJFcPDLBVSJRLHQJqXLJFZJFIJBNJDIJBUqXIBkFDJIJEJPTIYJGWRIJeQPDIJeEfHIJFsJXOqGDSFHXEJqXgJCsJCgGQJqXgdQYJEgFMFNBgJFcqDVJwXUJVJFZJchIgJCCxOEJqXxOwXUJyDJBVRuscisciJBiJBieUtqXiJFDJkiFsJXQUGEZJcUJFsJXZtXIrXZDZJDrZJFNJDZJFstXvJFQqXvJFCJEsJXQJqkhkNGBbDJdTRbYJMEBlDwXUJMEFiJFcfXNJDRcNJWMTBLJXC\",\n\n // 8-kana words\n \"BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD\",\n\n // 9-kana words\n \"QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD\",\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#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFnAc8AbAc8MgAfGgrAfHboAfJnvAfLV8AfLkoAfMT8AfMnoAfQb8AfScrAfSgrAgAZ8AgFl3AgGX8AgHZvAgHgrAgJXoAgJX8AgJboAgLZoAgLn4AgOX8AgoATAgoAnAgoCUAgoJgAgoLXAgoMYAgoSeAgrDUAgrJTAhrFnAhrLjAhrQgAjAgoAjJnrAkMX8AkOnoAlCTvAlCV8AlClvAlFg4AlFl6AlFn3AloSnAlrAXAlrAfAlrFUAlrFbAlrGgAlrOXAlvKnAlvMTAl3AbAl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X8FkMT8MX8HTrDUMX8ScoSnMYJT6CTvMgAcrMXoMg8SToAfMlvAXLg3MnFl3AnvOT3AnFl3OUoATHT8OU3RnLXrOXrOXrSnObPbvFn6Og8HgrSnOg8OX8DbPTvAgoJgPU3RYLnrPXrDnJZrPb8CTGgvPlrLTDlvPlvFUJnoQUvFXrQlQeMnoAl3QlrQlrSnRTFTrJUoSTDlLiLXSTFg6HT3STJgoMn4STrFTJTrSTrLZFl3ST4FnMXoSUrDlHUoScvHTvSnSfLkvMXo\",\n \"AUoAcrMXoAZ8HboAg8AbOg6ATFgAg8AloMXoAl3AT8JTrAl8MX8MXoCT3SToJU8Cl8Db8MXoDT8HgrATrDboOT8MXoGTOTrATMnGT8LhrAZ8GnvFnGnQXHToGgvAcrHTvAXvLl3HbrAZoMXoHgBlFXLg3HgMnFXrSnHgrSb8JUoHn6HT8LgvITvATrJUoJUoLZrRnvJU8HT8Jb8JXvFX8QT8JXvLToJTrJYrQnGnQXJgrJnoATrJnoJU8ScvJnvMnvMXoLTCTLgrJXLTJlRTvQlLbRnJlQYvLbrMb8LnvLbvFn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg\",\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.8\";\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.7\";\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, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe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d, 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.10\";\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.10\";\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\n } else {\n // A lot of common tools do not prefix private keys with a 0x (see: #1166)\n if (typeof(privateKey) === \"string\") {\n if (privateKey.match(/^[0-9a-f]*$/i) && privateKey.length === 64) {\n privateKey = \"0x\" + privateKey;\n }\n }\n\n const signingKey = new SigningKey(privateKey);\n defineReadOnly(this, \"_signingKey\", () => signingKey);\n }\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.7\";\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.12\";\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.19\";\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 && internalBlockNumber) {\n try {\n const result = await internalBlockNumber;\n if ((getTime() - result.respTime) <= maxAge) {\n return result.blockNumber;\n }\n } catch(error) {\n // Don't null the dead (rejected) fetch, if it has already been updated\n if (this._internalBlockNumber === internalBlockNumber) {\n this._internalBlockNumber = null;\n }\n throw error;\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 // Swallow unhandled exceptions; if needed they are handled else where\n checkInternalBlockNumber.catch((error) => {\n // Don't null the dead (rejected) fetch, if it has already been updated\n if (this._internalBlockNumber === checkInternalBlockNumber) {\n this._internalBlockNumber = null;\n }\n });\n\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 let blockNumber: number = null;\n try {\n blockNumber = await this._getInternalBlockNumber(100 + this.pollingInterval / 2);\n } catch (error) {\n this.emit(\"error\", error);\n return;\n }\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 }).catch((error) => { this.emit(\"error\", error); });\n\n return;\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 }, (error) => { });\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(); }, 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, isHexString } 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): any {\n // Undo the \"convenience\" some nodes are attempting to prevent backwards\n // incompatibility; maybe for v6 consider forwarding reverts as errors\n if (method === \"call\" && error.code === Logger.errors.SERVER_ERROR) {\n const e = error.error;\n if (e && e.message.match(\"reverted\") && isHexString(e.data)) {\n return e.data;\n }\n }\n\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 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, isHexString } 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): any {\n // Undo the \"convenience\" some nodes are attempting to prevent backwards\n // incompatibility; maybe for v6 consider forwarding reverts as errors\n if (method === \"call\" && error.code === Logger.errors.SERVER_ERROR) {\n const e = error.error;\n if (e && e.message.match(\"reverted\") && isHexString(e.data)) {\n return e.data;\n }\n }\n\n // Get the message from any nested error structure\n let message = error.message;\n if (error.code === Logger.errors.SERVER_ERROR) {\n if (error.error && typeof(error.error.message) === \"string\") {\n message = error.error.message;\n } 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.9\";\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.26\";\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"]}