(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5584f7ff"],{"0218":function(e,t,r){const n=r("19d7"),f=r("19b5"),{ACCOUNT_KEY_TAG:i}=r("6369");class a{static decode(e){if(e=f.addHexPrefix(e),!e.startsWith(i.ACCOUNT_KEY_PUBLIC_TAG))throw new Error(`Cannot decode to AccountKeyPublic. The prefix must be ${i.ACCOUNT_KEY_PUBLIC_TAG}: ${e}`);const t=n.decode("0x"+e.slice(i.ACCOUNT_KEY_PUBLIC_TAG.length));return new a(t)}static fromXYPoint(e,t){const r=f.leftPad(f.stripHexPrefix(e),64),n=f.leftPad(f.stripHexPrefix(t),64),i="0x"+(r+n);return new a(i)}static fromPublicKey(e){return new a(e)}constructor(e){this.publicKey=e}get publicKey(){return this._publicKey}set publicKey(e){if(!f.isValidPublicKey(e))throw new Error("Invalid public key: "+e);this._publicKey=f.addHexPrefix(e)}getRLPEncoding(){const e=f.compressPublicKey(this.publicKey);return i.ACCOUNT_KEY_PUBLIC_TAG+n.encode(e).slice(2)}getXYPoint(){return f.xyPointFromPublicKey(this.publicKey)}}e.exports=a},"02c5":function(e,t,r){"use strict";var n=r("cc15"),f=r("769f"),i=r("e351");function a(e,t){return void 0===e?t:(n.isBoolean(e,i.COMPRESSED_TYPE_INVALID),e)}e.exports=function(e){return{privateKeyVerify:function(t){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),32===t.length&&e.privateKeyVerify(t)},privateKeyExport:function(t,r){n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0);var o=e.privateKeyExport(t,r);return f.privateKeyExport(t,o,r)},privateKeyImport:function(t){if(n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),t=f.privateKeyImport(t),t&&32===t.length&&e.privateKeyVerify(t))return t;throw new Error(i.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(t){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyNegate(t)},privateKeyModInverse:function(t){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyModInverse(t)},privateKeyTweakAdd:function(t,r){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,i.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,i.TWEAK_LENGTH_INVALID),e.privateKeyTweakAdd(t,r)},privateKeyTweakMul:function(t,r){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,i.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,i.TWEAK_LENGTH_INVALID),e.privateKeyTweakMul(t,r)},publicKeyCreate:function(t,r){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyCreate(t,r)},publicKeyConvert:function(t,r){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyConvert(t,r)},publicKeyVerify:function(t){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),e.publicKeyVerify(t)},publicKeyTweakAdd:function(t,r,f){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,i.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,i.TWEAK_LENGTH_INVALID),f=a(f,!0),e.publicKeyTweakAdd(t,r,f)},publicKeyTweakMul:function(t,r,f){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,i.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,i.TWEAK_LENGTH_INVALID),f=a(f,!0),e.publicKeyTweakMul(t,r,f)},publicKeyCombine:function(t,r){n.isArray(t,i.EC_PUBLIC_KEYS_TYPE_INVALID),n.isLengthGTZero(t,i.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var f=0;f"/"!==e.slice(-1)?e+"/":e,o=(e,t)=>{r.appendFileSync(e,t+"\n",e=>{if(e)throw e})},s=(e={})=>(t,r)=>{if("object"!==typeof e)throw Error("file logger must take an object type argument.");e.path=a(e.path)||n,e.name=e.name||f,e.extension=e.extension||i;const s=`${e.path}${e.name}.${e.extension}`;t.timestamp=(new Date).getTime(),o(s,JSON.stringify(t)),r()};e.exports=s},"03c7":function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("0664"),a=r("a9b0"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s}=r("1789"),u=r("1a84"),c=r("19b5");function l(e){if(e=c.addHexPrefix(e),!e.startsWith(s.TxTypeAccountUpdate))throw new Error(`Cannot decode to AccountUpdate. The prefix must be ${s.TxTypeAccountUpdate}: ${e}`);const t="0x"+e.slice(4),[r,n,i,a,o,u]=f.decode(t);return{nonce:c.trimLeadingZero(r),gasPrice:c.trimLeadingZero(n),gas:c.trimLeadingZero(i),from:a,rlpEncodedKey:o,signatures:u}}class h extends a{static create(e){return new h(e)}static decode(e){const t=l(e);return t.account=u.createFromRLPEncoding(t.from,t.rlpEncodedKey),new h(t)}constructor(e){n.isString(e)&&(e=l(e),e.account=u.createFromRLPEncoding(e.from,e.rlpEncodedKey)),super(o.TxTypeAccountUpdate,e),this.account=e.account}get account(){return this._account}set account(e){if(!(e instanceof u))throw new Error("Invalid account. 'account' should be instance of 'Account'.");if(this.from.toLowerCase()!==e.address.toLowerCase())throw new Error(`Transaction from address(${this.from.toLowerCase()}) and account address(${e.address}) do not match.`);this._account=e}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode());return s.TxTypeAccountUpdate+f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.from.toLowerCase(),this.account.getRLPEncodingAccountKey(),e]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),f.encode([s.TxTypeAccountUpdate,i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.from.toLowerCase(),this.account.getRLPEncodingAccountKey()])}}e.exports=h},"03fb":function(e,t,r){const n=r("8d05");function f(e){this.name=e.name,this.type=e.type,this.subscriptions=e.subscriptions||{},this.requestManager=null}f.prototype.setRequestManager=function(e){this.requestManager=e},f.prototype.attachToObject=function(e){const t=this.buildCall(),r=this.name.split(".");r.length>1?(e[r[0]]=e[r[0]]||{},e[r[0]][r[1]]=t):e[r[0]]=t},f.prototype.buildCall=function(){const e=this;return function(){e.subscriptions[arguments[0]]||console.warn(`Subscription ${JSON.stringify(arguments[0])} doesn't exist. Subscribing anyway.`);const t=new n({subscription:e.subscriptions[arguments[0]],requestManager:e.requestManager,type:e.type});return t.subscribe.apply(t,arguments)}},e.exports={subscriptions:f,subscription:n}},"0576":function(e,t,r){"use strict";(function(e){var r=e.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),n=e.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);t.privateKeyExport=function(t,f,i){var a=e.from(i?r:n);return t.copy(a,i?8:9),f.copy(a,i?181:214),a},t.privateKeyImport=function(e){var t=e.length,r=0;if(t2)return null;if(t1?e[r+n-2]<<8:0);return r+=n,t32||tf))return null;if(2!==t[i++])return null;var o=t[i++];if(128&o){if(a=o-128,i+a>f)return null;for(;a>0&&0===t[i];i+=1,a-=1);for(o=0;a>0;i+=1,a-=1)o=(o<<8)+t[i]}if(o>f-i)return null;var s=i;if(i+=o,2!==t[i++])return null;var u=t[i++];if(128&u){if(a=u-128,i+a>f)return null;for(;a>0&&0===t[i];i+=1,a-=1);for(u=0;a>0;i+=1,a-=1)u=(u<<8)+t[i]}if(u>f-i)return null;var c=i;for(i+=u;o>0&&0===t[s];o-=1,s+=1);if(o>32)return null;var l=t.slice(s,s+o);for(l.copy(r,32-l.length);u>0&&0===t[c];u-=1,c+=1);if(u>32)return null;var h=t.slice(c,c+u);return h.copy(n,32-h.length),{r:r,s:n}}}).call(this,r("b639").Buffer)},"064c":function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("0664"),a=r("558a"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s}=r("1789"),u=r("19b5");function c(e){if(e=u.addHexPrefix(e),!e.startsWith(s.TxTypeFeeDelegatedChainDataAnchoring))throw new Error(`Cannot decode to FeeDelegatedChainDataAnchoring. The prefix must be ${s.TxTypeFeeDelegatedChainDataAnchoring}: ${e}`);const t="0x"+e.slice(4),[r,n,i,a,o,c,l,h]=f.decode(t);return{nonce:u.trimLeadingZero(r),gasPrice:u.trimLeadingZero(n),gas:u.trimLeadingZero(i),from:a,input:o,signatures:c,feePayer:l,feePayerSignatures:h}}class l extends a{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){if(n.isString(e)&&(e=c(e)),super(o.TxTypeFeeDelegatedChainDataAnchoring,e),e.input&&e.data)throw new Error("'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.");this.input=e.input||e.data}get input(){return this._input}set input(e){if(!e||!u.isHex(e))throw new Error("Invalid input data "+e);this._input=u.addHexPrefix(e)}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode()),t=this.feePayerSignatures.map(e=>e.encode());return s.TxTypeFeeDelegatedChainDataAnchoring+f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.from.toLowerCase(),this.input,e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),f.encode([s.TxTypeFeeDelegatedChainDataAnchoring,i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.from.toLowerCase(),this.input])}}e.exports=l},"0664":function(e,t,r){r("bd8b");const n=(e,t)=>parseInt(e.slice(2*t+2,2*t+4),16),f=e=>{let t;t="undefined"!==typeof window&&window.crypto&&window.crypto.getRandomValues?window.crypto.getRandomValues(new Uint8Array(e)):r("1c46").randomBytes(e);let n="0x";for(let r=0;r(e.length-2)/2,a=e=>"0x"+e.reduce((e,t)=>e+t.slice(2),""),o=(e,t,r)=>"0x"+r.slice(2*e+2,2*t+2),s=e=>{let t="0x";for(let r=0,n=i(e);rt.length===2*e+2?t:u(e,"0x0"+t.slice(2)),c=(e,t)=>t.length===2*e+2?t:c(e,t+"0"),l=e=>{let t=[];for(let r=2,n=e.length;r{let t="0x";for(let r=0,n=e.length;rnew Uint8Array(l(e)),p=e=>h([].slice.call(e,0)),m=e=>{let t=e.toString(16);return t.length%2===0?"0x"+t:"0x0"+t},y=e=>parseInt(e.slice(2),16),g=(e,t)=>e.concat(t.slice(2)),b=e=>"0x0"===e?"0x":e.length%2===0?e:"0x0"+e.slice(2),v=e=>"0"===e[2]?"0x"+e.slice(3):e,w=e=>{let t="0x";for(let r=0;r{let t="";for(let r=2;r{const t=e=>{const t=e.toString(16);return t.length<2?"0"+t:t};let r="0x";for(let n=0;n!=e.length;n++){let f=e.charCodeAt(n);if(f<128)r+=t(f);else{if(f<2048)r+=t(f>>6|192);else{if(f>55295&&f<56320){if(++n==e.length)return null;let i=e.charCodeAt(n);if(i<56320||i>57343)return null;f=65536+((1023&f)<<10)+(1023&i),r+=t(f>>18|240),r+=t(f>>12&63|128)}else r+=t(f>>12|224);r+=t(f>>6&63|128)}r+=t(63&f|128)}}return r},E=e=>{let t="",r=0,f=i(e);while(r127){if(i>191&&i<224){if(r>=f)return null;i=(31&i)<<6|63&n(e,r)}else if(i>223&&i<240){if(r+1>=f)return null;i=(15&i)<<12|(63&n(e,r))<<6|63&n(e,++r)}else{if(!(i>239&&i<248))return null;if(r+2>=f)return null;i=(7&i)<<18|(63&n(e,r))<<12|(63&n(e,++r))<<6|63&n(e,++r)}++r}if(i<=65535)t+=String.fromCharCode(i);else{if(!(i<=1114111))return null;i-=65536,t+=String.fromCharCode(i>>10|55296),t+=String.fromCharCode(1023&i|56320)}}return t};e.exports={random:f,length:i,concat:g,flatten:a,slice:o,reverse:s,pad:u,padRight:c,fromAscii:w,toAscii:_,fromString:T,toString:E,fromNumber:m,toNumber:y,fromNat:b,toNat:v,fromArray:h,toArray:l,fromUint8Array:p,toUint8Array:d}},"0683":function(e,t,r){const n=r("2ef0"),f=r("e240"),i=r("19b5"),a=r("cf45"),{KEY_ROLE:o,isMultipleKeysFormat:s,isRoleBasedKeysFormat:u}=r("fc77"),{decryptKey:c}=r("fc77"),l=r("92c9"),h=r("13dc"),d=r("50f4"),p=r("bed1");class m{static generate(e){const t=f.create(e||i.randomHex(32));return m.createWithSingleKey(t.address,t.privateKey)}static generateSingleKey(e){return f.create(e||i.randomHex(32)).privateKey}static generateMultipleKeys(e,t){if(void 0===e||!n.isNumber(e)||n.isString(e))throw new Error("To generate random multiple private keys, the number of keys should be defined.");const r=[];for(let n=0;no.roleLast)throw new Error(`Unsupported role. The length of array should be less than ${o.roleLast}.`);const r=[[],[],[]];for(let n=0;n>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function m(e,t,r,n,f){var i,a=0;for(i=0;i>>8)-1}function y(e,t,r,n){return m(e,t,r,n,16)}function g(e,t,r,n){return m(e,t,r,n,32)}function b(e,t,r,n){for(var f,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,o=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,s=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,c=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,d=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,y=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,g=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=i,T=a,E=o,x=s,M=u,A=c,k=l,P=h,C=d,S=p,R=m,I=y,N=g,L=b,F=v,K=w,O=0;O<20;O+=2)f=_+N|0,M^=f<<7|f>>>25,f=M+_|0,C^=f<<9|f>>>23,f=C+M|0,N^=f<<13|f>>>19,f=N+C|0,_^=f<<18|f>>>14,f=A+T|0,S^=f<<7|f>>>25,f=S+A|0,L^=f<<9|f>>>23,f=L+S|0,T^=f<<13|f>>>19,f=T+L|0,A^=f<<18|f>>>14,f=R+k|0,F^=f<<7|f>>>25,f=F+R|0,E^=f<<9|f>>>23,f=E+F|0,k^=f<<13|f>>>19,f=k+E|0,R^=f<<18|f>>>14,f=K+I|0,x^=f<<7|f>>>25,f=x+K|0,P^=f<<9|f>>>23,f=P+x|0,I^=f<<13|f>>>19,f=I+P|0,K^=f<<18|f>>>14,f=_+x|0,T^=f<<7|f>>>25,f=T+_|0,E^=f<<9|f>>>23,f=E+T|0,x^=f<<13|f>>>19,f=x+E|0,_^=f<<18|f>>>14,f=A+M|0,k^=f<<7|f>>>25,f=k+A|0,P^=f<<9|f>>>23,f=P+k|0,M^=f<<13|f>>>19,f=M+P|0,A^=f<<18|f>>>14,f=R+S|0,I^=f<<7|f>>>25,f=I+R|0,C^=f<<9|f>>>23,f=C+I|0,S^=f<<13|f>>>19,f=S+C|0,R^=f<<18|f>>>14,f=K+F|0,N^=f<<7|f>>>25,f=N+K|0,L^=f<<9|f>>>23,f=L+N|0,F^=f<<13|f>>>19,f=F+L|0,K^=f<<18|f>>>14;_=_+i|0,T=T+a|0,E=E+o|0,x=x+s|0,M=M+u|0,A=A+c|0,k=k+l|0,P=P+h|0,C=C+d|0,S=S+p|0,R=R+m|0,I=I+y|0,N=N+g|0,L=L+b|0,F=F+v|0,K=K+w|0,e[0]=_>>>0&255,e[1]=_>>>8&255,e[2]=_>>>16&255,e[3]=_>>>24&255,e[4]=T>>>0&255,e[5]=T>>>8&255,e[6]=T>>>16&255,e[7]=T>>>24&255,e[8]=E>>>0&255,e[9]=E>>>8&255,e[10]=E>>>16&255,e[11]=E>>>24&255,e[12]=x>>>0&255,e[13]=x>>>8&255,e[14]=x>>>16&255,e[15]=x>>>24&255,e[16]=M>>>0&255,e[17]=M>>>8&255,e[18]=M>>>16&255,e[19]=M>>>24&255,e[20]=A>>>0&255,e[21]=A>>>8&255,e[22]=A>>>16&255,e[23]=A>>>24&255,e[24]=k>>>0&255,e[25]=k>>>8&255,e[26]=k>>>16&255,e[27]=k>>>24&255,e[28]=P>>>0&255,e[29]=P>>>8&255,e[30]=P>>>16&255,e[31]=P>>>24&255,e[32]=C>>>0&255,e[33]=C>>>8&255,e[34]=C>>>16&255,e[35]=C>>>24&255,e[36]=S>>>0&255,e[37]=S>>>8&255,e[38]=S>>>16&255,e[39]=S>>>24&255,e[40]=R>>>0&255,e[41]=R>>>8&255,e[42]=R>>>16&255,e[43]=R>>>24&255,e[44]=I>>>0&255,e[45]=I>>>8&255,e[46]=I>>>16&255,e[47]=I>>>24&255,e[48]=N>>>0&255,e[49]=N>>>8&255,e[50]=N>>>16&255,e[51]=N>>>24&255,e[52]=L>>>0&255,e[53]=L>>>8&255,e[54]=L>>>16&255,e[55]=L>>>24&255,e[56]=F>>>0&255,e[57]=F>>>8&255,e[58]=F>>>16&255,e[59]=F>>>24&255,e[60]=K>>>0&255,e[61]=K>>>8&255,e[62]=K>>>16&255,e[63]=K>>>24&255}function v(e,t,r,n){for(var f,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,o=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,s=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,c=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,d=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,y=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,g=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=i,T=a,E=o,x=s,M=u,A=c,k=l,P=h,C=d,S=p,R=m,I=y,N=g,L=b,F=v,K=w,O=0;O<20;O+=2)f=_+N|0,M^=f<<7|f>>>25,f=M+_|0,C^=f<<9|f>>>23,f=C+M|0,N^=f<<13|f>>>19,f=N+C|0,_^=f<<18|f>>>14,f=A+T|0,S^=f<<7|f>>>25,f=S+A|0,L^=f<<9|f>>>23,f=L+S|0,T^=f<<13|f>>>19,f=T+L|0,A^=f<<18|f>>>14,f=R+k|0,F^=f<<7|f>>>25,f=F+R|0,E^=f<<9|f>>>23,f=E+F|0,k^=f<<13|f>>>19,f=k+E|0,R^=f<<18|f>>>14,f=K+I|0,x^=f<<7|f>>>25,f=x+K|0,P^=f<<9|f>>>23,f=P+x|0,I^=f<<13|f>>>19,f=I+P|0,K^=f<<18|f>>>14,f=_+x|0,T^=f<<7|f>>>25,f=T+_|0,E^=f<<9|f>>>23,f=E+T|0,x^=f<<13|f>>>19,f=x+E|0,_^=f<<18|f>>>14,f=A+M|0,k^=f<<7|f>>>25,f=k+A|0,P^=f<<9|f>>>23,f=P+k|0,M^=f<<13|f>>>19,f=M+P|0,A^=f<<18|f>>>14,f=R+S|0,I^=f<<7|f>>>25,f=I+R|0,C^=f<<9|f>>>23,f=C+I|0,S^=f<<13|f>>>19,f=S+C|0,R^=f<<18|f>>>14,f=K+F|0,N^=f<<7|f>>>25,f=N+K|0,L^=f<<9|f>>>23,f=L+N|0,F^=f<<13|f>>>19,f=F+L|0,K^=f<<18|f>>>14;e[0]=_>>>0&255,e[1]=_>>>8&255,e[2]=_>>>16&255,e[3]=_>>>24&255,e[4]=A>>>0&255,e[5]=A>>>8&255,e[6]=A>>>16&255,e[7]=A>>>24&255,e[8]=R>>>0&255,e[9]=R>>>8&255,e[10]=R>>>16&255,e[11]=R>>>24&255,e[12]=K>>>0&255,e[13]=K>>>8&255,e[14]=K>>>16&255,e[15]=K>>>24&255,e[16]=k>>>0&255,e[17]=k>>>8&255,e[18]=k>>>16&255,e[19]=k>>>24&255,e[20]=P>>>0&255,e[21]=P>>>8&255,e[22]=P>>>16&255,e[23]=P>>>24&255,e[24]=C>>>0&255,e[25]=C>>>8&255,e[26]=C>>>16&255,e[27]=C>>>24&255,e[28]=S>>>0&255,e[29]=S>>>8&255,e[30]=S>>>16&255,e[31]=S>>>24&255}function w(e,t,r,n){b(e,t,r,n)}function _(e,t,r,n){v(e,t,r,n)}var T=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function E(e,t,r,n,f,i,a){var o,s,u=new Uint8Array(16),c=new Uint8Array(64);for(s=0;s<16;s++)u[s]=0;for(s=0;s<8;s++)u[s]=i[s];while(f>=64){for(w(c,u,a,T),s=0;s<64;s++)e[t+s]=r[n+s]^c[s];for(o=1,s=8;s<16;s++)o=o+(255&u[s])|0,u[s]=255&o,o>>>=8;f-=64,t+=64,n+=64}if(f>0)for(w(c,u,a,T),s=0;s=64){for(w(s,o,f,T),a=0;a<64;a++)e[t+a]=s[a];for(i=1,a=8;a<16;a++)i=i+(255&o[a])|0,o[a]=255&i,i>>>=8;r-=64,t+=64}if(r>0)for(w(s,o,f,T),a=0;a>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),f=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|f<<9),i=255&e[8]|(255&e[9])<<8,this.r[4]=255&(f>>>4|i<<12),this.r[5]=i>>>1&8190,a=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(i>>>14|a<<2),o=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(a>>>11|o<<5),s=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(o>>>8|s<<8),this.r[9]=s>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function P(e,t,r,n,f,i){var a=new k(i);return a.update(r,n,f),a.finish(e,t),0}function C(e,t,r,n,f,i){var a=new Uint8Array(16);return P(a,0,r,n,f,i),y(e,t,a,0)}function S(e,t,r,n,f){var i;if(r<32)return-1;for(A(e,0,t,0,r,n,f),P(e,16,e,32,r-32,e),i=0;i<16;i++)e[i]=0;return 0}function R(e,t,r,n,f){var i,a=new Uint8Array(32);if(r<32)return-1;if(M(a,0,32,n,f),0!==C(t,16,t,32,r-32,a))return-1;for(A(e,0,t,0,r,n,f),i=0;i<32;i++)e[i]=0;return 0}function I(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function N(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function L(e,t,r){for(var n,f=~(r-1),i=0;i<16;i++)n=f&(e[i]^t[i]),e[i]^=n,t[i]^=n}function F(e,r){var n,f,i,a=t(),o=t();for(n=0;n<16;n++)o[n]=r[n];for(N(o),N(o),N(o),f=0;f<2;f++){for(a[0]=o[0]-65517,n=1;n<15;n++)a[n]=o[n]-65535-(a[n-1]>>16&1),a[n-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,L(o,a,1-i)}for(n=0;n<16;n++)e[2*n]=255&o[n],e[2*n+1]=o[n]>>8}function K(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return F(r,e),F(n,t),g(r,0,n,0)}function O(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function D(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function B(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function U(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function j(e,t,r){var n,f,i=0,a=0,o=0,s=0,u=0,c=0,l=0,h=0,d=0,p=0,m=0,y=0,g=0,b=0,v=0,w=0,_=0,T=0,E=0,x=0,M=0,A=0,k=0,P=0,C=0,S=0,R=0,I=0,N=0,L=0,F=0,K=r[0],O=r[1],D=r[2],B=r[3],U=r[4],j=r[5],V=r[6],H=r[7],G=r[8],W=r[9],q=r[10],Y=r[11],$=r[12],z=r[13],Z=r[14],J=r[15];n=t[0],i+=n*K,a+=n*O,o+=n*D,s+=n*B,u+=n*U,c+=n*j,l+=n*V,h+=n*H,d+=n*G,p+=n*W,m+=n*q,y+=n*Y,g+=n*$,b+=n*z,v+=n*Z,w+=n*J,n=t[1],a+=n*K,o+=n*O,s+=n*D,u+=n*B,c+=n*U,l+=n*j,h+=n*V,d+=n*H,p+=n*G,m+=n*W,y+=n*q,g+=n*Y,b+=n*$,v+=n*z,w+=n*Z,_+=n*J,n=t[2],o+=n*K,s+=n*O,u+=n*D,c+=n*B,l+=n*U,h+=n*j,d+=n*V,p+=n*H,m+=n*G,y+=n*W,g+=n*q,b+=n*Y,v+=n*$,w+=n*z,_+=n*Z,T+=n*J,n=t[3],s+=n*K,u+=n*O,c+=n*D,l+=n*B,h+=n*U,d+=n*j,p+=n*V,m+=n*H,y+=n*G,g+=n*W,b+=n*q,v+=n*Y,w+=n*$,_+=n*z,T+=n*Z,E+=n*J,n=t[4],u+=n*K,c+=n*O,l+=n*D,h+=n*B,d+=n*U,p+=n*j,m+=n*V,y+=n*H,g+=n*G,b+=n*W,v+=n*q,w+=n*Y,_+=n*$,T+=n*z,E+=n*Z,x+=n*J,n=t[5],c+=n*K,l+=n*O,h+=n*D,d+=n*B,p+=n*U,m+=n*j,y+=n*V,g+=n*H,b+=n*G,v+=n*W,w+=n*q,_+=n*Y,T+=n*$,E+=n*z,x+=n*Z,M+=n*J,n=t[6],l+=n*K,h+=n*O,d+=n*D,p+=n*B,m+=n*U,y+=n*j,g+=n*V,b+=n*H,v+=n*G,w+=n*W,_+=n*q,T+=n*Y,E+=n*$,x+=n*z,M+=n*Z,A+=n*J,n=t[7],h+=n*K,d+=n*O,p+=n*D,m+=n*B,y+=n*U,g+=n*j,b+=n*V,v+=n*H,w+=n*G,_+=n*W,T+=n*q,E+=n*Y,x+=n*$,M+=n*z,A+=n*Z,k+=n*J,n=t[8],d+=n*K,p+=n*O,m+=n*D,y+=n*B,g+=n*U,b+=n*j,v+=n*V,w+=n*H,_+=n*G,T+=n*W,E+=n*q,x+=n*Y,M+=n*$,A+=n*z,k+=n*Z,P+=n*J,n=t[9],p+=n*K,m+=n*O,y+=n*D,g+=n*B,b+=n*U,v+=n*j,w+=n*V,_+=n*H,T+=n*G,E+=n*W,x+=n*q,M+=n*Y,A+=n*$,k+=n*z,P+=n*Z,C+=n*J,n=t[10],m+=n*K,y+=n*O,g+=n*D,b+=n*B,v+=n*U,w+=n*j,_+=n*V,T+=n*H,E+=n*G,x+=n*W,M+=n*q,A+=n*Y,k+=n*$,P+=n*z,C+=n*Z,S+=n*J,n=t[11],y+=n*K,g+=n*O,b+=n*D,v+=n*B,w+=n*U,_+=n*j,T+=n*V,E+=n*H,x+=n*G,M+=n*W,A+=n*q,k+=n*Y,P+=n*$,C+=n*z,S+=n*Z,R+=n*J,n=t[12],g+=n*K,b+=n*O,v+=n*D,w+=n*B,_+=n*U,T+=n*j,E+=n*V,x+=n*H,M+=n*G,A+=n*W,k+=n*q,P+=n*Y,C+=n*$,S+=n*z,R+=n*Z,I+=n*J,n=t[13],b+=n*K,v+=n*O,w+=n*D,_+=n*B,T+=n*U,E+=n*j,x+=n*V,M+=n*H,A+=n*G,k+=n*W,P+=n*q,C+=n*Y,S+=n*$,R+=n*z,I+=n*Z,N+=n*J,n=t[14],v+=n*K,w+=n*O,_+=n*D,T+=n*B,E+=n*U,x+=n*j,M+=n*V,A+=n*H,k+=n*G,P+=n*W,C+=n*q,S+=n*Y,R+=n*$,I+=n*z,N+=n*Z,L+=n*J,n=t[15],w+=n*K,_+=n*O,T+=n*D,E+=n*B,x+=n*U,M+=n*j,A+=n*V,k+=n*H,P+=n*G,C+=n*W,S+=n*q,R+=n*Y,I+=n*$,N+=n*z,L+=n*Z,F+=n*J,i+=38*_,a+=38*T,o+=38*E,s+=38*x,u+=38*M,c+=38*A,l+=38*k,h+=38*P,d+=38*C,p+=38*S,m+=38*R,y+=38*I,g+=38*N,b+=38*L,v+=38*F,f=1,n=i+f+65535,f=Math.floor(n/65536),i=n-65536*f,n=a+f+65535,f=Math.floor(n/65536),a=n-65536*f,n=o+f+65535,f=Math.floor(n/65536),o=n-65536*f,n=s+f+65535,f=Math.floor(n/65536),s=n-65536*f,n=u+f+65535,f=Math.floor(n/65536),u=n-65536*f,n=c+f+65535,f=Math.floor(n/65536),c=n-65536*f,n=l+f+65535,f=Math.floor(n/65536),l=n-65536*f,n=h+f+65535,f=Math.floor(n/65536),h=n-65536*f,n=d+f+65535,f=Math.floor(n/65536),d=n-65536*f,n=p+f+65535,f=Math.floor(n/65536),p=n-65536*f,n=m+f+65535,f=Math.floor(n/65536),m=n-65536*f,n=y+f+65535,f=Math.floor(n/65536),y=n-65536*f,n=g+f+65535,f=Math.floor(n/65536),g=n-65536*f,n=b+f+65535,f=Math.floor(n/65536),b=n-65536*f,n=v+f+65535,f=Math.floor(n/65536),v=n-65536*f,n=w+f+65535,f=Math.floor(n/65536),w=n-65536*f,i+=f-1+37*(f-1),f=1,n=i+f+65535,f=Math.floor(n/65536),i=n-65536*f,n=a+f+65535,f=Math.floor(n/65536),a=n-65536*f,n=o+f+65535,f=Math.floor(n/65536),o=n-65536*f,n=s+f+65535,f=Math.floor(n/65536),s=n-65536*f,n=u+f+65535,f=Math.floor(n/65536),u=n-65536*f,n=c+f+65535,f=Math.floor(n/65536),c=n-65536*f,n=l+f+65535,f=Math.floor(n/65536),l=n-65536*f,n=h+f+65535,f=Math.floor(n/65536),h=n-65536*f,n=d+f+65535,f=Math.floor(n/65536),d=n-65536*f,n=p+f+65535,f=Math.floor(n/65536),p=n-65536*f,n=m+f+65535,f=Math.floor(n/65536),m=n-65536*f,n=y+f+65535,f=Math.floor(n/65536),y=n-65536*f,n=g+f+65535,f=Math.floor(n/65536),g=n-65536*f,n=b+f+65535,f=Math.floor(n/65536),b=n-65536*f,n=v+f+65535,f=Math.floor(n/65536),v=n-65536*f,n=w+f+65535,f=Math.floor(n/65536),w=n-65536*f,i+=f-1+37*(f-1),e[0]=i,e[1]=a,e[2]=o,e[3]=s,e[4]=u,e[5]=c,e[6]=l,e[7]=h,e[8]=d,e[9]=p,e[10]=m,e[11]=y,e[12]=g,e[13]=b,e[14]=v,e[15]=w}function V(e,t){j(e,t,t)}function H(e,r){var n,f=t();for(n=0;n<16;n++)f[n]=r[n];for(n=253;n>=0;n--)V(f,f),2!==n&&4!==n&&j(f,f,r);for(n=0;n<16;n++)e[n]=f[n]}function G(e,r){var n,f=t();for(n=0;n<16;n++)f[n]=r[n];for(n=250;n>=0;n--)V(f,f),1!==n&&j(f,f,r);for(n=0;n<16;n++)e[n]=f[n]}function W(e,r,n){var f,i,a=new Uint8Array(32),o=new Float64Array(80),u=t(),c=t(),l=t(),h=t(),d=t(),p=t();for(i=0;i<31;i++)a[i]=r[i];for(a[31]=127&r[31]|64,a[0]&=248,D(o,n),i=0;i<16;i++)c[i]=o[i],h[i]=u[i]=l[i]=0;for(u[0]=h[0]=1,i=254;i>=0;--i)f=a[i>>>3]>>>(7&i)&1,L(u,c,f),L(l,h,f),B(d,u,l),U(u,u,l),B(l,c,h),U(c,c,h),V(h,d),V(p,u),j(u,l,u),j(l,c,d),B(d,u,l),U(u,u,l),V(c,u),U(l,h,p),j(u,l,s),B(u,u,h),j(l,l,u),j(u,h,p),j(h,c,o),V(c,d),L(u,c,f),L(l,h,f);for(i=0;i<16;i++)o[i+16]=u[i],o[i+32]=l[i],o[i+48]=c[i],o[i+64]=h[i];var m=o.subarray(32),y=o.subarray(16);return H(m,m),j(y,y,m),F(e,y),0}function q(e,t){return W(e,t,i)}function Y(e,t){return n(t,32),q(e,t)}function $(e,t,r){var n=new Uint8Array(32);return W(n,r,t),_(e,f,n,T)}k.prototype.blocks=function(e,t,r){var n,f,i,a,o,s,u,c,l,h,d,p,m,y,g,b,v,w,_,T=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],A=this.h[3],k=this.h[4],P=this.h[5],C=this.h[6],S=this.h[7],R=this.h[8],I=this.h[9],N=this.r[0],L=this.r[1],F=this.r[2],K=this.r[3],O=this.r[4],D=this.r[5],B=this.r[6],U=this.r[7],j=this.r[8],V=this.r[9];while(r>=16)n=255&e[t+0]|(255&e[t+1])<<8,E+=8191&n,f=255&e[t+2]|(255&e[t+3])<<8,x+=8191&(n>>>13|f<<3),i=255&e[t+4]|(255&e[t+5])<<8,M+=8191&(f>>>10|i<<6),a=255&e[t+6]|(255&e[t+7])<<8,A+=8191&(i>>>7|a<<9),o=255&e[t+8]|(255&e[t+9])<<8,k+=8191&(a>>>4|o<<12),P+=o>>>1&8191,s=255&e[t+10]|(255&e[t+11])<<8,C+=8191&(o>>>14|s<<2),u=255&e[t+12]|(255&e[t+13])<<8,S+=8191&(s>>>11|u<<5),c=255&e[t+14]|(255&e[t+15])<<8,R+=8191&(u>>>8|c<<8),I+=c>>>5|T,l=0,h=l,h+=E*N,h+=x*(5*V),h+=M*(5*j),h+=A*(5*U),h+=k*(5*B),l=h>>>13,h&=8191,h+=P*(5*D),h+=C*(5*O),h+=S*(5*K),h+=R*(5*F),h+=I*(5*L),l+=h>>>13,h&=8191,d=l,d+=E*L,d+=x*N,d+=M*(5*V),d+=A*(5*j),d+=k*(5*U),l=d>>>13,d&=8191,d+=P*(5*B),d+=C*(5*D),d+=S*(5*O),d+=R*(5*K),d+=I*(5*F),l+=d>>>13,d&=8191,p=l,p+=E*F,p+=x*L,p+=M*N,p+=A*(5*V),p+=k*(5*j),l=p>>>13,p&=8191,p+=P*(5*U),p+=C*(5*B),p+=S*(5*D),p+=R*(5*O),p+=I*(5*K),l+=p>>>13,p&=8191,m=l,m+=E*K,m+=x*F,m+=M*L,m+=A*N,m+=k*(5*V),l=m>>>13,m&=8191,m+=P*(5*j),m+=C*(5*U),m+=S*(5*B),m+=R*(5*D),m+=I*(5*O),l+=m>>>13,m&=8191,y=l,y+=E*O,y+=x*K,y+=M*F,y+=A*L,y+=k*N,l=y>>>13,y&=8191,y+=P*(5*V),y+=C*(5*j),y+=S*(5*U),y+=R*(5*B),y+=I*(5*D),l+=y>>>13,y&=8191,g=l,g+=E*D,g+=x*O,g+=M*K,g+=A*F,g+=k*L,l=g>>>13,g&=8191,g+=P*N,g+=C*(5*V),g+=S*(5*j),g+=R*(5*U),g+=I*(5*B),l+=g>>>13,g&=8191,b=l,b+=E*B,b+=x*D,b+=M*O,b+=A*K,b+=k*F,l=b>>>13,b&=8191,b+=P*L,b+=C*N,b+=S*(5*V),b+=R*(5*j),b+=I*(5*U),l+=b>>>13,b&=8191,v=l,v+=E*U,v+=x*B,v+=M*D,v+=A*O,v+=k*K,l=v>>>13,v&=8191,v+=P*F,v+=C*L,v+=S*N,v+=R*(5*V),v+=I*(5*j),l+=v>>>13,v&=8191,w=l,w+=E*j,w+=x*U,w+=M*B,w+=A*D,w+=k*O,l=w>>>13,w&=8191,w+=P*K,w+=C*F,w+=S*L,w+=R*N,w+=I*(5*V),l+=w>>>13,w&=8191,_=l,_+=E*V,_+=x*j,_+=M*U,_+=A*B,_+=k*D,l=_>>>13,_&=8191,_+=P*O,_+=C*K,_+=S*F,_+=R*L,_+=I*N,l+=_>>>13,_&=8191,l=(l<<2)+l|0,l=l+h|0,h=8191&l,l>>>=13,d+=l,E=h,x=d,M=p,A=m,k=y,P=g,C=b,S=v,R=w,I=_,t+=16,r-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=A,this.h[4]=k,this.h[5]=P,this.h[6]=C,this.h[7]=S,this.h[8]=R,this.h[9]=I},k.prototype.finish=function(e,t){var r,n,f,i,a=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=r,r=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,a[0]=this.h[0]+5,r=a[0]>>>13,a[0]&=8191,i=1;i<10;i++)a[i]=this.h[i]+r,r=a[i]>>>13,a[i]&=8191;for(a[9]-=8192,n=(1^r)-1,i=0;i<10;i++)a[i]&=n;for(n=~n,i=0;i<10;i++)this.h[i]=this.h[i]&n|a[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,i=1;i<8;i++)f=(this.h[i]+this.pad[i]|0)+(f>>>16)|0,this.h[i]=65535&f;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},k.prototype.update=function(e,t,r){var n,f;if(this.leftover){for(f=16-this.leftover,f>r&&(f=r),n=0;n=16&&(f=r-r%16,this.blocks(e,t,f),t+=f,r-=f),r){for(n=0;n=128){for(T=0;T<16;T++)E=8*T+$,S[T]=r[E+0]<<24|r[E+1]<<16|r[E+2]<<8|r[E+3],R[T]=r[E+4]<<24|r[E+5]<<16|r[E+6]<<8|r[E+7];for(T=0;T<80;T++)if(f=I,i=N,a=L,o=F,s=K,u=O,c=D,l=B,h=U,d=j,p=V,m=H,y=G,g=W,b=q,v=Y,x=B,M=Y,A=65535&M,k=M>>>16,P=65535&x,C=x>>>16,x=(K>>>14|G<<18)^(K>>>18|G<<14)^(G>>>9|K<<23),M=(G>>>14|K<<18)^(G>>>18|K<<14)^(K>>>9|G<<23),A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,x=K&O^~K&D,M=G&W^~G&q,A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,x=Q[2*T],M=Q[2*T+1],A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,x=S[T%16],M=R[T%16],A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,k+=A>>>16,P+=k>>>16,C+=P>>>16,w=65535&P|C<<16,_=65535&A|k<<16,x=w,M=_,A=65535&M,k=M>>>16,P=65535&x,C=x>>>16,x=(I>>>28|U<<4)^(U>>>2|I<<30)^(U>>>7|I<<25),M=(U>>>28|I<<4)^(I>>>2|U<<30)^(I>>>7|U<<25),A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,x=I&N^I&L^N&L,M=U&j^U&V^j&V,A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,k+=A>>>16,P+=k>>>16,C+=P>>>16,l=65535&P|C<<16,v=65535&A|k<<16,x=o,M=m,A=65535&M,k=M>>>16,P=65535&x,C=x>>>16,x=w,M=_,A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,k+=A>>>16,P+=k>>>16,C+=P>>>16,o=65535&P|C<<16,m=65535&A|k<<16,N=f,L=i,F=a,K=o,O=s,D=u,B=c,I=l,j=h,V=d,H=p,G=m,W=y,q=g,Y=b,U=v,T%16===15)for(E=0;E<16;E++)x=S[E],M=R[E],A=65535&M,k=M>>>16,P=65535&x,C=x>>>16,x=S[(E+9)%16],M=R[(E+9)%16],A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,w=S[(E+1)%16],_=R[(E+1)%16],x=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7,M=(_>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25),A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,w=S[(E+14)%16],_=R[(E+14)%16],x=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6,M=(_>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26),A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,k+=A>>>16,P+=k>>>16,C+=P>>>16,S[E]=65535&P|C<<16,R[E]=65535&A|k<<16;x=I,M=U,A=65535&M,k=M>>>16,P=65535&x,C=x>>>16,x=e[0],M=t[0],A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,k+=A>>>16,P+=k>>>16,C+=P>>>16,e[0]=I=65535&P|C<<16,t[0]=U=65535&A|k<<16,x=N,M=j,A=65535&M,k=M>>>16,P=65535&x,C=x>>>16,x=e[1],M=t[1],A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,k+=A>>>16,P+=k>>>16,C+=P>>>16,e[1]=N=65535&P|C<<16,t[1]=j=65535&A|k<<16,x=L,M=V,A=65535&M,k=M>>>16,P=65535&x,C=x>>>16,x=e[2],M=t[2],A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,k+=A>>>16,P+=k>>>16,C+=P>>>16,e[2]=L=65535&P|C<<16,t[2]=V=65535&A|k<<16,x=F,M=H,A=65535&M,k=M>>>16,P=65535&x,C=x>>>16,x=e[3],M=t[3],A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,k+=A>>>16,P+=k>>>16,C+=P>>>16,e[3]=F=65535&P|C<<16,t[3]=H=65535&A|k<<16,x=K,M=G,A=65535&M,k=M>>>16,P=65535&x,C=x>>>16,x=e[4],M=t[4],A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,k+=A>>>16,P+=k>>>16,C+=P>>>16,e[4]=K=65535&P|C<<16,t[4]=G=65535&A|k<<16,x=O,M=W,A=65535&M,k=M>>>16,P=65535&x,C=x>>>16,x=e[5],M=t[5],A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,k+=A>>>16,P+=k>>>16,C+=P>>>16,e[5]=O=65535&P|C<<16,t[5]=W=65535&A|k<<16,x=D,M=q,A=65535&M,k=M>>>16,P=65535&x,C=x>>>16,x=e[6],M=t[6],A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,k+=A>>>16,P+=k>>>16,C+=P>>>16,e[6]=D=65535&P|C<<16,t[6]=q=65535&A|k<<16,x=B,M=Y,A=65535&M,k=M>>>16,P=65535&x,C=x>>>16,x=e[7],M=t[7],A+=65535&M,k+=M>>>16,P+=65535&x,C+=x>>>16,k+=A>>>16,P+=k>>>16,C+=P>>>16,e[7]=B=65535&P|C<<16,t[7]=Y=65535&A|k<<16,$+=128,n-=128}return n}function te(e,t,r){var n,f=new Int32Array(8),i=new Int32Array(8),a=new Uint8Array(256),o=r;for(f[0]=1779033703,f[1]=3144134277,f[2]=1013904242,f[3]=2773480762,f[4]=1359893119,f[5]=2600822924,f[6]=528734635,f[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,ee(f,i,t,r),r%=128,n=0;n=0;--f)n=r[f/8|0]>>(7&f)&1,ne(e,t,n),re(t,e),re(e,e),ne(e,t,n)}function ae(e,r){var n=[t(),t(),t(),t()];I(n[0],l),I(n[1],h),I(n[2],o),j(n[3],l,h),ie(e,n,r)}function oe(e,r,f){var i,a=new Uint8Array(64),o=[t(),t(),t(),t()];for(f||n(r,32),te(a,r,32),a[0]&=248,a[31]&=127,a[31]|=64,ae(o,a),fe(e,o),i=0;i<32;i++)r[i+32]=e[i];return 0}var se=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ue(e,t){var r,n,f,i;for(n=63;n>=32;--n){for(r=0,f=n-32,i=n-12;f>4)*se[f],r=t[f]>>8,t[f]&=255;for(f=0;f<32;f++)t[f]-=r*se[f];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function ce(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ue(e,r)}function le(e,r,n,f){var i,a,o=new Uint8Array(64),s=new Uint8Array(64),u=new Uint8Array(64),c=new Float64Array(64),l=[t(),t(),t(),t()];te(o,f,32),o[0]&=248,o[31]&=127,o[31]|=64;var h=n+64;for(i=0;i>7&&U(e[0],a,e[0]),j(e[3],e[0],e[1]),0)}function de(e,r,n,f){var i,a=new Uint8Array(32),o=new Uint8Array(64),s=[t(),t(),t(),t()],u=[t(),t(),t(),t()];if(n<64)return-1;if(he(u,f))return-1;for(i=0;i=0},e.sign.keyPair=function(){var e=new Uint8Array(ke),t=new Uint8Array(Pe);return oe(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(Ne(e),e.length!==Pe)throw new Error("bad secret key size");for(var t=new Uint8Array(ke),r=0;re.encode());return s.TxTypeCancel+f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.from.toLowerCase(),e]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),f.encode([s.TxTypeCancel,i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.from.toLowerCase()])}}e.exports=l},"0a08":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOptions=void 0;const n=r("58c5"),f=r("f76c"),i=e=>"string"===typeof e&&n.validateMnemonic(e,f.wordlist),a=e=>e instanceof Array,o=e=>!a(e)&&!i(e),s=e=>{if(i(e))return{mnemonic:{phrase:e}};if(a(e))return{privateKeys:e};if(o(e))return{privateKeys:[e]};throw new Error("First argument to new HDWalletProvider() must be a mnemonic phrase, a single private key, or a list of private keys. Received: "+JSON.stringify(e))},u=e=>"mnemonic"in e&&"string"===typeof e.mnemonic?Object.assign(Object.assign({},e),{mnemonic:{phrase:e.mnemonic}}):e,c=e=>{const[t,r,n,f,i,a,o]=e,u=s(t);return Object.assign(Object.assign({},u),{providerOrUrl:r,addressIndex:n,numberOfAddresses:f,shareNonce:i,derivationPath:a,chainId:o})},l=e=>{if(1!==e.length)return!1;const[t]=e;return"providerOrUrl"in t&&("privateKeys"in t||"mnemonic"in t)},h=e=>!l(e)&&e.filter(e=>void 0!==e).length>=2,d=(...e)=>{if(l(e)){const[t]=e;return u(t)}if(h(e))return c(e);throw new Error("Unknown arguments format passed to new HDWalletProvider. Please check your configuration and try again")};t.getOptions=d},"0a8f":function(e,t,r){"use strict";const n=r("1eca"),{ok:f}=r("7872"),{objectToQuery:i}=r("d518");e.exports=n(({fetch:e,apiUrl:t,apiPath:r,headers:n})=>async(a,o)=>{o=o||{};const s=i({arg:a,"cid-version":o.cidVersion,flush:o.flush,format:o.format,hash:o.hashAlg,parents:o.parents,...o.qs||{}}),u=`${t}${r}/files/mkdir${s}`,c=await f(e(u,{signal:o.signal,headers:o.headers||n}));return c.text()})},"0b38":function(e,t,r){var n=r("2865"),f=r("f3db"),i=r("1cea"),a=r("42c4");e.exports.Backoff=n,e.exports.FunctionCall=a,e.exports.FibonacciStrategy=i,e.exports.ExponentialStrategy=f,e.exports.fibonacci=function(e){return new n(new i(e))},e.exports.exponential=function(e){return new n(new f(e))},e.exports.call=function(e,t,r){var n=Array.prototype.slice.call(arguments);return e=n[0],t=n.slice(1,n.length-1),r=n[n.length-1],new a(e,t,r)}},"0b4a":function(e,t,r){"use strict";const n=r("1eca"),{ok:f}=r("7872"),{objectToQuery:i}=r("d518");e.exports=n(({fetch:e,apiUrl:t,apiPath:r,headers:n})=>async(...a)=>{let o={};"object"===typeof a[a.length-1]&&(o=a.pop());const s=i({arg:a,flush:o.flush,format:o.format,hash:o.hashAlg,parents:o.parents,...o.qs||{}}),u=`${t}${r}/files/cp${s}`,c=await f(e(u,{signal:o.signal,headers:o.headers||n}));return c.text()})},"0b87":function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("0664"),a=r("a9b0"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s}=r("1789"),u=r("19b5");function c(e){if(e=u.addHexPrefix(e),!e.startsWith(s.TxTypeChainDataAnchoring))throw new Error(`Cannot decode to ChainDataAnchoring. The prefix must be ${s.TxTypeChainDataAnchoring}: ${e}`);const t="0x"+e.slice(4),[r,n,i,a,o,c]=f.decode(t);return{nonce:u.trimLeadingZero(r),gasPrice:u.trimLeadingZero(n),gas:u.trimLeadingZero(i),from:a,input:o,signatures:c}}class l extends a{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){if(n.isString(e)&&(e=c(e)),super(o.TxTypeChainDataAnchoring,e),e.input&&e.data)throw new Error("'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.");this.input=e.input||e.data}get input(){return this._input}set input(e){if(!e||!u.isHex(e))throw new Error("Invalid input data "+e);this._input=u.toHex(e)}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode());return s.TxTypeChainDataAnchoring+f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.from.toLowerCase(),this.input,e]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),f.encode([s.TxTypeChainDataAnchoring,i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.from.toLowerCase(),this.input])}}e.exports=l},"0c0c":function(e,t,r){const n=r("ee69").AccountKeyEnum;class f{constructor(e){if(e instanceof f&&(e=e.keys),"string"!==typeof e)throw new Error("To create AccountKeyPublic, a private key strings is required.");this._key=e,this.type=n.ACCOUNT_KEY_PUBLIC}get defaultKey(){return this._key}get keys(){return this._key}get transactionKey(){return this._key}get updateKey(){return this._key}get feePayerKey(){return this._key}toPublicKey(e){return e(this._key)}update(e){this._key=e.keys}}e.exports=f},"0c39":function(e){e.exports=JSON.parse('{"contractName":"ERC20TransferProxy","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"__OperatorRole_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"addOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"removeOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"__ERC20TransferProxy_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Upgradeable","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"erc20safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]}')},"0c9c":function(e,t,r){const n=r("2ef0"),f=r("3022"),i=r("19eb"),{formatters:a}=r("4695"),o=r("03fb").subscriptions,s=r("379f"),u=r("19b5"),c=r("921e"),l=r("9976"),h=r("9cca"),d=r("7ac7"),p=r("9d96"),m=r("dc44"),y=r("c8cf1"),g=r("fd8f"),b=r("ba9f"),{decodeFromRawTransaction:v}=r("ccf6"),w=function(...e){const t=this;i.packageInit(this,e);const r=this.setRequestManager;this.setRequestManager=function(e){return r(e),t.net.setRequestManager(e),t.personal.setRequestManager(e),t.accounts.setRequestManager(e),t.Contract._requestManager=t._requestManager,t.Contract.currentProvider=t._provider,!0};const w=this.setProvider;this.setProvider=function(...e){w.apply(t,e),t.setRequestManager(t._requestManager)};let _=null,T="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return _},set:function(e){return e&&(_=u.toChecksumAddress(a.inputAddressFormatter(e))),t.Contract.defaultAccount=_,t.personal.defaultAccount=_,k.forEach((function(e){e.defaultAccount=_})),e},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return T},set:function(e){if(!u.isValidBlockNumberCandidate(e))throw new Error("Invalid default block number.");return T=e,t.Contract.defaultBlock=T,t.personal.defaultBlock=T,k.forEach((function(e){e.defaultBlock=T})),e},enumerable:!0}),this.clearSubscriptions=t._requestManager.clearSubscriptions,this.decodeTransaction=v,this.net=new c(this),this.net.getNetworkType=g.bind(this),this.accounts=new m(this),this.personal=new l(this),this.personal.defaultAccount=this.defaultAccount;const E=this,x=function(){h.apply(this,arguments);const e=this,t=E.setProvider;E.setProvider=function(){t.apply(E,arguments),i.packageInit(e,[E])}};x.setProvider=function(){h.setProvider.apply(this,arguments)},x.prototype=Object.create(h.prototype),x.prototype.constructor=x,this.Contract=x,this.Contract.defaultAccount=this.defaultAccount,this.Contract.defaultBlock=this.defaultBlock,this.Contract._requestManager=this._requestManager,this.Contract._klayAccounts=this.accounts,this.Contract.currentProvider=this._requestManager.provider,this.KIP7=d,this.KIP7.defaultAccount=this.defaultAccount,this.KIP7.defaultBlock=this.defaultBlock,this.KIP7._requestManager=this._requestManager,this.KIP7._klayAccounts=this.accounts,this.KIP7.currentProvider=this._requestManager.provider;const M="`caver.klay.KIP7` has been deprecated. `caver.klay.KIP7` works using only `caver.klay.accounts.wallet`. If you are using `caver.wallet` then use `caver.kct.kip7`.";this.KIP7=f.deprecate(this.KIP7,M),this.KIP7.deploy=f.deprecate(this.KIP7.deploy,M),this.KIP17=p,this.KIP17.defaultAccount=this.defaultAccount,this.KIP17.defaultBlock=this.defaultBlock,this.KIP17._requestManager=this._requestManager,this.KIP17._klayAccounts=this.accounts,this.KIP17.currentProvider=this._requestManager.provider;const A="`caver.klay.KIP17` has been deprecated. `caver.klay.KIP17` works using only `caver.klay.accounts.wallet`. If you are using `caver.wallet` then use `caver.kct.kip17`.";this.KIP17=f.deprecate(p,A),this.KIP17.deploy=f.deprecate(this.KIP17.deploy,A),this.Iban=u.Iban,this.abi=y;const k=[...b.map(e=>new s(e)),new o({name:"subscribe",type:"klay",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:a.outputBlockFormatter},pendingTransactions:{subscriptionName:"newPendingTransactions",params:0},logs:{params:1,inputFormatter:[a.inputLogFormatter],outputFormatter:a.outputLogFormatter,subscriptionHandler:function(e){this.emit("data",e),n.isFunction(this.callback)&&this.callback(null,e,this)}},syncing:{params:0,outputFormatter:a.outputSyncingFormatter,subscriptionHandler:function(e){const t=this;!0!==this._isSyncing?(this._isSyncing=!0,this.emit("changed",t._isSyncing),n.isFunction(this.callback)&&this.callback(null,t._isSyncing,this),setTimeout((function(){t.emit("data",e),n.isFunction(t.callback)&&t.callback(null,e,t)}),0)):(this.emit("data",e),n.isFunction(t.callback)&&this.callback(null,e,this),clearTimeout(this._isSyncingTimeout),this._isSyncingTimeout=setTimeout((function(){e.currentBlock>e.highestBlock-200&&(t._isSyncing=!1,t.emit("changed",t._isSyncing),n.isFunction(t.callback)&&t.callback(null,t._isSyncing,t))}),500))}}}})];k.forEach((function(e){e.attachToObject(t),e.setRequestManager(t._requestManager,t.accounts),e.defaultBlock=t.defaultBlock,e.defaultAccount=t.defaultAccount}))};e.exports=w},"0ca82":function(e,t,r){"use strict";const n=r("55f5").Buffer,f=r("d485").Transform,i=r("3fb5");e.exports=function(e){function t(t,r,n,i,a){f.call(this,a),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=a,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return i(t,f),t.prototype._transform=function(e,t,r){let n=null;try{this.update(e,t)}catch(f){n=f}r(n)},t.prototype._flush=function(e){let t=null;try{this.push(this.digest())}catch(r){t=r}e(t)},t.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!==typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},"0d32":function(e,t,r){const n=r("faa1").EventEmitter,f=r("3022").inherits,i=r("6ef0"),a=r("579c"),o=r("2c27"),s=r("60e2"),u=r("375d"),c=(r("398c"),r("321b")),l=function(){};function h(e){const t=this;n.call(t),t.setMaxListeners(30),e=e||{};const r={sendAsync:t._handleAsync.bind(t)},f=e.blockTrackerProvider||r;t._blockTracker=e.blockTracker||new a({provider:f,pollingInterval:e.pollingInterval||4e3,setSkipCacheFlag:!0}),t._ready=new u,t.currentBlock=null,t._providers=[],t.silent=!1}function d(e){return{number:i.toBuffer(e.number),hash:i.toBuffer(e.hash),parentHash:i.toBuffer(e.parentHash),nonce:i.toBuffer(e.nonce),mixHash:i.toBuffer(e.mixHash),sha3Uncles:i.toBuffer(e.sha3Uncles),logsBloom:i.toBuffer(e.logsBloom),transactionsRoot:i.toBuffer(e.transactionsRoot),stateRoot:i.toBuffer(e.stateRoot),receiptsRoot:i.toBuffer(e.receiptRoot||e.receiptsRoot),miner:i.toBuffer(e.miner),difficulty:i.toBuffer(e.difficulty),totalDifficulty:i.toBuffer(e.totalDifficulty),size:i.toBuffer(e.size),extraData:i.toBuffer(e.extraData),gasLimit:i.toBuffer(e.gasLimit),gasUsed:i.toBuffer(e.gasUsed),timestamp:i.toBuffer(e.timestamp),transactions:e.transactions}}e.exports=h,f(h,n),h.prototype.start=function(e=l){const t=this;t._ready.go(),t._blockTracker.on("latest",e=>{t._getBlockByNumberWithRetry(e,(e,r)=>{if(e)return void this.emit("error",e);if(!r)return console.log(r),void this.emit("error",new Error("Could not find block"));const n=d(r);t._setCurrentBlock(n),t.emit("rawBlock",r),t.emit("latest",r)})}),t._blockTracker.on("sync",t.emit.bind(t,"sync")),t._blockTracker.on("error",t.emit.bind(t,"error")),t._running=!0,t.emit("start")},h.prototype.stop=function(){const e=this;e._blockTracker.removeAllListeners(),e._running=!1,e.emit("stop")},h.prototype.isRunning=function(){const e=this;return e._running},h.prototype.addProvider=function(e,t){const r=this;"number"===typeof t?r._providers.splice(t,0,e):r._providers.push(e),e.setEngine(this)},h.prototype.removeProvider=function(e){const t=this,r=t._providers.indexOf(e);if(r<0)throw new Error("Provider not found.");t._providers.splice(r,1)},h.prototype.send=function(e,t){this.sendAsync(e,t)},h.prototype.sendAsync=function(e,t){const r=this;r._ready.await((function(){Array.isArray(e)?o(e,r._handleAsync.bind(r),t):r._handleAsync(e,t)}))},h.prototype._getBlockByNumberWithRetry=function(e,t){const r=this;let n=5;return void f();function f(){r._getBlockByNumber(e,i)}function i(e,r){return e?t(e):r?void t(null,r):n>0?(n--,void setTimeout((function(){f()}),1e3)):void t(null,null)}},h.prototype._getBlockByNumber=function(e,t){const r=c({method:"eth_getBlockByNumber",params:[e,!1],skipCache:!0});this._handleAsync(r,(e,r)=>e?t(e):t(null,r.result))},h.prototype._handleAsync=function(e,t){var r=this,n=-1,f=null,i=null,a=[];function o(t){if(n+=1,a.unshift(t),n>=r._providers.length)u(new Error('Request for method "'+e.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{var f=r._providers[n];f.handleRequest(e,o,u)}catch(i){u(i)}}function u(n,o){r.silent||(i=n,f=o,s(a,(function(e,t){e?e(i,f,t):t()}),(function(){var r={id:e.id,jsonrpc:e.jsonrpc,result:f};null!=i?(r.error={message:i.stack||i.message||i,code:-32e3},t(i,r)):t(null,r)})))}o()},h.prototype._setCurrentBlock=function(e){const t=this;t.currentBlock=e,t.emit("block",e)}},"0d70":function(e,t,r){(function(t){var r,n=t.crypto||t.msCrypto;if(n&&n.getRandomValues){var f=new Uint8Array(16);r=function(){return n.getRandomValues(f),f}}if(!r){var i=new Array(16);r=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}e.exports=r}).call(this,r("c8ba"))},"0da3":function(e,t,r){const n=r("19d7"),f=r("0664"),i=r("b328"),a=r("19b5"),{ACCOUNT_KEY_TAG:o,fillWeightedMultiSigOptionsForMultiSig:s}=r("6369");class u{static decode(e){if(e=a.addHexPrefix(e),!e.startsWith(o.ACCOUNT_KEY_WEIGHTED_MULTISIG_TAG))throw new Error(`Cannot decode to AccountKeyWeightedMultiSig. The prefix must be ${o.ACCOUNT_KEY_WEIGHTED_MULTISIG_TAG}: ${e}`);const[t,r]=n.decode("0x"+e.slice(o.ACCOUNT_KEY_WEIGHTED_MULTISIG_TAG.length)),f=r.map(e=>new i(e[0],e[1]));return new u(t,f)}static fromPublicKeysAndOptions(e,t){if(t=s(e.length,t),e.length!==t.weights.length)throw new Error("The length of public keys is not equal to the length of weight array.");const r=[];for(let n=0;nasync function*(){let t;const r=e=>{t=()=>new Promise((t,r)=>{e(null,(e,n)=>!0===e?t({end:e}):e?r(e):void t({data:n}))})};n(e,r);while(1){const{end:e,data:r}=await t();if(e)break;yield r}}()},"10f2":function(e,t,r){const n=r("2ef0"),f=r("0683"),i=r("92c9"),a=r("13dc"),o=r("50f4"),s=r("19b5");class u{constructor(e){e=e||[],this._addressKeyringMap=new Map;for(const t of e)this.add(t)}get length(){return this._addressKeyringMap.size}generate(e,t){const r=[];for(let n=0;n0&&f[f.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!f||i[1]>f[0]&&i[1]0&&h!==a.sha256(a.sha256(u)).slice(0,8).toString("hex"))throw new Error("Failed to decrypt input - possibly invalid passphrase");return[3,4];case 3:throw new Error("Unsupported or invalid entropy type");case 4:return[2,new s.default(u)]}}))}))}function v(e,t){if(e.length<10)throw new Error("Passphrase must be at least 10 characters");if(t.length<10)throw new Error("User id must be at least 10 characters");var r=e+t,n=i.pbkdf2Sync(r,r,2e3,32,"sha256");return new s.default(n)}t.fromEtherWallet=y,t.fromEtherCamp=g,t.fromKryptoKit=b,t.fromQuorumWallet=v;var w={fromEtherWallet:y,fromEtherCamp:g,fromKryptoKit:b,fromQuorumWallet:v};t.default=w}).call(this,r("b639").Buffer)},"13dc":function(e,t,r){const n=r("2ef0"),f=r("19b5"),i=r("cf45"),{KEY_ROLE:a}=r("fc77"),o=r("1a84"),{fillWeightedMultiSigOptionsForMultiSig:s}=r("6369"),{validateForSigning:u,validateIndexWithKeys:c,encryptKey:l,formatEncrypted:h}=r("fc77");class d{constructor(e,t){this.address=e,this.keys=t}get address(){return this._address}set address(e){if(!f.isAddress(e))throw new Error("Invalid address : "+e);this._address=f.addHexPrefix(e).toLowerCase()}get keys(){return this._keys}set keys(e){null!==e?this._keys=p(e):this._key=null}getPublicKey(e=!1){const t=[];for(let r=0;r=a.roleLast||e<0)throw new Error("Invalid role number: "+e);return this.keys}toAccount(e){if(n.isArray(e))throw new Error("For AccountKeyWeightedMultiSig, options cannot be defined as an array of WeightedMultiSigOptions.");e=s(this.keys.length,e);const t=this.getPublicKey();return o.createWithAccountKeyWeightedMultiSig(this.address,t,e)}encrypt(e,t={}){let r=[];return r=l(this.keys,e,t),h(4,this.address,r,t)}getKlaytnWalletKey(){throw new Error("Not supported for this class.")}encryptV3(e,t){throw new Error("Not supported for this class. Use 'keyring.encrypt(password)'.")}isDecoupled(){return!0}}function p(e){if(!n.isArray(e))throw new Error("Invalid parameter. The private keys to add should be defined as an array.");const t=[];for(let r=0;rf)throw new Error(`The maximum number of keys is ${f}.`);if(a(e))throw new Error("There is a duplicate key.");this._keys=e,this.type=n.ACCOUNT_KEY_MULTISIG}get defaultKey(){return this._keys[0]}get keys(){return this._keys}get transactionKey(){return this._keys}get updateKey(){return this._keys}get feePayerKey(){return this._keys}toPublicKey(e){const t=[];for(let r=0;re.encode()),t=this.feePayerSignatures.map(e=>e.encode());return o.TxTypeFeeDelegatedValueTransferMemoWithRatio+n.encode([f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.to.toLowerCase(),f.fromNat(this.value),this.from.toLowerCase(),this.input,this.feeRatio,e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),n.encode([o.TxTypeFeeDelegatedValueTransferMemoWithRatio,f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.to.toLowerCase(),f.fromNat(this.value),this.from.toLowerCase(),this.input,this.feeRatio])}}e.exports=l},"172f":function(e,t){const r={messageId:0,toPayload:function(e,t){if(!e)throw new Error(`JSONRPC method should be specified for params: "${JSON.stringify(t)}"!`);return r.messageId++,{jsonrpc:"2.0",id:r.messageId,method:e,params:t||[]}},isValidResponse:function(e){return Array.isArray(e)?e.every(t):t(e);function t(e){return!!e&&!e.error&&"2.0"===e.jsonrpc&&("number"===typeof e.id||"string"===typeof e.id)&&void 0!==e.result}},toBatchPayload:function(e){return e.map((function(e){return r.toPayload(e.method,e.params)}))}};e.exports=r},1789:function(e,t,r){const n=r("2ef0"),f=r("19b5"),i=r("bed1"),a={TxTypeLegacyTransaction:"TxTypeLegacyTransaction",TxTypeValueTransfer:"TxTypeValueTransfer",TxTypeFeeDelegatedValueTransfer:"TxTypeFeeDelegatedValueTransfer",TxTypeFeeDelegatedValueTransferWithRatio:"TxTypeFeeDelegatedValueTransferWithRatio",TxTypeValueTransferMemo:"TxTypeValueTransferMemo",TxTypeFeeDelegatedValueTransferMemo:"TxTypeFeeDelegatedValueTransferMemo",TxTypeFeeDelegatedValueTransferMemoWithRatio:"TxTypeFeeDelegatedValueTransferMemoWithRatio",TxTypeAccountUpdate:"TxTypeAccountUpdate",TxTypeFeeDelegatedAccountUpdate:"TxTypeFeeDelegatedAccountUpdate",TxTypeFeeDelegatedAccountUpdateWithRatio:"TxTypeFeeDelegatedAccountUpdateWithRatio",TxTypeSmartContractDeploy:"TxTypeSmartContractDeploy",TxTypeFeeDelegatedSmartContractDeploy:"TxTypeFeeDelegatedSmartContractDeploy",TxTypeFeeDelegatedSmartContractDeployWithRatio:"TxTypeFeeDelegatedSmartContractDeployWithRatio",TxTypeSmartContractExecution:"TxTypeSmartContractExecution",TxTypeFeeDelegatedSmartContractExecution:"TxTypeFeeDelegatedSmartContractExecution",TxTypeFeeDelegatedSmartContractExecutionWithRatio:"TxTypeFeeDelegatedSmartContractExecutionWithRatio",TxTypeCancel:"TxTypeCancel",TxTypeFeeDelegatedCancel:"TxTypeFeeDelegatedCancel",TxTypeFeeDelegatedCancelWithRatio:"TxTypeFeeDelegatedCancelWithRatio",TxTypeChainDataAnchoring:"TxTypeChainDataAnchoring",TxTypeFeeDelegatedChainDataAnchoring:"TxTypeFeeDelegatedChainDataAnchoring",TxTypeFeeDelegatedChainDataAnchoringWithRatio:"TxTypeFeeDelegatedChainDataAnchoringWithRatio"},o={TxTypeLegacyTransaction:"","":a.TxTypeLegacyTransaction,TxTypeValueTransfer:"0x08","0x08":a.TxTypeValueTransfer,TxTypeFeeDelegatedValueTransfer:"0x09","0x09":a.TxTypeFeeDelegatedValueTransfer,TxTypeFeeDelegatedValueTransferWithRatio:"0x0a","0x0a":a.TxTypeFeeDelegatedValueTransferWithRatio,TxTypeValueTransferMemo:"0x10","0x10":a.TxTypeValueTransferMemo,TxTypeFeeDelegatedValueTransferMemo:"0x11","0x11":a.TxTypeFeeDelegatedValueTransferMemo,TxTypeFeeDelegatedValueTransferMemoWithRatio:"0x12","0x12":a.TxTypeFeeDelegatedValueTransferMemoWithRatio,TxTypeAccountUpdate:"0x20","0x20":a.TxTypeAccountUpdate,TxTypeFeeDelegatedAccountUpdate:"0x21","0x21":a.TxTypeFeeDelegatedAccountUpdate,TxTypeFeeDelegatedAccountUpdateWithRatio:"0x22","0x22":a.TxTypeFeeDelegatedAccountUpdateWithRatio,TxTypeSmartContractDeploy:"0x28","0x28":a.TxTypeSmartContractDeploy,TxTypeFeeDelegatedSmartContractDeploy:"0x29","0x29":a.TxTypeFeeDelegatedSmartContractDeploy,TxTypeFeeDelegatedSmartContractDeployWithRatio:"0x2a","0x2a":a.TxTypeFeeDelegatedSmartContractDeployWithRatio,TxTypeSmartContractExecution:"0x30","0x30":a.TxTypeSmartContractExecution,TxTypeFeeDelegatedSmartContractExecution:"0x31","0x31":a.TxTypeFeeDelegatedSmartContractExecution,TxTypeFeeDelegatedSmartContractExecutionWithRatio:"0x32","0x32":a.TxTypeFeeDelegatedSmartContractExecutionWithRatio,TxTypeCancel:"0x38","0x38":a.TxTypeCancel,TxTypeFeeDelegatedCancel:"0x39","0x39":a.TxTypeFeeDelegatedCancel,TxTypeFeeDelegatedCancelWithRatio:"0x3a","0x3a":a.TxTypeFeeDelegatedCancelWithRatio,TxTypeChainDataAnchoring:"0x48","0x48":a.TxTypeChainDataAnchoring,TxTypeFeeDelegatedChainDataAnchoring:"0x49","0x49":a.TxTypeFeeDelegatedChainDataAnchoring,TxTypeFeeDelegatedChainDataAnchoringWithRatio:"0x4a","0x4a":a.TxTypeFeeDelegatedChainDataAnchoringWithRatio},s={EVM:"0x0"},u=e=>f.hexToNumber(o[e]),c=(e,t=!1)=>{const r=new Set;let f=[],o=e;(!n.isArray(e)&&e instanceof i||n.isArray(e)&&n.isString(e[0]))&&(o=[e]);for(const n of o){const e=new i(n);if(!e.isEmpty()){const t=n.toString();r.has(t)||(r.add(t,!0),f.push(e))}}if(0===f.length&&(f=[i.emtpySig]),t&&f.length>1)throw new Error(a.TxTypeLegacyTransaction+" cannot have multiple sigantures.");return t?f[0]:f},l=e=>{const t=f.addHexPrefix(e).slice(0,4);return o[t]?o[t]:a.TxTypeLegacyTransaction},h=e=>{if(void 0===e)return s.EVM;switch(e){case 0:case"0x":case"0x0":case"EVM":return s.EVM}throw new Error("Unsupported code format : "+e)};e.exports={TX_TYPE_STRING:a,TX_TYPE_TAG:o,CODE_FORMAT:s,refineSignatures:c,typeDetectionFromRLPEncoding:l,getCodeFormatTag:h,getTypeInt:u}},1830:function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("0664"),a=r("749b"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s}=r("1789"),u=r("19b5");function c(e){if(e=u.addHexPrefix(e),!e.startsWith(s.TxTypeFeeDelegatedChainDataAnchoringWithRatio))throw new Error(`Cannot decode to FeeDelegatedChainDataAnchoringWithRatio. The prefix must be ${s.TxTypeFeeDelegatedChainDataAnchoringWithRatio}: ${e}`);const t="0x"+e.slice(4),[r,n,i,a,o,c,l,h,d]=f.decode(t);return{nonce:u.trimLeadingZero(r),gasPrice:u.trimLeadingZero(n),gas:u.trimLeadingZero(i),from:a,input:o,feeRatio:u.trimLeadingZero(c),signatures:l,feePayer:h,feePayerSignatures:d}}class l extends a{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){if(n.isString(e)&&(e=c(e)),super(o.TxTypeFeeDelegatedChainDataAnchoringWithRatio,e),e.input&&e.data)throw new Error("'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.");this.input=e.input||e.data}get input(){return this._input}set input(e){if(!e||!u.isHex(e))throw new Error("Invalid input data "+e);this._input=u.addHexPrefix(e)}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode()),t=this.feePayerSignatures.map(e=>e.encode());return s.TxTypeFeeDelegatedChainDataAnchoringWithRatio+f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.from.toLowerCase(),this.input,this.feeRatio,e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),f.encode([s.TxTypeFeeDelegatedChainDataAnchoringWithRatio,i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.from.toLowerCase(),this.input,this.feeRatio])}}e.exports=l},1910:function(e,t,r){const n=r("f3a4");class f{static getHashForSignature(e){const t=e.getRLPEncodingForSignature();return n.keccak256(t)}static getHashForFeePayerSignature(e){const t=e.getRLPEncodingForFeePayerSignature();return n.keccak256(t)}}e.exports=f},"19b5":function(e,t,r){const n=r("2ef0"),f=r("70c1"),i=r("e240"),a=r("923c"),o=r("64e6"),s=r("1e32"),u=r("24b6"),c=r("91f4"),l=r("bed1"),h=function(e,t,r,f){return!n.isObject(e)||e instanceof Error||!e.data||((n.isObject(e.data)||n.isArray(e.data))&&(e.data=JSON.stringify(e.data,null,2)),e=`${e.message}\n${e.data}`),n.isString(e)&&(e=new Error(e)),n.isFunction(f)&&f(e),n.isFunction(r)&&((t&&n.isFunction(t.listeners)&&t.listeners("error").length||n.isFunction(f))&&t.catch((function(){})),setTimeout((function(){r(e)}),1)),t&&n.isFunction(t.emit)&&setTimeout((function(){t.emit("error",e),t.removeAllListeners()}),1),t},d=function(e){return n.isObject(e)&&e.name&&-1!==e.name.indexOf("(")?e.name:`${e.name}(${S(!1,e.inputs).join(",")})`},p=function(e){if(!a.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");let t="",r=0;const n=e.length;for("0x"===e.substring(0,2)&&(r=2);r7?r+=e[n].toUpperCase():r+=e[n];return r},C=e=>!(!n.isString(e)||!e.match(/^0x[0-9A-Fa-f]*$/));function S(e,t){const r=[];return t.forEach((function(t){if("object"===typeof t.components){if("tuple"!==t.type.substring(0,5))throw new Error("components found but type is not tuple; report on GitHub");let f="";const i=t.type.indexOf("[");i>=0&&(f=t.type.substring(i));const a=S(e,t.components);n.isArray(a)&&e?r.push(`tuple(${a.join(",")})${f}`):e?r.push(`(${a})`):r.push(`(${a.join(",")})${f}`)}else r.push(t.type)})),r}const R=function(e){return"string"===typeof e&&"0x"===e.slice(0,2)},I=function(e){return"string"!==typeof e||R(e)?e:"0x"+e},N=function(e){return"string"!==typeof e?e:R(e)?e.slice(2):e},L=e=>{const t=i.decodeSignature(e).map(e=>a.makeEven(a.trimLeadingZero(e)));return new l(t)};e.exports={_fireError:h,_jsonInterfaceMethodToString:d,_flattenTypes:S,randomHex:s,_:n,soliditySha3:o,toChecksumAddress:P,hexToAscii:p,toAscii:p,asciiToHex:m,fromAscii:m,unitMap:v,klayUnit:w,toWei:b,fromWei:g,unitKlayMap:v,toPeb:x,fromPeb:E,convertFromPeb:M,convertToPeb:A,BN:a.BN,isBN:a.isBN,isBigNumber:a.isBigNumber,isHex:a.isHex,isHexStrict:a.isHexStrict,sha3:a.sha3,keccak256:a.sha3,isAddress:a.isAddress,checkAddressChecksum:a.checkAddressChecksum,toHex:a.toHex,toBN:a.toBN,toBuffer:a.toBuffer,numberToBuffer:a.numberToBuffer,bufferToHex:a.bufferToHex,bytesToHex:a.bytesToHex,hexToBytes:a.hexToBytes,hexToNumberString:a.hexToNumberString,hexToNumber:a.hexToNumber,toDecimal:a.hexToNumber,numberToHex:a.numberToHex,fromDecimal:a.numberToHex,hexToUtf8:a.hexToUtf8,hexToString:a.hexToUtf8,toUtf8:a.hexToUtf8,utf8ToHex:a.utf8ToHex,stringToHex:a.utf8ToHex,fromUtf8:a.utf8ToHex,padLeft:a.leftPad,leftPad:a.leftPad,padRight:a.rightPad,rightPad:a.rightPad,toTwosComplement:a.toTwosComplement,isTxHash:a.isTxHash,isTxHashStrict:a.isTxHashStrict,isValidHash:a.isValidHash,isValidHashStrict:a.isValidHashStrict,promiEvent:u,Iban:c,isHexParameter:C,isHexPrefixed:R,addHexPrefix:I,stripHexPrefix:N,parsePredefinedBlockNumber:a.parsePredefinedBlockNumber,isPredefinedBlockNumber:a.isPredefinedBlockNumber,isValidBlockNumberCandidate:a.isValidBlockNumberCandidate,isValidPrivateKey:a.isValidPrivateKey,isValidNSHSN:a.isValidNSHSN,parsePrivateKey:a.parsePrivateKey,parseKlaytnWalletKey:a.parseKlaytnWalletKey,isKlaytnWalletKey:a.isKlaytnWalletKey,isContractDeployment:a.isContractDeployment,rlpEncode:a.rlpEncode,rlpDecode:a.rlpDecode,xyPointFromPublicKey:a.xyPointFromPublicKey,resolveSignature:a.resolveSignature,transformSignaturesToObject:a.transformSignaturesToObject,getTxTypeStringFromRawTransaction:a.getTxTypeStringFromRawTransaction,txTypeToString:a.txTypeToString,trimLeadingZero:a.trimLeadingZero,makeEven:a.makeEven,isValidPublicKey:a.isValidPublicKey,isCompressedPublicKey:a.isCompressedPublicKey,compressPublicKey:a.compressPublicKey,decompressPublicKey:a.decompressPublicKey,isValidRole:a.isValidRole,isEmptySig:a.isEmptySig,hashMessage:a.hashMessage,recover:a.recover,recoverPublicKey:a.recoverPublicKey,publicKeyToAddress:a.publicKeyToAddress,decodeSignature:L}},"19d7":function(e,t){const r=e=>{const t=e=>e.length%2===0?e:"0"+e,r=e=>t(e.toString(16)),n=(e,t)=>e<56?r(t+e):r(t+r(e).length/2+55)+r(e),f=e=>{if("string"===typeof e){const t=e.slice(2),r=2!=t.length||t>="80"?n(t.length/2,128):"";return r+t}{const t=e.map(f).join(""),r=n(t.length/2,192);return r+t}};return"0x"+f(e)},n=e=>{let t=2;const r=()=>{if(t>=e.length)throw"";const r=e.slice(t,t+2);return r<"80"?(t+=2,"0x"+r):r<"c0"?f():i()},n=()=>{const r=parseInt(e.slice(t,t+=2),16)%64;return r<56?r:parseInt(e.slice(t,t+=2*(r-55)),16)},f=()=>{const r=n();return"0x"+e.slice(t,t+=2*r)},i=()=>{const e=2*n()+t;let f=[];while(t"latest"===e||"earliest"===t?1:"latest"===t||"earliest"===e?-1:o(e)-o(t))}function i(e){return"0x"+e.toString(16)}function a(e){return e&&!["earliest","latest","pending"].includes(e)}function o(e){return void 0===e||null===e?e:Number.parseInt(e,16)}function s(e){if(void 0===e||null===e)return e;const t=o(e);return u(t+1)}function u(e){if(void 0===e||null===e)return e;let t=e.toString(16);const r=t.length%2;return r&&(t="0"+t),"0x"+t}function c(e){let t="0x";for(let r=0;r65536){if(!f)throw new Error("Invalid size: It must be >=0 && <= 65536");t(new Error("Invalid size: It must be >=0 && <= 65536"))}if("undefined"!==typeof n&&n.randomBytes){if(!f)return"0x"+n.randomBytes(e).toString("hex");n.randomBytes(e,(e,r)=>{e?t(e):t(null,"0x"+r.toString("hex"))})}else{let r;if("undefined"!==typeof n?r=n:"undefined"!==typeof msCrypto&&(r=msCrypto),r&&r.getRandomValues){const n=r.getRandomValues(new Uint8Array(e)),i="0x"+Array.from(n).map(e=>e.toString(16)).join("");if(!f)return i;t(null,i)}else{const e=new Error('"crypto" object does not exist. This Browser does not support generating secure random bytes.');if(!f)throw e;t(e)}}}e.exports=n},"1eca":function(e,t,r){"use strict";function n(){const e=location.protocol.startsWith("http")?location.protocol.split(":")[0]:"http",t=location.hostname,r=location.port||(e.startsWith("https")?443:80);return`${e}://${t}:${r}`}e.exports=e=>t=>(t=t||{},"string"===typeof t&&(t={apiUrl:t}),t.fetch=t.fetch||r("7872").fetch,t.apiUrl=t.apiUrl||n(),t.apiPath=t.apiPath||"/api/v0",t.headers=new Headers(t.headers),e(t))},"1f17":function(e,t,r){var n;try{n=r("6787")}catch(o){}finally{if(n||"undefined"===typeof window||(n=window),!n)throw new Error("Could not determine global this")}var f=n.WebSocket||n.MozWebSocket,i=r("a44c");function a(e,t){var r;return r=t?new f(e,t):new f(e),r}f&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(a,e,{get:function(){return f[e]}})})),e.exports={w3cwebsocket:f?a:null,version:i}},"1ff5":function(e,t,r){e.exports=r("91f0"),e.exports.parse=r("91f0"),e.exports.stringify=r("6868")},"20b1":function(e,t,r){"use strict";(function(e){var n=r("c44e"),f=r("3337").ec,i=new f("secp256k1"),a=i.curve;t.privateKeyExport=function(e,t){var r=new n(e);if(r.ucmp(a.n)>=0)throw new Error("couldn't export to DER format");var f=i.g.mul(r);return o(f.getX(),f.getY(),t)},t.privateKeyModInverse=function(t){var r=new n(t);if(r.ucmp(a.n)>=0||r.isZero())throw new Error("private key range is invalid");return r.invm(a.n).toArrayLike(e,"be",32)},t.signatureImport=function(t){var r=new n(t.r);r.ucmp(a.n)>=0&&(r=new n(0));var f=new n(t.s);return f.ucmp(a.n)>=0&&(f=new n(0)),e.concat([r.toArrayLike(e,"be",32),f.toArrayLike(e,"be",32)])},t.ecdhUnsafe=function(e,t,r){var f=i.keyFromPublic(e),s=new n(t);if(s.ucmp(a.n)>=0||s.isZero())throw new Error("scalar was invalid (zero or overflow)");var u=f.pub.mul(s);return o(u.getX(),u.getY(),r)};var o=function(t,r,n){var f=void 0;return n?(f=e.alloc(33),f[0]=r.isOdd()?3:2,t.toArrayLike(e,"be",32).copy(f,1)):(f=e.alloc(65),f[0]=4,t.toArrayLike(e,"be",32).copy(f,1),r.toArrayLike(e,"be",32).copy(f,33)),f}}).call(this,r("b639").Buffer)},"22f7":function(e,t){var r="mainnet",n=1,f=1,i="https://eth-mainnet.alchemyapi.io/v2/0DYeLgv-gOg8eigTuC7seAP_1XNggI12";e.exports={config:{networkName:r,chainId:n,netId:f,apiUrl:"https://api.parula.io/v1",apiKey:"",readonlyProviderUrl:i,nftAddress:"0x5A6d7399998765a5bd5CA5380C83bDa43b5d7c7a",nft1155Address:"0xD78d7773267A3a4d96fB377b4AD195fF9b203E01",exchangeAddress:"0x916F4c132EA791b270903726d43c8534B5934569",royaltiesRegistryAddress:"0x0f334F73C58BB4bf9e1Cf884B6bFaF78a9ACAC2d",transferProxyAddress:"0x920623f54d4F2dA0ed1862E70c0464A1ccB0C465",erc20TransferProxyAddress:"0x97b6dB1F74D3AAF42b7822EAe277Bc5F5feAfA2E",communityWalletAddress:"0x19d3600b0f3074523eDF97421a95ACB0eBf32FEf"}}},"22f8":function(e,t,r){const n=r("19d7"),f=r("0664");function i(e){return n.encode([f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value||"0x0"),e.data,f.fromNat(e.chainId||"0x1"),"0x","0x"])}e.exports={rlpEncodeForLegacyTransaction:i}},2366:function(e,t){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);function f(e,t){var n=t||0,f=r;return[f[e[n++]],f[e[n++]],f[e[n++]],f[e[n++]],"-",f[e[n++]],f[e[n++]],"-",f[e[n++]],f[e[n++]],"-",f[e[n++]],f[e[n++]],"-",f[e[n++]],f[e[n++]],f[e[n++]],f[e[n++]],f[e[n++]],f[e[n++]]].join("")}e.exports=f},2473:function(e,t,r){"use strict";const n=r("1eca"),{ok:f}=r("7872"),{objectToQuery:i}=r("d518");e.exports=n(({fetch:e,apiUrl:t,apiPath:r,headers:n})=>async a=>{a=a||{};const o=i(a.qs),s=`${t}${r}/pubsub/ls${o}`,u=await f(e(s,{signal:a.signal,headers:a.headers||n})),c=await u.json();return c.Strings||[]})},"24b6":function(e,t,r){const n=r("429e"),f=e=>{const t=new n;return Object.entries(t.__proto__).reduce((e,[t,r])=>(e[t]=r,e),e),e._events=t._events,e._eventsCount=t._eventsCount,e};function i(e){let t,r;const n=new Promise((e,n)=>{t=e,r=n}),i=e?n:f(n);return{resolve:t,reject:r,eventEmitter:i}}i.resolve=function(e){const t=i(!0);return t.resolve(e),t.eventEmitter},e.exports=i},2515:function(e,t){const r=(e,t="include")=>{if(!Array.isArray(e))throw Error("rpcFilter only takes an array for first argument");return e=e.reduce((e,t)=>(e[t]=t,e),{}),(r,n)=>{if("include"===t){if(!e[r.method])return;n(r)}else"exclude"===t&&(e[r.method]||n(r))}};e.exports=r},2532:function(e,t,r){"use strict";var n=r("23e7"),f=r("5a34"),i=r("1d80"),a=r("577e"),o=r("ab13");n({target:"String",proto:!0,forced:!o("includes")},{includes:function(e){return!!~a(i(this)).indexOf(a(f(e)),arguments.length>1?arguments[1]:void 0)}})},2710:function(e,t,r){var n=r("ded3").default,f=r("c973").default,i=r("970b").default,a=r("5bc3").default;r("96cf"),r("99af"),r("2ca0"),r("8a79"),r("ac1f"),r("1276"),r("a15b"),r("caad"),r("2532");var o=r("ce08"),s=r("72bf"),u=r("a087"),c=u.decAsset,l=u.enc,h=r("e32e"),d=h.ZERO_ADDRESS,p=h.ETH,m=h.ERC20,y=h.ERC721,g=h.ERC1155,b=r("ad39"),v=b.Asset,w=function(){"use strict";function e(t,r,n){i(this,e),this.web3=t,this.logger=n,this.apiUrl=r.apiUrl}return a(e,[{key:"getSellOrder",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r,f,i,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r="".concat(this.apiUrl,"/order/").concat(t.id),e.next=3,this.get(r);case 3:return f=e.sent,i=JSON.parse(f.order_rawdata).message,a=f.order_signature,delete f.order_rawdata,delete f.order_signature,e.abrupt("return",n({order:i,signature:a},f));case 9:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getAuctionOrder",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r,f,i,a,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r="".concat(this.apiUrl,"/order/").concat(t.id),e.next=3,this.get(r);case 3:return f=e.sent,f.order_rawdata?(i=JSON.parse(f.order_rawdata).message,a=f.order_signature):(o=this._encAssetData(f.maTypeMV,f.maContAddr,f.maTokenId),i={maker:f.order_wallet,makeAsset:v(f.maTypeMV,o,1)},a=""),delete f.order_rawdata,delete f.order_signature,e.abrupt("return",n({order:i,signature:a,immediate_buyable:f.immediate_buyable},f));case 8:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getBidOrder",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r,f,i,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r="".concat(this.apiUrl,"/bid/").concat(t.id),e.next=3,this.get(r);case 3:return f=e.sent,i=JSON.parse(f.order_rawdata).message,a=f.order_signature,delete f.order_rawdata,delete f.order_signature,e.abrupt("return",n({order:i,signature:a},f));case 9:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getOfferOrder",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r,f,i,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r="".concat(this.apiUrl,"/order/").concat(t.id),e.next=3,this.get(r);case 3:return f=e.sent,i=JSON.parse(f.order_rawdata).message,a=f.order_signature,delete f.order_rawdata,delete f.order_signature,e.abrupt("return",n({order:i,signature:a},f));case 9:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"get",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var n,f,i,a,o,u,l,h,d,p=arguments;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=p.length>1&&void 0!==p[1]?p[1]:{},!(t.startsWith("undefined")||t.endsWith(".kr/v1/order/99876654")||t.endsWith(".kr/v1/order/99876655"))){e.next=8;break}return f=t.split("/"),i=f[f.length-1],a=r("960e")("./sample_sell_order_".concat(i,".json")),o=JSON.stringify(a.data),u=c(this.web3,a.order.makeAsset),e.abrupt("return",{order_rawdata:o,order_signature:a.signature,maTypeMV:u.typeMV,maContAddr:u.contractAddress,maTokenId:u.tokenId,maValue:u.value});case 8:return l=s.stringify(n),h="".concat(t,"?").concat(l),e.next=12,this._fetch(h);case 12:return d=e.sent,e.abrupt("return",d.json());case 14:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_fetch",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r,i,a=this,s=arguments;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},this.apiKey,i=n(n({},r),{},{headers:n({},r.headers||{})}),this.logger("Sending request: ".concat(t," ").concat(JSON.stringify(i).substr(0,100),"...")),e.abrupt("return",o(t,i).then(function(){var e=f(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",a._handleApiResponse(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 5:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_handleApiResponse",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.ok){e.next=3;break}return this.logger("Got success: ".concat(t.status)),e.abrupt("return",t);case 3:return e.prev=3,e.next=6,t.text();case 6:r=e.sent,r=JSON.parse(r),e.next=12;break;case 10:e.prev=10,e.t0=e["catch"](3);case 12:this.logger("Got error ".concat(t.status,": ").concat(JSON.stringify(r))),e.t1=t.status,e.next=400===e.t1?16:401===e.t1||403===e.t1?18:404===e.t1?20:500===e.t1?22:503===e.t1?24:26;break;case 16:return n=r&&r.errors?r.errors.join(", "):"Invalid request: ".concat(JSON.stringify(r)),e.abrupt("break",28);case 18:return n="Unauthorized. Full message was '".concat(JSON.stringify(r),"'"),e.abrupt("break",28);case 20:return n="Not found. Full message was '".concat(JSON.stringify(r),"'"),e.abrupt("break",28);case 22:return n="Internal server error. OpenSea has been alerted, but if the problem persists please contact us via Discord: https://discord.gg/ga8EJbv - full message was ".concat(JSON.stringify(r)),e.abrupt("break",28);case 24:return n="Service unavailable. Please try again in a few minutes. If the problem persists please contact us via Discord: https://discord.gg/ga8EJbv - full message was ".concat(JSON.stringify(r)),e.abrupt("break",28);case 26:return n="Message: ".concat(JSON.stringify(r)),e.abrupt("break",28);case 28:throw new Error("API Error ".concat(t.status,": ").concat(n));case 29:case"end":return e.stop()}}),e,this,[[3,10]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_encAssetData",value:function(e,t,r){var n;if(e==p)n=l(this.web3,d);else if(e==m)n=l(this.web3,t);else{if(e!=y&&e!=g)throw"unknown type magic-value (".concat(e,")");n=l(this.web3,t,r)}return n}}]),e}();e.exports={ParulaAPI:w}},2740:function(e,t,r){(function(e){(function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function f(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(31).Buffer}catch(k){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function u(e,t,r,n){for(var f=0,i=Math.min(e.length,r),a=t;a=49?o-49+10:o>=17?o-17+10:o}return f}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var f=0;"-"===e[0]&&(f++,this.negative=1),f=0;f-=3)a=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[i]|=a<>>26-o&67108863,o+=24,o>=26&&(o-=26,i++);else if("le"===r)for(f=0,i=0;f>>26-o&67108863,o+=24,o>=26&&(o-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)f=s(e,t,n)<=18?(i-=18,a+=1,this.words[a]|=f>>>26):i+=8;else{var o=e.length-t;for(n=o%2===0?t+1:t;n=18?(i-=18,a+=1,this.words[a]|=f>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,f=1;f<=67108863;f*=t)n++;n--,f=f/t|0;for(var i=e.length-r,a=i%n,o=Math.min(i,i-a)+r,s=0,c=r;c1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e){for(var t=new Array(e.bitLength()),r=0;r>>f}return t}function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var f=0|e.words[0],i=0|t.words[0],a=f*i,o=67108863&a,s=a/67108864|0;r.words[0]=o;for(var u=1;u>>26,l=67108863&s,h=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=h;d++){var p=u-d|0;f=0|e.words[p],i=0|t.words[d],a=f*i+l,c+=a/67108864|0,l=67108863&a}r.words[u]=0|l,s=0|c}return 0!==s?r.words[u]=0|s:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var f=0,i=0,a=0;a>>24-f&16777215,r=0!==i||a!==this.length-1?c[6-s.length]+s+r:s+r,f+=2,f>=26&&(f-=26,a--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],d=h[e];r="";var p=this.clone();p.negative=0;while(!p.isZero()){var m=p.modn(d).toString(e);p=p.idivn(d),r=p.isZero()?m+r:c[u-m.length]+m+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n("undefined"!==typeof a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var f=this.byteLength(),i=r||Math.max(1,f);n(f<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,o,s="le"===t,u=new e(i),c=this.clone();if(s){for(o=0;!c.isZero();o++)a=c.andln(255),c.iushrn(8),u[o]=a;for(;o=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,f=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var f=0,i=0;i>>26;for(;0!==f&&i>>26;if(this.length=r.length,0!==f)this.words[this.length]=f,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,y=0|a[2],g=8191&y,b=y>>>13,v=0|a[3],w=8191&v,_=v>>>13,T=0|a[4],E=8191&T,x=T>>>13,M=0|a[5],A=8191&M,k=M>>>13,P=0|a[6],C=8191&P,S=P>>>13,R=0|a[7],I=8191&R,N=R>>>13,L=0|a[8],F=8191&L,K=L>>>13,O=0|a[9],D=8191&O,B=O>>>13,U=0|o[0],j=8191&U,V=U>>>13,H=0|o[1],G=8191&H,W=H>>>13,q=0|o[2],Y=8191&q,$=q>>>13,z=0|o[3],Z=8191&z,J=z>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,fe=0|o[6],ie=8191&fe,ae=fe>>>13,oe=0|o[7],se=8191&oe,ue=oe>>>13,ce=0|o[8],le=8191&ce,he=ce>>>13,de=0|o[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(l,j),f=Math.imul(l,V),f=f+Math.imul(h,j)|0,i=Math.imul(h,V);var ye=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,j),f=Math.imul(p,V),f=f+Math.imul(m,j)|0,i=Math.imul(m,V),n=n+Math.imul(l,G)|0,f=f+Math.imul(l,W)|0,f=f+Math.imul(h,G)|0,i=i+Math.imul(h,W)|0;var ge=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,j),f=Math.imul(g,V),f=f+Math.imul(b,j)|0,i=Math.imul(b,V),n=n+Math.imul(p,G)|0,f=f+Math.imul(p,W)|0,f=f+Math.imul(m,G)|0,i=i+Math.imul(m,W)|0,n=n+Math.imul(l,Y)|0,f=f+Math.imul(l,$)|0,f=f+Math.imul(h,Y)|0,i=i+Math.imul(h,$)|0;var be=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,j),f=Math.imul(w,V),f=f+Math.imul(_,j)|0,i=Math.imul(_,V),n=n+Math.imul(g,G)|0,f=f+Math.imul(g,W)|0,f=f+Math.imul(b,G)|0,i=i+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,f=f+Math.imul(p,$)|0,f=f+Math.imul(m,Y)|0,i=i+Math.imul(m,$)|0,n=n+Math.imul(l,Z)|0,f=f+Math.imul(l,J)|0,f=f+Math.imul(h,Z)|0,i=i+Math.imul(h,J)|0;var ve=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,j),f=Math.imul(E,V),f=f+Math.imul(x,j)|0,i=Math.imul(x,V),n=n+Math.imul(w,G)|0,f=f+Math.imul(w,W)|0,f=f+Math.imul(_,G)|0,i=i+Math.imul(_,W)|0,n=n+Math.imul(g,Y)|0,f=f+Math.imul(g,$)|0,f=f+Math.imul(b,Y)|0,i=i+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,f=f+Math.imul(p,J)|0,f=f+Math.imul(m,Z)|0,i=i+Math.imul(m,J)|0,n=n+Math.imul(l,Q)|0,f=f+Math.imul(l,ee)|0,f=f+Math.imul(h,Q)|0,i=i+Math.imul(h,ee)|0;var we=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,j),f=Math.imul(A,V),f=f+Math.imul(k,j)|0,i=Math.imul(k,V),n=n+Math.imul(E,G)|0,f=f+Math.imul(E,W)|0,f=f+Math.imul(x,G)|0,i=i+Math.imul(x,W)|0,n=n+Math.imul(w,Y)|0,f=f+Math.imul(w,$)|0,f=f+Math.imul(_,Y)|0,i=i+Math.imul(_,$)|0,n=n+Math.imul(g,Z)|0,f=f+Math.imul(g,J)|0,f=f+Math.imul(b,Z)|0,i=i+Math.imul(b,J)|0,n=n+Math.imul(p,Q)|0,f=f+Math.imul(p,ee)|0,f=f+Math.imul(m,Q)|0,i=i+Math.imul(m,ee)|0,n=n+Math.imul(l,re)|0,f=f+Math.imul(l,ne)|0,f=f+Math.imul(h,re)|0,i=i+Math.imul(h,ne)|0;var _e=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(C,j),f=Math.imul(C,V),f=f+Math.imul(S,j)|0,i=Math.imul(S,V),n=n+Math.imul(A,G)|0,f=f+Math.imul(A,W)|0,f=f+Math.imul(k,G)|0,i=i+Math.imul(k,W)|0,n=n+Math.imul(E,Y)|0,f=f+Math.imul(E,$)|0,f=f+Math.imul(x,Y)|0,i=i+Math.imul(x,$)|0,n=n+Math.imul(w,Z)|0,f=f+Math.imul(w,J)|0,f=f+Math.imul(_,Z)|0,i=i+Math.imul(_,J)|0,n=n+Math.imul(g,Q)|0,f=f+Math.imul(g,ee)|0,f=f+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,f=f+Math.imul(p,ne)|0,f=f+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,n=n+Math.imul(l,ie)|0,f=f+Math.imul(l,ae)|0,f=f+Math.imul(h,ie)|0,i=i+Math.imul(h,ae)|0;var Te=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(I,j),f=Math.imul(I,V),f=f+Math.imul(N,j)|0,i=Math.imul(N,V),n=n+Math.imul(C,G)|0,f=f+Math.imul(C,W)|0,f=f+Math.imul(S,G)|0,i=i+Math.imul(S,W)|0,n=n+Math.imul(A,Y)|0,f=f+Math.imul(A,$)|0,f=f+Math.imul(k,Y)|0,i=i+Math.imul(k,$)|0,n=n+Math.imul(E,Z)|0,f=f+Math.imul(E,J)|0,f=f+Math.imul(x,Z)|0,i=i+Math.imul(x,J)|0,n=n+Math.imul(w,Q)|0,f=f+Math.imul(w,ee)|0,f=f+Math.imul(_,Q)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,f=f+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0,n=n+Math.imul(p,ie)|0,f=f+Math.imul(p,ae)|0,f=f+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0,n=n+Math.imul(l,se)|0,f=f+Math.imul(l,ue)|0,f=f+Math.imul(h,se)|0,i=i+Math.imul(h,ue)|0;var Ee=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,j),f=Math.imul(F,V),f=f+Math.imul(K,j)|0,i=Math.imul(K,V),n=n+Math.imul(I,G)|0,f=f+Math.imul(I,W)|0,f=f+Math.imul(N,G)|0,i=i+Math.imul(N,W)|0,n=n+Math.imul(C,Y)|0,f=f+Math.imul(C,$)|0,f=f+Math.imul(S,Y)|0,i=i+Math.imul(S,$)|0,n=n+Math.imul(A,Z)|0,f=f+Math.imul(A,J)|0,f=f+Math.imul(k,Z)|0,i=i+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,f=f+Math.imul(E,ee)|0,f=f+Math.imul(x,Q)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,f=f+Math.imul(w,ne)|0,f=f+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(g,ie)|0,f=f+Math.imul(g,ae)|0,f=f+Math.imul(b,ie)|0,i=i+Math.imul(b,ae)|0,n=n+Math.imul(p,se)|0,f=f+Math.imul(p,ue)|0,f=f+Math.imul(m,se)|0,i=i+Math.imul(m,ue)|0,n=n+Math.imul(l,le)|0,f=f+Math.imul(l,he)|0,f=f+Math.imul(h,le)|0,i=i+Math.imul(h,he)|0;var xe=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,j),f=Math.imul(D,V),f=f+Math.imul(B,j)|0,i=Math.imul(B,V),n=n+Math.imul(F,G)|0,f=f+Math.imul(F,W)|0,f=f+Math.imul(K,G)|0,i=i+Math.imul(K,W)|0,n=n+Math.imul(I,Y)|0,f=f+Math.imul(I,$)|0,f=f+Math.imul(N,Y)|0,i=i+Math.imul(N,$)|0,n=n+Math.imul(C,Z)|0,f=f+Math.imul(C,J)|0,f=f+Math.imul(S,Z)|0,i=i+Math.imul(S,J)|0,n=n+Math.imul(A,Q)|0,f=f+Math.imul(A,ee)|0,f=f+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,f=f+Math.imul(E,ne)|0,f=f+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(w,ie)|0,f=f+Math.imul(w,ae)|0,f=f+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,n=n+Math.imul(g,se)|0,f=f+Math.imul(g,ue)|0,f=f+Math.imul(b,se)|0,i=i+Math.imul(b,ue)|0,n=n+Math.imul(p,le)|0,f=f+Math.imul(p,he)|0,f=f+Math.imul(m,le)|0,i=i+Math.imul(m,he)|0,n=n+Math.imul(l,pe)|0,f=f+Math.imul(l,me)|0,f=f+Math.imul(h,pe)|0,i=i+Math.imul(h,me)|0;var Me=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,G),f=Math.imul(D,W),f=f+Math.imul(B,G)|0,i=Math.imul(B,W),n=n+Math.imul(F,Y)|0,f=f+Math.imul(F,$)|0,f=f+Math.imul(K,Y)|0,i=i+Math.imul(K,$)|0,n=n+Math.imul(I,Z)|0,f=f+Math.imul(I,J)|0,f=f+Math.imul(N,Z)|0,i=i+Math.imul(N,J)|0,n=n+Math.imul(C,Q)|0,f=f+Math.imul(C,ee)|0,f=f+Math.imul(S,Q)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(A,re)|0,f=f+Math.imul(A,ne)|0,f=f+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(E,ie)|0,f=f+Math.imul(E,ae)|0,f=f+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,n=n+Math.imul(w,se)|0,f=f+Math.imul(w,ue)|0,f=f+Math.imul(_,se)|0,i=i+Math.imul(_,ue)|0,n=n+Math.imul(g,le)|0,f=f+Math.imul(g,he)|0,f=f+Math.imul(b,le)|0,i=i+Math.imul(b,he)|0,n=n+Math.imul(p,pe)|0,f=f+Math.imul(p,me)|0,f=f+Math.imul(m,pe)|0,i=i+Math.imul(m,me)|0;var Ae=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,Y),f=Math.imul(D,$),f=f+Math.imul(B,Y)|0,i=Math.imul(B,$),n=n+Math.imul(F,Z)|0,f=f+Math.imul(F,J)|0,f=f+Math.imul(K,Z)|0,i=i+Math.imul(K,J)|0,n=n+Math.imul(I,Q)|0,f=f+Math.imul(I,ee)|0,f=f+Math.imul(N,Q)|0,i=i+Math.imul(N,ee)|0,n=n+Math.imul(C,re)|0,f=f+Math.imul(C,ne)|0,f=f+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(A,ie)|0,f=f+Math.imul(A,ae)|0,f=f+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,n=n+Math.imul(E,se)|0,f=f+Math.imul(E,ue)|0,f=f+Math.imul(x,se)|0,i=i+Math.imul(x,ue)|0,n=n+Math.imul(w,le)|0,f=f+Math.imul(w,he)|0,f=f+Math.imul(_,le)|0,i=i+Math.imul(_,he)|0,n=n+Math.imul(g,pe)|0,f=f+Math.imul(g,me)|0,f=f+Math.imul(b,pe)|0,i=i+Math.imul(b,me)|0;var ke=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Z),f=Math.imul(D,J),f=f+Math.imul(B,Z)|0,i=Math.imul(B,J),n=n+Math.imul(F,Q)|0,f=f+Math.imul(F,ee)|0,f=f+Math.imul(K,Q)|0,i=i+Math.imul(K,ee)|0,n=n+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,f=f+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,n=n+Math.imul(C,ie)|0,f=f+Math.imul(C,ae)|0,f=f+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,n=n+Math.imul(A,se)|0,f=f+Math.imul(A,ue)|0,f=f+Math.imul(k,se)|0,i=i+Math.imul(k,ue)|0,n=n+Math.imul(E,le)|0,f=f+Math.imul(E,he)|0,f=f+Math.imul(x,le)|0,i=i+Math.imul(x,he)|0,n=n+Math.imul(w,pe)|0,f=f+Math.imul(w,me)|0,f=f+Math.imul(_,pe)|0,i=i+Math.imul(_,me)|0;var Pe=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Q),f=Math.imul(D,ee),f=f+Math.imul(B,Q)|0,i=Math.imul(B,ee),n=n+Math.imul(F,re)|0,f=f+Math.imul(F,ne)|0,f=f+Math.imul(K,re)|0,i=i+Math.imul(K,ne)|0,n=n+Math.imul(I,ie)|0,f=f+Math.imul(I,ae)|0,f=f+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,n=n+Math.imul(C,se)|0,f=f+Math.imul(C,ue)|0,f=f+Math.imul(S,se)|0,i=i+Math.imul(S,ue)|0,n=n+Math.imul(A,le)|0,f=f+Math.imul(A,he)|0,f=f+Math.imul(k,le)|0,i=i+Math.imul(k,he)|0,n=n+Math.imul(E,pe)|0,f=f+Math.imul(E,me)|0,f=f+Math.imul(x,pe)|0,i=i+Math.imul(x,me)|0;var Ce=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,re),f=Math.imul(D,ne),f=f+Math.imul(B,re)|0,i=Math.imul(B,ne),n=n+Math.imul(F,ie)|0,f=f+Math.imul(F,ae)|0,f=f+Math.imul(K,ie)|0,i=i+Math.imul(K,ae)|0,n=n+Math.imul(I,se)|0,f=f+Math.imul(I,ue)|0,f=f+Math.imul(N,se)|0,i=i+Math.imul(N,ue)|0,n=n+Math.imul(C,le)|0,f=f+Math.imul(C,he)|0,f=f+Math.imul(S,le)|0,i=i+Math.imul(S,he)|0,n=n+Math.imul(A,pe)|0,f=f+Math.imul(A,me)|0,f=f+Math.imul(k,pe)|0,i=i+Math.imul(k,me)|0;var Se=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,ie),f=Math.imul(D,ae),f=f+Math.imul(B,ie)|0,i=Math.imul(B,ae),n=n+Math.imul(F,se)|0,f=f+Math.imul(F,ue)|0,f=f+Math.imul(K,se)|0,i=i+Math.imul(K,ue)|0,n=n+Math.imul(I,le)|0,f=f+Math.imul(I,he)|0,f=f+Math.imul(N,le)|0,i=i+Math.imul(N,he)|0,n=n+Math.imul(C,pe)|0,f=f+Math.imul(C,me)|0,f=f+Math.imul(S,pe)|0,i=i+Math.imul(S,me)|0;var Re=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,se),f=Math.imul(D,ue),f=f+Math.imul(B,se)|0,i=Math.imul(B,ue),n=n+Math.imul(F,le)|0,f=f+Math.imul(F,he)|0,f=f+Math.imul(K,le)|0,i=i+Math.imul(K,he)|0,n=n+Math.imul(I,pe)|0,f=f+Math.imul(I,me)|0,f=f+Math.imul(N,pe)|0,i=i+Math.imul(N,me)|0;var Ie=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,le),f=Math.imul(D,he),f=f+Math.imul(B,le)|0,i=Math.imul(B,he),n=n+Math.imul(F,pe)|0,f=f+Math.imul(F,me)|0,f=f+Math.imul(K,pe)|0,i=i+Math.imul(K,me)|0;var Ne=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(D,pe),f=Math.imul(D,me),f=f+Math.imul(B,pe)|0,i=Math.imul(B,me);var Le=(u+n|0)+((8191&f)<<13)|0;return u=(i+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,s[0]=ye,s[1]=ge,s[2]=be,s[3]=ve,s[4]=we,s[5]=_e,s[6]=Te,s[7]=Ee,s[8]=xe,s[9]=Me,s[10]=Ae,s[11]=ke,s[12]=Pe,s[13]=Ce,s[14]=Se,s[15]=Re,s[16]=Ie,s[17]=Ne,s[18]=Le,0!==u&&(s[19]=u,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,f=0,i=0;i>>26)|0,f+=a>>>26,a&=67108863}r.words[i]=o,n=a,a=f}return 0!==n?r.words[i]=n:r.length--,r.strip()}function g(e,t,r){var n=new b;return n.mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=p),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?m(this,e,t):n<63?p(this,e,t):n<1024?y(this,e,t):g(this,e,t),r},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,f,i){for(var a=0;a>>=1)f++;return 1<>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=f/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=d(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,r=e%26,f=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==f){for(t=this.length-1;t>=0;t--)this.words[t+f]=this.words[t];for(t=0;t=0),f=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),o=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==c||u>=f);u--){var l=0|this.words[u];this.words[u]=c<<26-i|l>>>i,c=l&o}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,f=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var f=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(s/67108864|0),this.words[f+r]=67108863&i}for(;f>26,this.words[f+r]=67108863&i;if(0===o)return this.strip();for(n(-1===o),o=0,f=0;f>26,this.words[f]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),f=e,a=0|f.words[f.length-1],o=this._countBits(a);r=26-o,0!==r&&(f=f.ushln(r),n.iushln(r),a=0|f.words[f.length-1]);var s,u=n.length-f.length;if("mod"!==t){s=new i(null),s.length=u+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var d=67108864*(0|n.words[f.length+h])+(0|n.words[f.length+h-1]);d=Math.min(d/a|0,67108863),n._ishlnsubmul(f,d,h);while(0!==n.negative)d--,n.negative=0,n._ishlnsubmul(f,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(f=o.div.neg()),"div"!==t&&(a=o.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:f,mod:a}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(f=o.div.neg()),{div:f,mod:o.mod}):0!==(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(a=o.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:o.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var f,a,o},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),f=e.andln(1),i=r.cmp(n);return i<0||1===f&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,f=this.length-1;f>=0;f--)r=(t*r+(0|this.words[f]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var f=(0|this.words[r])+67108864*t;this.words[r]=f/e|0,t=f%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var f=new i(1),a=new i(0),o=new i(0),s=new i(1),u=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++u;var c=r.clone(),l=t.clone();while(!t.isZero()){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0){t.iushrn(h);while(h-- >0)(f.isOdd()||a.isOdd())&&(f.iadd(c),a.isub(l)),f.iushrn(1),a.iushrn(1)}for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0){r.iushrn(p);while(p-- >0)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(l)),o.iushrn(1),s.iushrn(1)}t.cmp(r)>=0?(t.isub(r),f.isub(o),a.isub(s)):(r.isub(t),o.isub(f),s.isub(a))}return{a:o,b:s,gcd:r.iushln(u)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var f,a=new i(1),o=new i(0),s=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var u=0,c=1;0===(t.words[0]&c)&&u<26;++u,c<<=1);if(u>0){t.iushrn(u);while(u-- >0)a.isOdd()&&a.iadd(s),a.iushrn(1)}for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0){r.iushrn(l);while(l-- >0)o.isOdd()&&o.iadd(s),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),a.isub(o)):(r.isub(t),o.isub(a))}return f=0===t.cmpn(1)?a:o,f.cmpn(0)<0&&f.iadd(e),f},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var f=t.cmp(r);if(f<0){var i=t;t=r,r=i}else if(0===f||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,f=1<>>26,o&=67108863,this.words[a]=o}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var f=0|this.words[0];t=f===e?0:fe.length)return 1;if(this.length=0;r--){var n=0|this.words[r],f=0|e.words[r];if(n!==f){nf&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new M(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function T(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},f(_,w),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),f=0;f>>22,i=a}i>>>=22,e.words[f-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=f,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new T;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return v[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var f=this.m.subn(1),a=0;while(!f.isZero()&&0===f.andln(1))a++,f.iushrn(1);n(!f.isZero());var o=new i(1).toRed(this),s=o.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();c=new i(2*c*c).toRed(this);while(0!==this.pow(c,u).cmp(s))c.redIAdd(s);var l=this.pow(c,f),h=this.pow(e,f.addn(1).iushrn(1)),d=this.pow(e,f),p=a;while(0!==d.cmp(o)){for(var m=d,y=0;0!==m.cmp(o);y++)m=m.redSqr();n(y=0;f--){for(var c=t.words[f],l=u-1;l>=0;l--){var h=c>>l&1;a!==n[0]&&(a=this.sqr(a)),0!==h||0!==o?(o<<=1,o|=h,s++,(s===r||0===f&&0===l)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}u=26}return a},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new A(e)},f(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=r.isub(n).iushrn(this.shift),i=f;return f.cmp(this.m)>=0?i=f.isub(this.m):f.cmpn(0)<0&&(i=f.iadd(this.m)),i._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=r.isub(n).iushrn(this.shift),a=f;return f.cmp(this.m)>=0?a=f.isub(this.m):f.cmpn(0)<0&&(a=f.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(e,this)}).call(this,r("62e4")(e))},2803:function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("475b"),f=r("98e6"),i=r("9a12"),a=r("a3ca"),o=r("d5c5");t.keccak=function(t,r){return void 0===r&&(r=256),t="string"!==typeof t||i.isHexString(t)?o.toBuffer(t):e.from(t,"utf8"),r||(r=256),n("keccak"+r).update(t).digest()},t.keccak256=function(e){return t.keccak(e)},t.sha256=function(e){return e=o.toBuffer(e),f("sha256").update(e).digest()},t.ripemd160=function(e,t){e=o.toBuffer(e);var r=f("rmd160").update(e).digest();return!0===t?o.setLength(r,32):r},t.rlphash=function(e){return t.keccak(a.encode(e))}}).call(this,r("b639").Buffer)},2865:function(e,t,r){var n=r("faa1"),f=r("ccc1"),i=r("3022");function a(e){n.EventEmitter.call(this),this.backoffStrategy_=e,this.maxNumberOfRetry_=-1,this.backoffNumber_=0,this.backoffDelay_=0,this.timeoutID_=-1,this.handlers={backoff:this.onBackoff_.bind(this)}}i.inherits(a,n.EventEmitter),a.prototype.failAfter=function(e){f.checkArgument(e>0,"Expected a maximum number of retry greater than 0 but got %s.",e),this.maxNumberOfRetry_=e},a.prototype.backoff=function(e){f.checkState(-1===this.timeoutID_,"Backoff in progress."),this.backoffNumber_===this.maxNumberOfRetry_?(this.emit("fail",e),this.reset()):(this.backoffDelay_=this.backoffStrategy_.next(),this.timeoutID_=setTimeout(this.handlers.backoff,this.backoffDelay_),this.emit("backoff",this.backoffNumber_,this.backoffDelay_,e))},a.prototype.onBackoff_=function(){this.timeoutID_=-1,this.emit("ready",this.backoffNumber_,this.backoffDelay_),this.backoffNumber_++},a.prototype.reset=function(){this.backoffNumber_=0,this.backoffStrategy_.reset(),clearTimeout(this.timeoutID_),this.timeoutID_=-1},e.exports=a},29:function(e,t){},"2ca0":function(e,t,r){"use strict";var n=r("23e7"),f=r("06cf").f,i=r("50c4"),a=r("577e"),o=r("5a34"),s=r("1d80"),u=r("ab13"),c=r("c430"),l="".startsWith,h=Math.min,d=u("startsWith"),p=!c&&!d&&!!function(){var e=f(String.prototype,"startsWith");return e&&!e.writable}();n({target:"String",proto:!0,forced:!p&&!d},{startsWith:function(e){var t=a(s(this));o(e);var r=i(h(arguments.length>1?arguments[1]:void 0,t.length)),n=a(e);return l?l.call(t,n,r):t.slice(r,r+n.length)===n}})},"2d58":function(e,t,r){"use strict";const n=r("1eca"),{objectToQuery:f}=r("d518"),{ok:i}=r("7872"),a=r("83c7");e.exports=n(({fetch:e,apiUrl:t,apiPath:r,headers:n})=>async(o,s)=>{s=s||{};const u=f({arg:o.toString(),...s.qs||{}}),c=`${t}${r}/block/stat${u}`,l=await i(e(c,{signal:s.signal,headers:s.headers||n}));return a(await l.json())})},"2dfe":function(e,t,r){const n=r("375a");class f extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!==typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return n(this.serialize(),o,2)}}class i extends f{constructor(e,t,r){if(!a(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function a(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function o(e,t){if("[Circular]"!==t)return t}e.exports={EthereumRpcError:f,EthereumProviderError:i}},"2e19":function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("d968");t.MAX_INTEGER=new n("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new n("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=e.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=e.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=e.from(t.KECCAK256_RLP_S,"hex")}).call(this,r("b639").Buffer)},"2eeb":function(e,t,r){const n=r("add0").Mutex,f=r("c3dd"),i=r("57b8"),a=r("5bf5"),o=r("6db1"),s=r("ff29"),{intToHex:u,hexToInt:c}=r("1d6f");function l({blockTracker:e,provider:t}){let r=0,f={};const l=new n,y=p({mutex:l}),g=i({eth_newFilter:y(h(v)),eth_newBlockFilter:y(h(w)),eth_newPendingTransactionFilter:y(h(_)),eth_uninstallFilter:y(d(x)),eth_getFilterChanges:y(d(T)),eth_getFilterLogs:y(d(E))}),b=async({oldBlock:e,newBlock:t})=>{if(0===f.length)return;const r=await l.acquire();try{await Promise.all(m(f).map(async r=>{try{await r.update({oldBlock:e,newBlock:t})}catch(n){console.error(n)}}))}catch(n){console.error(n)}r()};return g.newLogFilter=v,g.newBlockFilter=w,g.newPendingTransactionFilter=_,g.uninstallFilter=x,g.getFilterChanges=T,g.getFilterLogs=E,g.destroy=()=>{k()},g;async function v(e){const r=new a({provider:t,params:e});await M(r);return r}async function w(){const e=new o({provider:t});await M(e);return e}async function _(){const e=new s({provider:t});await M(e);return e}async function T(e){const t=c(e),r=f[t];if(!r)throw new Error(`No filter for index "${t}"`);const n=r.getChangesAndClear();return n}async function E(e){const t=c(e),r=f[t];if(!r)throw new Error(`No filter for index "${t}"`);return"log"===r.type?results=r.getAllResults():results=[],results}async function x(e){const t=c(e),r=f[t],n=Boolean(r);return n&&await A(t),n}async function M(t){const n=m(f).length,i=await e.getLatestBlock();await t.initialize({currentBlock:i}),r++,f[r]=t,t.id=r,t.idHex=u(r);const a=m(f).length;return P({prevFilterCount:n,newFilterCount:a}),r}async function A(e){const t=m(f).length;delete f[e];const r=m(f).length;P({prevFilterCount:t,newFilterCount:r})}async function k(){const e=m(f).length;f={},P({prevFilterCount:e,newFilterCount:0})}function P({prevFilterCount:t,newFilterCount:r}){0===t&&r>0?e.on("sync",b):t>0&&0===r&&e.removeListener("sync",b)}}function h(e){return d(async(...t)=>{const r=await e(...t),n=u(r.id);return n})}function d(e){return f(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function p({mutex:e}){return t=>async(r,n,f,i)=>{const a=await e.acquire();a(),t(r,n,f,i)}}function m(e,t){const r=[];for(let n in e)r.push(e[n]);return r}e.exports=l},"2f1b":function(e,t,r){"use strict";var n=r("d8db"),f=function(){function e(){this._subscriptionsForType={},this._currentSubscription=null}var t=e.prototype;return t.addSubscription=function(e,t){t.subscriber!==this&&n(!1),this._subscriptionsForType[e]||(this._subscriptionsForType[e]=[]);var r=this._subscriptionsForType[e].length;return this._subscriptionsForType[e].push(t),t.eventType=e,t.key=r,t},t.removeAllSubscriptions=function(e){void 0===e?this._subscriptionsForType={}:delete this._subscriptionsForType[e]},t.removeSubscription=function(e){var t=e.eventType,r=e.key,n=this._subscriptionsForType[t];n&&delete n[r]},t.getSubscriptionsForType=function(e){return this._subscriptionsForType[e]},e}();e.exports=f},30:function(e,t){},3066:function(e,t,r){"use strict";const{Buffer:n}=r("b639"),f=r("1eca"),{ok:i}=r("7872"),{objectToQuery:a}=r("d518");e.exports=f(({fetch:e,apiUrl:t,apiPath:r,headers:f})=>async(o,s)=>{s=s||{};const u=a({arg:o.toString(),...s.qs||{}}),c=`${t}${r}/block/get${u}`,l=await i(e(c,{signal:s.signal,headers:s.headers||f}));return n.from(await l.arrayBuffer())})},3070:function(e,t,r){const n=r("2ef0"),f=r("9cca"),{kip13JsonInterface:i,interfaceIds:a}=r("bec2"),{isAddress:o}=r("19b5");class s extends f{static async isImplementedKIP13Interface(e){const t=new s(e),r=await t.sendQuery(a.preCondition.true),n=await t.sendQuery(a.preCondition.false);return r&&!n}constructor(e,t=i){if(e)if(n.isString(e)){if(!o(e))throw new Error("Invalid contract address "+e)}else t=e,e=void 0;super(t,e)}async sendQuery(e){const t=await this.methods.supportsInterface(e).call();return t}}e.exports=s},31:function(e,t){},32:function(e,t){},"321b":function(e,t,r){const n=r("741b"),f=r("53a8");function i(e){return f({id:n(),jsonrpc:"2.0",params:[]},e)}e.exports=i},3292:function(e,t,r){"use strict";const{encodeText:n}=r("a8c0");class f{constructor(e,t,r,f){this.name=e,this.code=t,this.codeBuf=n(this.code),this.alphabet=f,this.codec=r(f)}encode(e){return this.codec.encode(e)}decode(e){for(const t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.codec.decode(e)}}e.exports=f},"32a9":function(e,t,r){"use strict";const n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];t.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],f=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],c=e[7]^e[17]^e[27]^e[37]^e[47],l=e[8]^e[18]^e[28]^e[38]^e[48],h=e[9]^e[19]^e[29]^e[39]^e[49];let d=l^(i<<1|a>>>31),p=h^(a<<1|i>>>31);const m=e[0]^d,y=e[1]^p,g=e[10]^d,b=e[11]^p,v=e[20]^d,w=e[21]^p,_=e[30]^d,T=e[31]^p,E=e[40]^d,x=e[41]^p;d=r^(o<<1|s>>>31),p=f^(s<<1|o>>>31);const M=e[2]^d,A=e[3]^p,k=e[12]^d,P=e[13]^p,C=e[22]^d,S=e[23]^p,R=e[32]^d,I=e[33]^p,N=e[42]^d,L=e[43]^p;d=i^(u<<1|c>>>31),p=a^(c<<1|u>>>31);const F=e[4]^d,K=e[5]^p,O=e[14]^d,D=e[15]^p,B=e[24]^d,U=e[25]^p,j=e[34]^d,V=e[35]^p,H=e[44]^d,G=e[45]^p;d=o^(l<<1|h>>>31),p=s^(h<<1|l>>>31);const W=e[6]^d,q=e[7]^p,Y=e[16]^d,$=e[17]^p,z=e[26]^d,Z=e[27]^p,J=e[36]^d,X=e[37]^p,Q=e[46]^d,ee=e[47]^p;d=u^(r<<1|f>>>31),p=c^(f<<1|r>>>31);const te=e[8]^d,re=e[9]^p,ne=e[18]^d,fe=e[19]^p,ie=e[28]^d,ae=e[29]^p,oe=e[38]^d,se=e[39]^p,ue=e[48]^d,ce=e[49]^p,le=m,he=y,de=b<<4|g>>>28,pe=g<<4|b>>>28,me=v<<3|w>>>29,ye=w<<3|v>>>29,ge=T<<9|_>>>23,be=_<<9|T>>>23,ve=E<<18|x>>>14,we=x<<18|E>>>14,_e=M<<1|A>>>31,Te=A<<1|M>>>31,Ee=P<<12|k>>>20,xe=k<<12|P>>>20,Me=C<<10|S>>>22,Ae=S<<10|C>>>22,ke=I<<13|R>>>19,Pe=R<<13|I>>>19,Ce=N<<2|L>>>30,Se=L<<2|N>>>30,Re=K<<30|F>>>2,Ie=F<<30|K>>>2,Ne=O<<6|D>>>26,Le=D<<6|O>>>26,Fe=U<<11|B>>>21,Ke=B<<11|U>>>21,Oe=j<<15|V>>>17,De=V<<15|j>>>17,Be=G<<29|H>>>3,Ue=H<<29|G>>>3,je=W<<28|q>>>4,Ve=q<<28|W>>>4,He=$<<23|Y>>>9,Ge=Y<<23|$>>>9,We=z<<25|Z>>>7,qe=Z<<25|z>>>7,Ye=J<<21|X>>>11,$e=X<<21|J>>>11,ze=ee<<24|Q>>>8,Ze=Q<<24|ee>>>8,Je=te<<27|re>>>5,Xe=re<<27|te>>>5,Qe=ne<<20|fe>>>12,et=fe<<20|ne>>>12,tt=ae<<7|ie>>>25,rt=ie<<7|ae>>>25,nt=oe<<8|se>>>24,ft=se<<8|oe>>>24,it=ue<<14|ce>>>18,at=ce<<14|ue>>>18;e[0]=le^~Ee&Fe,e[1]=he^~xe&Ke,e[10]=je^~Qe&me,e[11]=Ve^~et&ye,e[20]=_e^~Ne&We,e[21]=Te^~Le&qe,e[30]=Je^~de&Me,e[31]=Xe^~pe&Ae,e[40]=Re^~He&tt,e[41]=Ie^~Ge&rt,e[2]=Ee^~Fe&Ye,e[3]=xe^~Ke&$e,e[12]=Qe^~me&ke,e[13]=et^~ye&Pe,e[22]=Ne^~We&nt,e[23]=Le^~qe&ft,e[32]=de^~Me&Oe,e[33]=pe^~Ae&De,e[42]=He^~tt&ge,e[43]=Ge^~rt&be,e[4]=Fe^~Ye&it,e[5]=Ke^~$e&at,e[14]=me^~ke&Be,e[15]=ye^~Pe&Ue,e[24]=We^~nt&ve,e[25]=qe^~ft&we,e[34]=Me^~Oe&ze,e[35]=Ae^~De&Ze,e[44]=tt^~ge&Ce,e[45]=rt^~be&Se,e[6]=Ye^~it&le,e[7]=$e^~at&he,e[16]=ke^~Be&je,e[17]=Pe^~Ue&Ve,e[26]=nt^~ve&_e,e[27]=ft^~we&Te,e[36]=Oe^~ze&Je,e[37]=De^~Ze&Xe,e[46]=ge^~Ce&Re,e[47]=be^~Se&Ie,e[8]=it^~le&Ee,e[9]=at^~he&xe,e[18]=Be^~je&Qe,e[19]=Ue^~Ve&et,e[28]=ve^~_e&Ne,e[29]=we^~Te&Le,e[38]=ze^~Je&de,e[39]=Ze^~Xe&pe,e[48]=Ce^~Re&He,e[49]=Se^~Ie&Ge,e[0]^=n[2*t],e[1]^=n[2*t+1]}}},"32fe":function(e,t,r){"use strict";const n=r("1ce8"),f=r("2612"),{names:i}=r("a531"),a=r("9b62"),o=r("d46b"),s=r("f3bf"),u={};for(const _ in i){const e=_;u[i[e]]=e}function c(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return a(e,"base16")}function l(e){return o(e,"base16")}function h(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return a(n.encode("base58btc",e)).slice(1)}function d(e){const t=e instanceof Uint8Array?a(e):e;return n.decode("z"+t)}function p(e){if(!(e instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(e.length<2)throw new Error("multihash too short. must be > 2 bytes.");const t=f.decode(e);if(!b(t))throw new Error("multihash unknown function code: 0x"+t.toString(16));e=e.slice(f.decode.bytes);const r=f.decode(e);if(r<0)throw new Error("multihash invalid length: "+r);if(e=e.slice(f.decode.bytes),e.length!==r)throw new Error("multihash length inconsistent: 0x"+a(e,"base16"));return{code:t,name:u[t],length:r,digest:e}}function m(e,t,r){if(!e||void 0===t)throw new Error("multihash encode requires at least two args: digest, code");const n=y(t);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==r&&(r=e.length),r&&e.length!==r)throw new Error("digest length should be equal to specified length.");const i=f.encode(n),a=f.encode(r);return s([i,a,e],i.length+a.length+e.length)}function y(e){let t=e;if("string"===typeof e){if(void 0===i[e])throw new Error("Unrecognized hash function named: "+e);t=i[e]}if("number"!==typeof t)throw new Error("Hash function code should be a number. Got: "+t);if(void 0===u[t]&&!g(t))throw new Error("Unrecognized function code: "+t);return t}function g(e){return e>0&&e<16}function b(e){return!!g(e)||!!u[e]}function v(e){p(e)}function w(e){return v(e),e.subarray(0,2)}Object.freeze(u),e.exports={names:i,codes:u,toHexString:c,fromHexString:l,toB58String:h,fromB58String:d,decode:p,encode:m,coerceCode:y,isAppCode:g,validate:v,prefix:w,isValidCode:b}},33:function(e,t){},3359:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("3b36"),f=r("3e00"),i=function(){function e(e){this._hdkey=e}return e.fromMasterSeed=function(t){return new e(f.HDKey.fromMasterSeed(t))},e.fromExtendedKey=function(t){return new e(f.HDKey.fromExtendedKey(t))},e.prototype.privateExtendedKey=function(){if(!this._hdkey.privateExtendedKey)throw new Error("This is a public key only wallet");return this._hdkey.privateExtendedKey},e.prototype.publicExtendedKey=function(){return this._hdkey.publicExtendedKey},e.prototype.derivePath=function(t){return new e(this._hdkey.derive(t))},e.prototype.deriveChild=function(t){return new e(this._hdkey.deriveChild(t))},e.prototype.getWallet=function(){return this._hdkey._privateKey?n.default.fromPrivateKey(this._hdkey._privateKey):n.default.fromPublicKey(this._hdkey._publicKey,!0)},e}();t.default=i},"339a":function(e){e.exports=JSON.parse('{"contractName":"Paru721V2","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"RoyaltyOwnerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"indexed":false,"internalType":"struct LibPart.Part[]","name":"royalty","type":"tuple[]"}],"name":"RoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"BURNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_baseuri","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"mintItem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"royaltyOwner","type":"address"},{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"internalType":"struct LibPart.Part[]","name":"royalties","type":"tuple[]"}],"name":"mintItemWithRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"internalType":"struct LibPart.Part[]","name":"royalties","type":"tuple[]"}],"name":"updateRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"transferRoyaltyOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRoyalties","outputs":[{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"internalType":"struct LibPart.Part[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRoyaltyOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function","constant":true}]}')},34:function(e,t){},35:function(e,t){},"364d":function(e,t,r){"use strict";const n=(e,t)=>function(...r){const n=t.promiseModule;return new n((n,f)=>{t.multiArgs?r.push((...e)=>{t.errorFirst?e[0]?f(e):(e.shift(),n(e)):n(e)}):t.errorFirst?r.push((e,t)=>{e?f(e):n(t)}):r.push(n),e.apply(this,r)})};e.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=typeof e;if(null===e||"object"!==r&&"function"!==r)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===e?"null":r}\``);const f=e=>{const r=t=>"string"===typeof t?e===t:t.test(e);return t.include?t.include.some(r):!t.exclude.some(r)};let i;i="function"===r?function(...r){return t.excludeMain?e(...r):n(e,t).apply(this,r)}:Object.create(Object.getPrototypeOf(e));for(const a in e){const r=e[a];i[a]="function"===typeof r&&f(a)?n(r,t):r}return i}},3676:function(e,t,r){"use strict";const{objectToQuery:n}=r("d518"),f=r("1eca"),{ok:i}=r("7872"),{toFormData:a}=r("92dc");e.exports=f(({fetch:e,apiUrl:t,apiPath:r,headers:f})=>async(o,s,u)=>{u=u||{};const c=n({arg:o,"stream-channels":!0,"cid-version":u.cidVersion,count:u.count,create:u.create,hash:u.hashAlg,offset:u.offset,parents:u.parents,"raw-leaves":u.rawLeaves,truncate:u.truncate,...u.qs||{}}),l=`${t}${r}/files/write${c}`,h=await i(e(l,{method:"POST",signal:u.signal,headers:u.headers||f,body:await a(o,s)}));return h.text()})},"375d":function(e,t,r){const n=r("faa1").EventEmitter,f=r("3022").inherits;function i(){const e=this;n.call(e),e.isLocked=!0}e.exports=i,f(i,n),i.prototype.go=function(){const e=this;e.isLocked=!1,e.emit("unlock")},i.prototype.stop=function(){const e=this;e.isLocked=!0,e.emit("lock")},i.prototype.await=function(e){const t=this;t.isLocked?t.once("unlock",e):setTimeout(e)}},"379f":function(e,t,r){const n=r("2ef0"),f=r("4695").errors,i=r("4695").formatters,a=r("19b5"),o=r("03fb").subscriptions,s=r("4695").validateFunction.validateParams,u=50,c=1,l=c*u,h=r("b8a5");function d(e){if(!e.call||!e.name)throw f.needNameCallPropertyToCreateMethod;this.name=e.name,this.call=e.call,this.hexCall=e.hexCall,this.params=e.params||0,this.inputFormatter=e.inputFormatter||[],this.outputFormatter=e.outputFormatter,this.transformPayload=e.transformPayload,this.extraFormatters=e.extraFormatters,this.requestManager=e.requestManager,this.accounts=e.accounts,this.defaultBlock=e.defaultBlock||"latest",this.defaultAccount=e.defaultAccount||null,this.outputFormatterDisable=e.outputFormatterDisable}function p(e,t){this.requestManager=e,t&&(this.accounts=t)}function m(e,t){this.setRequestManager(e||this.requestManager,t||this.accounts);const r=this.buildCall();return r.call=this.call,r}function y(e){const t=this.buildCall();t.call=this.call;const[r,n]=this.name.split(".");n?(e[r]=e[r]||{},e[r][n]=t):e[r]=t}function g(e){return this.hexCall&&a.isHexParameter(e[0])?this.hexCall:this.call}function b(e){if(n.isFunction(e[e.length-1]))return e.pop()}function v(e){if(e.length!==this.params)throw f.InvalidNumberOfParams(e.length,this.params,this.name)}function w(e){const t=this;return!this.inputFormatter||n.isEmpty(this.inputFormatter)?e:this.inputFormatter.map((r,n)=>r&&r.call(t,e[n])||e[n])}function _(e){const t=this,r=e=>"function"===typeof t.outputFormatter?t.outputFormatter(e):e;return n.isArray(e)?e.map(r):r(e)}function T(e){const t=this.getCall(e),r=this.extractCallback(e),n=this.formatInput(e);this.validateArgs(n);const f={method:t,params:n,callback:r};return this.transformPayload&&this.transformPayload(f)||f}d.prototype.setRequestManager=p,d.prototype.createFunction=m,d.prototype.attachToObject=y,d.prototype.getCall=g,d.prototype.extractCallback=b,d.prototype.validateArgs=v,d.prototype.formatInput=w,d.prototype.formatOutput=_,d.prototype.toPayload=T,d.prototype.buildCall=k,d.prototype._confirmTransaction=P,d.prototype.request=D;const E=(e,t,r,n)=>(f,i)=>{try{i=t.formatOutput(i)}catch(o){f||(f=o)}if(f=i instanceof Error&&i||f,f)return a._fireError(f.error||f,e.eventEmitter,e.reject,r.callback);r.callback&&r.callback(null,i),n?(e.eventEmitter.emit("transactionHash",i),t._confirmTransaction(e,i,r)):e.resolve(i)},x=(e,t,r)=>f=>{const i=f.rawTransaction?f.rawTransaction:f,a=n.extend({},t,{method:"klay_sendRawTransaction",params:[i]});e.requestManager.send(a,r)},M=(e,t,r)=>(f,i)=>{const o=f.method;if(i&&"klay_sendRawTransaction"===o)if(i.accounts){const e=f.params[0];if("string"!==typeof e&&n.isObject(e))return e.rawTransaction?t(e):i.accounts.getRawTransactionWithSignatures(e).then(t).catch(e=>{r(e)})}else{const e=f.params[0];if(!n.isString(e)&&n.isObject(e)&&n.isFunction(e.getRLPEncoding))return t(e.getRLPEncoding())}if(i&&i.accounts&&i.accounts.wallet&&i.accounts.wallet.length)switch(o){case"klay_sendTransaction":{const e=f.params[0];let a;if(!n.isObject(e))return void r(new Error("The transaction must be defined as an object."));let o,c=e.from;e.senderRawTransaction&&e.feePayer&&(c=e.feePayer,e.from&&(console.log('"from" is ignored for a fee-delegated transaction.'),delete e.from));try{o=i.accounts.wallet.getAccount(c)}catch(u){return void r(u)}if(o&&o.privateKey){const n=i.accounts._getRoleKey(e,o);return i.accounts.signTransaction(e,n).then(t).catch(e=>{r(e)})}if(e.signatures)return i.accounts.getRawTransactionWithSignatures(e).then(t).catch(e=>{r(e)});if(void 0!==e.feePayer||void 0!==e.type&&"LEGACY"!==e.type)return a=new Error(`No private key found in the caver-js wallet. Trying to use the Klaytn node's wallet, but it only supports legacy transactions. Please add private key of ${c} to the caver-js wallet.`),void r(a);if(a=s(e),a)return void r(a);break}case"klay_sign":{const t=f.params[1],r=i.accounts.wallet.getAccount(f.params[0]);if(r&&r.privateKey){const n=i.accounts.sign(t,r.privateKey);return f.callback&&f.callback(null,n.signature),void e.resolve(n.signature)}break}}if("klay_sendTransaction"===o||"klay_sendTransactionAsFeePayer"===o||"klay_signTransaction"===o||"klay_signTransactionAsFeePayer"===o){const e={};Object.keys(f.params[0]).map(t=>{let r=t;r.startsWith("_")&&(r=r.slice(1)),"signatures"===r||"feePayerSignatures"===r?a.isEmptySig(f.params[0][r])||(e[r]=a.transformSignaturesToObject(f.params[0][r]),"signatures"!==r||"klay_signTransaction"!==o&&"klay_sendTransaction"!==o||console.warn("When sign/send a transaction using the Node API, existing 'signatures' can be initialized."),"feePayerSignatures"!==r||"klay_signTransactionAsFeePayer"!==o&&"klay_sendTransactionAsFeePayer"!==o||console.warn("When sign/send a transaction using the Node API, existing 'feePayerSignatures' can be initialized.")):"codeFormat"===r?e[r]=a.hexToNumber(f.params[0][r]):"account"===r?e.key=f.params[0][r].getRLPEncodingAccountKey():"0x"!==f.params[0][r]&&(e[r]=f.params[0][r])}),f.params[0]=e}return i.requestManager.send(f,r)},A=(e,t)=>(...r)=>{const f=a.promiEvent(!t),i=e.toPayload(r),o=E(f,e,i,t),s=x(e,i,o),u=M(f,s,o),c=t&&n.isObject(i.params[0])&&void 0===i.params[0].gasPrice;if(!c)return u(i,e),f.eventEmitter;const l=new d({name:"getGasPrice",call:"klay_gasPrice",params:0}).createFunction(e.requestManager);return l((t,r)=>{i.params[0].gasPrice=r||i.params[0].gasPrice,u(i,e)}),f.eventEmitter};function k(){const e=this,t="klay_sendTransaction"===e.call||"klay_sendTransactionAsFeePayer"===e.call||"klay_sendRawTransaction"===e.call||"personal_sendTransaction"===e.call||"personal_sendValueTransfer"===e.call||"personal_sendAccountUpdate"===e.call,r=A(e,t);return r.method=e,r.request=this.request.bind(this),r}function P(e,t,r){let f=r.params&&n.isObject(r.params[0])&&r.params[0]||{};n.isString(r.params[0])&&(f=h.decode(r.params[0]));const i={method:this,promiseResolved:!1,canUnsubscribe:!0,timeoutCount:0,intervalId:null,gasProvided:f.gas||null,isContractDeployment:a.isContractDeployment(f),defer:e,result:t,_klaytnCall:{}};C(i),S(i)}const C=e=>{const t=[new d({name:"getTransactionReceipt",call:"klay_getTransactionReceipt",params:1,outputFormatter:e.method.outputFormatterDisable?void 0:i.outputTransactionReceiptFormatter}),new d({name:"getCode",call:"klay_getCode",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]}),new o({name:"subscribe",type:"klay",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:i.outputBlockFormatter}}})];n.each(t,t=>{t.attachToObject(e._klaytnCall),t.requestManager=e.method.requestManager})},S=e=>{const{defer:t,promiseResolved:r,result:n,_klaytnCall:f}=e;f.getTransactionReceipt(n).then(t=>{t&&t.blockHash?I(e,t,!1):r||R(e,t)}).catch(()=>{r||R(e)})},R=function(e,t){const{_klaytnCall:r,intervalId:n,method:f}=e;f.requestManager.provider.supportsSubscriptions()?r.subscribe("newBlockHeaders",I.bind(null,e,t,!1)):e.intervalId=setInterval(I.bind(null,e,t,!0),1e3)},I=function(e,t,r,n,f,i){const{intervalId:o,defer:s,method:u,canUnsubscribe:c,_klaytnCall:l,isContractDeployment:h,promiseResolved:d,timeoutCount:p,result:m}=e;return n?(i.unsubscribe(),e.promiseResolved=!0,void a._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:n},s.eventEmitter,s.reject)):(i=i||{unsubscribe:()=>clearInterval(e.intervalId)},(t&&a.promiEvent.resolve(t)||l.getTransactionReceipt(m)).then(t=>{N(t);const r=L(t,u);if(!e.promiseResolved)return h?K(e,r,i):O(e,r,i)}).catch(F))},N=e=>{if(e&&!e.blockHash)throw f.blockHashNull},L=(e,t)=>(t.extraFormatters&&t.extraFormatters.receiptFormatter&&(e=t.extraFormatters.receiptFormatter(e)),e),F=(e,t,r)=>{const{defer:n,timeoutCount:f,promiseResolved:i}=e;e.timeoutCount++,t?e.timeoutCount-1>=l&&(r.unsubscribe(),e.promiseResolved=!0,a._fireError(new Error(`Transaction was not mined within${l} seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!`),n.eventEmitter,n.reject)):e.timeoutCount-1>=u&&(r.unsubscribe(),e.promiseResolved=!0,a._fireError(new Error("Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),n.eventEmitter,n.reject))},K=(e,t,r)=>{const{defer:n,method:i,canUnsubscribe:o,_klaytnCall:s,promiseResolved:u}=e;if(!t.contractAddress)return o&&(r.unsubscribe(),e.promiseResolved=!0),void a._fireError(f.receiptDidntContainContractAddress,n.eventEmitter,n.reject);if(!t.status&&t.txError){const e=JSON.stringify(t,null,2);a._fireError(new Error(`${f.txErrorTable[t.txError]}\n ${e}`),n.eventEmitter,n.reject)}return s.getCode(t.contractAddress,(f,a)=>{a&&(n.eventEmitter.emit("receipt",t),n.resolve(i.extraFormatters&&i.extraFormatters.contractDeployFormatter&&i.extraFormatters.contractDeployFormatter(t)||t),o&&n.eventEmitter.removeAllListeners(),o&&r.unsubscribe(),e.promiseResolved=!0)}),t},O=(e,t,r)=>{const{defer:n,canUnsubscribe:i,promiseResolved:o,gasProvided:s}=e;if(!t||t.outOfGas||s&&s===t.gasUsed||!0!==t.status&&"0x1"!==t.status&&"undefined"!==typeof t.status){if(!t)return;const r=JSON.stringify(t,null,2),{txError:n}=t;n&&f.txErrorTable[n]?a._fireError(new Error(`${f.txErrorTable[n]}\n ${r}`),e.defer.eventEmitter,e.defer.reject):!1===t.status||"0x0"===t.status?a._fireError(f.transactionReverted(r),e.defer.eventEmitter,e.defer.reject):(t.gasUsed,a._fireError(f.transactionRanOutOfGas(r),e.defer.eventEmitter,e.defer.reject))}else{try{e.defer.eventEmitter.emit("receipt",t),e.defer.resolve(t)}catch(u){console.log("receipt error",u)}i&&e.defer.eventEmitter.removeAllListeners()}i&&r.unsubscribe(),e.promiseResolved=!0};function D(...e){const t=this.toPayload(e);return t.format=this.formatOutput.bind(this),t}e.exports=d},"37a0":function(e,t,r){const n=r("19d7"),f=r("0664"),i=r("19b5"),a=r("4695"),{VALUE_TRANFSER_TYPE_TAG:o,VALUE_TRANSFER_MEMO_TYPE_TAG:s,FEE_DELEGATED_VALUE_TRANSFER_TYPE_TAG:u,FEE_DELEGATED_VALUE_TRANSFER_MEMO_TYPE_TAG:c,FEE_DELEGATED_VALUE_TRANSFER_MEMO_WITH_RATIO_TYPE_TAG:l,FEE_DELEGATED_VALUE_TRANSFER_WITH_RATIO_TYPE_TAG:h}=a.constants;function d(e){return n.encode([n.encode([o,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value),e.from.toLowerCase()]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function p(e){return n.encode([n.encode([s,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value),e.from.toLowerCase(),e.data]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function m(e){if(e.senderRawTransaction){const t="0x"+e.senderRawTransaction.slice(4),[r,a,o,s,c,l,[[h,d,p]]]=i.rlpDecode(t);return n.encode([n.encode([u,f.fromNat(r),f.fromNat(a),f.fromNat(o),s.toLowerCase(),f.fromNat(c),l.toLowerCase()]),e.feePayer.toLowerCase(),f.fromNat(e.chainId||"0x1"),"0x","0x"])}return n.encode([n.encode([u,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value),e.from.toLowerCase()]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function y(e){if(e.senderRawTransaction){const t="0x"+e.senderRawTransaction.slice(4),[r,a,o,s,u,c,l,[[d,p,m]]]=i.rlpDecode(t);return n.encode([n.encode([h,f.fromNat(r),f.fromNat(a),f.fromNat(o),s.toLowerCase(),f.fromNat(u),c.toLowerCase(),l]),e.feePayer.toLowerCase(),f.fromNat(e.chainId||"0x1"),"0x","0x"])}return n.encode([n.encode([h,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value),e.from.toLowerCase(),f.fromNat(e.feeRatio)]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function g(e){if(e.senderRawTransaction){const t="0x"+e.senderRawTransaction.slice(4),[r,a,o,s,u,l,h,[[d,p,m]]]=i.rlpDecode(t);return n.encode([n.encode([c,f.fromNat(r),f.fromNat(a),f.fromNat(o),s.toLowerCase(),f.fromNat(u),l.toLowerCase(),h]),e.feePayer.toLowerCase(),f.fromNat(e.chainId||"0x1"),"0x","0x"])}return n.encode([n.encode([c,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value),e.from.toLowerCase(),e.data]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function b(e){if(e.senderRawTransaction){const t="0x"+e.senderRawTransaction.slice(4),[r,a,o,s,u,c,h,d,[[p,m,y]]]=i.rlpDecode(t);return n.encode([n.encode([l,f.fromNat(r),f.fromNat(a),f.fromNat(o),s.toLowerCase(),f.fromNat(u),c.toLowerCase(),h,f.fromNat(d)]),e.feePayer.toLowerCase(),f.fromNat(e.chainId||"0x1"),"0x","0x"])}return n.encode([n.encode([l,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value),e.from.toLowerCase(),e.data,f.fromNat(e.feeRatio)]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}e.exports={rlpEncodeForValueTransfer:d,rlpEncodeForValueTransferMemo:p,rlpEncodeForFeeDelegatedValueTransfer:m,rlpEncodeForFeeDelegatedValueTransferWithRatio:y,rlpEncodeForFeeDelegatedValueTransferMemo:g,rlpEncodeForFeeDelegatedValueTransferMemoWithRatio:b}},3841:function(e,t,r){"use strict";(function(e){var n=r("f934"),f=r("3337").ec,i=new f("secp256k1"),a=i.curve;t.privateKeyExport=function(e,t){var r=new n(e);if(r.ucmp(a.n)>=0)throw new Error("couldn't export to DER format");var f=i.g.mul(r);return o(f.getX(),f.getY(),t)},t.privateKeyModInverse=function(t){var r=new n(t);if(r.ucmp(a.n)>=0||r.isZero())throw new Error("private key range is invalid");return r.invm(a.n).toArrayLike(e,"be",32)},t.signatureImport=function(t){var r=new n(t.r);r.ucmp(a.n)>=0&&(r=new n(0));var f=new n(t.s);return f.ucmp(a.n)>=0&&(f=new n(0)),e.concat([r.toArrayLike(e,"be",32),f.toArrayLike(e,"be",32)])},t.ecdhUnsafe=function(e,t,r){var f=i.keyFromPublic(e),s=new n(t);if(s.ucmp(a.n)>=0||s.isZero())throw new Error("scalar was invalid (zero or overflow)");var u=f.pub.mul(s);return o(u.getX(),u.getY(),r)};var o=function(t,r,n){var f=void 0;return n?(f=e.alloc(33),f[0]=r.isOdd()?3:2,t.toArrayLike(e,"be",32).copy(f,1)):(f=e.alloc(65),f[0]=4,t.toArrayLike(e,"be",32).copy(f,1),r.toArrayLike(e,"be",32).copy(f,33)),f}}).call(this,r("b639").Buffer)},"398c":function(e,t,r){const n=r("ac4f");function f(e,t={}){if(!i(e))return null;const{includeBlockRef:r}=t,f=r?e.params:o(e);return e.method+":"+n(f)}function i(e){return"never"!==u(e)}function a(e){var t=s(e);return t>=e.params.length?null:e.params[t]}function o(e){var t=s(e);return t>=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function s(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function u(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}e.exports={cacheIdentifierForPayload:f,canCache:i,blockTagForPayload:a,paramsWithoutBlockTag:o,blockTagParamIndex:s,cacheTypeForPayload:u}},"39c0":function(e){e.exports=JSON.parse('{"contractName":"IERC1155","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]}')},"3a3a":function(e,t,r){"use strict";const n=r("1eca"),{ok:f}=r("7872"),{objectToQuery:i}=r("d518"),a=r("83c7");e.exports=n(({fetch:e,apiUrl:t,apiPath:r,headers:n})=>async o=>{o=o||{};const s=i(o.qs),u=`${t}${r}/version${s}`,c=await f(e(u,{signal:o.signal,headers:o.headers||n})),l=await c.json();return a(l)})},"3b36":function(e,t,r){"use strict";(function(e){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&f[f.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!f||i[1]>f[0]&&i[1]this.emit("update",e))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}}e.exports=f},"3da3":function(e,t,r){"use strict";const n=r("91d3");class f{constructor(){this._subs=new Map}static singleton(){return f.instance||(f.instance=new f),f.instance}subscribe(e,t,r){const f=this._subs.get(e)||[];if(f.find(e=>e.handler===t))throw new Error(`Already subscribed to ${e} with this handler`);const i=new n;return this._subs.set(e,[{handler:t,controller:i}].concat(f)),r&&r.addEventListener("abort",()=>this.unsubscribe(e,t)),i.signal}unsubscribe(e,t){const r=this._subs.get(e)||[];let n;t?(this._subs.set(e,r.filter(e=>e.handler!==t)),n=r.filter(e=>e.handler===t)):(this._subs.set(e,[]),n=r),n.forEach(e=>e.controller.abort())}}e.exports=f},"3dca":function(e,t,r){const n=r("2ef0"),f=r("4695").errors,i=r("be65"),a=r("172f"),o=r("5594"),s=function e(t,r){this.provider=null,this.providers=e.providers,this.setProvider(t,r),this.subscriptions={}};s.providers={WebsocketProvider:r("801a"),HttpProvider:r("5574"),IpcProvider:r("f2f44")},s.prototype.setProvider=function(e,t){const r=this;if(e&&"string"===typeof e&&this.providers)if(/^http(s)?:\/\//i.test(e))e=new this.providers.HttpProvider(e);else if(/^ws(s)?:\/\//i.test(e))e=new this.providers.WebsocketProvider(e);else if(e&&"object"===typeof t&&"function"===typeof t.connect)e=new this.providers.IpcProvider(e,t);else if(e)throw new Error(`Can't autodetect provider for "${e}"`);return this.provider&&this.clearSubscriptions(),this.provider=e||null,this.provider&&this.provider.on&&this.provider.on("data",(function(e,t){e=e||t,e.method&&r.subscriptions[e.params.subscription]&&r.subscriptions[e.params.subscription].callback&&r.subscriptions[e.params.subscription].callback(null,e.params.result)})),this},s.prototype.send=function(e,t){if(t=t||function(){},!this.provider)return t(f.InvalidProvider());const r=a.toPayload(e.method,e.params),n=0!==i.getMiddlewares().length;if(!n)return o(this.provider)(r);function o(e){return function(r){e[e.sendAsync?"sendAsync":"send"](r,(function(e,o){return n&&i.applyMiddleware(r,"inbound"),o&&o.id&&r.id!==o.id?t(new Error(`Wrong response id "${o.id}" (expected: "${r.id}") in ${JSON.stringify(r)}`)):e?t(e):o&&o.error?t(f.ErrorResponse(o)):a.isValidResponse(o)?void t(null,o.result):t(f.InvalidResponse(o))}))}}i.applyMiddleware(r,"outbound",o(this.provider))},s.prototype.sendBatch=function(e,t){if(!this.provider)return t(f.InvalidProvider());const r=a.toBatchPayload(e);this.provider[this.provider.sendAsync?"sendAsync":"send"](r,(function(e,r){return e?t(e):n.isArray(r)?void t(null,r):t(f.InvalidResponse(r))}))},s.prototype.addSubscription=function(e,t,r,n){if(!this.provider.on)throw new Error("The provider doesn't support subscriptions: "+this.provider.constructor.name);this.subscriptions[e]={callback:n,type:r,name:t}},s.prototype.removeSubscription=function(e,t){const r=this;this.subscriptions[e]&&(this.send({method:this.subscriptions[e].type+"_unsubscribe",params:[e]},t),delete r.subscriptions[e])},s.prototype.clearSubscriptions=function(e){const t=this;Object.keys(this.subscriptions).forEach((function(r){e&&"syncing"===t.subscriptions[r].name||t.removeSubscription(r)})),this.provider.reset&&this.provider.reset()},e.exports={Manager:s,BatchManager:o}},"3e00":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("6f4d");t.HDKey=n},"41b5":function(e,t){e.exports="object"==typeof self?self.FormData:window.FormData},"427a":function(e,t,r){(function(t){(function(t,r){"use strict";e.exports?e.exports=r():(t.nacl||(t.nacl={}),t.nacl.util=r())})(this,(function(){"use strict";var e={};function r(e){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e))throw new TypeError("invalid encoding")}return e.decodeUTF8=function(e){if("string"!==typeof e)throw new TypeError("expected string");var t,r=unescape(encodeURIComponent(e)),n=new Uint8Array(r.length);for(t=0;t0&&this.backoff_.failAfter(this.failAfter_),this.state_=s.State_.RUNNING,this.doCall_(!1)},s.prototype.doCall_=function(e){e&&this.numRetries_++;var t=["call"].concat(this.arguments_);n.EventEmitter.prototype.emit.apply(this,t);var r=this.handleFunctionCallback_.bind(this);this.function_.apply(null,this.arguments_.concat(r))},s.prototype.doCallback_=function(){this.callback_.apply(null,this.lastResult_)},s.prototype.handleFunctionCallback_=function(){if(!this.isAborted()){var e=Array.prototype.slice.call(arguments);this.lastResult_=e,n.EventEmitter.prototype.emit.apply(this,["callback"].concat(e));var t=e[0];t&&this.retryPredicate_(t)?this.backoff_.backoff(t):(this.state_=s.State_.COMPLETED,this.doCallback_())}},s.prototype.handleBackoff_=function(e,t,r){this.emit("backoff",e,t,r)},e.exports=s},"42f1":function(e,t,r){"use strict";const n=r("f016"),f=r("3292"),{rfc4648:i}=r("53af"),{decodeText:a,encodeText:o}=r("a8c0"),s=()=>({encode:a,decode:o}),u=[["identity","\0",s,""],["base2","0",i(1),"01"],["base8","7",i(3),"01234567"],["base10","9",n,"0123456789"],["base16","f",i(4),"0123456789abcdef"],["base16upper","F",i(4),"0123456789ABCDEF"],["base32hex","v",i(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",i(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",i(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",i(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",i(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",i(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",i(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",i(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",i(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",n,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],c=u.reduce((e,t)=>(e[t[0]]=new f(t[0],t[1],t[2],t[3]),e),{}),l=u.reduce((e,t)=>(e[t[1]]=c[t[0]],e),{});e.exports={names:c,codes:l}},"431d":function(e,t,r){const n=r("9e697");class f extends n{constructor(e){if(super(),!e)throw new Error("JsonRpcEngineMiddlewareSubprovider - no constructorFn specified");this._constructorFn=e}setEngine(e){if(this.middleware)throw new Error("JsonRpcEngineMiddlewareSubprovider - subprovider added to engine twice");const t=e._blockTracker,r=this._constructorFn({engine:e,provider:e,blockTracker:t});if(!r)throw new Error("JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware");if("function"!==typeof r)throw new Error("JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function");this.middleware=r}handleRequest(e,t,r){const n={id:e.id};function f(e){t((t,r,f)=>{t?(delete n.result,n.error={message:t.message||t}):n.result=r,e?e(f):f()})}function i(e){if(e)return r(e);r(null,n.result)}this.middleware(e,n,f,i)}}e.exports=f},4358:function(e,t,r){"use strict";(function(t){var n=r("2213"),f=r("c9b8"),i=r("766f"),a=function(e){return 32===e.length&&n.privateKeyVerify(Uint8Array.from(e))},o=function(e,t){if(32!==e.length)throw new RangeError("private key length is invalid");var r=f.privateKeyExport(e,t);return i.privateKeyExport(e,r,t)},s=function(e){if(e=i.privateKeyImport(e),null!==e&&32===e.length&&a(e))return e;throw new Error("couldn't import from DER format")},u=function(e){return t.from(n.privateKeyNegate(Uint8Array.from(e)))},c=function(e){if(32!==e.length)throw new Error("private key length is invalid");return t.from(f.privateKeyModInverse(Uint8Array.from(e)))},l=function(e,r){return t.from(n.privateKeyTweakAdd(Uint8Array.from(e),r))},h=function(e,r){return t.from(n.privateKeyTweakMul(Uint8Array.from(e),Uint8Array.from(r)))},d=function(e,r){return t.from(n.publicKeyCreate(Uint8Array.from(e),r))},p=function(e,r){return t.from(n.publicKeyConvert(Uint8Array.from(e),r))},m=function(e){return(33===e.length||65===e.length)&&n.publicKeyVerify(Uint8Array.from(e))},y=function(e,r,f){return t.from(n.publicKeyTweakAdd(Uint8Array.from(e),Uint8Array.from(r),f))},g=function(e,r,f){return t.from(n.publicKeyTweakMul(Uint8Array.from(e),Uint8Array.from(r),f))},b=function(e,r){var f=[];return e.forEach((function(e){f.push(Uint8Array.from(e))})),t.from(n.publicKeyCombine(f,r))},v=function(e){return t.from(n.signatureNormalize(Uint8Array.from(e)))},w=function(e){return t.from(n.signatureExport(Uint8Array.from(e)))},_=function(e){return t.from(n.signatureImport(Uint8Array.from(e)))},T=function(e){if(0===e.length)throw new RangeError("signature length is invalid");var t=i.signatureImportLax(e);if(null===t)throw new Error("couldn't parse DER signature");return f.signatureImport(t)},E=function(e,r,f){if(null===f)throw new TypeError("options should be an Object");var i=void 0;if(f){if(i={},null===f.data)throw new TypeError("options.data should be a Buffer");if(f.data){if(32!==f.data.length)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(f.data)}if(null===f.noncefn)throw new TypeError("options.noncefn should be a Function");f.noncefn&&(i.noncefn=function(e,r,n,i,a){var o=null!=n?t.from(n):null,s=null!=i?t.from(i):null,u=t.from("");return f.noncefn&&(u=f.noncefn(t.from(e),t.from(r),o,s,a)),Uint8Array.from(u)})}var a=n.ecdsaSign(Uint8Array.from(e),Uint8Array.from(r),i);return{signature:t.from(a.signature),recovery:a.recid}},x=function(e,t,r){return n.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),r)},M=function(e,r,f,i){return t.from(n.ecdsaRecover(Uint8Array.from(r),f,Uint8Array.from(e),i))},A=function(e,r){return t.from(n.ecdh(Uint8Array.from(e),Uint8Array.from(r),{}))},k=function(e,r,n){if(33!==e.length&&65!==e.length)throw new RangeError("public key length is invalid");if(32!==r.length)throw new RangeError("private key length is invalid");return t.from(f.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(r),n))};e.exports={privateKeyVerify:a,privateKeyExport:o,privateKeyImport:s,privateKeyNegate:u,privateKeyModInverse:c,privateKeyTweakAdd:l,privateKeyTweakMul:h,publicKeyCreate:d,publicKeyConvert:p,publicKeyVerify:m,publicKeyTweakAdd:y,publicKeyTweakMul:g,publicKeyCombine:b,signatureNormalize:v,signatureExport:w,signatureImport:_,signatureImportLax:T,sign:E,verify:x,recover:M,ecdh:A,ecdhUnsafe:k}}).call(this,r("b639").Buffer)},4695:function(e,t,r){const n=r("f90d"),f=r("6325"),i=r("c3bd"),a=r("e3fd"),o=r("6561");e.exports={errors:n,formatters:f,payloadTransformer:i,constants:a,validateFunction:o}},"475b":function(e,t,r){"use strict";e.exports=r("0f71")(r("d9180"))},"475e":function(e,t,r){"use strict";const n=r("55f5").Buffer,f=r("d485").Transform,i=r("3fb5");e.exports=function(e){function t(t,r,n,i){f.call(this,i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return i(t,f),t.prototype._transform=function(e,t,r){let n=null;try{this.update(e,t)}catch(f){n=f}r(n)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!==typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},4857:function(e,t,r){const n=r("3022").inherits,f=r("e71f");function i(e){if(!e)throw new Error("ProviderSubprovider - no provider specified");this.provider=e}e.exports=i,n(i,f),i.prototype.handleRequest=function(e,t,r){this.provider.send(e,(function(e,t){if(e)return r(e);r(null,t.result)}))}},4872:function(e,t,r){const n=r("19b5"),{KEY_ROLE:f}=r("fc77"),{refineSignatures:i}=r("1789"),a=r("a9b0"),o=r("558a");class s{async validateSignedMessage(e,t,r,a=!1){const o=await s._klaytnCall.getAccountKey(r);t=i(t);const c=[];for(const f of t){const t=n.recoverPublicKey(e,f,a),r=t.toString();c.push(r)}return u(r,o,c,f.roleTransactionKey)}async validateTransaction(e){let t=await this.validateSender(e);return!0===t&&e instanceof o&&(t=this.validateFeePayer(e)),t}async validateSender(e){if(!(e instanceof a))throw new Error("Invalid parameter type: To validate `signatures` field in the transaction, you need to pass the transaction instance.");const t=await s._klaytnCall.getAccountKey(e.from),r=e.recoverPublicKeys(),n=e.type.includes("AccountUpdate")?f.roleAccountUpdateKey:f.roleTransactionKey;return u(e.from,t,r,n)}async validateFeePayer(e){if(!(e instanceof o))throw new Error("Invalid parameter type: To validate `feePayerSignatures` field in the transaction, you need to pass the fee-delegated transaction instance.");const t=await s._klaytnCall.getAccountKey(e.feePayer),r=e.recoverFeePayerPublicKeys(),n=f.roleFeePayerKey;return u(e.feePayer,t,r,n)}}function u(e,t,r,f){let i=!1;switch(null===t&&(t={keyType:1,key:{}}),t.keyType){case 1:for(const t of r){const r=n.publicKeyToAddress(t);if(r.toLowerCase()===e.toLowerCase()){i=!0;break}}break;case 2:for(const e of r){const r=n.xyPointFromPublicKey(e);if(r[0].toLowerCase()===t.key.x.toLowerCase()&&r[1].toLowerCase()===t.key.y.toLowerCase()){i=!0;break}}break;case 3:break;case 4:let a=0;const o=t.key.threshold;for(const e of r){for(const r of t.key.keys){const t=n.xyPointFromPublicKey(e);if(t[0].toLowerCase()===r.key.x.toLowerCase()&&t[1].toLowerCase()===r.key.y.toLowerCase()){a+=r.weight;break}}if(a>=o){i=!0;break}}break;case 5:const s=t.key[f];if(5===t.key[f].keyType)throw new Error("Invalid account key type: nested composite type");i=u(e,s,r);break;default:throw new Error("Invalid account key type")}return i}e.exports=s},"4af6":function(e){e.exports=JSON.parse('{"contractName":"IERC165","abi":[{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]}')},"4b73":function(e,t,r){var n=r("605f"),f="baobab",i=1001,a=1001,o="https://api.baobab.klaytn.net:8651",s=["5239d77e1a412282001266717accd0681efe653ee0350a1221094689fbdbbeec"];try{var u=r("d2f2")("".concat(process.env.HOME,"/.klaytn/baobab_deployer")),c=u.alicePrivateKey,l=u.bobPrivateKey;s.push(c),s.push(l)}catch(d){}var h=new n({privateKeys:s,providerOrUrl:o,chainId:i});e.exports={config:{networkName:f,chainId:i,netId:a,apiUrl:"https://api.cilo.kr/v1",apiKey:"",readonlyProviderUrl:o,nftAddress:"0xFEe780cA54D27B7e39F010fE424be910D48081Cd",nft1155Address:"0xcCC2b61C71402172F72Be757Fa14d3a557372f4b",exchangeAddress:"0x7C33a7635734bfBCF925EC77aB7AE30d2EDC91eC",royaltiesRegistryAddress:"0x61A02F80f1E56681f37C814497649399cEA25Fd3",transferProxyAddress:"0x771565ACd561DEf7E71529382aa32CDAE5E8844b",erc20TransferProxyAddress:"0x627d521C1D4F00488C3CBa4dc060f523F5a96576",communityWalletAddress:"0xbbd546281301CCCF287173fB2437C387aDeC16b6"},provider:h,ALICE_ADDRESS:"0x7a450816d74fd8e1ca20e9e015064af6e9c760b2",BOB_ADDRESS:"0xe617464c1ab3aa4db1b734c6f10e49a8188b2e1d",TESTERC20_ADDRESS:"0xe06c059cb4240bbec882f9d0e15c926e90091416"}},"4bac":function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("0664"),a=r("a9b0"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s}=r("1789"),u=r("19b5");function c(e){if(e=u.addHexPrefix(e),!e.startsWith(s.TxTypeSmartContractExecution))throw new Error(`Cannot decode to SmartContractExecution. The prefix must be ${s.TxTypeSmartContractExecution}: ${e}`);const t="0x"+e.slice(4),[r,n,i,a,o,c,l,h]=f.decode(t);return{nonce:u.trimLeadingZero(r),gasPrice:u.trimLeadingZero(n),gas:u.trimLeadingZero(i),to:a,value:u.trimLeadingZero(o),from:c,input:l,signatures:h}}class l extends a{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){if(n.isString(e)&&(e=c(e)),super(o.TxTypeSmartContractExecution,e),this.to=e.to,this.value=e.value||"0x0",e.input&&e.data)throw new Error("'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.");this.input=e.input||e.data}get to(){return this._to}set to(e){if(!u.isAddress(e))throw new Error("Invalid address of to: "+e);this._to=e.toLowerCase()}get value(){return this._value}set value(e){this._value=u.numberToHex(e)}get input(){return this._input}set input(e){if(!e||!u.isHex(e))throw new Error("Invalid input data "+e);this._input=u.addHexPrefix(e)}get data(){return this._input}set data(e){this._input=e}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode());return s.TxTypeSmartContractExecution+f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.from.toLowerCase(),this.input,e]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),f.encode([s.TxTypeSmartContractExecution,i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.from.toLowerCase(),this.input])}}e.exports=l},"50f4":function(e,t,r){const n=r("2ef0"),f=r("19b5"),i=r("cf45"),{KEY_ROLE:a,MAXIMUM_KEY_NUM:o,isMultipleKeysFormat:s,isRoleBasedKeysFormat:u}=r("fc77"),c=r("1a84"),{fillWeightedMultiSigOptionsForRoleBased:l}=r("6369"),{validateForSigning:h,validateIndexWithKeys:d,encryptKey:p,formatEncrypted:m}=r("fc77");class y{constructor(e,t){this.address=e,this.keys=t}get address(){return this._address}set address(e){if(!f.isAddress(e))throw new Error("Invalid address : "+e);this._address=f.addHexPrefix(e).toLowerCase()}get keys(){return this._keys}set keys(e){null!==e?this._keys=g(e):this._key=null}get roleTransactionKey(){return this.getKeyByRole(a.roleTransactionKey)}get roleAccountUpdateKey(){return this.getKeyByRole(a.roleAccountUpdateKey)}get roleFeePayerKey(){return this.getKeyByRole(a.roleFeePayerKey)}getPublicKey(e=!1){const t=b();for(let r=0;r=a.roleLast||e<0)throw new Error("Invalid role number: "+e);let t=this._keys[e];if(0===t.length&&e>a.roleTransactionKey){if(0===this._keys[a.roleTransactionKey].length)throw new Error(`The key with ${a[e]} role does not exist. The ${a[0]} for the default role is also empty.`);t=this._keys[a.roleTransactionKey]}return t}toAccount(e){if(void 0!==e&&!n.isArray(e))throw new Error("options for an account should define threshold and weight for each roles in an array format");const t=[];for(const n of this.keys)t.push(n.length);e=l(t,e);const r=this.getPublicKey();return c.createWithAccountKeyRoleBased(this.address,r,e)}encrypt(e,t={}){const r=[];for(let n=a.roleTransactionKey;n[])}function v(e,t,r){if(void 0!==r){if(r=Array.isArray(r)?r:[r],r.length>o)throw new Error(`The maximum number of private keys that can be used in keyring is ${o}.`);if(t>=a.roleLast)throw new Error(`Unsupported role number. The role number should be less than ${a.roleLast}. Please use 'caver.wallet.keyring.role'`);for(const n of r){const r=n instanceof i?n:new i(n);e[t].push(r)}}}e.exports=y},"53af":function(e,t,r){"use strict";const n=(e,t,r)=>{const n={};for(let u=0;u=8&&(a-=8,i[s++]=255&o>>a)}if(a>=r||255&o<<8-a)throw new SyntaxError("Unexpected end of data");return i},f=(e,t,r)=>{const n="="===t[t.length-1],f=(1<r)a-=r,i+=t[f&o>>a]}if(a&&(i+=t[f&o<t=>({encode(r){return f(r,t,e)},decode(r){return n(r,t,e)}});e.exports={rfc4648:i}},5574:function(e,t,r){const n=r("8602").XMLHttpRequest,f=r("4695").errors,i=function(e,t){t=t||{},this.host=e||"http://localhost:8545",this.timeout=t.timeout||0,this.headers=t.headers,this.connected=!1};i.prototype._prepareRequest=function(){const e=new n;return e.open("POST",this.host,!0),e.setRequestHeader("Content-Type","application/json"),e.timeout=this.timeout&&1!==this.timeout?this.timeout:0,this.headers&&this.headers.forEach((function(t){e.setRequestHeader(t.name,t.value)})),null===e._url.port&&"https"===this.host.slice(0,5)&&(e._url.port=443),e},i.prototype.send=function(e,t){const r=this,n=this._prepareRequest(),i=this.host;let a;n.onreadystatechange=function(){if(2===n.readyState&&clearTimeout(a),4===n.readyState&&1!==n.timeout){let i=n.responseText,o=null;if(null===n.response)o=f.InvalidResponse(n.response),clearTimeout(a);else try{i=JSON.parse(i)}catch(e){""===n.responseText?o=f.RequestFailed(n.statusText):(console.error("Invalid JSON RPC response: "+JSON.stringify(n.responseText)),o=f.InvalidResponse(n.responseText))}r.connected=!0,t(o,i)}},n.ontimeout=function(){console.error(`CONNECTION TIMEOUT: timeout of ${this.timeout}ms achived`),r.connected=!1,clearTimeout(a),t(f.ConnectionTimeout(this.timeout))};try{0!==n.timeout&&(a=setTimeout((function(){n.status<4&&(console.error("CONNECTION ERROR: Couldn't connect to node "+i),n.abort(),t(f.InvalidConnection(i)))}),n.timeout)),n.send(JSON.stringify(e))}catch(o){console.error("CONNECTION ERROR: Couldn't connect to node "+this.host),this.connected=!1,clearTimeout(a),t(f.InvalidConnection(this.host))}},i.prototype.supportsSubscriptions=function(){return!1},e.exports=i},"558a":function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("f3a4"),a=r("0664"),o=r("1910"),s=r("a9b0"),{refineSignatures:u,typeDetectionFromRLPEncoding:c}=r("1789"),l=r("0683"),h=r("92c9"),d=r("13dc"),p=r("50f4"),{KEY_ROLE:m}=r("fc77"),y=r("19b5"),g=r("bed1");class b extends s{constructor(e,t){super(e,t),this.feePayer=t.feePayer,this.feePayerSignatures=t.feePayerSignatures||[]}get feePayer(){return this._feePayer}set feePayer(e){if(e&&"0x"!==e||(e="0x0000000000000000000000000000000000000000"),!y.isAddress(e))throw new Error("Invalid address of fee payer: "+e);this._feePayer=e.toLowerCase()}get feePayerSignatures(){return this._feePayerSignatures}set feePayerSignatures(e){this._feePayerSignatures=u(e)}async signAsFeePayer(e,t,r=o.getHashForFeePayerSignature){n.isFunction(t)&&(r=t,t=void 0);let f=e;if(n.isString(e)&&(f=l.createFromPrivateKey(e)),!(f instanceof h)&&!(f instanceof d)&&!(f instanceof p))throw new Error("Unsupported key type. The key parameter of the signAsFeePayer must be a single private key string, KlaytnWalletKey string, or Keyring instance.");if(this.feePayer&&"0x"!==this.feePayer&&"0x0000000000000000000000000000000000000000"!==this.feePayer||(this.feePayer=f.address),this.feePayer.toLowerCase()!==f.address.toLowerCase())throw new Error("The feePayer address of the transaction is different with the address of the keyring to use.");await this.fillTransaction();const i=r(this),a=f.sign(i,this.chainId,m.roleFeePayerKey,t);return this.appendFeePayerSignatures(a),this}appendFeePayerSignatures(e){let t=e;if(n.isString(t)&&(t=y.resolveSignature(t)),t instanceof g&&(t=[t]),!n.isArray(t))throw new Error("Failed to append signatures: invalid signatures format "+t);n.isString(t[0])&&(t=[t]),this.feePayerSignatures=this.feePayerSignatures.concat(t)}combineSignedRawTransactions(e){if(!n.isArray(e))throw new Error("The parameter must be an array of RLP encoded transaction strings.");let t=!1;(y.isEmptySig(this.signatures)||y.isEmptySig(this.feePayerSignatures))&&(t=!0);for(const r of e){const e=c(r);if(this.type!==e)throw new Error("Transaction type mismatch: Signatures from different transactions cannot be combined.");const n=this.constructor.decode(r);for(const r in n){if("_signatures"===r||"_feePayerSignatures"===r)continue;if("_feePayer"===r){const e="0x0000000000000000000000000000000000000000";if(("0x"!==n[r]&&n[r]!==e||"0x"===this[r]||this[r]===e)&&t&&(this[r]=n[r]),"0x"===n[r]||n[r]===e)continue}void 0===this[r]&&t&&(this[r]=n[r]);const e="Transactions containing different information cannot be combined.";if("_account"!==r){if(this[r]!==n[r])throw new Error(e)}else if(this[r].getRLPEncodingAccountKey()!==n[r].getRLPEncodingAccountKey())throw new Error(e)}this.appendSignatures(n.signatures),this.appendFeePayerSignatures(n.feePayerSignatures)}return this.getRLPEncoding()}getSenderTxHash(){const e=this.getRLPEncoding(),t=e.slice(0,4),r="0x"+e.slice(4),n=f.decode(r);return i.keccak256(t+f.encode(n.slice(0,n.length-2)).slice(2))}getRLPEncodingForFeePayerSignature(){return f.encode([this.getCommonRLPEncodingForSignature(),this.feePayer,a.fromNat(this.chainId),"0x","0x"])}recoverFeePayerPublicKeys(){if(y.isEmptySig(this.feePayerSignatures))throw new Error("Failed to recover public keys from feePayerSignatures: feePayerSignatures is empty.");const e=a.toNumber(this.feePayerSignatures[0].v),t=e<35?a.fromNat("0x1"):a.fromNumber(e-35>>1);this.chainId||(this.chainId=t);const r=this.getRLPEncodingForFeePayerSignature(),n=i.keccak256(r),f=[];for(const i of this.feePayerSignatures){const e=a.toNumber(i.v),t=e<35?a.fromNat("0x1"):a.fromNumber(e-35>>1);if(y.trimLeadingZero(this.chainId)!==y.trimLeadingZero(t))throw new Error("Invalid feePayerSignatures data: recovery data is not matched.");f.push(y.recoverPublicKey(n,i,!0))}return f}}e.exports=b},5594:function(e,t,r){const n=r("172f"),f=r("4695").errors,i=function(e){this.requestManager=e,this.requests=[]};i.prototype.add=function(e){this.requests.push(e)},i.prototype.execute=function(){const e=this.requests;this.requestManager.sendBatch(e,(function(t,r){r=r||[],e.map((function(e,t){return r[t]||{}})).forEach((function(t,r){if(e[r].callback){if(t&&t.error)return e[r].callback(f.ErrorResponse(t));if(!n.isValidResponse(t))return e[r].callback(f.InvalidResponse(t));e[r].callback(null,e[r].format?e[r].format(t.result):t.result)}}))}))},e.exports=i},"55f5":function(e,t,r){ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ var n=r("b639"),f=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return f(e,t,r)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(f.prototype),i(f,a),a.from=function(e,t,r){if("number"===typeof e)throw new TypeError("Argument must not be a number");return f(e,t,r)},a.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError("Argument must be a number");var n=f(e);return void 0!==t?"string"===typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return f(e)},a.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},"56b0":function(e,t,r){const n=r("61d1"),f=r("5d37"),i=r("0774d"),a=r("19eb");class o{constructor(...e){const t=this;a.packageInit(this,e);const r=this.setRequestManager;this.setRequestManager=function(e){return r(e),t.klay.setRequestManager(e),t.net.setRequestManager(e),t.governance.setRequestManager(e),!0};const o=this.setProvider;this.setProvider=function(){o.apply(t,arguments),t.setRequestManager(t._requestManager)},this.klay=new n(this),this.net=new f(this),this.governance=new i(this)}}e.exports=o},"572a":function(e,t,r){const n=r("321b");function f(e,t,r){e.sendAsync(n({method:"eth_estimateGas",params:[t]}),(function(e,t){if(e)return"no contract code at given address"===e.message?r(null,"0xcf08"):r(e);r(null,t.result)}))}e.exports=f},"57b8":function(e,t,r){e.exports=r("d5a1")},"58c5":function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function f(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function a(e){try{s(n.next(e))}catch(t){i(t)}}function o(e){try{s(n["throw"](e))}catch(t){i(t)}}function s(e){e.done?r(e.value):f(e.value).then(a,o)}s((n=n.apply(e,t||[])).next())}))},f=this&&this.__generator||function(e,t){var r,n,f,i,a={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return i={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(e){return function(t){return s([e,t])}}function s(i){if(r)throw new TypeError("Generator is already executing.");while(a)try{if(r=1,n&&(f=2&i[0]?n["return"]:i[0]?n["throw"]||((f=n["return"])&&f.call(n),0):n.next)&&!(f=f.call(n,i[1])).done)return f;switch(n=0,f&&(i=[2&i[0],f.value]),i[0]){case 0:case 1:f=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(f=a.trys,!(f=f.length>0&&f[f.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!f||i[1]>f[0]&&i[1]e.encode()),t=this.feePayerSignatures.map(e=>e.encode());return s.TxTypeFeeDelegatedAccountUpdate+n.encode([f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.from.toLowerCase(),this.account.getRLPEncodingAccountKey(),e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),n.encode([s.TxTypeFeeDelegatedAccountUpdate,f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.from.toLowerCase(),this.account.getRLPEncodingAccountKey()])}}e.exports=h},"5bc3":function(e,t){function r(e,t){for(var r=0;r{if(t){if(e.return)try{await e.return()}catch(f){return r(f)}return r(t)}let n;try{n=await e.next()}catch(f){return r(f)}if(n.done)return r(!0);r(null,n.value)}}i.source=i,i.transform=i.through=e=>t=>i(e(f(t))),i.duplex=e=>({sink:i.sink(e.sink),source:i(e.source)}),i.sink=e=>t=>{e({[Symbol.asyncIterator](){return this},next:()=>new Promise((e,r)=>{t(null,(t,n)=>!0===t?e({done:!0,value:n}):t?r(t):void e({done:!1,value:n}))}),return:()=>new Promise((e,r)=>{t(!0,(t,n)=>{if(t&&!0!==t)return r(t);e({done:!0,value:n})})}),throw:e=>new Promise((r,n)=>{t(e,(e,t)=>{if(e&&!0!==e)return n(e);r({done:!0,value:t})})})})},e.exports=i},"5bf5":function(e,t,r){const n=r("417a"),f=r("364d"),i=r("864f"),{bnToHex:a,hexToInt:o,incrementHexInt:s,minBlockRef:u,blockRefIsNumber:c}=r("1d6f");class l extends i{constructor({provider:e,params:t}){super(),this.type="log",this.ethQuery=new n(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},t),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(e=>e.toLowerCase()))}async initialize({currentBlock:e}){let t=this.params.fromBlock;["latest","pending"].includes(t)&&(t=e),"earliest"===t&&(t="0x0"),this.params.fromBlock=t;const r=u(this.params.toBlock,e),n=Object.assign({},this.params,{toBlock:r}),f=await this._fetchLogs(n);this.addInitialResults(f)}async update({oldBlock:e,newBlock:t}){const r=t;let n;n=e?s(e):t;const f=Object.assign({},this.params,{fromBlock:n,toBlock:r}),i=await this._fetchLogs(f),a=i.filter(e=>this.matchLog(e));this.addResults(a)}async _fetchLogs(e){const t=await f(t=>this.ethQuery.getLogs(e,t))();return t}matchLog(e){if(o(this.params.fromBlock)>=o(e.blockNumber))return!1;if(c(this.params.toBlock)&&o(this.params.toBlock)<=o(e.blockNumber))return!1;const t=e.address&&e.address.toLowerCase();if(this.params.address&&t&&!this.params.address.includes(t))return!1;const r=this.params.topics.every((t,r)=>{let n=e.topics[r];if(!n)return!1;n=n.toLowerCase();let f=Array.isArray(t)?t:[t];const i=f.includes(null);if(i)return!0;f=f.map(e=>e.toLowerCase());const a=f.includes(n);return a});return r}}e.exports=l},"5c91":function(e,t,r){"use strict";const{objectToQuery:n}=r("d518"),f=r("1eca"),{ok:i}=r("7872");e.exports=f(({fetch:e,apiUrl:t,apiPath:r,headers:f})=>async(a,o)=>{o||"object"!==typeof a||(o=a,a=null),o=o||{};const s=n({peer:a,...o.qs||{}}),u=`${t}${r}/bitswap/wantlist${s}`,c=await i(e(u,{signal:o.signal,headers:o.headers||f})),l=await c.json();return(l.Keys||[]).map(e=>e["/"])})},"5d37":function(e,t,r){const n=r("19eb"),f=r("379f"),i=function(...e){const t=this;n.packageInit(this,e);const r=[new f({name:"getNetworkId",call:"net_networkID",params:0}),new f({name:"isListening",call:"net_listening",params:0}),new f({name:"getPeerCount",call:"net_peerCount",params:0}),new f({name:"getPeerCountByType",call:"net_peerCountByType",params:0})];r.forEach((function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)}))};e.exports=i},"5e37":function(e,t){async function r({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const a=n(t),o=n(r),s=o-a+1,u=Array(s).fill().map((e,t)=>a+t).map(f),c=await Promise.all(u.map(t=>i(e,"eth_getBlockByNumber",[t,!1])));return c}function n(e){return void 0===e||null===e?e:Number.parseInt(e,16)}function f(e){if(void 0===e||null===e)return e;const t=e.toString(16);return"0x"+t}function i(e,t,r){return new Promise((n,f)=>{e.sendAsync({id:1,jsonrpc:"2.0",method:t,params:r},(e,t)=>{if(e)return f(e);n(t.result)})})}e.exports=r},"5e78":function(e,t,r){"use strict";(function(e){var r=e.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),n=e.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);t.privateKeyExport=function(t,f,i){var a=e.from(i?r:n);return t.copy(a,i?8:9),f.copy(a,i?181:214),a},t.privateKeyImport=function(e){var t=e.length,r=0;if(t2)return null;if(t1?e[r+n-2]<<8:0);return r+=n,t32||tf))return null;if(2!==t[i++])return null;var o=t[i++];if(128&o){if(a=o-128,i+a>f)return null;for(;a>0&&0===t[i];i+=1,a-=1);for(o=0;a>0;i+=1,a-=1)o=(o<<8)+t[i]}if(o>f-i)return null;var s=i;if(i+=o,2!==t[i++])return null;var u=t[i++];if(128&u){if(a=u-128,i+a>f)return null;for(;a>0&&0===t[i];i+=1,a-=1);for(u=0;a>0;i+=1,a-=1)u=(u<<8)+t[i]}if(u>f-i)return null;var c=i;for(i+=u;o>0&&0===t[s];o-=1,s+=1);if(o>32)return null;var l=t.slice(s,s+o);for(l.copy(r,32-l.length);u>0&&0===t[c];u-=1,c+=1);if(u>32)return null;var h=t.slice(c,c+u);return h.copy(n,32-h.length),{r:r,s:n}}}).call(this,r("b639").Buffer)},"5ebb":function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("da80"),f=r("f2b7");t.createHmac=r("1a2a"),t.randomBytes=r("11dc");var i=function(){function t(e){this.hashFunction=e,this.buffers=[]}return t.prototype.update=function(t){if(!e.isBuffer(t))throw new Error("hdkey-crypto shim is outdated");return this.buffers.push(t),this},t.prototype.digest=function(t){if(t)throw new Error("hdkey-crypto shim is outdated");return this.hashFunction(e.concat(this.buffers))},t}();t.createHash=function(e){if("ripemd160"===e)return new i(n.ripemd160);if("sha256"===e)return new i(f.sha256);throw new Error("hdkey-crypto shim is outdated")}}).call(this,r("b639").Buffer)},"605f":function(e,t,r){"use strict";(function(t){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),f=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return f(t,e),t},a=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var f=0;for(n=Object.getOwnPropertySymbols(e);f{t(null,e.rawTransaction)}).catch(console.log)},signMessage({data:e,from:t},r){const n=e;n||r("No data to sign"),S[t]||r("Account not found");let f=S[t].getPrivateKey();const i=c.toBuffer(n),a=c.hashPersonalMessage(i),o=c.ecsign(a,f),s=c.toRpcSig(o.v,o.r,o.s);r(null,s)},signPersonalMessage(...e){this.signMessage(...e)}})),i?this.engine.addProvider(M):this.engine.addProvider(new m.default),this.engine.addProvider(new p.default),"string"===typeof r){const e=r,t=(w.default.parse(e).protocol||"http:").toLowerCase();switch(t){case"ws:":case"wss:":this.engine.addProvider(new v.default({rpcUrl:e}));break;default:this.engine.addProvider(new b.default({rpcUrl:e}))}}else{const e=r;this.engine.addProvider(new g(e))}this.engine.start(e=>{if(e)throw e})}initialize(){return new Promise((e,t)=>{this.engine.sendAsync({jsonrpc:"2.0",id:Date.now(),method:"eth_chainId",params:[]},(r,n)=>{if(r)t(r);else if(n.error)t(n.error);else{if(isNaN(parseInt(n.result,16))){const e=`When requesting the chain id from the node, itreturned the malformed result ${n.result}.`;throw new Error(e)}this.chainId=parseInt(n.result,16),e()}})})}checkBIP39Mnemonic({addressIndex:e,numberOfAddresses:t,phrase:r,password:n}){if(this.hdwallet=h.hdkey.fromMasterSeed(s.mnemonicToSeedSync(r,n)),!s.validateMnemonic(r,u.wordlist))throw new Error("Mnemonic invalid or undefined");for(let f=e;f{this.engine.send(e,t)})}sendAsync(e,t){this.initialized.then(()=>{this.engine.sendAsync(e,t)})}getAddress(e){return e?this.addresses[e]:this.addresses[0]}getAddresses(){return this.addresses}static isValidProvider(e){const t=["http:","https:","ws:","wss:"];if("string"===typeof e){const r=w.default.parse(e.toLowerCase());return!(!t.includes(r.protocol||"")||!r.slashes)}return!0}}e.exports=A}).call(this,r("b639").Buffer)},"61d1":function(e,t,r){const n=r("2ef0"),f=r("19eb"),{formatters:i}=r("4695"),a=r("03fb").subscriptions,o=r("379f"),s=r("19b5"),u=r("a9b0"),c=r("4872");class l{constructor(...e){const t=this;f.packageInit(this,e);const r=this.setRequestManager;this.setRequestManager=function(e){return r(e),!0};const l=this.setProvider;this.setProvider=function(...e){l.apply(t,e),t.setRequestManager(t._requestManager)},this.clearSubscriptions=t._requestManager.clearSubscriptions;class h extends o{constructor(e){e.outputFormatterDisable=!0,super(e)}}const d=[new h({name:"getChainId",call:"klay_chainID",params:0}),new h({name:"getGasPrice",call:"klay_gasPrice",params:0}),new h({name:"getTransactionCount",call:"klay_getTransactionCount",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]}),new h({name:"getAccountKey",call:"klay_getAccountKey",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]}),new h({name:"getTransactionByHash",call:"klay_getTransactionByHash",params:1})];u._klaytnCall={},c._klaytnCall={},n.each(d,(function(e){e=new h(e),e.attachToObject(u._klaytnCall),e.attachToObject(c._klaytnCall),e.setRequestManager(t._requestManager)}));const p=[...d,new h({name:"accountCreated",call:"klay_accountCreated",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]}),new h({name:"getAccounts",call:"klay_accounts",params:0}),new h({name:"encodeAccountKey",call:"klay_encodeAccountKey",params:1,inputFormatter:[i.inputAccountKeyFormatter]}),new h({name:"decodeAccountKey",call:"klay_decodeAccountKey",params:1}),new h({name:"getAccount",call:"klay_getAccount",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]}),new h({name:"getBalance",call:"klay_getBalance",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]}),new h({name:"getCode",call:"klay_getCode",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]}),new h({name:"isContractAccount",call:"klay_isContractAccount",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]}),new h({name:"sign",call:"klay_sign",params:2,inputFormatter:[i.inputAddressFormatter,i.inputSignFormatter]}),new h({name:"getBlockNumber",call:"klay_blockNumber",params:0}),new h({name:"getBlock",call:"klay_getBlockByNumber",hexCall:"klay_getBlockByHash",params:2,inputFormatter:[i.inputBlockNumberFormatter,i.toBoolean]}),new h({name:"getBlockByNumber",call:"klay_getBlockByNumber",params:2,inputFormatter:[i.inputBlockNumberFormatter,i.toBoolean]}),new h({name:"getBlockByHash",call:"klay_getBlockByHash",params:2,inputFormatter:[i.inputBlockNumberFormatter,i.toBoolean]}),new h({name:"getBlockReceipts",call:"klay_getBlockReceipts",params:1}),new h({name:"getBlockTransactionCount",call:"klay_getBlockTransactionCountByNumber",hexCall:"klay_getBlockTransactionCountByHash",params:1,inputFormatter:[i.inputBlockNumberFormatter]}),new h({name:"getBlockTransactionCountByNumber",call:"klay_getBlockTransactionCountByNumber",params:1,inputFormatter:[i.inputBlockNumberFormatter]}),new h({name:"getBlockTransactionCountByHash",call:"klay_getBlockTransactionCountByHash",params:1,inputFormatter:[i.inputBlockNumberFormatter]}),new h({name:"getBlockWithConsensusInfo",call:"klay_getBlockWithConsensusInfoByNumber",hexCall:"klay_getBlockWithConsensusInfoByHash",params:1,inputFormatter:[i.inputDefaultBlockNumberFormatter]}),new h({name:"getBlockWithConsensusInfoByNumber",call:"klay_getBlockWithConsensusInfoByNumber",params:1,inputFormatter:[i.inputDefaultBlockNumberFormatter]}),new h({name:"getBlockWithConsensusInfoByHash",call:"klay_getBlockWithConsensusInfoByHash",params:1,inputFormatter:[i.inputDefaultBlockNumberFormatter]}),new h({name:"getCommittee",call:"klay_getCommittee",params:1,inputFormatter:[i.inputDefaultBlockNumberFormatter]}),new h({name:"getCommitteeSize",call:"klay_getCommitteeSize",params:1,inputFormatter:[i.inputDefaultBlockNumberFormatter]}),new h({name:"getCouncil",call:"klay_getCouncil",params:1,inputFormatter:[i.inputDefaultBlockNumberFormatter]}),new h({name:"getCouncilSize",call:"klay_getCouncilSize",params:1,inputFormatter:[i.inputDefaultBlockNumberFormatter]}),new h({name:"getStorageAt",call:"klay_getStorageAt",params:3,inputFormatter:[i.inputAddressFormatter,s.numberToHex,i.inputDefaultBlockNumberFormatter]}),new h({name:"isMining",call:"klay_mining",params:0}),new h({name:"isSyncing",call:"klay_syncing",params:0}),new h({name:"call",call:"klay_call",params:2,inputFormatter:[i.inputCallFormatter,i.inputDefaultBlockNumberFormatter]}),new h({name:"estimateGas",call:"klay_estimateGas",params:1,inputFormatter:[i.inputCallFormatter]}),new h({name:"estimateComputationCost",call:"klay_estimateComputationCost",params:2,inputFormatter:[i.inputCallFormatter,i.inputDefaultBlockNumberFormatter]}),new h({name:"getTransactionFromBlock",call:"klay_getTransactionByBlockNumberAndIndex",hexCall:"klay_getTransactionByBlockHashAndIndex",params:2,inputFormatter:[i.inputBlockNumberFormatter,s.numberToHex]}),new h({name:"getTransactionByBlockNumberAndIndex",call:"klay_getTransactionByBlockNumberAndIndex",params:2,inputFormatter:[i.inputBlockNumberFormatter,s.numberToHex]}),new h({name:"getTransactionByBlockHashAndIndex",call:"klay_getTransactionByBlockHashAndIndex",params:2,inputFormatter:[i.inputBlockNumberFormatter,s.numberToHex]}),new h({name:"getTransaction",call:"klay_getTransactionByHash",params:1}),new h({name:"getTransactionByHash",call:"klay_getTransactionByHash",params:1}),new h({name:"getTransactionBySenderTxHash",call:"klay_getTransactionBySenderTxHash",params:1}),new h({name:"getTransactionReceipt",call:"klay_getTransactionReceipt",params:1}),new h({name:"getTransactionReceiptBySenderTxHash",call:"klay_getTransactionReceiptBySenderTxHash",params:1}),new h({name:"sendRawTransaction",call:"klay_sendRawTransaction",params:1}),new h({name:"submitTransaction",call:"klay_sendRawTransaction",params:1}),new h({name:"sendTransaction",call:"klay_sendTransaction",params:1,inputFormatter:[i.inputTransactionFormatter]}),new h({name:"sendTransactionAsFeePayer",call:"klay_sendTransactionAsFeePayer",params:1,inputFormatter:[i.inputTransactionFormatter]}),new h({name:"signTransaction",call:"klay_signTransaction",params:1,inputFormatter:[i.inputTransactionFormatter]}),new h({name:"signTransactionAsFeePayer",call:"klay_signTransactionAsFeePayer",params:1,inputFormatter:[i.inputTransactionFormatter]}),new h({name:"getDecodedAnchoringTransactionByHash",call:"klay_getDecodedAnchoringTransactionByHash",params:1}),new h({name:"getClientVersion",call:"klay_clientVersion",params:0}),new h({name:"getGasPriceAt",call:"klay_gasPriceAt",params:1,inputFormatter:[i.inputDefaultBlockNumberFormatter]}),new h({name:"isParallelDBWrite",call:"klay_isParallelDBWrite",params:0}),new h({name:"isSenderTxHashIndexingEnabled",call:"klay_isSenderTxHashIndexingEnabled",params:0}),new h({name:"getProtocolVersion",call:"klay_protocolVersion",params:0}),new h({name:"getRewardbase",call:"klay_rewardbase",params:0}),new h({name:"isWriteThroughCaching",call:"klay_writeThroughCaching",params:0}),new h({name:"getFilterChanges",call:"klay_getFilterChanges",params:1,inputFormatter:[s.numberToHex]}),new h({name:"getFilterLogs",call:"klay_getFilterLogs",params:1,inputFormatter:[s.numberToHex]}),new h({name:"getLogs",call:"klay_getLogs",params:1,inputFormatter:[i.inputLogFormatter]}),new h({name:"newBlockFilter",call:"klay_newBlockFilter",params:0}),new h({name:"newFilter",call:"klay_newFilter",params:1,inputFormatter:[i.inputLogFormatter]}),new h({name:"newPendingTransactionFilter",call:"klay_newPendingTransactionFilter",params:0}),new h({name:"uninstallFilter",call:"klay_uninstallFilter",params:1,inputFormatter:[s.numberToHex]}),new h({name:"sha3",call:"klay_sha3",params:1}),new h({name:"getCypressCredit",call:"klay_getCypressCredit",params:1,inputFormatter:[i.inputDefaultBlockNumberFormatter]}),new a({name:"subscribe",type:"klay",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0},pendingTransactions:{subscriptionName:"newPendingTransactions",params:0},logs:{params:1,inputFormatter:[i.inputLogFormatter],subscriptionHandler:function(e){this.emit("data",e),n.isFunction(this.callback)&&this.callback(null,e,this)}},syncing:{params:0,subscriptionHandler:function(e){const t=this;!0!==this._isSyncing?(this._isSyncing=!0,this.emit("changed",t._isSyncing),n.isFunction(this.callback)&&this.callback(null,t._isSyncing,this),setTimeout((function(){t.emit("data",e),n.isFunction(t.callback)&&t.callback(null,e,t)}),0)):(this.emit("data",e),n.isFunction(t.callback)&&this.callback(null,e,this),clearTimeout(this._isSyncingTimeout),this._isSyncingTimeout=setTimeout((function(){e.currentBlock>e.highestBlock-200&&(t._isSyncing=!1,t.emit("changed",t._isSyncing),n.isFunction(t.callback)&&t.callback(null,t._isSyncing,t))}),500))}}}})];p.forEach((function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)}))}}e.exports=l},6223:function(e,t){const r=3;function n(){var e=(new Date).getTime()*Math.pow(10,r),t=Math.floor(Math.random()*Math.pow(10,r));return e+t}e.exports=n},6325:function(e,t,r){const n=r("2ef0"),f=r("19b5"),i=r("6561").validateParams,{getTypeInt:a}=r("1789"),o=r("ed19"),s=r("0218"),u=r("fb5f"),c=r("0da3"),l=r("77c8"),h=function(e){return f.toBN(e).toString(10)},d=function(e){return!this||void 0!==e&&null!==e?p(e):f.parsePredefinedBlockNumber(this.defaultBlock)||"latest"},p=function(e){if(void 0!==e)return f.isPredefinedBlockNumber(e)?f.parsePredefinedBlockNumber(e):f.isHexStrict(e)?n.isString(e)?e.toLowerCase():e:f.numberToHex(e)},m=function(e){if(e.from&&(e.from=S(e.from)),e.to){if(e.type&&e.type.includes("DEPLOY")&&(e.humanReadable=void 0!==e.humanReadable&&e.humanReadable),e.humanReadable)throw new Error("HumanReadableAddress is not supported yet.");f.isContractDeployment(e)&&"0x"===e.to||(e.to=S(e.to))}if(e.data&&e.input&&!e.type.includes("TxType"))throw new Error('You can\'t have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.');!e.data&&e.input&&(e.data=e.input,delete e.input),e.data&&!f.isHex(e.data)&&(e.data=f.toHex(e.data)),(e.gas||e.gasLimit)&&(e.gas=e.gas||e.gasLimit);const t=["gasPrice","gas","value","nonce","feeRatio"];return t.filter((function(t){return void 0!==e[t]})).forEach((function(t){e[t]=f.numberToHex(e[t])})),e},y=function(e){e=m(e);const t=e.from||(this?this.defaultAccount:null);return t&&(e.from=S(t)),e},g=function(e){if(!e.type.includes("TxType")){if(e=m(e),e.senderRawTransaction){if(void 0===e.feePayer)throw new Error('The "feePayer" field must be defined for signing with feePayer!');return e.feePayer=S(e.feePayer),e}if(!n.isNumber(e.from)&&!n.isObject(e.from)){if(e.from=e.from||(this?this.defaultAccount:null),!e.from&&!n.isNumber(e.from))throw new Error('The send transactions "from" field must be defined!');e.from=S(e.from)}e.data&&(e.data=f.addHexPrefix(e.data));const t=i(e);if(t)throw t}const t=a(e.type);return""!==t&&(e.typeInt=t),e},b=function(e){if(e=m(e),!n.isNumber(e.from)&&!n.isObject(e.from)){if(e.from=e.from||(this?this.defaultAccount:null),!e.from&&!n.isNumber(e.from))throw new Error('The send transactions "from" field must be defined!');e.from=S(e.from)}return e.data&&(e.data=f.addHexPrefix(e.data)),e},v=function(e){return f.isHexStrict(e)?e:f.utf8ToHex(e)},w=function(e){if(e instanceof o)return{keyType:1,key:{}};if(e instanceof s)return{keyType:2,key:{x:e.getXYPoint()[0],y:e.getXYPoint()[1]}};if(e instanceof u)return{keyType:3,key:{}};if(e instanceof c){const t={threshold:e.threshold,keys:[]};for(const r of e.weightedPublicKeys)t.keys.push({weight:r.weight,key:{x:f.xyPointFromPublicKey(r.publicKey)[0],y:f.xyPointFromPublicKey(r.publicKey)[1]}});return{keyType:4,key:t}}if(e instanceof l){const t=[];for(const r of e.accountKeys)t.push(w(r));return{keyType:5,key:t}}if(void 0===e.keyType||void 0===e.key)throw new Error("AccountKey obejct should define 'keyType' and 'key'");return e},_=function(e){return e?(void 0!==e.blockNumber&&(e.blockNumber=f.hexToNumber(e.blockNumber)),void 0!==e.transactionIndex&&(e.transactionIndex=f.hexToNumber(e.transactionIndex)),e.nonce=f.hexToNumber(e.nonce),e.gas=f.hexToNumber(e.gas),e.gasPrice=h(e.gasPrice),e.value&&(e.value=h(e.value)),e.to&&f.isAddress(e.to)?e.to=f.toChecksumAddress(e.to):e.to=null,e.from&&(e.from=f.toChecksumAddress(e.from)),e):null},T=function(e){if(!e)return null;if("object"!==typeof e)throw new Error("Received receipt is invalid: "+e);return void 0!==e.blockNumber&&(e.blockNumber=f.hexToNumber(e.blockNumber)),void 0!==e.transactionIndex&&(e.transactionIndex=f.hexToNumber(e.transactionIndex)),e.gasUsed=f.hexToNumber(e.gasUsed),n.isArray(e.logs)&&(e.logs=e.logs.map(A)),e.contractAddress&&(e.contractAddress=f.toChecksumAddress(e.contractAddress)),"undefined"!==typeof e.status&&(e.status=1===parseInt(e.status)),e},E=function(e){return e.gasLimit=f.hexToNumber(e.gasLimit),e.gasUsed=f.hexToNumber(e.gasUsed),e.size=f.hexToNumber(e.size),e.timestamp=f.hexToNumber(e.timestamp),void 0!==e.number&&(e.number=f.hexToNumber(e.number)),e.difficulty&&(e.difficulty=h(e.difficulty)),e.totalDifficulty&&(e.totalDifficulty=h(e.totalDifficulty)),n.isArray(e.transactions)&&e.transactions.forEach((function(e){if(!n.isString(e))return _(e)})),e.miner&&(e.miner=f.toChecksumAddress(e.miner)),e},x=function(e){return null===e||"undefined"===typeof e?null:(e=String(e),0===e.indexOf("0x")?e:f.fromUtf8(e))},M=function(e){return e.topics=(e.topics||[]).map(e=>n.isArray(e)?e.map(x):x(e)),e.address&&(e.address=n.isArray(e.address)?e.address.map(e=>S(e)):S(e.address)),e.fromBlock="number"===typeof e.fromBlock?f.numberToHex(e.fromBlock):e.fromBlock,e.toBlock="number"===typeof e.toBlock?f.numberToHex(e.toBlock):e.toBlock,e},A=function(e){if(delete e.removed,"string"===typeof e.blockHash&&"string"===typeof e.transactionHash&&"string"===typeof e.logIndex){const t=f.sha3(e.blockHash.replace("0x","")+e.transactionHash.replace("0x","")+e.logIndex.replace("0x",""));e.id="log_"+t.replace("0x","").substr(0,8)}else e.id||(e.id=null);return void 0!==e.blockNumber&&(e.blockNumber=f.hexToNumber(e.blockNumber)),void 0!==e.transactionIndex&&(e.transactionIndex=f.hexToNumber(e.transactionIndex)),void 0!==e.logIndex&&(e.logIndex=f.hexToNumber(e.logIndex)),e.address&&(e.address=f.toChecksumAddress(e.address)),e},k=function(e){return e.ttl&&(e.ttl=f.numberToHex(e.ttl)),e.workToProve&&(e.workToProve=f.numberToHex(e.workToProve)),e.priority&&(e.priority=f.numberToHex(e.priority)),n.isArray(e.topics)||(e.topics=e.topics?[e.topics]:[]),e.topics=e.topics.map((function(e){return 0===e.indexOf("0x")?e:f.fromUtf8(e)})),e},P=function(e){return e.expiry=f.hexToNumber(e.expiry),e.sent=f.hexToNumber(e.sent),e.ttl=f.hexToNumber(e.ttl),e.workProved=f.hexToNumber(e.workProved),e.topics||(e.topics=[]),e.topics=e.topics.map((function(e){return f.toUtf8(e)})),e},C=function(e){return n.isString(e)&&(e=new Error(e)),e},S=function(e){const t=new f.Iban(e);if(t.isValid()&&t.isDirect())return t.toAddress().toLowerCase();if(f.isAddress(e))return"0x"+e.toLowerCase().replace("0x","");throw new Error(`Provided address "${e}" is invalid, the capitalization checksum test failed.`)},R=function(e){return e.startingBlock=f.hexToNumber(e.startingBlock),e.currentBlock=f.hexToNumber(e.currentBlock),e.highestBlock=f.hexToNumber(e.highestBlock),e.knownStates&&(e.knownStates=f.hexToNumber(e.knownStates),e.pulledStates=f.hexToNumber(e.pulledStates)),e},I=function(e){return"0x"===e.slice(0,2)&&(e=e.slice(2)),e},N=e=>!!e;e.exports={inputDefaultBlockNumberFormatter:d,inputBlockNumberFormatter:p,inputCallFormatter:y,inputTransactionFormatter:g,inputPersonalTransactionFormatter:b,inputAddressFormatter:S,inputPostFormatter:k,inputLogFormatter:M,inputSignFormatter:v,inputRawKeyFormatter:I,inputAccountKeyFormatter:w,outputBigNumberFormatter:h,outputTransactionFormatter:_,outputTransactionReceiptFormatter:T,outputBlockFormatter:E,outputLogFormatter:A,outputPostFormatter:P,outputSyncingFormatter:R,outputVotingPowerFormatter:C,toChecksumAddress:f.toChecksumAddress,hexToNumber:f.hexToNumber,numberToHex:f.numberToHex,toBoolean:N}},6347:function(e,t,r){var n={EventEmitter:r("e8af"),EmitterSubscription:r("85fd")};e.exports=n},6369:function(e,t,r){const n=r("2ef0"),f=r("cfbe"),i={ACCOUNT_KEY_NIL_TAG:"0x80",ACCOUNT_KEY_LEGACY_TAG:"0x01c0",ACCOUNT_KEY_PUBLIC_TAG:"0x02",ACCOUNT_KEY_FAIL_TAG:"0x03c0",ACCOUNT_KEY_WEIGHTED_MULTISIG_TAG:"0x04",ACCOUNT_KEY_ROLE_BASED_TAG:"0x05"},a=(e,t)=>{if(n.isArray(t))throw new Error("For AccountKeyWeightedMultiSig, options cannot be defined as an array of WeightedMultiSigOptions.");return t||(t=new f(1,Array(e).fill(1))),t instanceof f||(t=f.fromObject(t)),t.isEmpty()?new f(1,Array(e).fill(1)):t},o=(e,t=[])=>{if(!n.isArray(t))throw new Error("For AccountKeyRoleBased, options should be an array of WeightedMultiSigOptions.");for(let r=0;r1?new f(1,Array(e[r]).fill(1)):new f,t[r]?t[r]=n:t.push(n)}return t};e.exports={ACCOUNT_KEY_TAG:i,fillWeightedMultiSigOptionsForMultiSig:a,fillWeightedMultiSigOptionsForRoleBased:o}},"64e6":function(e,t,r){const n=r("2ef0"),f=r("d968"),i=r("923c"),a=function(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e},o=function(e){const t=/^\D+(\d+).*$/.exec(e);return t?parseInt(t[1],10):null},s=function(e){const t=/^\D+\d*\[(\d+)\]$/.exec(e);return t?parseInt(t[1],10):null},u=function(e){const t=typeof e;if("string"===t)return i.isHexStrict(e)?new f(e.replace(/0x/i,""),16):new f(e,10);if("number"===t)return new f(e);if(i.isBigNumber(e))return new f(e.toString(10));if(i.isBN(e))return e;throw new Error(e+" is not a number")},c=function(e,t,r){let n,s;if(e=a(e),"bytes"===e){if(t.replace(/^0x/i,"").length%2!==0)throw new Error("Invalid bytes characters "+t.length);return t}if("string"===e)return i.utf8ToHex(t);if("bool"===e)return t?"01":"00";if(e.startsWith("address")){if(n=r?64:40,!i.isAddress(t))throw new Error(t+" is not a valid address, or the checksum is invalid.");return i.leftPad(t.toLowerCase(),n)}if(n=o(e),e.startsWith("bytes")){if(!n)throw new Error("bytes[] not yet supported in solidity");if(r&&(n=32),n<1||n>32||n256)throw new Error(`Invalid uint${n} size`);if(s=u(t),s.bitLength()>n)throw new Error(`Supplied uint exceeds width: ${n} vs ${s.bitLength()}`);if(s.lt(new f(0)))throw new Error(`Supplied uint ${s.toString()} is negative`);return n?i.leftPad(s.toString("hex"),n/8*2):s}if(e.startsWith("int")){if(n%8||n<8||n>256)throw new Error(`Invalid int${n} size`);if(s=u(t),s.bitLength()>n)throw new Error(`Supplied int exceeds width: ${n} vs ${s.bitLength()}`);return s.lt(new f(0))?s.toTwos(n).toString("hex"):n?i.leftPad(s.toString("hex"),n/8*2):s}throw new Error("Unsupported or invalid type: "+e)},l=function(e){if(n.isArray(e))throw new Error("Autodetection of array types is not supported.");let t,r,a,o="";if(n.isObject(e)&&(Object.prototype.hasOwnProperty.call(e,"v")||Object.prototype.hasOwnProperty.call(e,"t")||Object.prototype.hasOwnProperty.call(e,"value")||Object.prototype.hasOwnProperty.call(e,"type"))?(t=Object.prototype.hasOwnProperty.call(e,"t")?e.t:e.type,o=Object.prototype.hasOwnProperty.call(e,"v")?e.v:e.value):(t=i.toHex(e,!0),o=i.toHex(e),t.startsWith("int")||t.startsWith("uint")||(t="bytes")),!t.startsWith("int")&&!t.startsWith("uint")||"string"!==typeof o||/^(-)?0x/i.test(o)||(o=new f(o)),n.isArray(o)){if(a=s(t),a&&o.length!==a)throw new Error(`${t} is not matching the given array ${JSON.stringify(o)}`);a=o.length}return n.isArray(o)?(r=o.map((function(e){return c(t,e,a).toString("hex").replace("0x","")})),r.join("")):(r=c(t,o,a),r.toString("hex").replace("0x",""))},h=function(){const e=Array.prototype.slice.call(arguments),t=n.map(e,l);return i.sha3("0x"+t.join(""))};e.exports=h},"651f":function(e,t,r){"use strict";const{objectToQuery:n}=r("d518"),f=r("1eca"),{ok:i}=r("7872"),a=r("83c7");e.exports=f(({fetch:e,apiUrl:t,apiPath:r,headers:f})=>async o=>{o=o||{};const s=n({verbose:o.verbose,streams:o.streams,latency:o.latency,...o.qs||{}}),u=`${t}${r}/swarm/peers${s}`,c=await i(e(u,{signal:o.signal,headers:o.headers||f})),l=await c.json();return(l.Peers||[]).map(e=>{const t=a(e);return t.streams&&(t.streams=t.streams.map(a)),t})})},6561:function(e,t,r){const n=r("19b5"),{TX_TYPE_STRING:f}=r("1789");function i(e){let t;if(e.senderRawTransaction)return e.feePayer&&"0x"!==e.feePayer&&"0x0000000000000000000000000000000000000000"!==e.feePayer?n.isAddress(e.feePayer)||(t=new Error("Invalid address of fee payer: "+e.feePayer)):t=new Error("Invalid fee payer: "+e.feePayer),t;const r=a(e.type);return r?(t=s(e),void 0!==t||(e.type===f.TxTypeLegacyTransaction||e.from?e.from&&("0x"===e.from||"0x0000000000000000000000000000000000000000"===e.from?e.type!==f.TxTypeLegacyTransaction&&(t=new Error("Invalid address of from: "+e.from)):n.isAddress(e.from)||(t=new Error("Invalid address of from: "+e.from))):t=new Error('"from" is missing'),void 0===e.gas&&void 0===e.gasLimit?t=new Error('"gas" is missing'):(e.nonce<0||e.gas<0||e.gasPrice<0||e.chainId<0)&&(t=new Error("gas, gasPrice, nonce or chainId is lower than 0")),e.feePayerSignatures&&!n.isEmptySig(e.feePayerSignatures)&&(e.feePayer&&"0x"!==e.feePayer&&"0x0000000000000000000000000000000000000000"!==e.feePayer?n.isAddress(e.feePayer)||(t=new Error("Invalid address of fee payer: "+e.feePayer)):t=new Error('"feePayer" is missing: feePayer must be defined with feePayerSignatures.'))),t):new Error(`The transaction type [${e.type}] is not supported`)}function a(e){if(!e)return!0;switch(e){case"VALUE_TRANSFER":case"FEE_DELEGATED_VALUE_TRANSFER":case"FEE_DELEGATED_VALUE_TRANSFER_WITH_RATIO":case"VALUE_TRANSFER_MEMO":case"FEE_DELEGATED_VALUE_TRANSFER_MEMO":case"FEE_DELEGATED_VALUE_TRANSFER_MEMO_WITH_RATIO":case"ACCOUNT_UPDATE":case"FEE_DELEGATED_ACCOUNT_UPDATE":case"FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO":case"SMART_CONTRACT_DEPLOY":case"FEE_DELEGATED_SMART_CONTRACT_DEPLOY":case"FEE_DELEGATED_SMART_CONTRACT_DEPLOY_WITH_RATIO":case"SMART_CONTRACT_EXECUTION":case"FEE_DELEGATED_SMART_CONTRACT_EXECUTION":case"FEE_DELEGATED_SMART_CONTRACT_EXECUTION_WITH_RATIO":case"CANCEL":case"FEE_DELEGATED_CANCEL":case"FEE_DELEGATED_CANCEL_WITH_RATIO":case"CHAIN_DATA_ANCHORING":case"LEGACY":case f.TxTypeValueTransfer:case f.TxTypeFeeDelegatedValueTransfer:case f.TxTypeFeeDelegatedValueTransferWithRatio:case f.TxTypeValueTransferMemo:case f.TxTypeFeeDelegatedValueTransferMemo:case f.TxTypeFeeDelegatedValueTransferMemoWithRatio:case f.TxTypeAccountUpdate:case f.TxTypeFeeDelegatedAccountUpdate:case f.TxTypeFeeDelegatedAccountUpdateWithRatio:case f.TxTypeSmartContractDeploy:case f.TxTypeFeeDelegatedSmartContractDeploy:case f.TxTypeFeeDelegatedSmartContractDeployWithRatio:case f.TxTypeSmartContractExecution:case f.TxTypeFeeDelegatedSmartContractExecution:case f.TxTypeFeeDelegatedSmartContractExecutionWithRatio:case f.TxTypeCancel:case f.TxTypeFeeDelegatedCancel:case f.TxTypeFeeDelegatedCancelWithRatio:case f.TxTypeChainDataAnchoring:case f.TxTypeFeeDelegatedChainDataAnchoring:case f.TxTypeFeeDelegatedChainDataAnchoringWithRatio:case f.TxTypeLegacyTransaction:return!0}return!1}function o(e){if(void 0===e)return!0;switch(e){case 0:case"EVM":case"0x":case"0x0":return!0}return!1}function s(e){if(void 0===e.type)return u(e);switch(e.type){case"LEGACY":case f.TxTypeLegacyTransaction:return u(e);case"VALUE_TRANSFER":case f.TxTypeValueTransfer:return p(e);case"FEE_DELEGATED_VALUE_TRANSFER":case f.TxTypeFeeDelegatedValueTransfer:return m(e);case"FEE_DELEGATED_VALUE_TRANSFER_WITH_RATIO":case f.TxTypeFeeDelegatedValueTransferWithRatio:return y(e);case"VALUE_TRANSFER_MEMO":case f.TxTypeValueTransferMemo:return b(e);case"FEE_DELEGATED_VALUE_TRANSFER_MEMO":case f.TxTypeFeeDelegatedValueTransferMemo:return v(e);case"FEE_DELEGATED_VALUE_TRANSFER_MEMO_WITH_RATIO":case f.TxTypeFeeDelegatedValueTransferMemoWithRatio:return w(e);case"ACCOUNT_UPDATE":case f.TxTypeAccountUpdate:return E(e);case"FEE_DELEGATED_ACCOUNT_UPDATE":case f.TxTypeFeeDelegatedAccountUpdate:return x(e);case"FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO":case f.TxTypeFeeDelegatedAccountUpdateWithRatio:return M(e);case"SMART_CONTRACT_DEPLOY":case f.TxTypeSmartContractDeploy:return k(e);case"FEE_DELEGATED_SMART_CONTRACT_DEPLOY":case f.TxTypeFeeDelegatedSmartContractDeploy:return P(e);case"FEE_DELEGATED_SMART_CONTRACT_DEPLOY_WITH_RATIO":case f.TxTypeFeeDelegatedSmartContractDeployWithRatio:return C(e);case"SMART_CONTRACT_EXECUTION":case f.TxTypeSmartContractExecution:return R(e);case"FEE_DELEGATED_SMART_CONTRACT_EXECUTION":case f.TxTypeFeeDelegatedSmartContractExecution:return I(e);case"FEE_DELEGATED_SMART_CONTRACT_EXECUTION_WITH_RATIO":case f.TxTypeFeeDelegatedSmartContractExecutionWithRatio:return N(e);case"CANCEL":case f.TxTypeCancel:return F(e);case"FEE_DELEGATED_CANCEL":case f.TxTypeFeeDelegatedCancel:return K(e);case"FEE_DELEGATED_CANCEL_WITH_RATIO":case f.TxTypeFeeDelegatedCancelWithRatio:return O(e);case"CHAIN_DATA_ANCHORING":case f.TxTypeChainDataAnchoring:return B(e);case f.TxTypeFeeDelegatedChainDataAnchoring:return U(e);case f.TxTypeFeeDelegatedChainDataAnchoringWithRatio:return j(e)}}function u(e){if(void 0===e.to&&void 0===e.data&&void 0===e.input)return new Error("contract creation without any data provided");if(e.to&&"0x"!==e.to&&"0x0000000000000000000000000000000000000000"!==e.to&&!n.isAddress(e.to))return new Error("Invalid address of to: "+e.to);if(void 0!==e.codeFormat)return new Error(`"codeFormat" cannot be used with ${e.type} transaction`);if(void 0!==e.humanReadable)return new Error(`"humanReadable" cannot be used with ${e.type} transaction`);const t=c(e);return t||h(e)}function c(e){const t=e.type?e.type:"LEGACY";return void 0!==e.feePayer?new Error(`"feePayer" cannot be used with ${t} transaction`):void 0!==e.feeRatio?new Error(`"feeRatio" cannot be used with ${t} transaction`):void 0!==e.feePayerSignatures?new Error(`"feePayerSignatures" cannot be used with ${t} transaction`):void 0}function l(e){if(e.type.includes("WITH_RATIO")||e.type.includes("WithRatio")){if(void 0===e.feeRatio)return new Error('"feeRatio" is missing')}else if(void 0!==e.feeRatio)return new Error(`"feeRatio" cannot be used with ${e.type} transaction`)}function h(e){const t=e.type?e.type:"LEGACY";return void 0!==e.account?new Error(`"account" cannot be used with ${t} transaction`):void 0!==e.key?new Error(`"key" cannot be used with ${t} transaction`):void 0!==e.legacyKey?new Error(`"legacyKey" cannot be used with ${t} transaction`):void 0!==e.publicKey?new Error(`"publicKey" cannot be used with ${t} transaction`):void 0!==e.multisig?new Error(`"multisig" cannot be used with ${t} transaction`):void 0!==e.roleTransactionKey?new Error(`"roleTransactionKey" cannot be used with ${t} transaction`):void 0!==e.roleAccountUpdateKey?new Error(`"roleAccountUpdateKey" cannot be used with ${t} transaction`):void 0!==e.roleFeePayerKey?new Error(`"roleFeePayerKey" cannot be used with ${t} transaction`):void 0!==e.failKey?new Error(`"failKey" cannot be used with ${t} transaction`):void 0}function d(e){return void 0===e.to?new Error('"to" is missing'):n.isAddress(e.to)?void 0===e.value?new Error('"value" is missing'):void 0!==e.codeFormat?new Error(`"codeFormat" cannot be used with ${e.type} transaction`):void 0!==e.data?new Error(`"data" cannot be used with ${e.type} transaction`):void 0!==e.input?new Error(`"input" cannot be used with ${e.type} transaction`):void 0!==e.humanReadable?new Error(`"humanReadable" cannot be used with ${e.type} transaction`):void 0:new Error("Invalid address of to: "+e.to)}function p(e){let t=d(e);return t||(t=c(e),t||h(e))}function m(e){let t=d(e);return t||(t=l(e),t||h(e))}function y(e){return m(e)}function g(e){return void 0===e.to?new Error('"to" is missing'):n.isAddress(e.to)?void 0===e.value?new Error('"value" is missing'):void 0!==e.input&&void 0!==e.data?new Error('"data" and "input" cannot be used as properties of transactions at the same time.'):void 0===e.input&&void 0===e.data?e.type.includes("TxType")?new Error('"input" is missing'):new Error('"data" is missing'):void 0!==e.codeFormat?new Error(`"codeFormat" cannot be used with ${e.type} transaction`):void 0!==e.humanReadable?new Error(`"humanReadable" cannot be used with ${e.type} transaction`):void 0:new Error("Invalid address of to: "+e.to)}function b(e){let t=g(e);return t||(t=c(e),t||h(e))}function v(e){let t=g(e);return t||(t=l(e),t||h(e))}function w(e){return v(e)}function _(e){if(void 0!==e.data)return new Error(`"data" cannot be used with ${e.type} transaction`);if(void 0!==e.input)return new Error(`"input" cannot be used with ${e.type} transaction`);if(void 0!==e.codeFormat)return new Error(`"codeFormat" cannot be used with ${e.type} transaction`);if(void 0!==e.humanReadable)return new Error(`"humanReadable" cannot be used with ${e.type} transaction`);if(e.type.includes("TxType"))return e.account?void 0!==e.key?new Error(`"key" cannot be used with ${e.type} transaction.`):void 0!==e.legacyKey?new Error(`"legacyKey" cannot be used with ${e.type} transaction.`):e.publicKey?new Error(`"publicKey" cannot be used with ${e.type} transaction.`):e.multisig?new Error(`"multisig" cannot be used with ${e.type} transaction.`):e.roleTransactionKey?new Error(`"roleTransactionKey" cannot be used with ${e.type} transaction.`):e.roleAccountUpdateKey?new Error(`"roleAccountUpdateKey" cannot be used with ${e.type} transaction.`):e.roleFeePayerKey?new Error(`"roleFeePayerKey" cannot be used with ${e.type} transaction.`):void 0!==e.failKey?new Error(`"failKey" cannot be used with ${e.type} transaction.`):void 0:new Error(`Missing account information with ${e.type} transaction`);if(e.account)return new Error(`"account" cannot be used with ${e.type} transaction`);const t=`The key parameter to be used for ${e.type} is duplicated.`;if(!e.key&&void 0===e.legacyKey&&!e.publicKey&&!e.multisig&&!e.roleTransactionKey&&!e.roleAccountUpdateKey&&!e.roleFeePayerKey&&void 0===e.failKey)return new Error(`Missing key information with ${e.type} transaction`);if(e.key){if(void 0!==e.legacyKey||e.publicKey||e.multisig||e.roleTransactionKey||e.roleAccountUpdateKey||e.roleFeePayerKey||void 0!==e.failKey)return new Error(t)}else if(void 0!==e.legacyKey){if(e.publicKey||e.multisig||e.roleTransactionKey||e.roleAccountUpdateKey||e.roleFeePayerKey||void 0!==e.failKey)return new Error(t)}else if(e.publicKey){if(e.multisig||e.roleTransactionKey||e.roleAccountUpdateKey||e.roleFeePayerKey||void 0!==e.failKey)return new Error(t)}else if(e.multisig){if(e.roleTransactionKey||e.roleAccountUpdateKey||e.roleFeePayerKey||void 0!==e.failKey)return new Error(t)}else if(void 0!==e.failKey&&(e.roleTransactionKey||e.roleAccountUpdateKey||e.roleFeePayerKey))return new Error(t)}function T(e){return void 0!==e.to?new Error(`"to" cannot be used with ${e.type} transaction`):void 0!==e.value?new Error(`"value" cannot be used with ${e.type} transaction`):void 0}function E(e){let t=T(e);return t||(t=_(e),t||c(e))}function x(e){let t=T(e);return t||(t=_(e),t||l(e))}function M(e){return x(e)}function A(e){return void 0!==e.value||e.type.includes("TxType")?void 0===e.input||void 0===e.data||e.type.includes("TxType")?void 0===e.input&&void 0===e.data?e.type.includes("TxType")?new Error('"input" is missing'):new Error('"data" is missing'):e.to&&"0x"!==e.to?new Error(`"to" cannot be used with ${e.type} transaction`):void 0===e.codeFormat||o(e.codeFormat)?void 0!==e.humanReadable&&!0===e.humanReadable?new Error("HumanReadableAddress is not supported yet."):void 0:new Error(`The codeFormat(${e.codeFormat}) is invalid.`):new Error('"data" and "input" cannot be used as properties of transactions at the same time.'):new Error('"value" is missing')}function k(e){let t=A(e);return t||(t=c(e),t||h(e))}function P(e){let t=A(e);return t||(t=h(e),t||l(e))}function C(e){return P(e)}function S(e){return void 0===e.to?new Error('"to" is missing'):n.isAddress(e.to)?void 0!==e.input&&void 0!==e.data?new Error('"data" and "input" cannot be used as properties of transactions at the same time.'):void 0===e.input&&void 0===e.data?e.type.includes("TxType")?new Error('"input" is missing'):new Error('"data" is missing'):void 0!==e.codeFormat?new Error(`"codeFormat" cannot be used with ${e.type} transaction`):void 0!==e.humanReadable?new Error(`"humanReadable" cannot be used with ${e.type} transaction`):void 0:new Error("Invalid address of to: "+e.to)}function R(e){let t=S(e);return t||(t=c(e),t||h(e))}function I(e){let t=S(e);return t||(t=h(e),t||l(e))}function N(e){return I(e)}function L(e){return void 0!==e.to?new Error(`"to" cannot be used with ${e.type} transaction`):void 0!==e.value?new Error(`"value" cannot be used with ${e.type} transaction`):void 0!==e.data?new Error(`"data" cannot be used with ${e.type} transaction`):void 0!==e.input?new Error(`"input" cannot be used with ${e.type} transaction`):void 0!==e.codeFormat?new Error(`"codeFormat" cannot be used with ${e.type} transaction`):void 0!==e.humanReadable?new Error(`"humanReadable" cannot be used with ${e.type} transaction`):void 0}function F(e){let t=L(e);return t||(t=c(e),t||h(e))}function K(e){let t=L(e);return t||(t=h(e),t||l(e))}function O(e){return K(e)}function D(e){if(void 0!==e.input&&void 0!==e.data)return new Error('"data" and "input" cannot be used as properties of transactions at the same time.');if(void 0===e.input&&void 0===e.data){if(void 0===e.anchoredData)return e.type.includes("TxType")?new Error('"input" is missing'):new Error('"data" is missing');e.data=e.anchoredData,delete e.anchoredData}return void 0!==e.value?new Error(`"value" cannot be used with ${e.type} transaction`):void 0!==e.to?new Error(`"to" cannot be used with ${e.type} transaction`):void 0!==e.codeFormat?new Error(`"codeFormat" cannot be used with ${e.type} transaction`):void 0!==e.humanReadable?new Error(`"humanReadable" cannot be used with ${e.type} transaction`):void 0}function B(e){let t=D(e);return t||(t=c(e),t||h(e))}function U(e){let t=D(e);return t||(t=h(e),t||l(e))}function j(e){return U(e)}e.exports={validateParams:i,validateTxType:a,validateCodeFormat:o}},"65a6":function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0});var f=r("72a4");t.secp256k1=f;var i=r("9a12"),a=r("d968");t.BN=a;var o=r("a3ca");t.rlp=o,Object.assign(t,i),n(r("2e19")),n(r("f7ab")),n(r("2803")),n(r("e680")),n(r("d5c5")),n(r("7dd01"))},6784:function(e,t,r){"use strict";var n=r("55f5").Buffer,f=r("98e6"),i=r("2740"),a=r("3337").ec,o=r("e351"),s=new a("secp256k1"),u=s.curve;function c(e,t){var r=new i(t);if(r.cmp(u.p)>=0)return null;r=r.toRed(u.red);var n=r.redSqr().redIMul(r).redIAdd(u.b).redSqrt();return 3===e!==n.isOdd()&&(n=n.redNeg()),s.keyPair({pub:{x:r,y:n}})}function l(e,t,r){var n=new i(t),f=new i(r);if(n.cmp(u.p)>=0||f.cmp(u.p)>=0)return null;if(n=n.toRed(u.red),f=f.toRed(u.red),(6===e||7===e)&&f.isOdd()!==(7===e))return null;var a=n.redSqr().redIMul(n);return f.redSqr().redISub(a.redIAdd(u.b)).isZero()?s.keyPair({pub:{x:n,y:f}}):null}function h(e){var t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:c(t,e.slice(1,33));case 4:case 6:case 7:return 65!==e.length?null:l(t,e.slice(1,33),e.slice(33,65));default:return null}}t.privateKeyVerify=function(e){var t=new i(e);return t.cmp(u.n)<0&&!t.isZero()},t.privateKeyExport=function(e,t){var r=new i(e);if(r.cmp(u.n)>=0||r.isZero())throw new Error(o.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return n.from(s.keyFromPrivate(e).getPublic(t,!0))},t.privateKeyNegate=function(e){var t=new i(e);return t.isZero()?n.alloc(32):u.n.sub(t).umod(u.n).toArrayLike(n,"be",32)},t.privateKeyModInverse=function(e){var t=new i(e);if(t.cmp(u.n)>=0||t.isZero())throw new Error(o.EC_PRIVATE_KEY_RANGE_INVALID);return t.invm(u.n).toArrayLike(n,"be",32)},t.privateKeyTweakAdd=function(e,t){var r=new i(t);if(r.cmp(u.n)>=0)throw new Error(o.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(r.iadd(new i(e)),r.cmp(u.n)>=0&&r.isub(u.n),r.isZero())throw new Error(o.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return r.toArrayLike(n,"be",32)},t.privateKeyTweakMul=function(e,t){var r=new i(t);if(r.cmp(u.n)>=0||r.isZero())throw new Error(o.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return r.imul(new i(e)),r.cmp(u.n)&&(r=r.umod(u.n)),r.toArrayLike(n,"be",32)},t.publicKeyCreate=function(e,t){var r=new i(e);if(r.cmp(u.n)>=0||r.isZero())throw new Error(o.EC_PUBLIC_KEY_CREATE_FAIL);return n.from(s.keyFromPrivate(e).getPublic(t,!0))},t.publicKeyConvert=function(e,t){var r=h(e);if(null===r)throw new Error(o.EC_PUBLIC_KEY_PARSE_FAIL);return n.from(r.getPublic(t,!0))},t.publicKeyVerify=function(e){return null!==h(e)},t.publicKeyTweakAdd=function(e,t,r){var f=h(e);if(null===f)throw new Error(o.EC_PUBLIC_KEY_PARSE_FAIL);if(t=new i(t),t.cmp(u.n)>=0)throw new Error(o.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var a=u.g.mul(t).add(f.pub);if(a.isInfinity())throw new Error(o.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return n.from(a.encode(!0,r))},t.publicKeyTweakMul=function(e,t,r){var f=h(e);if(null===f)throw new Error(o.EC_PUBLIC_KEY_PARSE_FAIL);if(t=new i(t),t.cmp(u.n)>=0||t.isZero())throw new Error(o.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return n.from(f.pub.mul(t).encode(!0,r))},t.publicKeyCombine=function(e,t){for(var r=new Array(e.length),f=0;f=0||r.cmp(u.n)>=0)throw new Error(o.ECDSA_SIGNATURE_PARSE_FAIL);var f=n.from(e);return 1===r.cmp(s.nh)&&u.n.sub(r).toArrayLike(n,"be",32).copy(f,32),f},t.signatureExport=function(e){var t=e.slice(0,32),r=e.slice(32,64);if(new i(t).cmp(u.n)>=0||new i(r).cmp(u.n)>=0)throw new Error(o.ECDSA_SIGNATURE_PARSE_FAIL);return{r:t,s:r}},t.signatureImport=function(e){var t=new i(e.r);t.cmp(u.n)>=0&&(t=new i(0));var r=new i(e.s);return r.cmp(u.n)>=0&&(r=new i(0)),n.concat([t.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},t.sign=function(e,t,r,f){if("function"===typeof r){var a=r;r=function(r){var s=a(e,t,null,f,r);if(!n.isBuffer(s)||32!==s.length)throw new Error(o.ECDSA_SIGN_FAIL);return new i(s)}}var c=new i(t);if(c.cmp(u.n)>=0||c.isZero())throw new Error(o.ECDSA_SIGN_FAIL);var l=s.sign(e,t,{canonical:!0,k:r,pers:f});return{signature:n.concat([l.r.toArrayLike(n,"be",32),l.s.toArrayLike(n,"be",32)]),recovery:l.recoveryParam}},t.verify=function(e,t,r){var n={r:t.slice(0,32),s:t.slice(32,64)},f=new i(n.r),a=new i(n.s);if(f.cmp(u.n)>=0||a.cmp(u.n)>=0)throw new Error(o.ECDSA_SIGNATURE_PARSE_FAIL);if(1===a.cmp(s.nh)||f.isZero()||a.isZero())return!1;var c=h(r);if(null===c)throw new Error(o.EC_PUBLIC_KEY_PARSE_FAIL);return s.verify(e,n,{x:c.pub.x,y:c.pub.y})},t.recover=function(e,t,r,f){var a={r:t.slice(0,32),s:t.slice(32,64)},c=new i(a.r),l=new i(a.s);if(c.cmp(u.n)>=0||l.cmp(u.n)>=0)throw new Error(o.ECDSA_SIGNATURE_PARSE_FAIL);try{if(c.isZero()||l.isZero())throw new Error;var h=s.recoverPubKey(e,a,r);return n.from(h.encode(!0,f))}catch(d){throw new Error(o.ECDSA_RECOVER_FAIL)}},t.ecdh=function(e,r){var n=t.ecdhUnsafe(e,r,!0);return f("sha256").update(n).digest()},t.ecdhUnsafe=function(e,t,r){var f=h(e);if(null===f)throw new Error(o.EC_PUBLIC_KEY_PARSE_FAIL);var a=new i(t);if(a.cmp(u.n)>=0||a.isZero())throw new Error(o.ECDH_FAIL);return n.from(f.pub.mul(a).encode(!0,r))}},"67da":function(e,t,r){const n=r("19d7"),f=r("0664"),i=r("2ef0"),a=r("558a"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s}=r("1789"),u=r("19b5");function c(e){if(e=u.addHexPrefix(e),!e.startsWith(s.TxTypeFeeDelegatedValueTransferMemo))throw new Error(`Cannot decode to FeeDelegatedValueTransferMemo. The prefix must be ${s.TxTypeFeeDelegatedValueTransferMemo}: ${e}`);const t="0x"+e.slice(4),[r,f,i,a,o,c,l,h,d,p]=n.decode(t);return{nonce:u.trimLeadingZero(r),gasPrice:u.trimLeadingZero(f),gas:u.trimLeadingZero(i),to:a,value:u.trimLeadingZero(o),from:c,input:l,signatures:h,feePayer:d,feePayerSignatures:p}}class l extends a{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){if(i.isString(e)&&(e=c(e)),super(o.TxTypeFeeDelegatedValueTransferMemo,e),this.to=e.to,this.value=e.value,e.input&&e.data)throw new Error("'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.");this.input=e.input||e.data}get to(){return this._to}set to(e){if(!u.isAddress(e))throw new Error("Invalid address of to: "+e);this._to=e.toLowerCase()}get value(){return this._value}set value(e){this._value=u.numberToHex(e)}get input(){return this._input}set input(e){if(!e||!u.isHex(e))throw new Error("Invalid input data "+e);this._input=u.addHexPrefix(e)}get data(){return this._input}set data(e){this._input=e}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode()),t=this.feePayerSignatures.map(e=>e.encode());return s.TxTypeFeeDelegatedValueTransferMemo+n.encode([f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.to.toLowerCase(),f.fromNat(this.value),this.from.toLowerCase(),this.input,e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),n.encode([s.TxTypeFeeDelegatedValueTransferMemo,f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.to.toLowerCase(),f.fromNat(this.value),this.from.toLowerCase(),this.input])}}e.exports=l},6868:function(e,t){e.exports=e=>async function*(){for await(const t of e)yield JSON.stringify(t)+"\n"}()},"69b0":function(e,t,r){const n=r("0c0c"),f=r("148e"),i=r("aea2"),a=r("923c").isAddress,o=r("19b5").addHexPrefix;class s{static fromObject(e){return new s(e.address,new n(e.privateKey))}static isAccountKey(e){let t=!1;return e instanceof n&&(t=!0),e instanceof f&&(t=!0),e instanceof i&&(t=!0),t}constructor(e,t){if(!e||!t)throw new Error("Failed to create Account. address and accountKey are needed to create Account.");if(!a(e))throw new Error("Invalid address : "+e);if(!s.isAccountKey(t))throw new Error("Invalid accountKey.");e=o(e),Object.defineProperty(this,"address",{get:function(){return e},set:function(t){if(!a(t))throw new Error("Invalid address : "+t);e=o(t)},enumerable:!0}),Object.defineProperty(this,"accountKey",{get:function(){return t},set:function(e){if(!s.isAccountKey(e)&&null!==e)throw new Error("Invalid accountKey.");null===t||null===e||t.type!==e.type?t=e:t.update(e)},enumerable:!0,configurable:!0}),Object.defineProperty(this,"privateKey",{get:function(){return this.accountKey.defaultKey},set:function(){throw new Error("The privateKey cannot be modified. The privateKey is set to default key of accountKey, so update accountKey to modify the privateKey.")},enumerable:!0})}get keys(){return this.accountKey.keys}get accountKeyType(){return this.accountKey.type}get transactionKey(){return this.accountKey.transactionKey}get updateKey(){return this.accountKey.updateKey}get feePayerKey(){return this.accountKey.feePayerKey}toPublicKey(e){return this.accountKey.toPublicKey(e)}}e.exports=s},"69c7":function(e,t,r){"use strict";const n=r("1eca"),{ok:f}=r("7872"),{objectToQuery:i}=r("d518"),a=r("83c7");e.exports=n(({fetch:e,apiUrl:t,apiPath:r,headers:n})=>async o=>{o=o||{};const s=i(o.qs),u=`${t}${r}/bitswap/stat${s}`,c=await f(e(u,{signal:o.signal,headers:o.headers||n})),l=a(await c.json());return l.wantlist=(l.wantlist||[]).map(e=>e["/"]),l})},"6a9e":function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("0664"),a=r("a9b0"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s,CODE_FORMAT:u,getCodeFormatTag:c}=r("1789"),l=r("19b5");function h(e){if(e=l.addHexPrefix(e),!e.startsWith(s.TxTypeSmartContractDeploy))throw new Error(`Cannot decode to SmartContractDeploy. The prefix must be ${s.TxTypeSmartContractDeploy}: ${e}`);const t="0x"+e.slice(4),[r,n,i,a,o,u,h,d,p,m]=f.decode(t);return{nonce:l.trimLeadingZero(r),gasPrice:l.trimLeadingZero(n),gas:l.trimLeadingZero(i),to:a,value:l.trimLeadingZero(o),from:u,input:h,humanReadable:"0x1"===d,codeFormat:c(p),signatures:m}}class d extends a{static create(e){return new d(e)}static decode(e){return new d(h(e))}constructor(e){if(n.isString(e)&&(e=h(e)),super(o.TxTypeSmartContractDeploy,e),this.to=e.to||"0x",this.value=e.value||"0x0",e.input&&e.data)throw new Error("'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.");this.input=e.input||e.data,this.humanReadable=void 0!==e.humanReadable&&e.humanReadable,this.codeFormat=void 0!==e.codeFormat?e.codeFormat:u.EVM}get to(){return this._to}set to(e){if("0x"!==e)throw new Error("Invalid address of to: 'to' should be '0x' with smart contract deploy transaction.");this._to=e.toLowerCase()}get value(){return this._value}set value(e){this._value=l.numberToHex(e)}get input(){return this._input}set input(e){if(!e||!l.isHex(e))throw new Error("Invalid input data "+e);this._input=l.addHexPrefix(e)}get data(){return this._input}set data(e){this._input=e}get humanReadable(){return this._humanReadable}set humanReadable(e){if(!n.isBoolean(e))throw new Error("Invalid humanReadable "+e);this._humanReadable=e}get codeFormat(){return this._codeFormat}set codeFormat(e){this._codeFormat=c(e)}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode());return s.TxTypeSmartContractDeploy+f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.from.toLowerCase(),this.input,i.fromNat(!0===this.humanReadable?"0x1":"0x0"),i.fromNat(this.codeFormat),e]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),f.encode([s.TxTypeSmartContractDeploy,i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.from.toLowerCase(),this.input,i.fromNat(!0===this.humanReadable?"0x1":"0x0"),i.fromNat(this.codeFormat)])}}e.exports=d},"6b49":function(e,t,r){"use strict";(function(t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var f=r("6ef0"),i=r("e04c"),a=f.BN,o=new a("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=function(){function e(r){n(this,e),r=r||{};var i=[{name:"nonce",length:32,allowLess:!0,default:new t([])},{name:"gasPrice",length:32,allowLess:!0,default:new t([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new t([])},{name:"to",allowZero:!0,length:20,default:new t([])},{name:"value",length:32,allowLess:!0,default:new t([])},{name:"data",alias:"input",allowZero:!0,default:new t([])},{name:"v",allowZero:!0,default:new t([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new t([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new t([])}];f.defineProperties(this,i,r),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var a=f.bufferToInt(this.v),o=Math.floor((a-35)/2);o<0&&(o=0),this._chainId=o||r.chainId||0,this._homestead=!0}return e.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},e.prototype.hash=function(e){void 0===e&&(e=!0);var t=void 0;if(e)t=this.raw;else if(this._chainId>0){var r=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,t=this.raw,this.raw=r}else t=this.raw.slice(0,6);return f.rlphash(t)},e.prototype.getChainId=function(){return this._chainId},e.prototype.getSenderAddress=function(){if(this._from)return this._from;var e=this.getSenderPublicKey();return this._from=f.publicToAddress(e),this._from},e.prototype.getSenderPublicKey=function(){if((!this._senderPubKey||!this._senderPubKey.length)&&!this.verifySignature())throw new Error("Invalid Signature");return this._senderPubKey},e.prototype.verifySignature=function(){var e=this.hash(!1);if(this._homestead&&1===new a(this.s).cmp(o))return!1;try{var t=f.bufferToInt(this.v);this._chainId>0&&(t-=2*this._chainId+8),this._senderPubKey=f.ecrecover(e,t,this.r,this.s)}catch(r){return!1}return!!this._senderPubKey},e.prototype.sign=function(e){var t=this.hash(!1),r=f.ecsign(t,e);this._chainId>0&&(r.v+=2*this._chainId+8),Object.assign(this,r)},e.prototype.getDataFee=function(){for(var e=this.raw[5],t=new a(0),r=0;r0&&t.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===e||!1===e?0===t.length:t.join(" ")},e}();e.exports=s}).call(this,r("b639").Buffer)},"6d58":function(e){e.exports=JSON.parse('{"name":"websocket","description":"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.","keywords":["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],"author":"Brian McKelvey (https://github.com/theturtle32)","contributors":["Iñaki Baz Castillo (http://dev.sipdoc.net)"],"version":"1.0.31","repository":{"type":"git","url":"https://github.com/theturtle32/WebSocket-Node.git"},"homepage":"https://github.com/theturtle32/WebSocket-Node","engines":{"node":">=0.10.0"},"dependencies":{"debug":"^2.2.0","es5-ext":"^0.10.50","nan":"^2.14.0","typedarray-to-buffer":"^3.1.5","yaeti":"^0.0.6"},"devDependencies":{"buffer-equal":"^1.0.0","faucet":"^0.0.1","gulp":"^4.0.2","gulp-jshint":"^2.0.4","jshint-stylish":"^2.2.1","jshint":"^2.0.0","tape":"^4.9.1"},"config":{"verbose":false},"scripts":{"install":"(node-gyp rebuild 2> builderror.log) || (exit 0)","test":"faucet test/unit","gulp":"gulp"},"main":"index","directories":{"lib":"./lib"},"browser":"lib/browser.js","license":"Apache-2.0"}')},"6db1":function(e,t,r){const n=r("3c73"),f=r("5e37"),{incrementHexInt:i}=r("1d6f");class a extends n{constructor({provider:e,params:t}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:t}){const r=t,n=i(e),a=await f({provider:this.provider,fromBlock:n,toBlock:r}),o=a.map(e=>e.hash);this.addResults(o)}}e.exports=a},"6ef0":function(e,t,r){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f=r("c331"),i=f.keccak224,a=f.keccak384,o=f.keccak256,s=f.keccak512,u=r("4358"),c=r("f654"),l=r("a3ca"),h=r("8d08"),d=r("98e6"),p=r("8707").Buffer;Object.assign(t,r("9a12")),t.MAX_INTEGER=new h("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new h("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.SHA3_NULL_S=t.KECCAK256_NULL_S,t.KECCAK256_NULL=p.from(t.KECCAK256_NULL_S,"hex"),t.SHA3_NULL=t.KECCAK256_NULL,t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.SHA3_RLP_ARRAY_S=t.KECCAK256_RLP_ARRAY_S,t.KECCAK256_RLP_ARRAY=p.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.SHA3_RLP_ARRAY=t.KECCAK256_RLP_ARRAY,t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.SHA3_RLP_S=t.KECCAK256_RLP_S,t.KECCAK256_RLP=p.from(t.KECCAK256_RLP_S,"hex"),t.SHA3_RLP=t.KECCAK256_RLP,t.BN=h,t.rlp=l,t.secp256k1=u,t.zeros=function(e){return p.allocUnsafe(e).fill(0)},t.zeroAddress=function(){var e=20,r=t.zeros(e);return t.bufferToHex(r)},t.setLengthLeft=t.setLength=function(e,r,n){var f=t.zeros(r);return e=t.toBuffer(e),n?e.length0&&"0"===r.toString())e=e.slice(1),r=e[0];return e},t.toBuffer=function(e){if(!p.isBuffer(e))if(Array.isArray(e))e=p.from(e);else if("string"===typeof e)e=t.isHexString(e)?p.from(t.padToEven(t.stripHexPrefix(e)),"hex"):p.from(e);else if("number"===typeof e)e=t.intToBuffer(e);else if(null===e||void 0===e)e=p.allocUnsafe(0);else if(h.isBN(e))e=e.toArrayLike(p);else{if(!e.toArray)throw new Error("invalid type");e=p.from(e.toArray())}return e},t.bufferToInt=function(e){return new h(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return e=t.toBuffer(e),"0x"+e.toString("hex")},t.fromSigned=function(e){return new h(e).fromTwos(256)},t.toUnsigned=function(e){return p.from(e.toTwos(256).toArray())},t.keccak=function(e,r){switch(e=t.toBuffer(e),r||(r=256),r){case 224:return i(e);case 256:return o(e);case 384:return a(e);case 512:return s(e);default:throw new Error("Invald algorithm: keccak"+r)}},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),d("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=d("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(l.encode(e))},t.isValidPrivate=function(e){return u.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?u.publicKeyVerify(p.concat([p.from([4]),e])):!!t&&u.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=u.publicKeyConvert(e,!1).slice(1)),c(64===e.length),t.keccak(e).slice(-20)};var m=t.privateToPublic=function(e){return e=t.toBuffer(e),u.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return e=t.toBuffer(e),64!==e.length&&(e=u.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=u.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("Ethereum Signed Message:\n"+e.length.toString());return t.keccak(p.concat([r,e]))},t.ecrecover=function(e,r,n,f){var i=p.concat([t.setLength(n,32),t.setLength(f,32)],64),a=r-27;if(0!==a&&1!==a)throw new Error("Invalid signature v value");var o=u.recover(e,i,a);return u.publicKeyConvert(o,!1).slice(1)},t.toRpcSig=function(e,r,n){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(p.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(e=t.toBuffer(e),65!==e.length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(m(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){var r=t.zeroAddress();return r===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",f=0;f=8?n+=e[f].toUpperCase():n+=e[f];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=new h(r),r=r.isZero()?null:p.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!==typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var f=new h("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),i=new h("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&((27===e||28===e)&&(t=new h(t),r=new h(r),!(t.isZero()||t.gt(i)||r.isZero()||r.gt(i))&&(!1!==n||1!==new h(r).cmp(f))))},t.baToJSON=function(e){if(p.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n=f.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===f.length||!r.length||c(r.length===f.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=f}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:f,set:i}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:i,get:f})})),f)if("string"===typeof f&&(f=p.from(t.stripHexPrefix(f),"hex")),p.isBuffer(f)&&(f=l.decode(f)),Array.isArray(f)){if(f.length>e._fields.length)throw new Error("wrong number of fields in data");f.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==("undefined"===typeof f?"undefined":n(f)))throw new Error("invalid data");var i=Object.keys(f);r.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=f[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=f[t.alias])}))}}},"6f4d":function(e,t,r){"use strict";function n(e){return e&&"object"===typeof e&&"default"in e?e["default"]:e}var f=n(r("f654")),i=n(r("8707")),a=n(r("6f78")),o=r("5ebb"),s=r("9cc1"),u=i.Buffer,c=u.from("Bitcoin seed","utf8"),l=2147483648,h=78,d={private:76066276,public:76067358};function p(e){this.versions=e||d,this.depth=0,this.index=0,this._privateKey=null,this._publicKey=null,this.chainCode=null,this._fingerprint=0,this.parentFingerprint=0}function m(e,t,r){var n=u.allocUnsafe(h);n.writeUInt32BE(t,0),n.writeUInt8(e.depth,4);var f=e.depth?e.parentFingerprint:0;return n.writeUInt32BE(f,5),n.writeUInt32BE(e.index,9),e.chainCode.copy(n,13),r.copy(n,45),n}function y(e){var t=o.createHash("sha256").update(e).digest();return o.createHash("ripemd160").update(t).digest()}Object.defineProperty(p.prototype,"fingerprint",{get:function(){return this._fingerprint}}),Object.defineProperty(p.prototype,"identifier",{get:function(){return this._identifier}}),Object.defineProperty(p.prototype,"pubKeyHash",{get:function(){return this.identifier}}),Object.defineProperty(p.prototype,"privateKey",{get:function(){return this._privateKey},set:function(e){f.equal(e.length,32,"Private key must be 32 bytes."),f(!0===s.privateKeyVerify(e),"Invalid private key"),this._privateKey=e,this._publicKey=s.publicKeyCreate(e,!0),this._identifier=y(this.publicKey),this._fingerprint=this._identifier.slice(0,4).readUInt32BE(0)}}),Object.defineProperty(p.prototype,"publicKey",{get:function(){return this._publicKey},set:function(e){f(33===e.length||65===e.length,"Public key must be 33 or 65 bytes."),f(!0===s.publicKeyVerify(e),"Invalid public key"),this._publicKey=s.publicKeyConvert(e,!0),this._identifier=y(this.publicKey),this._fingerprint=this._identifier.slice(0,4).readUInt32BE(0),this._privateKey=null}}),Object.defineProperty(p.prototype,"privateExtendedKey",{get:function(){return this._privateKey?a.encode(m(this,this.versions.private,u.concat([u.alloc(1,0),this.privateKey]))):null}}),Object.defineProperty(p.prototype,"publicExtendedKey",{get:function(){return a.encode(m(this,this.versions.public,this.publicKey))}}),p.prototype.derive=function(e){if("m"===e||"M"===e||"m'"===e||"M'"===e)return this;var t=e.split("/"),r=this;return t.forEach((function(e,t){if(0!==t){var n=e.length>1&&"'"===e[e.length-1],i=parseInt(e,10);f(i=l,n=u.allocUnsafe(4);if(n.writeUInt32BE(e,0),r){f(this.privateKey,"Could not derive hardened child key");var i=this.privateKey,a=u.alloc(1,0);i=u.concat([a,i]),t=u.concat([i,n])}else t=u.concat([this.publicKey,n]);var c=o.createHmac("sha512",this.chainCode).update(t).digest(),h=c.slice(0,32),d=c.slice(32),m=new p(this.versions);if(this.privateKey)try{m.privateKey=s.privateKeyTweakAdd(this.privateKey,h)}catch(y){return this.deriveChild(e+1)}else try{m.publicKey=s.publicKeyTweakAdd(this.publicKey,h,!0)}catch(y){return this.deriveChild(e+1)}return m.chainCode=d,m.depth=this.depth+1,m.parentFingerprint=this.fingerprint,m.index=e,m},p.prototype.sign=function(e){return s.sign(e,this.privateKey).signature},p.prototype.verify=function(e,t){return s.verify(e,t,this.publicKey)},p.prototype.wipePrivateData=function(){return this._privateKey&&o.randomBytes(this._privateKey.length).copy(this._privateKey),this._privateKey=null,this},p.prototype.toJSON=function(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}},p.fromMasterSeed=function(e,t){var r=o.createHmac("sha512",c).update(e).digest(),n=r.slice(0,32),f=r.slice(32),i=new p(t);return i.chainCode=f,i.privateKey=n,i},p.fromExtendedKey=function(e,t){t=t||d;var r=new p(t),n=a.decode(e),i=n.readUInt32BE(0);f(i===t.private||i===t.public,"Version mismatch: does not match private or public"),r.depth=n.readUInt8(4),r.parentFingerprint=n.readUInt32BE(5),r.index=n.readUInt32BE(9),r.chainCode=n.slice(13,45);var o=n.slice(45);return 0===o.readUInt8(0)?(f(i===t.private,"Version mismatch: version does not match private"),r.privateKey=o.slice(1)):(f(i===t.public,"Version mismatch: version does not match public"),r.publicKey=o),r},p.fromJSON=function(e){return p.fromExtendedKey(e.xpriv)},p.HARDENED_OFFSET=l;var g=p;e.exports=g},"6f78":function(e,t,r){"use strict";var n=r("98e6"),f=r("06e9");function i(e){var t=n("sha256").update(e).digest();return n("sha256").update(t).digest()}e.exports=f(i)},7037:function(e,t,r){function n(t){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports["default"]=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports["default"]=e.exports,e.exports.__esModule=!0),n(t)}r("a4d3"),r("e01a"),r("d3b7"),r("d28b"),r("3ca3"),r("ddb0"),e.exports=n,e.exports["default"]=e.exports,e.exports.__esModule=!0},"70bb":function(e,t,r){var n={"./caver-abi/src/index.js":"c8cf1","./caver-account/src/index.js":"1a84","./caver-contract/src/index.js":"9cca","./caver-core-helpers/src/index.js":"4695","./caver-core-method/src/index.js":"379f","./caver-core-requestmanager/caver-providers-http/src/index.js":"5574","./caver-core-requestmanager/caver-providers-ipc/src/index.js":"f2f44","./caver-core-requestmanager/caver-providers-ws/src/index.js":"801a","./caver-core-requestmanager/src/index.js":"3dca","./caver-core-subscriptions/src/index.js":"03fb","./caver-core/src/index.js":"19eb","./caver-ipfs/src/index.js":"d321","./caver-kct/src/index.js":"ac5e","./caver-klay/caver-klay-accounts/src/index.js":"dc44","./caver-klay/caver-klay-personal/src/index.js":"9976","./caver-klay/src/index.js":"0c9c","./caver-middleware/src/index.js":"be65","./caver-net/src/index.js":"921e","./caver-rpc/src/index.js":"56b0","./caver-rtm/src/index.js":"ba9f","./caver-transaction/src/index.js":"8b32","./caver-utils/iban/src/index.js":"91f4","./caver-utils/promievent/src/index.js":"24b6","./caver-utils/src/index.js":"19b5","./caver-validator/src/index.js":"4872","./caver-wallet/src/index.js":"10f2"};function f(e){var t=i(e);return r(t)}function i(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}f.keys=function(){return Object.keys(n)},f.resolve=i,e.exports=f,f.id="70bb"},7247:function(e,t,r){ /*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */ (function(t){"use strict";function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function f(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function i(e){return new Uint8Array(e)}function a(e,t,r,n,f){null==n&&null==f||(e=e.slice?e.slice(n,f):Array.prototype.slice.call(e,n,f)),t.set(e,r)}var o=function(){function e(e){var t=[],r=0;e=encodeURI(e);while(r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}return{toBytes:e,fromBytes:t}}(),s=function(){function e(e){for(var t=[],r=0;r>4]+t[15&f])}return r.join("")}return{toBytes:e,fromBytes:r}}(),u={16:10,24:12,32:14},c=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],l=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],b=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],v=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],_=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],T=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],E=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],x=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function M(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=i[t],this._Kd[e-r][t%4]=i[t];var a,o=0,s=f;while(s>16&255]<<24^l[a>>8&255]<<16^l[255&a]<<8^l[a>>24&255]^c[o]<<24,o+=1,8!=f)for(t=1;t>8&255]<<8^l[a>>16&255]<<16^l[a>>24&255]<<24;for(t=f/2+1;t>2,d=s%4,this._Ke[h][d]=i[t],this._Kd[e-h][d]=i[t++],s++}for(var h=1;h>24&255]^T[a>>16&255]^E[a>>8&255]^x[255&a]},A.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=M(e),f=0;f<4;f++)n[f]^=this._Ke[0][f];for(var a=1;a>24&255]^p[n[(f+1)%4]>>16&255]^m[n[(f+2)%4]>>8&255]^y[255&n[(f+3)%4]]^this._Ke[a][f];n=r.slice()}var o,s=i(16);for(f=0;f<4;f++)o=this._Ke[t][f],s[4*f]=255&(l[n[f]>>24&255]^o>>24),s[4*f+1]=255&(l[n[(f+1)%4]>>16&255]^o>>16),s[4*f+2]=255&(l[n[(f+2)%4]>>8&255]^o>>8),s[4*f+3]=255&(l[255&n[(f+3)%4]]^o);return s},A.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=M(e),f=0;f<4;f++)n[f]^=this._Kd[0][f];for(var a=1;a>24&255]^b[n[(f+3)%4]>>16&255]^v[n[(f+2)%4]>>8&255]^w[255&n[(f+1)%4]]^this._Kd[a][f];n=r.slice()}var o,s=i(16);for(f=0;f<4;f++)o=this._Kd[t][f],s[4*f]=255&(h[n[f]>>24&255]^o>>24),s[4*f+1]=255&(h[n[(f+3)%4]>>16&255]^o>>16),s[4*f+2]=255&(h[n[(f+2)%4]>>8&255]^o>>8),s[4*f+3]=255&(h[255&n[(f+1)%4]]^o);return s};var k=function(e){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new A(e)};k.prototype.encrypt=function(e){if(e=f(e),e.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;nNumber.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},R.prototype.setBytes=function(e){if(e=f(e,!0),16!=e.length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},R.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var I=function(e,t){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof R||(t=new R(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new A(e)};function N(e){e=f(e,!0);var t=16-e.length%16,r=i(e.length+t);a(e,r);for(var n=e.length;n16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n-1}function Xe(e,t){var r=this.__data__,n=mt(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}function Qe(e){var t=-1,r=e?e.length:0;this.clear();while(++t0&&r(o)?t>1?gt(o,t-1,r,n,f):re(f,o):n||(f[f.length]=o)}return f}var bt=Ot();function vt(e,t){return e&&bt(e,t,wr)}function wt(e,t){t=$t(t,e)?[t]:Ft(t);var r=0,n=t.length;while(null!=e&&ru))return!1;var l=i.get(e);if(l&&i.get(t))return l==t;var h=-1,d=!0,p=f&a?new it:void 0;i.set(e,t),i.set(t,e);while(++h-1&&e%1==0&&e-1&&e%1==0&&e<=u}function dr(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function pr(e){return!!e&&"object"==typeof e}function mr(e){return"symbol"==typeof e||pr(e)&&ve.call(e)==x}var yr=ee?ae(ee):kt;function gr(e){return null==e?"":Lt(e)}function br(e,t,r){var n=null==e?void 0:wt(e,t);return void 0===n?r:n}function vr(e,t){return null!=e&&Wt(e,t,Tt)}function wr(e){return ur(e)?pt(e):Ct(e)}function _r(e){return e}function Tr(e){return $t(e)?fe(tr(e)):Nt(e)}r.exports=nr}).call(this,r("c8ba"),r("62e4")(e))},"741b":function(e,t){function r(){return Math.floor(Number.MAX_SAFE_INTEGER*Math.random())}e.exports=r},"749b":function(e,t,r){const n=r("2ef0"),f=r("558a"),i=r("19b5");class a extends f{constructor(e,t){super(e,t),this.feeRatio=t.feeRatio}get feeRatio(){return this._feeRatio}set feeRatio(e){if(!n.isNumber(e)&&!i.isHex(e))throw new Error("Invalid type fo feeRatio: feeRatio should be number type or hex number string.");if(i.hexToNumber(e)<=0||i.hexToNumber(e)>=100)throw new Error("Invalid feeRatio: feeRatio is out of range. [1, 99]");this._feeRatio=i.numberToHex(e)}}e.exports=a},"74c8":function(e,t,r){"use strict";const n=r("1eca"),f=r("3da3");e.exports=n(({fetch:e,apiUrl:t,apiPath:r,headers:n})=>{const i=f.singleton();return async(e,t)=>i.unsubscribe(e,t)})},"74ef":function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("0664"),a=r("f3a4"),o=r("a9b0"),{TX_TYPE_STRING:s}=r("1789"),u=r("19b5");function c(e){e=u.addHexPrefix(e);const[t,r,n,i,a,o,s,c,l]=f.decode(e);return{nonce:u.trimLeadingZero(t),gasPrice:u.trimLeadingZero(r),gas:u.trimLeadingZero(n),to:i,value:u.trimLeadingZero(a),input:o,signatures:[s,c,l]}}class l extends o{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){if(n.isString(e)&&(e=c(e)),e.from=e.from||"0x0000000000000000000000000000000000000000",super(s.TxTypeLegacyTransaction,e),this.to=e.to||"0x",e.input&&e.data)throw new Error("'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.");this.input=e.input||e.data||"0x",this.value=e.value||"0x0"}get to(){return this._to}set to(e){if("0x"!==e&&!u.isAddress(e))throw new Error("Invalid address "+e);this._to=e.toLowerCase()}get value(){return this._value}set value(e){this._value=u.numberToHex(e)}get input(){return this._input}set input(e){if(!e||!u.isHex(e))throw new Error("Invalid input data "+e);this._input=u.addHexPrefix(e)}get data(){return this._input}set data(e){this._input=e}appendSignatures(e){if(!u.isEmptySig(this.signatures))throw new Error(`signatures already defined. ${this.type} cannot include more than one signature. Please use tx.signatures = sigArr to replace.`);if(Array.isArray(e[0])){if(e.length>1)throw new Error(`signatures are too long. ${this.type} cannot include more than one signature.`);e=e[0]}this.signatures=e}getRLPEncoding(){return this.validateOptionalValues(),f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.input,this.signatures.v,this.signatures.r,this.signatures.s])}getRLPEncodingForSignature(){if(this.validateOptionalValues(),void 0===this.chainId)throw new Error("chainId is undefined. Define chainId in transaction or use 'transaction.fillTransaction' to fill values.");return f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.input,i.fromNat(this.chainId||"0x1"),"0x","0x"])}getCommonRLPEncodingForSignature(){return this.getRLPEncodingForSignature()}recoverPublicKeys(){if(u.isEmptySig(this.signatures))throw new Error("Failed to recover public key from signatures: signatures is empty.");const e=i.toNumber(this.signatures.v),t=e<35?i.fromNat("0x1"):i.fromNumber(e-35>>1);this.chainId||(this.chainId=t);const r=this.getRLPEncodingForSignature(),n=a.keccak256(r),f=[];return f.push(u.recoverPublicKey(n,this.signatures,!0)),f}}e.exports=l},"75fe":function(e,t,r){(function(t){t.rootRequire=e=>r("70bb")(`./${e}/src/index.js`);const{packageInit:n,providers:f}=r("19eb"),i=r("0c9c"),a=r("1a84"),o=r("10f2"),s=r("0683"),u=r("8b32"),c=r("56b0"),l=r("c8cf1"),h=r("9cca"),d=r("ac5e"),p=r("4872"),m=r("19eb"),y=r("379f"),g=r("be65"),b=r("19b5"),v=r("4695").formatters,w=r("4695"),_=r("d321"),{version:T}=r("eb02");function E(e,t){const r=this;this.use=g.registerMiddleware.bind(g),n(this,[e,t]),this.version=T,this.utils=b,this.abi=l,this.formatters=v,this.helpers=w,this.Method=y,this.account=a,this.wallet=new o,this.wallet.keyring=s,this.transaction=u,this.kct=new d(this),this.klay=new i(this),this.rpc=new c(this),this.validator=new p,this.middleware=g,this.ipfs=new _;const f=this.setProvider;this.setProvider=(e,t)=>(f.apply(this,[e,t]),r.klay.setRequestManager(r._requestManager),r.rpc.setRequestManager(r._requestManager),r.kct.setRequestManager(r._requestManager),r.contract._requestManager=r._requestManager,r.contract.currentProvider=r._provider,!0);const E=this,x=function(){h.apply(this,arguments);const e=this,t=E.setProvider;E.setProvider=function(){t.apply(E,arguments),m.packageInit(e,[E])},this.setWallet(E.wallet)};x.create=function(){return new x(...arguments)},x.setProvider=function(){h.setProvider.apply(this,arguments)},x.prototype=Object.create(h.prototype),x.prototype.constructor=x,this.contract=x,this.contract._requestManager=this._requestManager,this.contract.currentProvider=this._requestManager.provider}E.utils=b,E.abi=l,E.providers=f,e.exports=E,e.exports.formatters=v}).call(this,r("c8ba"))},"766f":function(e,t,r){"use strict";(function(e){var r=e.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),n=e.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);t.privateKeyExport=function(t,f,i){var a=e.from(i?r:n);return t.copy(a,i?8:9),f.copy(a,i?181:214),a},t.privateKeyImport=function(e){var t=e.length,r=0;if(t2)return null;if(t1?e[r+n-2]<<8:0);return r+=n,t32||tf))return null;if(2!==t[i++])return null;var o=t[i++];if(128&o){if(a=o-128,i+a>f)return null;for(;a>0&&0===t[i];i+=1,a-=1);for(o=0;a>0;i+=1,a-=1)o=(o<<8)+t[i]}if(o>f-i)return null;var s=i;if(i+=o,2!==t[i++])return null;var u=t[i++];if(128&u){if(a=u-128,i+a>f)return null;for(;a>0&&0===t[i];i+=1,a-=1);for(u=0;a>0;i+=1,a-=1)u=(u<<8)+t[i]}if(u>f-i)return null;var c=i;for(i+=u;o>0&&0===t[s];o-=1,s+=1);if(o>32)return null;var l=t.slice(s,s+o);for(l.copy(r,32-l.length);u>0&&0===t[c];u-=1,c+=1);if(u>32)return null;var h=t.slice(c,c+u);return h.copy(n,32-h.length),{r:r,s:n}}}).call(this,r("b639").Buffer)},"769f":function(e,t,r){"use strict";var n=r("55f5").Buffer,f=r("cd10"),i=n.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),a=n.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);t.privateKeyExport=function(e,t,r){var f=n.from(r?i:a);return e.copy(f,r?8:9),t.copy(f,r?181:214),f},t.privateKeyImport=function(e){var t=e.length,r=0;if(!(t2)&&!(t1?e[r+n-2]<<8:0);if(r+=n,!(t32||t1&&0===t[i]&&!(128&t[i+1]);--r,++i);for(var a=n.concat([n.from([0]),e.s]),o=33,s=0;o>1&&0===a[s]&&!(128&a[s+1]);--o,++s);return f.encode(t.slice(i),a.slice(s))},t.signatureImport=function(e){var t=n.alloc(32,0),r=n.alloc(32,0);try{var i=f.decode(e);if(33===i.r.length&&0===i.r[0]&&(i.r=i.r.slice(1)),i.r.length>32)throw new Error("R length is too long");if(33===i.s.length&&0===i.s[0]&&(i.s=i.s.slice(1)),i.s.length>32)throw new Error("S length is too long")}catch(a){return}return i.r.copy(t,32-i.r.length),i.s.copy(r,32-i.s.length),{r:t,s:r}},t.signatureImportLax=function(e){var t=n.alloc(32,0),r=n.alloc(32,0),f=e.length,i=0;if(48===e[i++]){var a=e[i++];if(!(128&a&&(i+=a-128,i>f))&&2===e[i++]){var o=e[i++];if(128&o){if(a=o-128,i+a>f)return;for(;a>0&&0===e[i];i+=1,a-=1);for(o=0;a>0;i+=1,a-=1)o=(o<<8)+e[i]}if(!(o>f-i)){var s=i;if(i+=o,2===e[i++]){var u=e[i++];if(128&u){if(a=u-128,i+a>f)return;for(;a>0&&0===e[i];i+=1,a-=1);for(u=0;a>0;i+=1,a-=1)u=(u<<8)+e[i]}if(!(u>f-i)){var c=i;for(i+=u;o>0&&0===e[s];o-=1,s+=1);if(!(o>32)){var l=e.slice(s,s+o);for(l.copy(t,32-l.length);u>0&&0===e[c];u-=1,c+=1);if(!(u>32)){var h=e.slice(c,c+u);return h.copy(r,32-h.length),{r:t,s:r}}}}}}}}}},"76bb":function(e){e.exports=JSON.parse('{"rpc":{"invalidInput":-32000,"resourceNotFound":-32001,"resourceUnavailable":-32002,"transactionRejected":-32003,"methodNotSupported":-32004,"parse":-32700,"invalidRequest":-32600,"methodNotFound":-32601,"invalidParams":-32602,"internal":-32603},"provider":{"userRejectedRequest":4001,"unauthorized":4100,"unsupportedMethod":4200}}')},"77a4":function(e,t,r){"use strict";const{Buffer:n}=r("b639"),f=r("1eca"),{objectToQuery:i}=r("d518"),{ok:a}=r("7872");function o(e){let t="";for(const r of e)t+=r>=65&&r<=90||r>=97&&r<=122||r>=48&&r<=57||45===r||46===r||95===r||126===r?String.fromCharCode(r):"%"+r.toString(16).padStart(2,"0");return t}e.exports=f(({fetch:e,apiUrl:t,apiPath:r,headers:f})=>async(s,u,c)=>{c=c||{};let l=i(c.qs);l=l?"&"+l.slice(1):l;const h=`${t}${r}/pubsub/pub?arg=${encodeURIComponent(s)}&arg=${o(n.from(u))}${l}`,d=await a(e(h,{method:"POST",signal:c.signal,headers:c.headers||f}));return d.text()})},"77be":function(e,t,r){var n=r("3022");function f(e){Error.call(this,e),this.message=e}function i(e){Error.call(this,e),this.message=e}n.inherits(f,Error),f.prototype.name="IllegalArgumentError",n.inherits(i,Error),i.prototype.name="IllegalStateError",e.exports.IllegalStateError=i,e.exports.IllegalArgumentError=f},"77c8":function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("0da3"),a=r("ed19"),o=r("0218"),s=r("fb5f"),u=r("19b5"),{ACCOUNT_KEY_TAG:c}=r("6369"),{KEY_ROLE:l}=r("fc77"),h=r("cfbe");function d(e){if(!n.isArray(e))return!1;if(e.length>l.roleLast)return!1;for(const t of e)if(void 0!==t&&!(t instanceof a)&&!(t instanceof o)&&!(t instanceof s)&&!(t instanceof i))return!1;return!0}class p{static decode(e){if(e=u.addHexPrefix(e),!e.startsWith(c.ACCOUNT_KEY_ROLE_BASED_TAG))throw new Error(`Cannot decode to AccountKeyRoleBased. The prefix must be ${c.ACCOUNT_KEY_ROLE_BASED_TAG}: ${e}`);const t=f.decode("0x"+e.slice(c.ACCOUNT_KEY_ROLE_BASED_TAG.length)),r=[];for(const n of t){if(n.startsWith(c.ACCOUNT_KEY_ROLE_BASED_TAG))throw new Error("Nested role based key.");if(n.startsWith(c.ACCOUNT_KEY_NIL_TAG))r.push(void 0);else if(n.startsWith(c.ACCOUNT_KEY_LEGACY_TAG))r.push(a.decode(n));else if(n.startsWith(c.ACCOUNT_KEY_PUBLIC_TAG))r.push(o.decode(n));else if(n.startsWith(c.ACCOUNT_KEY_FAIL_TAG))r.push(s.decode(n));else{if(!n.startsWith(c.ACCOUNT_KEY_WEIGHTED_MULTISIG_TAG))throw new Error("Failed to decode RLP-encoded account key. Invalid RLP-encoded account key "+n);r.push(i.decode(n))}}return new p(r)}static fromRoleBasedPublicKeysAndOptions(e,t){t||(t=Array(l.roleLast).fill(new h));const r=[];for(let f=0;f{if(e=await e,!e.ok){const{status:r}=e,f="unexpected status "+r;let i;try{let r=await e.text();try{r=JSON.parse(r),i=r.message||r.Message}catch(t){i=r}}catch(t){throw Object.assign(n(t,f),{status:r})}throw Object.assign(new Error(i||f),{status:r})}return e},t.toIterable=e=>{if(e[Symbol.asyncIterator])return e;if(e.getReader)return async function*(){const t=e.getReader();try{while(1){const{done:e,value:r}=await t.read();if(e)return;yield r}}finally{t.releaseLock()}}();throw new Error("unknown stream")}},"7ac7":function(e,t,r){const n=r("2ef0"),f=r("8e7f"),i=r("9cca"),{validateDeployParameterForKIP7:a,determineSendParams:o,kip7JsonInterface:s,kip7ByteCode:u,formatParamForUint256:c,interfaceIds:l}=r("bec2"),{isAddress:h,toBuffer:d,isHexStrict:p,toHex:m}=r("19b5"),y=r("3070");class g extends i{static deploy(e,t){a(e);const{name:r,symbol:f,decimals:i,initialSupply:o}=e,s=new g;return n.isString(t)&&(t={from:t,gas:4e6,value:0}),t.gas=void 0!==t.gas?t.gas:4e6,s.deploy({data:u,arguments:[r,f,i,o]}).send(t)}static detectInterface(e){const t=new g(e);return t.detectInterface()}constructor(e,t=s){if(e)if(n.isString(e)){if(!h(e))throw new Error("Invalid token address "+e)}else t=e,e=void 0;super(t,e)}clone(e=this.options.address){const t=new this.constructor(e,this.options.jsonInterface);return t.setWallet(this._wallet),t}async detectInterface(){const e={IKIP7:!1,IKIP7Metadata:!1,IKIP7Mintable:!1,IKIP7Burnable:!1,IKIP7Pausable:!1},t="This contract does not support KIP-13.",r=this._address;try{const n=await y.isImplementedKIP13Interface(r);if(!0!==n)throw new Error(t);return e.IKIP7=await this.supportsInterface(l.kip7.IKIP7),!1===e.IKIP7?e:(await Promise.all(Object.keys(l.kip7).map(async t=>{l.kip7[t]!==l.kip7.IKIP7&&(e[t]=await this.supportsInterface(l.kip7[t]))})),e)}catch(n){throw new Error(t)}}async supportsInterface(e){const t=await this.methods.supportsInterface(e).call();return t}async name(){const e=await this.methods.name().call();return e}async symbol(){const e=await this.methods.symbol().call();return e}async decimals(){const e=await this.methods.decimals().call();return Number(e)}async totalSupply(){const e=await this.methods.totalSupply().call();return new f(e)}async balanceOf(e){const t=await this.methods.balanceOf(e).call();return new f(t)}async allowance(e,t){const r=await this.methods.allowance(e,t).call();return new f(r)}async isMinter(e){const t=await this.methods.isMinter(e).call();return t}async isPauser(e){const t=await this.methods.isPauser(e).call();return t}async paused(){const e=await this.methods.paused().call();return e}async approve(e,t,r={}){const n=this.methods.approve(e,c(t));return r=await o(n,r,this.options),n.send(r)}async transfer(e,t,r={}){const n=this.methods.transfer(e,c(t));return r=await o(n,r,this.options),n.send(r)}async transferFrom(e,t,r,n={}){const f=this.methods.transferFrom(e,t,c(r));return n=await o(f,n,this.options),f.send(n)}async safeTransfer(e,t,r,f={}){if(r&&n.isObject(r)&&(void 0!==r.gas||void 0!==r.from)){if(Object.keys(f).length>0)throw new Error("Invalid parameters");f=r,r=void 0}r&&!n.isBuffer(r)&&(n.isString(r)&&!p(r)&&(r=m(r)),r=d(r));const i=r?this.methods.safeTransfer(e,c(t),r):this.methods.safeTransfer(e,c(t));return f=await o(i,f,this.options),i.send(f)}async safeTransferFrom(e,t,r,f,i={}){if(f&&n.isObject(f)&&(void 0!==f.gas||void 0!==f.from)){if(Object.keys(i).length>0)throw new Error("Invalid parameters");i=f,f=void 0}f&&!n.isBuffer(f)&&(n.isString(f)&&!p(f)&&(f=m(f)),f=d(f));const a=f?this.methods.safeTransferFrom(e,t,c(r),f):this.methods.safeTransferFrom(e,t,c(r));return i=await o(a,i,this.options),a.send(i)}async mint(e,t,r={}){const n=this.methods.mint(e,c(t));return r=await o(n,r,this.options),n.send(r)}async addMinter(e,t={}){const r=this.methods.addMinter(e);return t=await o(r,t,this.options),r.send(t)}async renounceMinter(e={}){const t=this.methods.renounceMinter();return e=await o(t,e,this.options),t.send(e)}async burn(e,t={}){const r=this.methods.burn(c(e));return t=await o(r,t,this.options),r.send(t)}async burnFrom(e,t,r={}){const n=this.methods.burnFrom(e,c(t));return r=await o(n,r,this.options),n.send(r)}async addPauser(e,t={}){const r=this.methods.addPauser(e);return t=await o(r,t,this.options),r.send(t)}async pause(e={}){const t=this.methods.pause();return e=await o(t,e,this.options),t.send(e)}async unpause(e={}){const t=this.methods.unpause();return e=await o(t,e,this.options),t.send(e)}async renouncePauser(e={}){const t=this.methods.renouncePauser();return e=await o(t,e,this.options),t.send(e)}}g.byteCode=u,e.exports=g},"7c39":function(e,t,r){const n=r("9758"),f=r("2969"),i=r("3022").inherits,a=r("6ef0"),o=r("8be9"),s=r("53a8"),u=r("a1d9"),c=r("9e697"),l=r("572a"),h=/^[0-9A-Fa-f]+$/g;function d(e){const t=this;t.nonceLock=u(1),e.getAccounts&&(t.getAccounts=e.getAccounts),e.processTransaction&&(t.processTransaction=e.processTransaction),e.processMessage&&(t.processMessage=e.processMessage),e.processPersonalMessage&&(t.processPersonalMessage=e.processPersonalMessage),e.processTypedMessage&&(t.processTypedMessage=e.processTypedMessage),t.approveTransaction=e.approveTransaction||t.autoApprove,t.approveMessage=e.approveMessage||t.autoApprove,t.approvePersonalMessage=e.approvePersonalMessage||t.autoApprove,t.approveDecryptMessage=e.approveDecryptMessage||t.autoApprove,t.approveEncryptionPublicKey=e.approveEncryptionPublicKey||t.autoApprove,t.approveTypedMessage=e.approveTypedMessage||t.autoApprove,e.signTransaction&&(t.signTransaction=e.signTransaction||v("signTransaction")),e.signMessage&&(t.signMessage=e.signMessage||v("signMessage")),e.signPersonalMessage&&(t.signPersonalMessage=e.signPersonalMessage||v("signPersonalMessage")),e.decryptMessage&&(t.decryptMessage=e.decryptMessage||v("decryptMessage")),e.encryptionPublicKey&&(t.encryptionPublicKey=e.encryptionPublicKey||v("encryptionPublicKey")),e.signTypedMessage&&(t.signTypedMessage=e.signTypedMessage||v("signTypedMessage")),e.recoverPersonalSignature&&(t.recoverPersonalSignature=e.recoverPersonalSignature),e.publishTransaction&&(t.publishTransaction=e.publishTransaction),t.estimateGas=e.estimateGas||t.estimateGas,t.getGasPrice=e.getGasPrice||t.getGasPrice}function p(e){return{from:e.from,to:e.to,value:e.value,data:e.data,gas:e.gas,gasPrice:e.gasPrice,nonce:e.nonce}}function m(e){return e.toLowerCase()}function y(e){const t=a.addHexPrefix(e),r=a.isValidAddress(t);return r}function g(e){const t=a.addHexPrefix(e),r=a.isValidAddress(t);return!r&&b(e)}function b(e){const t="string"===typeof e;if(!t)return!1;const r="0x"===e.slice(0,2);if(!r)return!1;const n=e.slice(2),f=n.match(h);return f}function v(e){return function(t,r){r(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+e+'" fn in constructor options'))}}e.exports=d,i(d,c),d.prototype.handleRequest=function(e,t,r){const f=this;let i,a,o,u,c;switch(f._parityRequests={},f._parityRequestCount=0,e.method){case"eth_coinbase":return void f.getAccounts((function(e,t){if(e)return r(e);let n=t[0]||null;r(null,n)}));case"eth_accounts":return void f.getAccounts((function(e,t){if(e)return r(e);r(null,t)}));case"eth_sendTransaction":return i=e.params[0],void n([e=>f.validateTransaction(i,e),e=>f.processTransaction(i,e)],r);case"eth_signTransaction":return i=e.params[0],void n([e=>f.validateTransaction(i,e),e=>f.processSignTransaction(i,e)],r);case"eth_sign":return c=e.params[0],u=e.params[1],o=e.params[2]||{},a=s(o,{from:c,data:u}),void n([e=>f.validateMessage(a,e),e=>f.processMessage(a,e)],r);case"personal_sign":return function(){const t=e.params[0],i=e.params[1];if(g(i)&&y(t)){let t="The eth_personalSign method requires params ordered ";t+="[message, address]. This was previously handled incorrectly, ",t+="and has been corrected automatically. ",t+="Please switch this param order for smooth behavior in the future.",console.warn(t),c=e.params[0],u=e.params[1]}else u=e.params[0],c=e.params[1];o=e.params[2]||{},a=s(o,{from:c,data:u}),n([e=>f.validatePersonalMessage(a,e),e=>f.processPersonalMessage(a,e)],r)}();case"eth_decryptMessage":return function(){const t=e.params[0],i=e.params[1];if(g(i)&&y(t)){let t="The eth_decryptMessage method requires params ordered ";t+="[message, address]. This was previously handled incorrectly, ",t+="and has been corrected automatically. ",t+="Please switch this param order for smooth behavior in the future.",console.warn(t),c=e.params[0],u=e.params[1]}else u=e.params[0],c=e.params[1];o=e.params[2]||{},a=s(o,{from:c,data:u}),n([e=>f.validateDecryptMessage(a,e),e=>f.processDecryptMessage(a,e)],r)}();case"encryption_public_key":return function(){const t=e.params[0];n([e=>f.validateEncryptionPublicKey(t,e),e=>f.processEncryptionPublicKey(t,e)],r)}();case"personal_ecRecover":return function(){u=e.params[0];let t=e.params[1];o=e.params[2]||{},a=s(o,{sig:t,data:u}),f.recoverPersonalSignature(a,r)}();case"eth_signTypedData":case"eth_signTypedData_v3":case"eth_signTypedData_v4":return function(){const t=e.params[0],i=e.params[1];y(t)?(c=t,u=i):(u=t,c=i),o=e.params[2]||{},a=s(o,{from:c,data:u}),n([e=>f.validateTypedMessage(a,e),e=>f.processTypedMessage(a,e)],r)}();case"parity_postTransaction":return i=e.params[0],void f.parityPostTransaction(i,r);case"parity_postSign":return c=e.params[0],u=e.params[1],void f.parityPostSign(c,u,r);case"parity_checkRequest":return function(){const t=e.params[0];f.parityCheckRequest(t,r)}();case"parity_defaultAccount":return void f.getAccounts((function(e,t){if(e)return r(e);const n=t[0]||null;r(null,n)}));default:return void t()}},d.prototype.getAccounts=function(e){e(null,[])},d.prototype.processTransaction=function(e,t){const r=this;n([t=>r.approveTransaction(e,t),(e,t)=>r.checkApproval("transaction",e,t),t=>r.finalizeAndSubmitTx(e,t)],t)},d.prototype.processSignTransaction=function(e,t){const r=this;n([t=>r.approveTransaction(e,t),(e,t)=>r.checkApproval("transaction",e,t),t=>r.finalizeTx(e,t)],t)},d.prototype.processMessage=function(e,t){const r=this;n([t=>r.approveMessage(e,t),(e,t)=>r.checkApproval("message",e,t),t=>r.signMessage(e,t)],t)},d.prototype.processPersonalMessage=function(e,t){const r=this;n([t=>r.approvePersonalMessage(e,t),(e,t)=>r.checkApproval("message",e,t),t=>r.signPersonalMessage(e,t)],t)},d.prototype.processDecryptMessage=function(e,t){const r=this;n([t=>r.approveDecryptMessage(e,t),(e,t)=>r.checkApproval("decryptMessage",e,t),t=>r.decryptMessage(e,t)],t)},d.prototype.processEncryptionPublicKey=function(e,t){const r=this;n([t=>r.approveEncryptionPublicKey(e,t),(e,t)=>r.checkApproval("encryptionPublicKey",e,t),t=>r.encryptionPublicKey(e,t)],t)},d.prototype.processTypedMessage=function(e,t){const r=this;n([t=>r.approveTypedMessage(e,t),(e,t)=>r.checkApproval("message",e,t),t=>r.signTypedMessage(e,t)],t)},d.prototype.autoApprove=function(e,t){t(null,!0)},d.prototype.checkApproval=function(e,t,r){r(t?null:new Error("User denied "+e+" signature."))},d.prototype.parityPostTransaction=function(e,t){const r=this,n=r._parityRequestCount,f="0x"+n.toString(16);r._parityRequestCount++,r.emitPayload({method:"eth_sendTransaction",params:[e]},(function(e,t){if(e)return void(r._parityRequests[f]={error:e});const n=t.result;r._parityRequests[f]=n})),t(null,f)},d.prototype.parityPostSign=function(e,t,r){const n=this,f=n._parityRequestCount,i="0x"+f.toString(16);n._parityRequestCount++,n.emitPayload({method:"eth_sign",params:[e,t]},(function(e,t){if(e)return void(n._parityRequests[i]={error:e});const r=t.result;n._parityRequests[i]=r})),r(null,i)},d.prototype.parityCheckRequest=function(e,t){const r=this,n=r._parityRequests[e]||null;return n?n.error?t(n.error):void t(null,n):t(null,null)},d.prototype.recoverPersonalSignature=function(e,t){let r;try{r=o.recoverPersonalSignature(e)}catch(n){return t(n)}t(null,r)},d.prototype.validateTransaction=function(e,t){const r=this;if(void 0===e.from)return t(new Error("Undefined address - from address required to sign transaction."));r.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error(`Unknown address - unable to sign transaction for this address: "${e.from}"`))}))},d.prototype.validateMessage=function(e,t){const r=this;if(void 0===e.from)return t(new Error("Undefined address - from address required to sign message."));r.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`))}))},d.prototype.validatePersonalMessage=function(e,t){const r=this;return void 0===e.from?t(new Error("Undefined address - from address required to sign personal message.")):void 0===e.data?t(new Error("Undefined message - message required to sign personal message.")):b(e.data)?void r.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`))})):t(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."))},d.prototype.validateDecryptMessage=function(e,t){const r=this;return void 0===e.from?t(new Error("Undefined address - from address required to decrypt message.")):void 0===e.data?t(new Error("Undefined message - message required to decrypt message.")):b(e.data)?void r.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error(`Unknown address - unable to decrypt message for this address: "${e.from}"`))})):t(new Error("HookedWalletSubprovider - validateDecryptMessage - message was not encoded as hex."))},d.prototype.validateEncryptionPublicKey=function(e,t){const r=this;r.validateSender(e,(function(r,n){return r?t(r):n?void t():t(new Error(`Unknown address - unable to obtain encryption public key for this address: "${e}"`))}))},d.prototype.validateTypedMessage=function(e,t){return void 0===e.from?t(new Error("Undefined address - from address required to sign typed data.")):void 0===e.data?t(new Error("Undefined data - message required to sign typed data.")):void this.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`))}))},d.prototype.validateSender=function(e,t){const r=this;if(!e)return t(null,!1);r.getAccounts((function(r,n){if(r)return t(r);const f=-1!==n.map(m).indexOf(e.toLowerCase());t(null,f)}))},d.prototype.finalizeAndSubmitTx=function(e,t){const r=this;r.nonceLock.take((function(){n([r.fillInTxExtras.bind(r,e),r.signTransaction.bind(r),r.publishTransaction.bind(r)],(function(e,n){if(r.nonceLock.leave(),e)return t(e);t(null,n)}))}))},d.prototype.finalizeTx=function(e,t){const r=this;r.nonceLock.take((function(){n([r.fillInTxExtras.bind(r,e),r.signTransaction.bind(r)],(function(n,f){if(r.nonceLock.leave(),n)return t(n);t(null,{raw:f,tx:e})}))}))},d.prototype.publishTransaction=function(e,t){const r=this;r.emitPayload({method:"eth_sendRawTransaction",params:[e]},(function(e,r){if(e)return t(e);t(null,r.result)}))},d.prototype.estimateGas=function(e,t){const r=this;l(r.engine,e,t)},d.prototype.getGasPrice=function(e){const t=this;t.emitPayload({method:"eth_gasPrice",params:[]},(function(t,r){if(t)return e(t);e(null,r.result)}))},d.prototype.fillInTxExtras=function(e,t){const r=this,n=e.from,i={};void 0===e.gasPrice&&(i.gasPrice=r.getGasPrice.bind(r)),void 0===e.nonce&&(i.nonce=r.emitPayload.bind(r,{method:"eth_getTransactionCount",params:[n,"pending"]})),void 0===e.gas&&(i.gas=r.estimateGas.bind(r,p(e))),f(i,(function(r,n){if(r)return t(r);const f={};n.gasPrice&&(f.gasPrice=n.gasPrice),n.nonce&&(f.nonce=n.nonce.result),n.gas&&(f.gas=n.gas),t(null,s(e,f))}))}},"7ce7":function(e,t,r){"use strict";const n=r("41b5"),{objectToQuery:f}=r("d518"),i=r("1eca"),{ok:a}=r("7872"),o=r("83c7");e.exports=i(({fetch:e,apiUrl:t,apiPath:r,headers:i})=>{const s=async(u,c)=>{c=c||{};const l=f({format:c.format,mhtype:c.mhtype,mhlen:c.mhlen,pin:c.pin,...c.qs||{}}),h=`${t}${r}/block/put${l}`,d=new n;let p;d.append("file",u);try{p=await a(e(h,{method:"POST",signal:c.signal,headers:c.headers||i,body:d}))}catch(m){if("dag-pb"===c.format)return s(u,{...c,format:"protobuf"});if("dag-cbor"===c.format)return s(u,{...c,format:"cbor"});throw m}return o(await p.json())};return s})},"7d90":function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("0664"),a=r("a9b0"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s}=r("1789"),u=r("19b5");function c(e){if(e=u.addHexPrefix(e),!e.startsWith(s.TxTypeValueTransferMemo))throw new Error(`Cannot decode to ValueTransferMemo. The prefix must be ${s.TxTypeValueTransferMemo}: ${e}`);const t="0x"+e.slice(4),[r,n,i,a,o,c,l,h]=f.decode(t);return{nonce:u.trimLeadingZero(r),gasPrice:u.trimLeadingZero(n),gas:u.trimLeadingZero(i),to:a,value:u.trimLeadingZero(o),from:c,input:l,signatures:h}}class l extends a{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){if(n.isString(e)&&(e=c(e)),super(o.TxTypeValueTransferMemo,e),this.to=e.to,this.value=e.value,e.input&&e.data)throw new Error("'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.");this.input=e.input||e.data}get to(){return this._to}set to(e){if(!u.isAddress(e))throw new Error("Invalid address of to: "+e);this._to=e.toLowerCase()}get value(){return this._value}set value(e){this._value=u.numberToHex(e)}get input(){return this._input}set input(e){if(!e||!u.isHex(e))throw new Error("Invalid input data "+e);this._input=u.addHexPrefix(e)}get data(){return this._input}set data(e){this._input=e}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode());return s.TxTypeValueTransferMemo+f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.from.toLowerCase(),this.input,e]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),f.encode([s.TxTypeValueTransferMemo,i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.from.toLowerCase(),this.input])}}e.exports=l},"7dd01":function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("f654"),f=r("9a12"),i=r("a3ca"),a=r("d5c5");t.defineProperties=function(t,r,o){if(t.raw=[],t._fields=[],t.toJSON=function(e){if(void 0===e&&(e=!1),e){var r={};return t._fields.forEach((function(e){r[e]="0x"+t[e].toString("hex")})),r}return a.baToJSON(t.raw)},t.serialize=function(){return i.encode(t.raw)},r.forEach((function(r,f){function i(){return t.raw[f]}function o(i){i=a.toBuffer(i),"00"!==i.toString("hex")||r.allowZero||(i=e.allocUnsafe(0)),r.allowLess&&r.length?(i=a.stripZeros(i),n(r.length>=i.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===i.length||!r.length||n(r.length===i.length,"The field "+r.name+" must have byte length of "+r.length),t.raw[f]=i}t._fields.push(r.name),Object.defineProperty(t,r.name,{enumerable:!0,configurable:!0,get:i,set:o}),r.default&&(t[r.name]=r.default),r.alias&&Object.defineProperty(t,r.alias,{enumerable:!1,configurable:!0,set:o,get:i})})),o)if("string"===typeof o&&(o=e.from(f.stripHexPrefix(o),"hex")),e.isBuffer(o)&&(o=i.decode(o)),Array.isArray(o)){if(o.length>t._fields.length)throw new Error("wrong number of fields in data");o.forEach((function(e,r){t[t._fields[r]]=a.toBuffer(e)}))}else{if("object"!==typeof o)throw new Error("invalid data");var s=Object.keys(o);r.forEach((function(e){-1!==s.indexOf(e.name)&&(t[e.name]=o[e.name]),-1!==s.indexOf(e.alias)&&(t[e.alias]=o[e.alias])}))}}}).call(this,r("b639").Buffer)},"7e34":function(e,t,r){"use strict";const{objectToQuery:n}=r("d518"),f=r("1eca"),{ok:i}=r("7872"),a=r("83c7");e.exports=f(({fetch:e,apiUrl:t,apiPath:r,headers:f})=>(o,s)=>async function*(){s=s||{};const u=n({arg:o.toString(),...s.qs||{}}),c=`${t}${r}/ls${u}`,l=await i(e(c,{signal:s.signal,headers:s.headers||f})),h=await l.json(),d=((h.Objects||[])[0]||{}).Links||[];for(const e of d)yield a(e)}())},"801a":function(e,t,r){const n=r("429e"),f=r("1f17").w3cwebsocket,i=r("4695").errors,a=r("aa4d5"),o=function(e,t){n.call(this),t=t||{},this.url=e,this._customTimeout=t.timeout||15e3,this.headers=t.headers||{},this.protocol=t.protocol||void 0,this.reconnectOptions=Object.assign({auto:!1,delay:5e3,maxAttempts:!1,onTimeout:!1},t.reconnect),this.clientConfig=t.clientConfig||void 0,this.requestOptions=t.requestOptions||void 0,this.DATA="data",this.CLOSE="close",this.ERROR="error",this.CONNECT="connect",this.RECONNECT="reconnect",this.connection=null,this.requestQueue=new Map,this.responseQueue=new Map,this.reconnectAttempts=0,this.reconnecting=!1;const r=a.parseURL(e);r.username&&r.password&&(this.headers.authorization="Basic "+a.btoa(`${r.username}:${r.password}`)),r.auth&&(this.headers.authorization="Basic "+a.btoa(r.auth)),Object.defineProperty(this,"connected",{get:function(){return this.connection&&this.connection.readyState===this.connection.OPEN},enumerable:!0}),this.connect()};o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.prototype.connect=function(){this.connection=new f(this.url,this.protocol,void 0,this.headers,this.requestOptions,this.clientConfig),this._addSocketListeners()},o.prototype._onMessage=function(e){const t=this;this._parseResponse("string"===typeof e.data?e.data:"").forEach((function(e){if(e.method&&-1!==e.method.indexOf("_subscription"))return void t.emit(t.DATA,e);let r=e.id;Array.isArray(e)&&(r=e[0].id),t.responseQueue.has(r)&&(void 0!==t.responseQueue.get(r).callback&&t.responseQueue.get(r).callback(!1,e),t.responseQueue.delete(r))}))},o.prototype._onConnect=function(){if(this.emit(this.CONNECT),this.reconnectAttempts=0,this.reconnecting=!1,this.requestQueue.size>0){const e=this;this.requestQueue.forEach((function(t,r){e.send(t.payload,t.callback),e.requestQueue.delete(r)}))}},o.prototype._onClose=function(e){const t=this;!this.reconnectOptions.auto||[1e3,1001].includes(e.code)&&!1!==e.wasClean?(this.emit(this.CLOSE,e),this.requestQueue.size>0&&this.requestQueue.forEach((function(r,n){r.callback(i.ConnectionNotOpenError(e)),t.requestQueue.delete(n)})),this.responseQueue.size>0&&this.responseQueue.forEach((function(r,n){r.callback(i.InvalidConnection("on WS",e)),t.responseQueue.delete(n)})),this._removeSocketListeners(),this.removeAllListeners()):this.reconnect()},o.prototype._addSocketListeners=function(){this.connection.addEventListener("message",this._onMessage.bind(this)),this.connection.addEventListener("open",this._onConnect.bind(this)),this.connection.addEventListener("close",this._onClose.bind(this))},o.prototype._removeSocketListeners=function(){this.connection.removeEventListener("message",this._onMessage),this.connection.removeEventListener("open",this._onConnect),this.connection.removeEventListener("close",this._onClose)},o.prototype._parseResponse=function(e){const t=this,r=[],n=e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|");return n.forEach((function(e){t.lastChunk&&(e=t.lastChunk+e);let n=null;try{n=JSON.parse(e)}catch(f){return t.lastChunk=e,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout((function(){t.reconnectOptions.auto&&t.reconnectOptions.onTimeout?t.reconnect():(t.emit(t.ERROR,i.ConnectionTimeout(t._customTimeout)),t.requestQueue.size>0&&t.requestQueue.forEach((function(e,r){e.callback(i.ConnectionTimeout(t._customTimeout)),t.requestQueue.delete(r)})))}),t._customTimeout))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,n&&r.push(n)})),r},o.prototype.send=function(e,t){const r=this;let n=e.id;const f={payload:e,callback:t};if(Array.isArray(e)&&(n=e[0].id),this.connection.readyState===this.connection.CONNECTING||this.reconnecting)this.requestQueue.set(n,f);else{if(this.connection.readyState!==this.connection.OPEN)return this.requestQueue.delete(n),this.emit(this.ERROR,i.ConnectionNotOpenError()),void f.callback(i.ConnectionNotOpenError());this.responseQueue.set(n,f),this.requestQueue.delete(n);try{this.connection.send(JSON.stringify(f.payload))}catch(a){f.callback(a),r.responseQueue.delete(n)}}},o.prototype.reset=function(){this.responseQueue.clear(),this.requestQueue.clear(),this.removeAllListeners(),this._removeSocketListeners(),this._addSocketListeners()},o.prototype.disconnect=function(e,t){this._removeSocketListeners(),this.connection.close(e||1e3,t)},o.prototype.supportsSubscriptions=function(){return!0},o.prototype.reconnect=function(){const e=this;this.reconnecting=!0,this.responseQueue.size>0&&this.responseQueue.forEach((function(t,r){t.callback(i.PendingRequestsOnReconnectingError()),e.responseQueue.delete(r)})),!this.reconnectOptions.maxAttempts||this.reconnectAttempts0&&this.requestQueue.forEach((function(t,r){t.callback(i.MaxAttemptsReachedOnReconnectingError()),e.requestQueue.delete(r)})))},e.exports=o},8131:function(e,t,r){const n=r("19d7"),f=r("0664"),i=r("19b5"),a=r("4695"),{SMART_CONTRACT_DEPLOY_TYPE_TAG:o,SMART_CONTRACT_EXECUTION_TYPE_TAG:s,FEE_DELEGATED_SMART_CONTRACT_EXECUTION_TYPE_TAG:u,FEE_DELEGATED_SMART_CONTRACT_DEPLOY_TYPE_TAG:c,FEE_DELEGATED_SMART_CONTRACT_DEPLOY_WITH_RATIO_TYPE_TAG:l,FEE_DELEGATED_SMART_CONTRACT_EXECUTION_WITH_RATIO_TYPE_TAG:h,CODE_FORMAT_EVM_TAG:d}=a.constants;function p(e){switch(e){case 0:case"EVM":return d}return d}function m(e){return n.encode([n.encode([o,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value),e.from.toLowerCase(),e.data,f.fromNat(!0===e.humanReadable?"0x1":"0x0"),f.fromNat(p(e.codeFormat))]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function y(e){return n.encode([n.encode([s,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value||"0x0"),e.from.toLowerCase(),e.data]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function g(e){if(e.senderRawTransaction){const t="0x"+e.senderRawTransaction.slice(4),[r,a,o,s,u,l,h,d,p,[[m,y,g]]]=i.rlpDecode(t);return n.encode([n.encode([c,f.fromNat(r),f.fromNat(a),f.fromNat(o),s.toLowerCase(),f.fromNat(u),l.toLowerCase(),h,d,p]),e.feePayer.toLowerCase(),f.fromNat(e.chainId||"0x1"),"0x","0x"])}return n.encode([n.encode([c,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value),e.from.toLowerCase(),e.data,f.fromNat(!0===e.humanReadable?"0x1":"0x0"),f.fromNat(p(e.codeFormat))]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function b(e){if(e.senderRawTransaction){const t="0x"+e.senderRawTransaction.slice(4),[r,a,o,s,u,c,h,d,p,m,[[y,g,b]]]=i.rlpDecode(t);return n.encode([n.encode([l,f.fromNat(r),f.fromNat(a),f.fromNat(o),s.toLowerCase(),f.fromNat(u),c.toLowerCase(),h,d,p,m]),e.feePayer.toLowerCase(),f.fromNat(e.chainId||"0x1"),"0x","0x"])}return n.encode([n.encode([l,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value),e.from.toLowerCase(),e.data,f.fromNat(!0===e.humanReadable?"0x1":"0x0"),f.fromNat(e.feeRatio),f.fromNat(p(e.codeFormat))]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function v(e){if(e.senderRawTransaction){const t="0x"+e.senderRawTransaction.slice(4),[r,a,o,s,c,l,h,[[d,p,m]]]=i.rlpDecode(t);return n.encode([n.encode([u,f.fromNat(r),f.fromNat(a),f.fromNat(o),s.toLowerCase(),f.fromNat(c),l.toLowerCase(),h]),e.feePayer.toLowerCase(),f.fromNat(e.chainId||"0x1"),"0x","0x"])}return n.encode([n.encode([u,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value||"0x0"),e.from.toLowerCase(),e.data]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function w(e){if(e.senderRawTransaction){const t="0x"+e.senderRawTransaction.slice(4),[r,a,o,s,u,c,l,d,[[p,m,y]]]=i.rlpDecode(t);return n.encode([n.encode([h,f.fromNat(r),f.fromNat(a),f.fromNat(o),s.toLowerCase(),f.fromNat(u),c.toLowerCase(),l,f.fromNat(d)]),e.feePayer.toLowerCase(),f.fromNat(e.chainId||"0x1"),"0x","0x"])}return n.encode([n.encode([h,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.to.toLowerCase(),f.fromNat(e.value||"0x0"),e.from.toLowerCase(),e.data,f.fromNat(e.feeRatio)]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}e.exports={rlpEncodeForContractDeploy:m,rlpEncodeForFeeDelegatedSmartContractDeploy:g,rlpEncodeForFeeDelegatedSmartContractDeployWithRatio:b,rlpEncodeForContractExecution:y,rlpEncodeForFeeDelegatedSmartContractExecution:v,rlpEncodeForFeeDelegatedSmartContractExecutionWithRatio:w}},"83c7":function(e,t,r){"use strict";e.exports=e=>{if(null==e)return e;const t=/^[A-Z]+$/;return Object.keys(e).reduce((r,n)=>(t.test(n)?r[n.toLowerCase()]=e[n]:t.test(n[0])?r[n[0].toLowerCase()+n.slice(1)]=e[n]:r[n]=e[n],r),{})}},"857c":function(e,t,r){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f=r("c331"),i=f.keccak224,a=f.keccak384,o=f.keccak256,s=f.keccak512,u=r("b460"),c=r("f654"),l=r("a3ca"),h=r("c44e"),d=r("98e6"),p=r("8707").Buffer;Object.assign(t,r("9a12")),t.MAX_INTEGER=new h("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new h("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.SHA3_NULL_S=t.KECCAK256_NULL_S,t.KECCAK256_NULL=p.from(t.KECCAK256_NULL_S,"hex"),t.SHA3_NULL=t.KECCAK256_NULL,t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.SHA3_RLP_ARRAY_S=t.KECCAK256_RLP_ARRAY_S,t.KECCAK256_RLP_ARRAY=p.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.SHA3_RLP_ARRAY=t.KECCAK256_RLP_ARRAY,t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.SHA3_RLP_S=t.KECCAK256_RLP_S,t.KECCAK256_RLP=p.from(t.KECCAK256_RLP_S,"hex"),t.SHA3_RLP=t.KECCAK256_RLP,t.BN=h,t.rlp=l,t.secp256k1=u,t.zeros=function(e){return p.allocUnsafe(e).fill(0)},t.zeroAddress=function(){var e=20,r=t.zeros(e);return t.bufferToHex(r)},t.setLengthLeft=t.setLength=function(e,r,n){var f=t.zeros(r);return e=t.toBuffer(e),n?e.length0&&"0"===r.toString())e=e.slice(1),r=e[0];return e},t.toBuffer=function(e){if(!p.isBuffer(e))if(Array.isArray(e))e=p.from(e);else if("string"===typeof e)e=t.isHexString(e)?p.from(t.padToEven(t.stripHexPrefix(e)),"hex"):p.from(e);else if("number"===typeof e)e=t.intToBuffer(e);else if(null===e||void 0===e)e=p.allocUnsafe(0);else if(h.isBN(e))e=e.toArrayLike(p);else{if(!e.toArray)throw new Error("invalid type");e=p.from(e.toArray())}return e},t.bufferToInt=function(e){return new h(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return e=t.toBuffer(e),"0x"+e.toString("hex")},t.fromSigned=function(e){return new h(e).fromTwos(256)},t.toUnsigned=function(e){return p.from(e.toTwos(256).toArray())},t.keccak=function(e,r){switch(e=t.toBuffer(e),r||(r=256),r){case 224:return i(e);case 256:return o(e);case 384:return a(e);case 512:return s(e);default:throw new Error("Invald algorithm: keccak"+r)}},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),d("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=d("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(l.encode(e))},t.isValidPrivate=function(e){return u.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?u.publicKeyVerify(p.concat([p.from([4]),e])):!!t&&u.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=u.publicKeyConvert(e,!1).slice(1)),c(64===e.length),t.keccak(e).slice(-20)};var m=t.privateToPublic=function(e){return e=t.toBuffer(e),u.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return e=t.toBuffer(e),64!==e.length&&(e=u.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=u.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("Ethereum Signed Message:\n"+e.length.toString());return t.keccak(p.concat([r,e]))},t.ecrecover=function(e,r,n,f){var i=p.concat([t.setLength(n,32),t.setLength(f,32)],64),a=r-27;if(0!==a&&1!==a)throw new Error("Invalid signature v value");var o=u.recover(e,i,a);return u.publicKeyConvert(o,!1).slice(1)},t.toRpcSig=function(e,r,n){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(p.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(e=t.toBuffer(e),65!==e.length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(m(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){var r=t.zeroAddress();return r===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",f=0;f=8?n+=e[f].toUpperCase():n+=e[f];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=new h(r),r=r.isZero()?null:p.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!==typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var f=new h("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),i=new h("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&((27===e||28===e)&&(t=new h(t),r=new h(r),!(t.isZero()||t.gt(i)||r.isZero()||r.gt(i))&&(!1!==n||1!==new h(r).cmp(f))))},t.baToJSON=function(e){if(p.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n=f.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===f.length||!r.length||c(r.length===f.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=f}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:f,set:i}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:i,get:f})})),f)if("string"===typeof f&&(f=p.from(t.stripHexPrefix(f),"hex")),p.isBuffer(f)&&(f=l.decode(f)),Array.isArray(f)){if(f.length>e._fields.length)throw new Error("wrong number of fields in data");f.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==("undefined"===typeof f?"undefined":n(f)))throw new Error("invalid data");var i=Object.keys(f);r.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=f[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=f[t.alias])}))}}},"85fd":function(e,t,r){"use strict";function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var f=r("a988"),i=function(e){function t(t,r,n){var f;return f=e.call(this,t)||this,f.listener=r,f.context=n,f}return n(t,e),t}(f);e.exports=i},"864f":function(e,t,r){const n=r("3c73");class f extends n{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}}e.exports=f},"8a79":function(e,t,r){"use strict";var n=r("23e7"),f=r("06cf").f,i=r("50c4"),a=r("577e"),o=r("5a34"),s=r("1d80"),u=r("ab13"),c=r("c430"),l="".endsWith,h=Math.min,d=u("endsWith"),p=!c&&!d&&!!function(){var e=f(String.prototype,"endsWith");return e&&!e.writable}();n({target:"String",proto:!0,forced:!p&&!d},{endsWith:function(e){var t=a(s(this));o(e);var r=arguments.length>1?arguments[1]:void 0,n=i(t.length),f=void 0===r?n:h(i(r),n),u=a(e);return l?l.call(t,u,f):t.slice(f-u.length,f)===u}})},"8b32":function(e,t,r){const n=r("74ef"),f=r("a73f"),i=r("8e37"),a=r("a8cf"),o=r("7d90"),s=r("67da"),u=r("1605"),c=r("03c7"),l=r("5a46"),h=r("eace"),d=r("6a9e"),p=r("b47d"),m=r("d287"),y=r("4bac"),g=r("ab51"),b=r("d9ea"),v=r("08e8"),w=r("db81"),_=r("df7a"),T=r("0b87"),E=r("064c"),x=r("1830"),M=r("b8a5"),A=r("a9b0"),{TX_TYPE_STRING:k,TX_TYPE_TAG:P}=r("1789"),C=r("1a84"),S=r("558a");async function R(e){let t=await A._klaytnCall.getTransactionByHash(e);if(null===t)throw new Error(`Failed to get transaction from Klaytn with '${e}'.`);if(t.key){const e=C.createFromRLPEncoding(t.from,t.key);t.account=e,delete t.key}switch(t.type){case"TxTypeLegacyTransaction":t=new n(t);break;case"TxTypeValueTransfer":t=new f(t);break;case"TxTypeFeeDelegatedValueTransfer":t=new i(t);break;case"TxTypeFeeDelegatedValueTransferWithRatio":t=new a(t);break;case"TxTypeValueTransferMemo":t=new o(t);break;case"TxTypeFeeDelegatedValueTransferMemo":t=new s(t);break;case"TxTypeFeeDelegatedValueTransferMemoWithRatio":t=new u(t);break;case"TxTypeAccountUpdate":t=new c(t);break;case"TxTypeFeeDelegatedAccountUpdate":t=new l(t);break;case"TxTypeFeeDelegatedAccountUpdateWithRatio":t=new h(t);break;case"TxTypeSmartContractDeploy":t=new d(t);break;case"TxTypeFeeDelegatedSmartContractDeploy":t=new p(t);break;case"TxTypeFeeDelegatedSmartContractDeployWithRatio":t=new m(t);break;case"TxTypeSmartContractExecution":t=new y(t);break;case"TxTypeFeeDelegatedSmartContractExecution":t=new g(t);break;case"TxTypeFeeDelegatedSmartContractExecutionWithRatio":t=new b(t);break;case"TxTypeCancel":t=new v(t);break;case"TxTypeFeeDelegatedCancel":t=new w(t);break;case"TxTypeFeeDelegatedCancelWithRatio":t=new _(t);break;case"TxTypeChainDataAnchoring":t=new T(t);break;case"TxTypeFeeDelegatedChainDataAnchoring":t=new E(t);break;case"TxTypeFeeDelegatedChainDataAnchoringWithRatio":t=new x(t);break}return t}function I(e){const t=M.decode(e);return t.recoverPublicKeys()}function N(e){const t=M.decode(e);if(!(t instanceof S))throw new Error("The `caver.transaction.recoverFeePayerPublicKeys` function can only use with fee delegation transaction. For basic transactions, use `caver.transaction.recoverPublicKeys`.");return t.recoverFeePayerPublicKeys()}e.exports={decode:M.decode,getTransactionByHash:R,recoverPublicKeys:I,recoverFeePayerPublicKeys:N,legacyTransaction:n,valueTransfer:f,feeDelegatedValueTransfer:i,feeDelegatedValueTransferWithRatio:a,valueTransferMemo:o,feeDelegatedValueTransferMemo:s,feeDelegatedValueTransferMemoWithRatio:u,accountUpdate:c,feeDelegatedAccountUpdate:l,feeDelegatedAccountUpdateWithRatio:h,smartContractDeploy:d,feeDelegatedSmartContractDeploy:p,feeDelegatedSmartContractDeployWithRatio:m,smartContractExecution:y,feeDelegatedSmartContractExecution:g,feeDelegatedSmartContractExecutionWithRatio:b,cancel:v,feeDelegatedCancel:w,feeDelegatedCancelWithRatio:_,chainDataAnchoring:T,feeDelegatedChainDataAnchoring:E,feeDelegatedChainDataAnchoringWithRatio:x,type:k,tag:P}},"8be9":function(e,t,r){const n=r("857c"),f=r("81ad");function i(e){const t=new Error("Expect argument to be non-empty array");if("object"!==typeof e||!e.length)throw t;const r=e.map((function(e){return"bytes"===e.type?n.toBuffer(e.value):e.value})),i=e.map((function(e){return e.type})),a=e.map((function(e){if(!e.name)throw t;return e.type+" "+e.name}));return f.soliditySHA3(["bytes32","bytes32"],[f.soliditySHA3(new Array(e.length).fill("string"),a),f.soliditySHA3(i,r)])}function a(e,t){const r=n.toBuffer(t),f=n.fromRpcSig(r);return n.ecrecover(e,f.v,f.r,f.s)}function o(e){const t=n.toBuffer(e.data),r=n.hashPersonalMessage(t);return a(r,e.sig)}function s(e,t){var r=""+e;while(r.length=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function u(e,t,r,n){for(var f=0,i=Math.min(e.length,r),a=t;a=49?o-49+10:o>=17?o-17+10:o}return f}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var f=0;"-"===e[0]&&(f++,this.negative=1),f=0;f-=3)a=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[i]|=a<>>26-o&67108863,o+=24,o>=26&&(o-=26,i++);else if("le"===r)for(f=0,i=0;f>>26-o&67108863,o+=24,o>=26&&(o-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)f=s(e,t,n)<=18?(i-=18,a+=1,this.words[a]|=f>>>26):i+=8;else{var o=e.length-t;for(n=o%2===0?t+1:t;n=18?(i-=18,a+=1,this.words[a]|=f>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,f=1;f<=67108863;f*=t)n++;n--,f=f/t|0;for(var i=e.length-r,a=i%n,o=Math.min(i,i-a)+r,s=0,c=r;c1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e){for(var t=new Array(e.bitLength()),r=0;r>>f}return t}function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var f=0|e.words[0],i=0|t.words[0],a=f*i,o=67108863&a,s=a/67108864|0;r.words[0]=o;for(var u=1;u>>26,l=67108863&s,h=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=h;d++){var p=u-d|0;f=0|e.words[p],i=0|t.words[d],a=f*i+l,c+=a/67108864|0,l=67108863&a}r.words[u]=0|l,s=0|c}return 0!==s?r.words[u]=0|s:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var f=0,i=0,a=0;a>>24-f&16777215,r=0!==i||a!==this.length-1?c[6-s.length]+s+r:s+r,f+=2,f>=26&&(f-=26,a--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],d=h[e];r="";var p=this.clone();p.negative=0;while(!p.isZero()){var m=p.modn(d).toString(e);p=p.idivn(d),r=p.isZero()?m+r:c[u-m.length]+m+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n("undefined"!==typeof a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var f=this.byteLength(),i=r||Math.max(1,f);n(f<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,o,s="le"===t,u=new e(i),c=this.clone();if(s){for(o=0;!c.isZero();o++)a=c.andln(255),c.iushrn(8),u[o]=a;for(;o=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,f=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var f=0,i=0;i>>26;for(;0!==f&&i>>26;if(this.length=r.length,0!==f)this.words[this.length]=f,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,y=0|a[2],g=8191&y,b=y>>>13,v=0|a[3],w=8191&v,_=v>>>13,T=0|a[4],E=8191&T,x=T>>>13,M=0|a[5],A=8191&M,k=M>>>13,P=0|a[6],C=8191&P,S=P>>>13,R=0|a[7],I=8191&R,N=R>>>13,L=0|a[8],F=8191&L,K=L>>>13,O=0|a[9],D=8191&O,B=O>>>13,U=0|o[0],j=8191&U,V=U>>>13,H=0|o[1],G=8191&H,W=H>>>13,q=0|o[2],Y=8191&q,$=q>>>13,z=0|o[3],Z=8191&z,J=z>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,fe=0|o[6],ie=8191&fe,ae=fe>>>13,oe=0|o[7],se=8191&oe,ue=oe>>>13,ce=0|o[8],le=8191&ce,he=ce>>>13,de=0|o[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(l,j),f=Math.imul(l,V),f=f+Math.imul(h,j)|0,i=Math.imul(h,V);var ye=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,j),f=Math.imul(p,V),f=f+Math.imul(m,j)|0,i=Math.imul(m,V),n=n+Math.imul(l,G)|0,f=f+Math.imul(l,W)|0,f=f+Math.imul(h,G)|0,i=i+Math.imul(h,W)|0;var ge=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,j),f=Math.imul(g,V),f=f+Math.imul(b,j)|0,i=Math.imul(b,V),n=n+Math.imul(p,G)|0,f=f+Math.imul(p,W)|0,f=f+Math.imul(m,G)|0,i=i+Math.imul(m,W)|0,n=n+Math.imul(l,Y)|0,f=f+Math.imul(l,$)|0,f=f+Math.imul(h,Y)|0,i=i+Math.imul(h,$)|0;var be=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,j),f=Math.imul(w,V),f=f+Math.imul(_,j)|0,i=Math.imul(_,V),n=n+Math.imul(g,G)|0,f=f+Math.imul(g,W)|0,f=f+Math.imul(b,G)|0,i=i+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,f=f+Math.imul(p,$)|0,f=f+Math.imul(m,Y)|0,i=i+Math.imul(m,$)|0,n=n+Math.imul(l,Z)|0,f=f+Math.imul(l,J)|0,f=f+Math.imul(h,Z)|0,i=i+Math.imul(h,J)|0;var ve=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,j),f=Math.imul(E,V),f=f+Math.imul(x,j)|0,i=Math.imul(x,V),n=n+Math.imul(w,G)|0,f=f+Math.imul(w,W)|0,f=f+Math.imul(_,G)|0,i=i+Math.imul(_,W)|0,n=n+Math.imul(g,Y)|0,f=f+Math.imul(g,$)|0,f=f+Math.imul(b,Y)|0,i=i+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,f=f+Math.imul(p,J)|0,f=f+Math.imul(m,Z)|0,i=i+Math.imul(m,J)|0,n=n+Math.imul(l,Q)|0,f=f+Math.imul(l,ee)|0,f=f+Math.imul(h,Q)|0,i=i+Math.imul(h,ee)|0;var we=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,j),f=Math.imul(A,V),f=f+Math.imul(k,j)|0,i=Math.imul(k,V),n=n+Math.imul(E,G)|0,f=f+Math.imul(E,W)|0,f=f+Math.imul(x,G)|0,i=i+Math.imul(x,W)|0,n=n+Math.imul(w,Y)|0,f=f+Math.imul(w,$)|0,f=f+Math.imul(_,Y)|0,i=i+Math.imul(_,$)|0,n=n+Math.imul(g,Z)|0,f=f+Math.imul(g,J)|0,f=f+Math.imul(b,Z)|0,i=i+Math.imul(b,J)|0,n=n+Math.imul(p,Q)|0,f=f+Math.imul(p,ee)|0,f=f+Math.imul(m,Q)|0,i=i+Math.imul(m,ee)|0,n=n+Math.imul(l,re)|0,f=f+Math.imul(l,ne)|0,f=f+Math.imul(h,re)|0,i=i+Math.imul(h,ne)|0;var _e=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(C,j),f=Math.imul(C,V),f=f+Math.imul(S,j)|0,i=Math.imul(S,V),n=n+Math.imul(A,G)|0,f=f+Math.imul(A,W)|0,f=f+Math.imul(k,G)|0,i=i+Math.imul(k,W)|0,n=n+Math.imul(E,Y)|0,f=f+Math.imul(E,$)|0,f=f+Math.imul(x,Y)|0,i=i+Math.imul(x,$)|0,n=n+Math.imul(w,Z)|0,f=f+Math.imul(w,J)|0,f=f+Math.imul(_,Z)|0,i=i+Math.imul(_,J)|0,n=n+Math.imul(g,Q)|0,f=f+Math.imul(g,ee)|0,f=f+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,f=f+Math.imul(p,ne)|0,f=f+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,n=n+Math.imul(l,ie)|0,f=f+Math.imul(l,ae)|0,f=f+Math.imul(h,ie)|0,i=i+Math.imul(h,ae)|0;var Te=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(I,j),f=Math.imul(I,V),f=f+Math.imul(N,j)|0,i=Math.imul(N,V),n=n+Math.imul(C,G)|0,f=f+Math.imul(C,W)|0,f=f+Math.imul(S,G)|0,i=i+Math.imul(S,W)|0,n=n+Math.imul(A,Y)|0,f=f+Math.imul(A,$)|0,f=f+Math.imul(k,Y)|0,i=i+Math.imul(k,$)|0,n=n+Math.imul(E,Z)|0,f=f+Math.imul(E,J)|0,f=f+Math.imul(x,Z)|0,i=i+Math.imul(x,J)|0,n=n+Math.imul(w,Q)|0,f=f+Math.imul(w,ee)|0,f=f+Math.imul(_,Q)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,f=f+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0,n=n+Math.imul(p,ie)|0,f=f+Math.imul(p,ae)|0,f=f+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0,n=n+Math.imul(l,se)|0,f=f+Math.imul(l,ue)|0,f=f+Math.imul(h,se)|0,i=i+Math.imul(h,ue)|0;var Ee=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,j),f=Math.imul(F,V),f=f+Math.imul(K,j)|0,i=Math.imul(K,V),n=n+Math.imul(I,G)|0,f=f+Math.imul(I,W)|0,f=f+Math.imul(N,G)|0,i=i+Math.imul(N,W)|0,n=n+Math.imul(C,Y)|0,f=f+Math.imul(C,$)|0,f=f+Math.imul(S,Y)|0,i=i+Math.imul(S,$)|0,n=n+Math.imul(A,Z)|0,f=f+Math.imul(A,J)|0,f=f+Math.imul(k,Z)|0,i=i+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,f=f+Math.imul(E,ee)|0,f=f+Math.imul(x,Q)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,f=f+Math.imul(w,ne)|0,f=f+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(g,ie)|0,f=f+Math.imul(g,ae)|0,f=f+Math.imul(b,ie)|0,i=i+Math.imul(b,ae)|0,n=n+Math.imul(p,se)|0,f=f+Math.imul(p,ue)|0,f=f+Math.imul(m,se)|0,i=i+Math.imul(m,ue)|0,n=n+Math.imul(l,le)|0,f=f+Math.imul(l,he)|0,f=f+Math.imul(h,le)|0,i=i+Math.imul(h,he)|0;var xe=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,j),f=Math.imul(D,V),f=f+Math.imul(B,j)|0,i=Math.imul(B,V),n=n+Math.imul(F,G)|0,f=f+Math.imul(F,W)|0,f=f+Math.imul(K,G)|0,i=i+Math.imul(K,W)|0,n=n+Math.imul(I,Y)|0,f=f+Math.imul(I,$)|0,f=f+Math.imul(N,Y)|0,i=i+Math.imul(N,$)|0,n=n+Math.imul(C,Z)|0,f=f+Math.imul(C,J)|0,f=f+Math.imul(S,Z)|0,i=i+Math.imul(S,J)|0,n=n+Math.imul(A,Q)|0,f=f+Math.imul(A,ee)|0,f=f+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,f=f+Math.imul(E,ne)|0,f=f+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(w,ie)|0,f=f+Math.imul(w,ae)|0,f=f+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,n=n+Math.imul(g,se)|0,f=f+Math.imul(g,ue)|0,f=f+Math.imul(b,se)|0,i=i+Math.imul(b,ue)|0,n=n+Math.imul(p,le)|0,f=f+Math.imul(p,he)|0,f=f+Math.imul(m,le)|0,i=i+Math.imul(m,he)|0,n=n+Math.imul(l,pe)|0,f=f+Math.imul(l,me)|0,f=f+Math.imul(h,pe)|0,i=i+Math.imul(h,me)|0;var Me=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,G),f=Math.imul(D,W),f=f+Math.imul(B,G)|0,i=Math.imul(B,W),n=n+Math.imul(F,Y)|0,f=f+Math.imul(F,$)|0,f=f+Math.imul(K,Y)|0,i=i+Math.imul(K,$)|0,n=n+Math.imul(I,Z)|0,f=f+Math.imul(I,J)|0,f=f+Math.imul(N,Z)|0,i=i+Math.imul(N,J)|0,n=n+Math.imul(C,Q)|0,f=f+Math.imul(C,ee)|0,f=f+Math.imul(S,Q)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(A,re)|0,f=f+Math.imul(A,ne)|0,f=f+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(E,ie)|0,f=f+Math.imul(E,ae)|0,f=f+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,n=n+Math.imul(w,se)|0,f=f+Math.imul(w,ue)|0,f=f+Math.imul(_,se)|0,i=i+Math.imul(_,ue)|0,n=n+Math.imul(g,le)|0,f=f+Math.imul(g,he)|0,f=f+Math.imul(b,le)|0,i=i+Math.imul(b,he)|0,n=n+Math.imul(p,pe)|0,f=f+Math.imul(p,me)|0,f=f+Math.imul(m,pe)|0,i=i+Math.imul(m,me)|0;var Ae=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,Y),f=Math.imul(D,$),f=f+Math.imul(B,Y)|0,i=Math.imul(B,$),n=n+Math.imul(F,Z)|0,f=f+Math.imul(F,J)|0,f=f+Math.imul(K,Z)|0,i=i+Math.imul(K,J)|0,n=n+Math.imul(I,Q)|0,f=f+Math.imul(I,ee)|0,f=f+Math.imul(N,Q)|0,i=i+Math.imul(N,ee)|0,n=n+Math.imul(C,re)|0,f=f+Math.imul(C,ne)|0,f=f+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(A,ie)|0,f=f+Math.imul(A,ae)|0,f=f+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,n=n+Math.imul(E,se)|0,f=f+Math.imul(E,ue)|0,f=f+Math.imul(x,se)|0,i=i+Math.imul(x,ue)|0,n=n+Math.imul(w,le)|0,f=f+Math.imul(w,he)|0,f=f+Math.imul(_,le)|0,i=i+Math.imul(_,he)|0,n=n+Math.imul(g,pe)|0,f=f+Math.imul(g,me)|0,f=f+Math.imul(b,pe)|0,i=i+Math.imul(b,me)|0;var ke=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Z),f=Math.imul(D,J),f=f+Math.imul(B,Z)|0,i=Math.imul(B,J),n=n+Math.imul(F,Q)|0,f=f+Math.imul(F,ee)|0,f=f+Math.imul(K,Q)|0,i=i+Math.imul(K,ee)|0,n=n+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,f=f+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,n=n+Math.imul(C,ie)|0,f=f+Math.imul(C,ae)|0,f=f+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,n=n+Math.imul(A,se)|0,f=f+Math.imul(A,ue)|0,f=f+Math.imul(k,se)|0,i=i+Math.imul(k,ue)|0,n=n+Math.imul(E,le)|0,f=f+Math.imul(E,he)|0,f=f+Math.imul(x,le)|0,i=i+Math.imul(x,he)|0,n=n+Math.imul(w,pe)|0,f=f+Math.imul(w,me)|0,f=f+Math.imul(_,pe)|0,i=i+Math.imul(_,me)|0;var Pe=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Q),f=Math.imul(D,ee),f=f+Math.imul(B,Q)|0,i=Math.imul(B,ee),n=n+Math.imul(F,re)|0,f=f+Math.imul(F,ne)|0,f=f+Math.imul(K,re)|0,i=i+Math.imul(K,ne)|0,n=n+Math.imul(I,ie)|0,f=f+Math.imul(I,ae)|0,f=f+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,n=n+Math.imul(C,se)|0,f=f+Math.imul(C,ue)|0,f=f+Math.imul(S,se)|0,i=i+Math.imul(S,ue)|0,n=n+Math.imul(A,le)|0,f=f+Math.imul(A,he)|0,f=f+Math.imul(k,le)|0,i=i+Math.imul(k,he)|0,n=n+Math.imul(E,pe)|0,f=f+Math.imul(E,me)|0,f=f+Math.imul(x,pe)|0,i=i+Math.imul(x,me)|0;var Ce=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,re),f=Math.imul(D,ne),f=f+Math.imul(B,re)|0,i=Math.imul(B,ne),n=n+Math.imul(F,ie)|0,f=f+Math.imul(F,ae)|0,f=f+Math.imul(K,ie)|0,i=i+Math.imul(K,ae)|0,n=n+Math.imul(I,se)|0,f=f+Math.imul(I,ue)|0,f=f+Math.imul(N,se)|0,i=i+Math.imul(N,ue)|0,n=n+Math.imul(C,le)|0,f=f+Math.imul(C,he)|0,f=f+Math.imul(S,le)|0,i=i+Math.imul(S,he)|0,n=n+Math.imul(A,pe)|0,f=f+Math.imul(A,me)|0,f=f+Math.imul(k,pe)|0,i=i+Math.imul(k,me)|0;var Se=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,ie),f=Math.imul(D,ae),f=f+Math.imul(B,ie)|0,i=Math.imul(B,ae),n=n+Math.imul(F,se)|0,f=f+Math.imul(F,ue)|0,f=f+Math.imul(K,se)|0,i=i+Math.imul(K,ue)|0,n=n+Math.imul(I,le)|0,f=f+Math.imul(I,he)|0,f=f+Math.imul(N,le)|0,i=i+Math.imul(N,he)|0,n=n+Math.imul(C,pe)|0,f=f+Math.imul(C,me)|0,f=f+Math.imul(S,pe)|0,i=i+Math.imul(S,me)|0;var Re=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,se),f=Math.imul(D,ue),f=f+Math.imul(B,se)|0,i=Math.imul(B,ue),n=n+Math.imul(F,le)|0,f=f+Math.imul(F,he)|0,f=f+Math.imul(K,le)|0,i=i+Math.imul(K,he)|0,n=n+Math.imul(I,pe)|0,f=f+Math.imul(I,me)|0,f=f+Math.imul(N,pe)|0,i=i+Math.imul(N,me)|0;var Ie=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,le),f=Math.imul(D,he),f=f+Math.imul(B,le)|0,i=Math.imul(B,he),n=n+Math.imul(F,pe)|0,f=f+Math.imul(F,me)|0,f=f+Math.imul(K,pe)|0,i=i+Math.imul(K,me)|0;var Ne=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(D,pe),f=Math.imul(D,me),f=f+Math.imul(B,pe)|0,i=Math.imul(B,me);var Le=(u+n|0)+((8191&f)<<13)|0;return u=(i+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,s[0]=ye,s[1]=ge,s[2]=be,s[3]=ve,s[4]=we,s[5]=_e,s[6]=Te,s[7]=Ee,s[8]=xe,s[9]=Me,s[10]=Ae,s[11]=ke,s[12]=Pe,s[13]=Ce,s[14]=Se,s[15]=Re,s[16]=Ie,s[17]=Ne,s[18]=Le,0!==u&&(s[19]=u,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,f=0,i=0;i>>26)|0,f+=a>>>26,a&=67108863}r.words[i]=o,n=a,a=f}return 0!==n?r.words[i]=n:r.length--,r.strip()}function g(e,t,r){var n=new b;return n.mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=p),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?m(this,e,t):n<63?p(this,e,t):n<1024?y(this,e,t):g(this,e,t),r},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,f,i){for(var a=0;a>>=1)f++;return 1<>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=f/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=d(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,r=e%26,f=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==f){for(t=this.length-1;t>=0;t--)this.words[t+f]=this.words[t];for(t=0;t=0),f=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),o=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==c||u>=f);u--){var l=0|this.words[u];this.words[u]=c<<26-i|l>>>i,c=l&o}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,f=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var f=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(s/67108864|0),this.words[f+r]=67108863&i}for(;f>26,this.words[f+r]=67108863&i;if(0===o)return this.strip();for(n(-1===o),o=0,f=0;f>26,this.words[f]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),f=e,a=0|f.words[f.length-1],o=this._countBits(a);r=26-o,0!==r&&(f=f.ushln(r),n.iushln(r),a=0|f.words[f.length-1]);var s,u=n.length-f.length;if("mod"!==t){s=new i(null),s.length=u+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var d=67108864*(0|n.words[f.length+h])+(0|n.words[f.length+h-1]);d=Math.min(d/a|0,67108863),n._ishlnsubmul(f,d,h);while(0!==n.negative)d--,n.negative=0,n._ishlnsubmul(f,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(f=o.div.neg()),"div"!==t&&(a=o.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:f,mod:a}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(f=o.div.neg()),{div:f,mod:o.mod}):0!==(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(a=o.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:o.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var f,a,o},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),f=e.andln(1),i=r.cmp(n);return i<0||1===f&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,f=this.length-1;f>=0;f--)r=(t*r+(0|this.words[f]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var f=(0|this.words[r])+67108864*t;this.words[r]=f/e|0,t=f%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var f=new i(1),a=new i(0),o=new i(0),s=new i(1),u=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++u;var c=r.clone(),l=t.clone();while(!t.isZero()){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0){t.iushrn(h);while(h-- >0)(f.isOdd()||a.isOdd())&&(f.iadd(c),a.isub(l)),f.iushrn(1),a.iushrn(1)}for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0){r.iushrn(p);while(p-- >0)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(l)),o.iushrn(1),s.iushrn(1)}t.cmp(r)>=0?(t.isub(r),f.isub(o),a.isub(s)):(r.isub(t),o.isub(f),s.isub(a))}return{a:o,b:s,gcd:r.iushln(u)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var f,a=new i(1),o=new i(0),s=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var u=0,c=1;0===(t.words[0]&c)&&u<26;++u,c<<=1);if(u>0){t.iushrn(u);while(u-- >0)a.isOdd()&&a.iadd(s),a.iushrn(1)}for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0){r.iushrn(l);while(l-- >0)o.isOdd()&&o.iadd(s),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),a.isub(o)):(r.isub(t),o.isub(a))}return f=0===t.cmpn(1)?a:o,f.cmpn(0)<0&&f.iadd(e),f},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var f=t.cmp(r);if(f<0){var i=t;t=r,r=i}else if(0===f||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,f=1<>>26,o&=67108863,this.words[a]=o}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var f=0|this.words[0];t=f===e?0:fe.length)return 1;if(this.length=0;r--){var n=0|this.words[r],f=0|e.words[r];if(n!==f){nf&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new M(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function T(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},f(_,w),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),f=0;f>>22,i=a}i>>>=22,e.words[f-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=f,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new T;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return v[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var f=this.m.subn(1),a=0;while(!f.isZero()&&0===f.andln(1))a++,f.iushrn(1);n(!f.isZero());var o=new i(1).toRed(this),s=o.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();c=new i(2*c*c).toRed(this);while(0!==this.pow(c,u).cmp(s))c.redIAdd(s);var l=this.pow(c,f),h=this.pow(e,f.addn(1).iushrn(1)),d=this.pow(e,f),p=a;while(0!==d.cmp(o)){for(var m=d,y=0;0!==m.cmp(o);y++)m=m.redSqr();n(y=0;f--){for(var c=t.words[f],l=u-1;l>=0;l--){var h=c>>l&1;a!==n[0]&&(a=this.sqr(a)),0!==h||0!==o?(o<<=1,o|=h,s++,(s===r||0===f&&0===l)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}u=26}return a},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new A(e)},f(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=r.isub(n).iushrn(this.shift),i=f;return f.cmp(this.m)>=0?i=f.isub(this.m):f.cmpn(0)<0&&(i=f.iadd(this.m)),i._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=r.isub(n).iushrn(this.shift),a=f;return f.cmp(this.m)>=0?a=f.isub(this.m):f.cmpn(0)<0&&(a=f.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(e,this)}).call(this,r("62e4")(e))},"8d234":function(e,t,r){const n=r("03928"),f=r("2515"),i=r("b437");e.exports={fileLogger:n,rpcFilter:f,timeMeasure:i}},"8d9e":function(e,t,r){"use strict";(function(t){var n=r("2213"),f=r("3841"),i=r("5e78"),a=function(e){return 32===e.length&&n.privateKeyVerify(Uint8Array.from(e))},o=function(e,t){if(32!==e.length)throw new RangeError("private key length is invalid");var r=f.privateKeyExport(e,t);return i.privateKeyExport(e,r,t)},s=function(e){if(e=i.privateKeyImport(e),null!==e&&32===e.length&&a(e))return e;throw new Error("couldn't import from DER format")},u=function(e){return t.from(n.privateKeyNegate(Uint8Array.from(e)))},c=function(e){if(32!==e.length)throw new Error("private key length is invalid");return t.from(f.privateKeyModInverse(Uint8Array.from(e)))},l=function(e,r){return t.from(n.privateKeyTweakAdd(Uint8Array.from(e),r))},h=function(e,r){return t.from(n.privateKeyTweakMul(Uint8Array.from(e),Uint8Array.from(r)))},d=function(e,r){return t.from(n.publicKeyCreate(Uint8Array.from(e),r))},p=function(e,r){return t.from(n.publicKeyConvert(Uint8Array.from(e),r))},m=function(e){return(33===e.length||65===e.length)&&n.publicKeyVerify(Uint8Array.from(e))},y=function(e,r,f){return t.from(n.publicKeyTweakAdd(Uint8Array.from(e),Uint8Array.from(r),f))},g=function(e,r,f){return t.from(n.publicKeyTweakMul(Uint8Array.from(e),Uint8Array.from(r),f))},b=function(e,r){var f=[];return e.forEach((function(e){f.push(Uint8Array.from(e))})),t.from(n.publicKeyCombine(f,r))},v=function(e){return t.from(n.signatureNormalize(Uint8Array.from(e)))},w=function(e){return t.from(n.signatureExport(Uint8Array.from(e)))},_=function(e){return t.from(n.signatureImport(Uint8Array.from(e)))},T=function(e){if(0===e.length)throw new RangeError("signature length is invalid");var t=i.signatureImportLax(e);if(null===t)throw new Error("couldn't parse DER signature");return f.signatureImport(t)},E=function(e,r,f){if(null===f)throw new TypeError("options should be an Object");var i=void 0;if(f){if(i={},null===f.data)throw new TypeError("options.data should be a Buffer");if(f.data){if(32!==f.data.length)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(f.data)}if(null===f.noncefn)throw new TypeError("options.noncefn should be a Function");f.noncefn&&(i.noncefn=function(e,r,n,i,a){var o=null!=n?t.from(n):null,s=null!=i?t.from(i):null,u=t.from("");return f.noncefn&&(u=f.noncefn(t.from(e),t.from(r),o,s,a)),Uint8Array.from(u)})}var a=n.ecdsaSign(Uint8Array.from(e),Uint8Array.from(r),i);return{signature:t.from(a.signature),recovery:a.recid}},x=function(e,t,r){return n.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),r)},M=function(e,r,f,i){return t.from(n.ecdsaRecover(Uint8Array.from(r),f,Uint8Array.from(e),i))},A=function(e,r){return t.from(n.ecdh(Uint8Array.from(e),Uint8Array.from(r),{}))},k=function(e,r,n){if(33!==e.length&&65!==e.length)throw new RangeError("public key length is invalid");if(32!==r.length)throw new RangeError("private key length is invalid");return t.from(f.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(r),n))};e.exports={privateKeyVerify:a,privateKeyExport:o,privateKeyImport:s,privateKeyNegate:u,privateKeyModInverse:c,privateKeyTweakAdd:l,privateKeyTweakMul:h,publicKeyCreate:d,publicKeyConvert:p,publicKeyVerify:m,publicKeyTweakAdd:y,publicKeyTweakMul:g,publicKeyCombine:b,signatureNormalize:v,signatureExport:w,signatureImport:_,signatureImportLax:T,sign:E,verify:x,recover:M,ecdh:A,ecdhUnsafe:k}}).call(this,r("b639").Buffer)},"8e37":function(e,t,r){const n=r("19d7"),f=r("0664"),i=r("2ef0"),a=r("558a"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s}=r("1789"),u=r("19b5");function c(e){if(e=u.addHexPrefix(e),!e.startsWith(s.TxTypeFeeDelegatedValueTransfer))throw new Error(`Cannot decode to FeeDelegatedValueTransfer. The prefix must be ${s.TxTypeFeeDelegatedValueTransfer}: ${e}`);const t="0x"+e.slice(4),[r,f,i,a,o,c,l,h,d]=n.decode(t);return{nonce:u.trimLeadingZero(r),gasPrice:u.trimLeadingZero(f),gas:u.trimLeadingZero(i),to:a,value:u.trimLeadingZero(o),from:c,signatures:l,feePayer:h,feePayerSignatures:d}}class l extends a{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){i.isString(e)&&(e=c(e)),super(o.TxTypeFeeDelegatedValueTransfer,e),this.to=e.to,this.value=e.value}get to(){return this._to}set to(e){if(!u.isAddress(e))throw new Error("Invalid address of to: "+e);this._to=e.toLowerCase()}get value(){return this._value}set value(e){this._value=u.numberToHex(e)}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode()),t=this.feePayerSignatures.map(e=>e.encode());return s.TxTypeFeeDelegatedValueTransfer+n.encode([f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.to.toLowerCase(),f.fromNat(this.value),this.from.toLowerCase(),e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),n.encode([s.TxTypeFeeDelegatedValueTransfer,f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.to.toLowerCase(),f.fromNat(this.value),this.from.toLowerCase()])}}e.exports=l},"8e7f":function(e,t,r){var n;(function(f){"use strict";var i,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,o=Math.ceil,s=Math.floor,u="[BigNumber Error] ",c=u+"Number primitive has more than 15 significant digits: ",l=1e14,h=14,d=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,y=1e9;function g(e){var t,r,n,f=K.prototype={constructor:K,toString:null,valueOf:null},i=new K(1),M=20,A=4,k=-7,P=21,C=-1e7,S=1e7,R=!1,I=1,N=0,L={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz";function K(e,t){var f,i,o,u,l,p,m,y,g=this;if(!(g instanceof K))return new K(e,t);if(null==t){if(e instanceof K)return g.s=e.s,g.e=e.e,void(g.c=(e=e.c)?e.slice():e);if(p="number"==typeof e,p&&0*e==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,l=e;l>=10;l/=10,u++);return g.e=u,void(g.c=[e])}y=String(e)}else{if(y=String(e),!a.test(y))return n(g,y,p);g.s=45==y.charCodeAt(0)?(y=y.slice(1),-1):1}(u=y.indexOf("."))>-1&&(y=y.replace(".","")),(l=y.search(/e/i))>0?(u<0&&(u=l),u+=+y.slice(l+1),y=y.substring(0,l)):u<0&&(u=y.length)}else{if(_(t,2,F.length,"Base"),y=String(e),10==t)return g=new K(e instanceof K?e:y),U(g,M+g.e+1,A);if(p="number"==typeof e,p){if(0*e!=0)return n(g,y,p,t);if(g.s=1/e<0?(y=y.slice(1),-1):1,K.DEBUG&&y.replace(/^0\.0*|\./,"").length>15)throw Error(c+e);p=!1}else g.s=45===y.charCodeAt(0)?(y=y.slice(1),-1):1;for(f=F.slice(0,t),u=l=0,m=y.length;lu){u=m;continue}}else if(!o&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){o=!0,l=-1,u=0;continue}return n(g,String(e),p,t)}y=r(y,t,10,g.s),(u=y.indexOf("."))>-1?y=y.replace(".",""):u=y.length}for(l=0;48===y.charCodeAt(l);l++);for(m=y.length;48===y.charCodeAt(--m););if(y=y.slice(l,++m),y){if(m-=l,p&&K.DEBUG&&m>15&&(e>d||e!==s(e)))throw Error(c+g.s*e);if(u=u-l-1,u>S)g.c=g.e=null;else if(u=P)?E(s,a):x(s,a,"0");else if(e=U(new K(e),t,r),i=e.e,s=v(e.c),o=s.length,1==n||2==n&&(t<=i||i<=k)){for(;oo){if(--t>0)for(s+=".";t--;s+="0");}else if(t+=i-o,t>0)for(i+1==o&&(s+=".");t--;s+="0");return e.s<0&&f?"-"+s:s}function D(e,t){for(var r,n=1,f=new K(e[0]);n=10;f/=10,n++);return(r=n+r*h-1)>S?e.c=e.e=null:r=10;u/=10,f++);if(i=t-f,i<0)i+=h,a=t,c=y[d=0],m=c/g[f-a-1]%10|0;else if(d=o((i+1)/h),d>=y.length){if(!n)break e;for(;y.length<=d;y.push(0));c=m=0,f=1,i%=h,a=i-h+1}else{for(c=u=y[d],f=1;u>=10;u/=10,f++);i%=h,a=i-h+f,m=a<0?0:c/g[f-a-1]%10|0}if(n=n||t<0||null!=y[d+1]||(a<0?c:c%g[f-a-1]),n=r<4?(m||n)&&(0==r||r==(e.s<0?3:2)):m>5||5==m&&(4==r||n||6==r&&(i>0?a>0?c/g[f-a]:0:y[d-1])%10&1||r==(e.s<0?8:7)),t<1||!y[0])return y.length=0,n?(t-=e.e+1,y[0]=g[(h-t%h)%h],e.e=-t||0):y[0]=e.e=0,e;if(0==i?(y.length=d,u=1,d--):(y.length=d+1,u=g[h-i],y[d]=a>0?s(c/g[f-a]%g[a])*u:0),n)for(;;){if(0==d){for(i=1,a=y[0];a>=10;a/=10,i++);for(a=y[0]+=u,u=1;a>=10;a/=10,u++);i!=u&&(e.e++,y[0]==l&&(y[0]=1));break}if(y[d]+=u,y[d]!=l)break;y[d--]=0,u=1}for(i=y.length;0===y[--i];y.pop());}e.e>S?e.c=e.e=null:e.e=P?E(t,r):x(t,r,"0"),e.s<0?"-"+t:t)}return K.clone=g,K.ROUND_UP=0,K.ROUND_DOWN=1,K.ROUND_CEIL=2,K.ROUND_FLOOR=3,K.ROUND_HALF_UP=4,K.ROUND_HALF_DOWN=5,K.ROUND_HALF_EVEN=6,K.ROUND_HALF_CEIL=7,K.ROUND_HALF_FLOOR=8,K.EUCLID=9,K.config=K.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(r=e[t],_(r,0,y,t),M=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(r=e[t],_(r,0,8,t),A=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&(r=e[t],r&&r.pop?(_(r[0],-y,0,t),_(r[1],0,y,t),k=r[0],P=r[1]):(_(r,-y,y,t),k=-(P=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if(r=e[t],r&&r.pop)_(r[0],-y,-1,t),_(r[1],1,y,t),C=r[0],S=r[1];else{if(_(r,-y,y,t),!r)throw Error(u+t+" cannot be zero: "+r);C=-(S=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if(r=e[t],r!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw R=!r,Error(u+"crypto unavailable");R=r}else R=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(r=e[t],_(r,0,9,t),I=r),e.hasOwnProperty(t="POW_PRECISION")&&(r=e[t],_(r,0,y,t),N=r),e.hasOwnProperty(t="FORMAT")){if(r=e[t],"object"!=typeof r)throw Error(u+t+" not an object: "+r);L=r}if(e.hasOwnProperty(t="ALPHABET")){if(r=e[t],"string"!=typeof r||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);F=r}}return{DECIMAL_PLACES:M,ROUNDING_MODE:A,EXPONENTIAL_AT:[k,P],RANGE:[C,S],CRYPTO:R,MODULO_MODE:I,POW_PRECISION:N,FORMAT:L,ALPHABET:F}},K.isBigNumber=function(e){return e instanceof K||e&&!0===e._isBigNumber||!1},K.maximum=K.max=function(){return D(arguments,f.lt)},K.minimum=K.min=function(){return D(arguments,f.gt)},K.random=function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return s(Math.random()*e)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(e){var r,n,f,a,c,l=0,d=[],m=new K(i);if(null==e?e=M:_(e,0,y),a=o(e/h),R)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(a*=2));l>>11),c>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),r[l]=n[0],r[l+1]=n[1]):(d.push(c%1e14),l+=2);l=a/2}else{if(!crypto.randomBytes)throw R=!1,Error(u+"crypto unavailable");for(r=crypto.randomBytes(a*=7);l=9e15?crypto.randomBytes(7).copy(r,l):(d.push(c%1e14),l+=7);l=a/7}if(!R)for(;l=10;c/=10,l++);lr-1&&(null==a[f+1]&&(a[f+1]=0),a[f+1]+=a[f]/r|0,a[f]%=r)}return a.reverse()}return function(n,f,i,a,o){var s,u,c,l,h,d,p,m,y=n.indexOf("."),g=M,b=A;for(y>=0&&(l=N,N=0,n=n.replace(".",""),m=new K(f),d=m.pow(n.length-y),N=l,m.c=r(x(v(d.c),d.e,"0"),10,i,e),m.e=m.c.length),p=r(n,f,i,o?(s=F,e):(s=e,F)),c=l=p.length;0==p[--l];p.pop());if(!p[0])return s.charAt(0);if(y<0?--c:(d.c=p,d.e=c,d.s=a,d=t(d,m,g,b,i),p=d.c,h=d.r,c=d.e),u=c+g+1,y=p[u],l=i/2,h=h||u<0||null!=p[u+1],h=b<4?(null!=y||h)&&(0==b||b==(d.s<0?3:2)):y>l||y==l&&(4==b||h||6==b&&1&p[u-1]||b==(d.s<0?8:7)),u<1||!p[0])n=h?x(s.charAt(1),-g,s.charAt(0)):s.charAt(0);else{if(p.length=u,h)for(--i;++p[--u]>i;)p[u]=0,u||(++c,p=[1].concat(p));for(l=p.length;!p[--l];);for(y=0,n="";y<=l;n+=s.charAt(p[y++]));n=x(n,c,s.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,f,i,a,o=0,s=e.length,u=t%m,c=t/m|0;for(e=e.slice();s--;)i=e[s]%m,a=e[s]/m|0,n=c*i+a*u,f=u*i+n%m*m+o,o=(f/r|0)+(n/m|0)+c*a,e[s]=f%r;return o&&(e=[o].concat(e)),e}function t(e,t,r,n){var f,i;if(r!=n)i=r>n?1:-1;else for(f=i=0;ft[f]?1:-1;break}return i}function r(e,t,r,n){for(var f=0;r--;)e[r]-=f,f=e[r]1;e.splice(0,1));}return function(n,f,i,a,o){var u,c,d,p,m,y,g,v,w,_,T,E,x,M,A,k,P,C=n.s==f.s?1:-1,S=n.c,R=f.c;if(!S||!S[0]||!R||!R[0])return new K(n.s&&f.s&&(S?!R||S[0]!=R[0]:R)?S&&0==S[0]||!R?0*C:C/0:NaN);for(v=new K(C),w=v.c=[],c=n.e-f.e,C=i+c+1,o||(o=l,c=b(n.e/h)-b(f.e/h),C=C/h|0),d=0;R[d]==(S[d]||0);d++);if(R[d]>(S[d]||0)&&c--,C<0)w.push(1),p=!0;else{for(M=S.length,k=R.length,d=0,C+=2,m=s(o/(R[0]+1)),m>1&&(R=e(R,m,o),S=e(S,m,o),k=R.length,M=S.length),x=k,_=S.slice(0,k),T=_.length;T=o/2&&A++;do{if(m=0,u=t(R,_,k,T),u<0){if(E=_[0],k!=T&&(E=E*o+(_[1]||0)),m=s(E/A),m>1){m>=o&&(m=o-1),y=e(R,m,o),g=y.length,T=_.length;while(1==t(y,_,g,T))m--,r(y,k=10;C/=10,d++);U(v,i+(v.e=d+c*h-1)+1,a,p)}else v.e=c,v.r=+p;return v}}(),n=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,r=/^\.([^.]+)$/,n=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(i,a,o,s){var c,l=o?a:a.replace(f,"");if(n.test(l))i.s=isNaN(l)?null:l<0?-1:1,i.c=i.e=null;else{if(!o&&(l=l.replace(e,(function(e,t,r){return c="x"==(r=r.toLowerCase())?16:"b"==r?2:8,s&&s!=c?e:t})),s&&(c=s,l=l.replace(t,"$1").replace(r,"0.$1")),a!=l))return new K(l,c);if(K.DEBUG)throw Error(u+"Not a"+(s?" base "+s:"")+" number: "+a);i.c=i.e=i.s=null}}}(),f.absoluteValue=f.abs=function(){var e=new K(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return w(this,new K(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,n,f,i=this;if(null!=e)return _(e,0,y),null==t?t=A:_(t,0,8),U(new K(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((f=r.length-1)-b(this.e/h))*h,f=r[f])for(;f%10==0;f/=10,n--);return n<0&&(n=0),n},f.dividedBy=f.div=function(e,r){return t(this,new K(e,r),M,A)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new K(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,f,a,c,l,d,p,m,y=this;if(e=new K(e),e.c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+j(e));if(null!=t&&(t=new K(t)),l=e.e>14,!y.c||!y.c[0]||1==y.c[0]&&!y.e&&1==y.c.length||!e.c||!e.c[0])return m=new K(Math.pow(+j(y),l?2-T(e):+j(e))),t?m.mod(t):m;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new K(NaN);n=!d&&y.isInteger()&&t.isInteger(),n&&(y=y.mod(t))}else{if(e.e>9&&(y.e>0||y.e<-1||(0==y.e?y.c[0]>1||l&&y.c[1]>=24e7:y.c[0]<8e13||l&&y.c[0]<=9999975e7)))return a=y.s<0&&T(e)?-0:0,y.e>-1&&(a=1/a),new K(d?1/a:a);N&&(a=o(N/h+2))}for(l?(r=new K(.5),d&&(e.s=1),p=T(e)):(f=Math.abs(+j(e)),p=f%2),m=new K(i);;){if(p){if(m=m.times(y),!m.c)break;a?m.c.length>a&&(m.c.length=a):n&&(m=m.mod(t))}if(f){if(f=s(f/2),0===f)break;p=f%2}else if(e=e.times(r),U(e,e.e+1,1),e.e>14)p=T(e);else{if(f=+j(e),0===f)break;p=f%2}y=y.times(y),a?y.c&&y.c.length>a&&(y.c.length=a):n&&(y=y.mod(t))}return n?m:(d&&(m=i.div(m)),t?m.mod(t):a?U(m,N,A,c):m)},f.integerValue=function(e){var t=new K(this);return null==e?e=A:_(e,0,8),U(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===w(this,new K(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return w(this,new K(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=w(this,new K(e,t)))||0===t},f.isInteger=function(){return!!this.c&&b(this.e/h)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return w(this,new K(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=w(this,new K(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var r,n,f,i,a=this,o=a.s;if(e=new K(e,t),t=e.s,!o||!t)return new K(NaN);if(o!=t)return e.s=-t,a.plus(e);var s=a.e/h,u=e.e/h,c=a.c,d=e.c;if(!s||!u){if(!c||!d)return c?(e.s=-t,e):new K(d?a:NaN);if(!c[0]||!d[0])return d[0]?(e.s=-t,e):new K(c[0]?a:3==A?-0:0)}if(s=b(s),u=b(u),c=c.slice(),o=s-u){for((i=o<0)?(o=-o,f=c):(u=s,f=d),f.reverse(),t=o;t--;f.push(0));f.reverse()}else for(n=(i=(o=c.length)<(t=d.length))?o:t,o=t=0;t0)for(;t--;c[r++]=0);for(t=l-1;n>o;){if(c[--n]=0;){for(r=0,p=E[f]%w,y=E[f]/w|0,a=s,i=f+a;i>f;)u=T[--a]%w,c=T[a]/w|0,o=y*u+c*p,u=p*u+o%w*w+g[i]+r,r=(u/v|0)+(o/w|0)+y*c,g[i--]=u%v;g[i]=r}return r?++n:g.splice(0,1),B(e,g,n)},f.negated=function(){var e=new K(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,f=n.s;if(e=new K(e,t),t=e.s,!f||!t)return new K(NaN);if(f!=t)return e.s=-t,n.minus(e);var i=n.e/h,a=e.e/h,o=n.c,s=e.c;if(!i||!a){if(!o||!s)return new K(f/0);if(!o[0]||!s[0])return s[0]?e:new K(o[0]?n:0*f)}if(i=b(i),a=b(a),o=o.slice(),f=i-a){for(f>0?(a=i,r=s):(f=-f,r=o),r.reverse();f--;r.push(0));r.reverse()}for(f=o.length,t=s.length,f-t<0&&(r=s,s=o,o=r,t=f),f=0;t;)f=(o[--t]=o[t]+s[t]+f)/l|0,o[t]=l===o[t]?0:o[t]%l;return f&&(o=[f].concat(o),++a),B(e,o,a)},f.precision=f.sd=function(e,t){var r,n,f,i=this;if(null!=e&&e!==!!e)return _(e,1,y),null==t?t=A:_(t,0,8),U(new K(i),e,t);if(!(r=i.c))return null;if(f=r.length-1,n=f*h+1,f=r[f]){for(;f%10==0;f/=10,n--);for(f=r[0];f>=10;f/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},f.shiftedBy=function(e){return _(e,-d,d),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,r,n,f,i,a=this,o=a.c,s=a.s,u=a.e,c=M+4,l=new K("0.5");if(1!==s||!o||!o[0])return new K(!s||s<0&&(!o||o[0])?NaN:o?a:1/0);if(s=Math.sqrt(+j(a)),0==s||s==1/0?(r=v(o),(r.length+u)%2==0&&(r+="0"),s=Math.sqrt(+r),u=b((u+1)/2)-(u<0||u%2),s==1/0?r="1e"+u:(r=s.toExponential(),r=r.slice(0,r.indexOf("e")+1)+u),n=new K(r)):n=new K(s+""),n.c[0])for(u=n.e,s=u+c,s<3&&(s=0);;)if(i=n,n=l.times(i.plus(t(a,i,c,1))),v(i.c).slice(0,s)===(r=v(n.c)).slice(0,s)){if(n.e0&&m>0){for(i=m%o||o,l=p.substr(0,i);i0&&(l+=c+p.slice(i)),d&&(l="-"+l)}n=h?l+(r.decimalSeparator||"")+((s=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):l}return(r.prefix||"")+n+(r.suffix||"")},f.toFraction=function(e){var r,n,f,a,o,s,c,l,d,m,y,g,b=this,w=b.c;if(null!=e&&(c=new K(e),!c.isInteger()&&(c.c||1!==c.s)||c.lt(i)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+j(c));if(!w)return new K(b);for(r=new K(i),d=n=new K(i),f=l=new K(i),g=v(w),o=r.e=g.length-b.e-1,r.c[0]=p[(s=o%h)<0?h+s:s],e=!e||c.comparedTo(r)>0?o>0?r:d:c,s=S,S=1/0,c=new K(g),l.c[0]=0;;){if(m=t(c,r,0,1),a=n.plus(m.times(f)),1==a.comparedTo(e))break;n=f,f=a,d=l.plus(m.times(a=d)),l=a,r=c.minus(m.times(a=r)),c=a}return a=t(e.minus(n),f,0,1),l=l.plus(a.times(d)),n=n.plus(a.times(f)),l.s=d.s=b.s,o*=2,y=t(d,f,o,A).minus(b).abs().comparedTo(t(l,n,o,A).minus(b).abs())<1?[d,f]:[l,n],S=s,y},f.toNumber=function(){return+j(this)},f.toPrecision=function(e,t){return null!=e&&_(e,1,y),O(this,e,t,2)},f.toString=function(e){var t,n=this,f=n.s,i=n.e;return null===i?f?(t="Infinity",f<0&&(t="-"+t)):t="NaN":(null==e?t=i<=k||i>=P?E(v(n.c),i):x(v(n.c),i,"0"):10===e?(n=U(new K(n),M+i+1,A),t=x(v(n.c),n.e,"0")):(_(e,2,F.length,"Base"),t=r(x(v(n.c),i,"0"),10,e,f,!0)),f<0&&n.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return j(this)},f._isBigNumber=!0,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf),null!=e&&K.set(e),K}function b(e){var t=0|e;return e>0||e===t?t:t-1}function v(e){for(var t,r,n=1,f=e.length,i=e[0]+"";nu^r?1:-1;for(o=(s=f.length)<(u=i.length)?s:u,a=0;ai[a]^r?1:-1;return s==u?0:s>u^r?1:-1}function _(e,t,r,n){if(er||e!==(e<0?o(e):s(e)))throw Error(u+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function T(e){var t=e.c.length-1;return b(e.e/h)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function x(e,t,r){var n,f;if(t<0){for(f=r+".";++t;f+=r);e=f+e}else if(n=e.length,++t>n){for(f=r,t-=n;--t;f+=r);e+=f}else t1))throw new Error("The randomisation factor must be between 0 and 1.");this.randomisationFactor_=e.randomisationFactor||0}f.prototype.getMaxDelay=function(){return this.maxDelay_},f.prototype.getInitialDelay=function(){return this.initialDelay_},f.prototype.next=function(){var e=this.next_(),t=1+Math.random()*this.randomisationFactor_,r=Math.round(e*t);return r},f.prototype.next_=function(){throw new Error("BackoffStrategy.next_() unimplemented.")},f.prototype.reset=function(){this.reset_()},f.prototype.reset_=function(){throw new Error("BackoffStrategy.reset_() unimplemented.")},e.exports=f},"91dd6":function(e,t,r){const n=r("19b5").isValidRole,f=r("19b5").isValidPublicKey;class i{constructor(e,t,r){this.address=e,this.keyForUpdate=a(t,r)}fillUpdateObject(e){delete e.key,Object.assign(e,this.keyForUpdate)}}function a(e,t){const r={};if("string"===typeof e){if(t)throw new Error("Failed to keyFormatter for AccountForUpdate: AccountKeyPublic/legacyKey/failKey cannot have options");switch(e){case"legacyKey":r.legacyKey=!0;break;case"failKey":r.failKey=!0;break;default:if(!f(e))throw new Error("Invalid public key");r.publicKey=e;break}}else if(Array.isArray(e)){if(!t||!t.threshold||!t.weight)throw new Error("For AccountKeyMultiSig, threshold and weight should be defined in options object.");if(!Array.isArray(t.weight))throw new Error("The weight should be defined as a array.");if(t.weight.length!==e.length)throw new Error("The length of keys in AccountKeyMultiSig and the length of weight array do not match.");r.multisig={threshold:t.threshold,keys:[]};let n=0;for(let i=0;iasync function*(){const t=/\r?\n/,r=new TextDecoder("utf8");let n="";for await(let f of e){"string"===typeof f&&(f=(new TextEncoder).encode(f)),n+=r.decode(f,{stream:!0});const e=n.split(t);n=e.pop();for(let t=0;t=t&&n<=r?n-t+10:e})).join("")},o=function(e){let t,r=e;while(r.length>2)t=r.slice(0,9),r=parseInt(t,10)%97+r.slice(t.length);return parseInt(r,10)%97},s=function(e){this._iban=e};s.toAddress=function(e){if(e=new s(e),!e.isDirect())throw new Error("IBAN is indirect and can't be converted");return e.toAddress()},s.toIban=function(e){return s.fromAddress(e).toString()},s.fromAddress=function(e){if(!f.isAddress(e))throw new Error("Provided address is not a valid address: "+e);e=e.replace("0x","").replace("0X","");const t=new n(e,16),r=t.toString(36),a=i(r,15);return s.fromBban(a.toUpperCase())},s.fromBban=function(e){const t="XE",r=o(a(`${t}00${e}`)),n=("0"+(98-r)).slice(-2);return new s(t+n+e)},s.createIndirect=function(e){return s.fromBban(`ETH${e.institution}${e.identifier}`)},s.isValid=function(e){const t=new s(e);return t.isValid()},s.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===o(a(this._iban))},s.prototype.isDirect=function(){return 34===this._iban.length||35===this._iban.length},s.prototype.isIndirect=function(){return 20===this._iban.length},s.prototype.checksum=function(){return this._iban.substr(2,2)},s.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},s.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},s.prototype.toAddress=function(){if(this.isDirect()){const e=this._iban.substr(4),t=new n(e,36);return f.toChecksumAddress(t.toString(16,20))}return""},s.prototype.toString=function(){return this._iban},e.exports=s},"921e":function(e,t,r){const n=r("19eb"),f=r("ba9f").rpc,i=r("379f"),a=function(...e){const t=this;n.packageInit(this,e);const r=[f.net.getId,f.net.isListening,f.net.getPeerCount,f.net.peerCountByType];r.forEach((function(e){e=new i(e),e.attachToObject(t),e.setRequestManager(t._requestManager)}))};e.exports=a},9222:function(e,t,r){"use strict";const n=r("1018"),{Buffer:f}=r("b639"),i=r("e478");e.exports=function(e){if(e[Symbol.iterator]){const t=f.from(e);return Object.assign(async function*(){yield t}(),{length:t.length})}if("undefined"!==typeof Blob&&e instanceof Blob)return Object.assign(i(e),{length:e.size});if(e[Symbol.asyncIterator])return async function*(){for await(const t of e)yield f.from(t)}();if("function"===typeof e)return n(e);throw new Error("Unexpected input: "+typeof e)}},"923c":function(e,t,r){(function(t){const n=r("2ef0"),f=r("d968"),i=r("8e7f"),a=r("a6b6"),o=r("fee1"),s=r("f3a4"),u=r("19d7"),c=r("e240"),l=r("3337"),h=new l.ec("secp256k1"),d={"0x20":"ACCOUNT_UPDATE","0x21":"FEE_DELEGATED_ACCOUNT_UPDATE","0x22":"FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO","0x08":"VALUE_TRANSFER","0x10":"VALUE_TRANSFER_MEMO","0x09":"FEE_DELEGATED_VALUE_TRANSFER","0x0a":"FEE_DELEGATED_VALUE_TRANSFER_WITH_RATIO","0x11":"FEE_DELEGATED_VALUE_TRANSFER_MEMO","0x12":"FEE_DELEGATED_VALUE_TRANSFER_MEMO_WITH_RATIO","0x28":"SMART_CONTRACT_DEPLOY","0x29":"FEE_DELEGATED_SMART_CONTRACT_DEPLOY","0x2a":"FEE_DELEGATED_SMART_CONTRACT_DEPLOY_WITH_RATIO","0x30":"SMART_CONTRACT_EXECUTION","0x31":"FEE_DELEGATED_SMART_CONTRACT_EXECUTION","0x32":"FEE_DELEGATED_SMART_CONTRACT_EXECUTION_WITH_RATIO","0x38":"CANCEL","0x39":"FEE_DELEGATED_CANCEL","0x3a":"FEE_DELEGATED_CANCEL_WITH_RATIO","0x48":"CHAIN_DATA_ANCHORING"},p=66,m=function(e){return f.isBN(e)},y=function(e){return i.isBigNumber(e)};function g(e){try{return a.apply(null,arguments)}catch(t){throw new Error(`${t} Given value: "${e}"`)}}const b=function(e){return"0x"+g(e).toTwos(256).toString(16,64)},v=function(e){return!!/^(0x)?[0-9a-f]{40}$/i.test(e)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(e)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(e))||w(e))},w=function(e){e=e.replace(/^0x/i,"");const t=q(e.toLowerCase()).replace(/^0x/i,"");for(let r=0;r<40;r++)if(parseInt(t[r],16)>7&&e[r].toUpperCase()!==e[r]||parseInt(t[r],16)<=7&&e[r].toLowerCase()!==e[r])return!1;return!0},_=function(e,t,r){const n=/^0x/i.test(e)||"number"===typeof e;e=e.toString(16).replace(/^0x/i,"");const f=t-e.length+1>=0?t-e.length+1:0;return(n?"0x":"")+new Array(f).join(r||"0")+e},T=function(e,t,r){const n=/^0x/i.test(e)||"number"===typeof e;e=e.toString(16).replace(/^0x/i,"");const f=t-e.length+1>=0?t-e.length+1:0;return(n?"0x":"")+e+new Array(f).join(r||"0")},E=function(e){e=o.encode(e);let t="";e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join(""),e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join("");for(let r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return"0x"+t.join("")},C=function(e){if(e=e.toString(16),!L(e))throw new Error(`Given value "${e}" is not a valid hex string.`);e=e.replace(/^0x/i,"");const t=[];for(let r=0;rO(e),O=e=>new RegExp(`^(0x|0X)?[0-9a-fA-F]{${p-2}}$`).test(e),D=e=>B(e),B=e=>new RegExp(`^(0x|0X)[0-9a-fA-F]{${p-2}}$`).test(e),U=function(e){return!!/^(0x)?[0-9a-f]{512}$/i.test(e)&&!(!/^(0x)?[0-9a-f]{512}$/.test(e)&&!/^(0x)?[0-9A-F]{512}$/.test(e))},j=function(e){return!!/^(0x)?[0-9a-f]{64}$/i.test(e)&&!(!/^(0x)?[0-9a-f]{64}$/.test(e)&&!/^(0x)?[0-9A-F]{64}$/.test(e))},V=e=>{switch(e){case"genesis":case"earliest":return"0x0";default:return e}},H=function(e){return"latest"===e||"pending"===e||"earliest"===e||"genesis"===e},G=e=>H(e)||L(e)||Number.isFinite(Number(e)),W="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",q=function(e){if("number"===typeof e)return null;L(e)&&/^0x/i.test(e.toString())&&(e=C(e)),m(e)&&(e=e.toString(10));const t=s.keccak256(e);return t===W?null:t};function Y(e){if("string"!==typeof e)throw new Error("The private key must be of type string");const t="0x"===e.slice(0,2);if(e=t?e.slice(2):e,110!==e.length&&64!==e.length)throw new Error(`Invalid private key(${e})`);const r=e.slice(0,64);if(!F(r))throw new Error("Invalid private key format : privateKey must be in hex format.");if(110!==e.length)return{privateKey:"0x"+e,address:"",isHumanReadable:!1};if(!z(e))throw new Error("Invalid KlaytnWalletKey format.");const n=e.slice(66,68);if("01"===n)throw new Error("HumanReadableAddress is not supported yet.");const f=e.slice(68);return{privateKey:"0x"+r,address:f,isHumanReadable:!1}}function $(e){if(!z(e))throw new Error("Invalid KlaytnWalletKey format: "+e);const t=e.startsWith("0x")?e.slice(2):e,r=t.split("0x");return["0x"+r[0],"0x"+r[1],"0x"+r[2]]}q._Hash=s;const z=e=>{if(!n.isString(e))return!1;const t="0x"===e.slice(0,2);if(e=t?e.slice(2):e,110!==e.length)return!1;const r=e.split("0x");if(3!==r.length)return!1;for(let n=0;nu.encode(e),Q=e=>u.decode(e),ee=e=>{let t=e;if(oe(t)&&(t=ue(e)),t=t.replace("0x",""),130===t.length&&"04"===t.slice(0,2)&&(t=t.slice(2)),128!==t.length)throw Error("Invalid public key");const r="0x"+t.slice(0,64).replace(/^0+/,""),n="0x"+t.slice(64).replace(/^0+/,"");return[r,n]},te=function(e){while(e&&e.startsWith("0x0"))e="0x"+e.slice(3);return e},re=function(e){return e.length%2===1&&(e=e.replace("0x","0x0")),e},ne=e=>{if(n.isArray(e)){const[t,r,n]=e;return[t,r,n]}if(n.isObject(e)){const t=e.V||e.v,r=e.R||e.r,n=e.S||e.s;if(!t||!r||!n)throw new Error("v, r, s fields should exist in signature");return[t,r,n]}if(n.isString(e)){const t="0x"+e.slice(130),r=c.decodeSignature(e);return[t,r[1],r[2]]}},fe=e=>{let t=!1;if(!e)throw new Error("Failed to transform signatures to object: invalid signatures "+e);if(n.isArray(e)){if(n.isString(e[0])){const r=e[0].replace("0x","");r.length<=64&&(e=[e],t=!0)}}else e=[e],t=!0;const r=[];for(const f of e){const e={};if(n.isArray(f)){if(3!==f.length)throw new Error(`Failed to transform signatures to object: invalid length of signature (${f.length})`);if(he(f))continue;const[t,r,n]=f;e.V=t,e.R=r,e.S=n}else if(n.isString(f)){const t=c.decodeSignature(f).map(e=>re(te(e)));e.V=t[0],e.R=t[1],e.S=t[2]}else{if(!n.isObject(f))throw new Error("Unsupported signature type: "+typeof f);Object.keys(f).map(t=>{if("v"===t||"V"===t||"_v"===t)e.V=f[t];else if("r"===t||"R"===t||"_r"===t)e.R=f[t];else{if("s"!==t&&"S"!==t&&"_s"!==t)throw new Error(`Failed to transform signatures to object: invalid key(${t}) is defined in signature object.`);e.S=f[t]}})}if(!e.V||!e.R||!e.S)throw new Error("Failed to transform signatures to object: invalid signature "+f);Object.keys(e).map(t=>{e[t]=te(e[t])}),r.push(e)}return t?r[0]:r},ie=e=>{if("string"!==typeof e)throw new Error("Invalid raw Tx",e);const t=e.slice(0,4),r=d[t];return r},ae=e=>{let t=e.replace("0x","");if(130===t.length&&"04"===t.slice(0,2)&&(t=t.slice(2)),66!==t.length&&128!==t.length)return!1;if(66===t.length&&!oe(t))return!1;66===t.length&&(t=ue(t));const r=ee(t);if(void 0===r||!r.length||2!==r.length)return!1;const n=h.curve.point(r[0].slice(2),r[1].slice(2),!0);return h.keyFromPublic(n).validate().result},oe=e=>{const t=["02","03"],r=e.replace("0x","");return 66===r.length&&t.includes(r.slice(0,2))},se=e=>{const t=oe(e);if(t)return e;const r=ee(e);if(void 0===r||!r.length||2!==r.length)throw new Error("invalid public key");const[n,f]=r,i=h.keyPair({pub:{x:n.replace("0x",""),y:f.replace("0x","")},pubEnc:"hex"}),a="0x"+i.getPublic(!0,"hex");return a},ue=e=>{if(!oe(e)){if(!ae(e))throw new Error("Invalid public key");return e}const t=e.replace("0x",""),r=h.curve,n=r.decodePoint(t,"hex"),f=n.encode("hex").slice(2);return"0x"+f},ce=e=>{if(e.type){if(e.type.includes("SMART_CONTRACT_DEPLOY")||e.type.includes("SmartContractDeploy"))return!0;if("LEGACY"!==e.type&&"TxTypeLegacyTransaction"!==e.type)return!1}return!(!e.data||"0x"===e.data||e.to&&"0x"!==e.to)},le=e=>{switch(e){case"roleTransactionKey":case"roleAccountUpdateKey":case"roleFeePayerKey":case"transactionKey":case"updateKey":case"feePayerKey":return!0}return!1},he=e=>{let t=e;n.isArray(e)||(t=ne(t)),n.isString(t[0])&&(t=[t]);for(let r of t){if(n.isArray(r)||(r=ne(r)),3!==r.length)throw new Error("Invalid signatures length: "+r.length);if("0x01"!==r[0]||"0x"!==r[1]||"0x"!==r[2])return!1}return!0},de=e=>{const r=L(e)?C(e):e,n=t.from(r),f="Klaytn Signed Message:\n"+r.length,i=t.from(f),a=t.concat([i,n]);return s.keccak256(a)},pe=(e,r,f=!1)=>{f||(e=de(e)),n.isArray(r)&&(r={v:r[0],r:r[1],s:r[2]});const i={v:parseInt(r.v.slice(2),16),r:r.r.slice(2),s:r.s.slice(2)},a=h.recoverPubKey(t.from(e.slice(2),"hex"),i,i.v<2?i.v:1-i.v%2);return"0x"+a.encode("hex",!1).slice(2)},me=(e,t,r=!1)=>(r||(e=de(e)),c.recover(e,c.encodeSignature(ne(t))).toLowerCase()),ye=e=>{e="0x"===e.slice(0,2)?e:"0x"+e,oe(e)&&(e=ue(e));const t=s.keccak256(e),r="0x"+t.slice(-40),n=s.keccak256s(r.slice(2));let f="0x";for(let i=0;i<40;i++)f+=parseInt(n[i+2],16)>7?r[i+2].toUpperCase():r[i+2];return f};e.exports={BN:f,isBN:m,isBigNumber:y,toBN:g,isAddress:v,isBloom:U,isTopic:j,checkAddressChecksum:w,utf8ToHex:E,hexToUtf8:x,hexToNumber:M,hexToNumberString:A,numberToHex:k,toHex:S,bufferToHex:R,toBuffer:I,numberToBuffer:N,hexToBytes:C,bytesToHex:P,isHex:F,isHexStrict:L,leftPad:_,rightPad:T,toTwosComplement:b,sha3:q,parsePredefinedBlockNumber:V,isPredefinedBlockNumber:H,isValidBlockNumberCandidate:G,isValidPrivateKey:Z,isValidNSHSN:J,parsePrivateKey:Y,parseKlaytnWalletKey:$,isKlaytnWalletKey:z,isContractDeployment:ce,rlpEncode:X,rlpDecode:Q,xyPointFromPublicKey:ee,resolveSignature:ne,transformSignaturesToObject:fe,getTxTypeStringFromRawTransaction:ie,trimLeadingZero:te,makeEven:re,txTypeToString:d,isValidPublicKey:ae,isCompressedPublicKey:oe,compressPublicKey:se,decompressPublicKey:ue,isTxHash:K,isTxHashStrict:D,isValidHash:O,isValidHashStrict:B,isValidRole:le,isEmptySig:he,hashMessage:de,recover:me,recoverPublicKey:pe,publicKeyToAddress:ye}}).call(this,r("b639").Buffer)},"92c9":function(e,t,r){const n=r("19b5"),f=r("cf45"),{KEY_ROLE:i}=r("fc77"),a=r("1a84"),{validateForSigning:o,validateIndexWithKeys:s,encryptKey:u,formatEncrypted:c}=r("fc77");class l{constructor(e,t){this.address=e,this.key=t}get address(){return this._address}set address(e){if(!n.isAddress(e))throw new Error("Invalid address : "+e);this._address=n.addHexPrefix(e).toLowerCase()}get key(){return this._key}set key(e){this._key=null!==e?e instanceof f?e:new f(e):null}getPublicKey(e=!1){return this.key.getPublicKey(e)}copy(){return new l(this.address,this.key)}sign(e,t,r,n){o(e,t);const f=this.getKeyByRole(r);return void 0!==n?(s(n,1),f.sign(e,t)):[f.sign(e,t)]}signMessage(e,t,r){if(void 0===t)throw new Error("role should be defined for signMessage. Please use 'caver.wallet.keyring.role'.");const f=n.hashMessage(e),i=this.getKeyByRole(t),a=[];return void 0!==r&&s(r,1),a.push(i.signMessage(f)),{messageHash:f,signatures:a,message:e}}getKeyByRole(e){if(void 0===e)throw new Error("role should be defined.");if(e>=i.roleLast||e<0)throw new Error("Invalid role number: "+e);return this.key}getKlaytnWalletKey(){return`${this.key.privateKey}0x00${this.address}`}toAccount(){if(!this.key)throw new Error("Failed to create Account instance: Empty key in keyring.");const e=this.getPublicKey();return a.createWithAccountKeyPublic(this.address,e)}encrypt(e,t={}){let r=[];return r=u(this.key,e,t),c(4,this.address,r,t)}encryptV3(e,t){t=t||{};const r=u(this.key,e,t)[0];return c(3,this.address,r,t)}isDecoupled(){return this.address.toLowerCase()!==this.key.getDerivedAddress().toLowerCase()}}e.exports=l},"92dc":function(e,t,r){"use strict";(function(e){const n=r("9222");t.toFormData=async(t,r)=>{r=n(r);const f=new FormData,i=[];for await(const n of r)i.push(e.isBuffer(n)?n.buffer:n);return f.append("file",new Blob(i,{type:"application/octet-stream"})),f}}).call(this,r("b639").Buffer)},"93f2":function(e,t,r){"use strict";(function(e){var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(t,"__esModule",{value:!0});var f=n(r("2330"));function i(e){return f.privateKeyVerify(e)}function a(t,r){return void 0===r&&(r=!0),e.from(f.publicKeyCreate(t,r))}function o(e){return f.publicKeyVerify(e)}function s(t,r){return void 0===r&&(r=!0),e.from(f.publicKeyConvert(t,r))}function u(t,r){return e.from(f.privateKeyTweakAdd(e.from(t),r))}function c(t,r,n){return void 0===n&&(n=!0),e.from(f.publicKeyTweakAdd(e.from(t),r,n))}function l(t,r){var n=f.ecdsaSign(t,r);return{signature:e.from(n.signature),recovery:n.recid}}function h(e,t,r){return f.ecdsaVerify(t,e,r)}t.privateKeyVerify=i,t.publicKeyCreate=a,t.publicKeyVerify=o,t.publicKeyConvert=s,t.privateKeyTweakAdd=u,t.publicKeyTweakAdd=c,t.sign=l,t.verify=h}).call(this,r("b639").Buffer)},9523:function(e,t){function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}e.exports=r,e.exports["default"]=e.exports,e.exports.__esModule=!0},"960e":function(e,t){function r(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}r.keys=function(){return[]},r.resolve=r,e.exports=r,r.id="960e"},9661:function(e,t,r){"use strict";const n=r("5beb"),{Buffer:f}=r("b639");t.concatify=e=>async(...t)=>{const r=[];for await(const n of e(...t))r.push(n);return f.concat(r)},t.collectify=e=>async(...t)=>{const r=[];for await(const n of e(...t))r.push(n);return r},t.pullify={source:e=>(...t)=>n(e(...t)),transform:e=>(...t)=>n.transform(r=>e(r,...t))}},"96ed":function(e,t,r){"use strict";const n=r("1eca"),{ok:f,toIterable:i}=r("7872");e.exports=n(({fetch:e,apiUrl:t,apiPath:n,headers:a})=>{const o=r("a406")({fetch:e,apiUrl:t,apiPath:n,headers:a});return(t,r)=>async function*(){r=r||{};const n=await f(e(t,{signal:r.signal,headers:r.headers||a})),s={path:decodeURIComponent(new URL(t).pathname.split("/").pop()||""),content:i(n.body)};for await(const e of o(s,r))yield e}()})},"970b":function(e,t){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}e.exports=r,e.exports["default"]=e.exports,e.exports.__esModule=!0},9976:function(e,t,r){const n=r("19eb"),f=r("379f"),i=r("19b5"),a=r("921e"),o=r("4695").formatters,s=r("ba9f").rpc,u=function(...e){const t=this;n.packageInit(this,e),this.net=new a(this);let r=null,u="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return r},set:function(e){return e&&(r=i.toChecksumAddress(o.inputAddressFormatter(e))),c.forEach((function(e){e.defaultAccount=r})),e},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return u},set:function(e){if(!i.isValidBlockNumberCandidate(e))throw new Error("Invalid default block number.");return u=e,c.forEach((function(e){e.defaultBlock=u})),e},enumerable:!0});const c=[s.personal.getAccounts,s.personal.newAccount,s.personal.unlockAccount,s.personal.lockAccount,s.personal.importRawKey,s.personal.sendTransaction,s.personal.signTransaction,s.personal.sign,s.personal.ecRecover,s.personal.replaceRawKey,s.personal.sendValueTransfer,s.personal.sendAccountUpdate];c.forEach((function(e){e=new f(e),e.attachToObject(t),e.setRequestManager(t._requestManager),e.defaultBlock=t.defaultBlock,e.defaultAccount=t.defaultAccount}))};e.exports=u},"9bc81":function(e){e.exports=JSON.parse('{"contractName":"IERC20","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]}')},"9cc1":function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r("93f2"))},"9cca":function(e,t,r){const n=r("2ef0"),f=r("19eb"),i=r("379f"),a=r("19b5"),o=r("03fb").subscription,s=r("6a9e"),u=r("4bac"),c=r("b47d"),l=r("ab51"),h=r("d287"),d=r("d9ea"),p=r("10f2"),{formatters:m}=r("4695"),{errors:y}=r("4695"),g=r("c8cf1"),b=function e(t,r,i){const o=this,s=Array.prototype.slice.call(arguments);if(!(this instanceof e))throw new Error('Please use the "new" keyword to instantiate a caver.contract() or caver.klay.Contract() object!');if(f.packageInit(this,[this.constructor.currentProvider]),this.clearSubscriptions=this._requestManager.clearSubscriptions,!t||!Array.isArray(t))throw new Error("You must provide the json interface of the contract when instantiating a contract object.");this.options={};const u=s[s.length-1];n.isObject(u)&&!n.isArray(u)&&(i=u,this.options=n.extend(this.options,this._getOrSetDefaultOptions(i)),n.isObject(r)&&(r=null)),Object.defineProperty(this,"defaultSendOptions",{get(){return o.options}}),Object.defineProperty(this.options,"address",{set(e){e&&(o._address=a.toChecksumAddress(m.inputAddressFormatter(e)))},get(){return o._address},enumerable:!0}),Object.defineProperty(this.options,"jsonInterface",{set(e){return o.methods={},o.events={},o._jsonInterface=e.map((function(e){let t,r;if(e.name&&(r=a._jsonInterfaceMethodToString(e)),"function"===e.type){if(e.signature=g.encodeFunctionSignature(r),t=o._createTxObject.bind({method:e,parent:o}),o.methods[e.name]){const t=o._createTxObject.bind({method:e,parent:o,nextMethod:o.methods[e.name]});o.methods[e.name]=t}else o.methods[e.name]=t;o.methods[e.signature]=t,o.methods[r]=t}else if("event"===e.type){e.signature=g.encodeEventSignature(r);const t=o._on.bind(o,e.signature);o.events[e.name]&&"bound "!==o.events[e.name].name||(o.events[e.name]=t),o.events[e.signature]=t,o.events[r]=t}const f=n.find(o._jsonInterface,(function(e){return"constructor"===e.type}))||{type:"constructor"};f.signature="constructor";const i=o._createTxObject.bind({method:f,parent:o});return o.methods[f.signature]=i,e})),o.events.allEvents=o._on.bind(o,"allevents"),o._jsonInterface},get(){return o._jsonInterface},enumerable:!0});let{defaultAccount:c}=this.constructor,l=this.constructor.defaultBlock||"latest";Object.defineProperty(this,"defaultAccount",{get(){return c},set(e){return e&&(c=a.toChecksumAddress(m.inputAddressFormatter(e))),e},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get(){return l},set(e){if(!a.isValidBlockNumberCandidate(e))throw new Error("Invalid default block number.");return l=e,e},enumerable:!0}),Object.defineProperty(this.options,"from",{set(e){e&&(o._from=a.toChecksumAddress(m.inputAddressFormatter(e)))},get(){return o._from},enumerable:!0}),Object.defineProperty(this.options,"feePayer",{set(e){e&&(o._feePayer=a.toChecksumAddress(m.inputAddressFormatter(e)))},get(){return o._feePayer},enumerable:!0}),Object.defineProperty(this.options,"feeDelegation",{set(e){void 0!==e&&(o._feeDelegation=e)},get(){return o._feeDelegation},enumerable:!0}),Object.defineProperty(this.options,"feeRatio",{set(e){if(void 0!==e){if(!n.isNumber(e)&&!a.isHex(e))throw new Error("Invalid type fo feeRatio: feeRatio should be number type or hex number string.");if(a.hexToNumber(e)<=0||a.hexToNumber(e)>=100)throw new Error("Invalid feeRatio: feeRatio is out of range. [1, 99]");o._feeRatio=a.numberToHex(e)}},get(){return o._feeRatio},enumerable:!0}),Object.defineProperty(this.options,"gasPrice",{set(e){if(e){if(!a.isValidNSHSN(e))throw y.invalidGasPrice();o._gasPrice=e}},get(){return o._gasPrice},enumerable:!0}),Object.defineProperty(this.options,"gas",{set(e){if(e){if(!a.isValidNSHSN(e))throw y.invalidGasLimit();o._gas=e}},get(){return o._gas},enumerable:!0}),Object.defineProperty(this.options,"data",{set(e){if(e){if(!a.isHexStrict(e))throw y.invalidData();o._data=e}},get(){return o._data},enumerable:!0}),this.methods={},this.events={},this._address=null,this._jsonInterface=[],this.options.address=r,this.options.jsonInterface=t};function v(e,t,r,f){const i=Object.assign({},e.options);if(i.value=i.value||0,!a.isAddress(i.from))return a._fireError(new Error('No "from" address specified in neither the given options, nor the default options.'),f.eventEmitter,f.reject,e.callback);if(n.isBoolean(t.payable)&&!t.payable&&i.value&&i.value>0)return a._fireError(new Error("Can not send value to non-payable contract method or constructor"),f.eventEmitter,f.reject,e.callback);if(i.feeDelegation){if(("signAsFeePayer"===e.type||"send"===e.type&&i.feePayer)&&!a.isAddress(i.feePayer))return a._fireError(new Error("Invalid fee payer: "+i.feePayer),f.eventEmitter,f.reject,e.callback)}else{if("signAsFeePayer"===e.type)return a._fireError(new Error("feeDelegation field should be defined as 'true' to sign as a fee payer"),f.eventEmitter,f.reject,e.callback);if(void 0!==i.feeRatio)return a._fireError(new Error("feeDelegation field should be defined as 'true' to use feeRatio"),f.eventEmitter,f.reject,e.callback);if(i.feePayer)return a._fireError(new Error("feeDelegation field should be defined as 'true' to use feePayer"),f.eventEmitter,f.reject,e.callback)}let o;return o=void 0!==r?i.feeDelegation?void 0!==i.feeRatio?new h(i):new c(i):new s(i):i.feeDelegation?void 0!==i.feeRatio?new d(i):new l(i):new u(i),o}b.create=function(e,t,r){return new b(e,t,r)},b.setProvider=function(e,t){f.packageInit(this,[e]),this._klayAccounts=t},b.prototype.setKeyrings=function(e){if(!(e instanceof p))throw new Error("keyrings should be an instance of 'KeyringContainer'");this._keyrings=e},b.prototype.setWallet=function(e){this._wallet=e},b.prototype.addAccounts=function(e){this._klayAccounts=e},b.prototype._getCallback=function(e){if(e&&n.isFunction(e[e.length-1]))return e.pop()},b.prototype._checkListener=function(e,t){if(t===e)throw new Error(`The event "${e}" is a reserved event name, you can't use it.`)},b.prototype._getOrSetDefaultOptions=function(e){const t=e.gasPrice?String(e.gasPrice):null,r=e.from?a.toChecksumAddress(m.inputAddressFormatter(e.from)):null;e.data=e.data||this.options.data,e.from=r||this.options.from,e.gasPrice=t||this.options.gasPrice;const n=e.feePayer?a.toChecksumAddress(m.inputAddressFormatter(e.feePayer)):null,f=e.feeRatio?e.feeRatio:null,i=void 0!==e.feeDelegation?e.feeDelegation:null;return e.feePayer=n||this.options.feePayer,e.feeRatio=f||this.options.feeRatio,e.feeDelegation=i||this.options.feeDelegation,"undefined"===typeof e.gas&&(e.gas=e.gasLimit||this.options.gas),delete e.gasLimit,e},b.prototype._encodeEventABI=function(e,t){t=t||{};const r=t.filter||{},f={};if(["fromBlock","toBlock"].filter((function(e){return void 0!==t[e]})).forEach((function(e){f[e]=m.inputBlockNumberFormatter(t[e])})),n.isArray(t.topics))f.topics=t.topics;else{if(f.topics=[],e&&!e.anonymous&&"ALLEVENTS"!==e.name&&f.topics.push(e.signature),"ALLEVENTS"!==e.name){const t=e.inputs.filter(e=>!0===e.indexed).map(e=>{const t=r[e.name];return t?n.isArray(t)?t.map(t=>g.encodeParameter(e.type,t)):g.encodeParameter(e.type,t):null});f.topics=f.topics.concat(t)}f.topics.length||delete f.topics}return this.options.address&&(f.address=this.options.address.toLowerCase()),f},b.prototype._decodeEventABI=function(e){let t=this;e.data=e.data||"",e.topics=e.topics||[];const r=m.outputLogFormatter(e);"ALLEVENTS"===t.name&&(t=t.jsonInterface.find((function(t){return t.signature===e.topics[0]}))||{anonymous:!0}),t.inputs=t.inputs||[];const n=t.anonymous?e.topics:e.topics.slice(1);return r.returnValues=g.decodeLog(t.inputs,e.data,n),delete r.returnValues.__length__,r.event=t.name,r.signature=t.anonymous||!e.topics[0]?null:e.topics[0],r.raw={data:r.data,topics:r.topics},delete r.data,delete r.topics,r},b.prototype._encodeMethodABI=function(){const e=this._method.signature,t=this.arguments||[];let r=!1;const f=this._parent.options.jsonInterface.filter((function(t){return"constructor"===e&&t.type===e||(t.signature===e||t.signature===e.replace("0x","")||t.name===e)&&"function"===t.type})).map((function(e){const f=n.isArray(e.inputs)?e.inputs.length:0;if(f!==t.length)throw new Error(`The number of arguments is not matching the methods required number. You need to pass ${f} arguments.`);return"function"===e.type&&(r=e.signature),n.isArray(e.inputs)?e.inputs:[]})).map((function(e){return g.encodeParameters(e,t).replace("0x","")}))[0]||"";if("constructor"===e){if(!this._deployData)throw new Error("The contract has no contract data option set. This is necessary to append the constructor parameters.");return this._deployData+f}const i=r?r+f:f;if(i)return i;throw new Error(`Couldn't find a matching contract method named "${this._method.name}".`)},b.prototype.decodeFunctionCall=function(e){let t;e=a.addHexPrefix(e);const r=10,n=e.slice(0,r);for(const f of this._jsonInterface)if(f.type&&"function"===f.type&&n===f.signature){t=f;break}return g.decodeFunctionCall(t,e)},b.prototype._decodeMethodReturn=function(e,t){if(!t)return null;t=t.length>=2?t.slice(2):t;const r=g.decodeParameters(e,t);return 1===r.__length__?r[0]:(delete r.__length__,r)},b.prototype.deploy=function(e,t){const r=Array.prototype.slice.call(arguments);if(1===r.length||2===r.length&&n.isFunction(r[r.length-1])){if(e=e||{},e.arguments=e.arguments||[],e=this._getOrSetDefaultOptions(e),!e.data){const e=new Error('No "data" specified in neither the given options, nor the default options.');throw t&&t(e),e}return this.methods.constructor(e.data,...e.arguments)}const f=r[0],i=r[1],a=r.slice(2);return this.methods.constructor(i,...a).send(f)},b.prototype.send=function(){const e=Array.prototype.slice.call(arguments),t=e[0],r=e[1],n=e.slice(2);return this.methods[r](...n).send(t)},b.prototype.call=function(){let e=Array.prototype.slice.call(arguments),t={};n.isObject(e[0])&&(t=e[0],e=e.slice(1));const r=e[0],f=e.slice(1);return this.methods[r](...f).call(t)},b.prototype.sign=function(){const e=Array.prototype.slice.call(arguments),t=e[0],r=e[1],n=e.slice(2);return this.methods[r](...n).sign(t)},b.prototype.signAsFeePayer=function(){const e=Array.prototype.slice.call(arguments),t=e[0],r=e[1],n=e.slice(2);return this.methods[r](...n).signAsFeePayer(t)},b.prototype._generateEventOptions=function(){const e=Array.prototype.slice.call(arguments),t=this._getCallback(e),r=n.isObject(e[e.length-1])?e.pop():{};let f=n.isString(e[0])?e[0]:"allevents";if(f="allevents"===f.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find((function(e){return"event"===e.type&&(e.name===f||e.signature==="0x"+f.replace("0x",""))})),!f)throw new Error(`Event "${f.name}" doesn't exist in this contract.`);if(!a.isAddress(this.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return{params:this._encodeEventABI(f,r),event:f,callback:t}},b.prototype.clone=function(e=this.options.address){const t=new this.constructor(this.options.jsonInterface,e,this.options);return t.setWallet(this._wallet),t},b.prototype.once=function(e,t,r){const f=Array.prototype.slice.call(arguments);if(r=this._getCallback(f),!r)throw new Error("Once requires a callback as the second parameter.");t&&delete t.fromBlock,this._on(e,t,(function(e,t,f){f.unsubscribe(),n.isFunction(r)&&r(e,t,f)}))},b.prototype._on=function(){const e=this._generateEventOptions.apply(this,arguments);this._checkListener("newListener",e.event.name),this._checkListener("removeListener",e.event.name);const t=new o({subscription:{params:1,inputFormatter:[m.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(e.event),subscriptionHandler(e){this.emit("data",e),n.isFunction(this.callback)&&this.callback(null,e,this)}},type:"klay",requestManager:this._requestManager});return t.subscribe("logs",e.params,e.callback||function(){}),t},b.prototype.getPastEvents=function(){const e=this._generateEventOptions.apply(this,arguments);let t=new i({name:"getPastLogs",call:"klay_getLogs",params:1,inputFormatter:[m.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(e.event)});t.setRequestManager(this._requestManager);const r=t.buildCall();return t=null,r(e.params,e.callback)},b.prototype._createTxObject=function(){let e=Array.prototype.slice.call(arguments);const t={};if("function"===this.method.type&&(t.call=this.parent._executeMethod.bind(t,"call"),t.call.request=this.parent._executeMethod.bind(t,"call",!0)),t.sign=this.parent._executeMethod.bind(t,"sign"),t.signAsFeePayer=this.parent._executeMethod.bind(t,"signAsFeePayer"),t.send=this.parent._executeMethod.bind(t,"send"),t.send.request=this.parent._executeMethod.bind(t,"send",!0),t.encodeABI=this.parent._encodeMethodABI.bind(t),t.estimateGas=this.parent._executeMethod.bind(t,"estimate"),"constructor"!==this.method.type||this.deployData||(this.deployData=e[0],e=e.slice(1)),t.arguments=e||[],t._method=this.method,t._parent=this.parent,e&&this.method.inputs){if(e.length!==this.method.inputs.length){if(this.nextMethod)return this.nextMethod.apply(null,e);throw y.InvalidNumberOfParams(e.length,this.method.inputs.length,this.method.name)}if(this.nextMethod)try{t.encodeABI(e)}catch(r){return this.nextMethod.apply(null,e)}}return t._klayAccounts=this.parent.constructor._klayAccounts||this._klayAccounts,t._wallet=this.parent._wallet||this._wallet,this.deployData&&(t._deployData=this.deployData),t},b.prototype._processExecuteArguments=function(e,t){const r={};if(r.type=e.shift(),r.callback=this._parent._getCallback(e),"call"===r.type&&!0!==e[e.length-1]&&(n.isString(e[e.length-1])||isFinite(e[e.length-1]))&&(r.defaultBlock=e.pop()),r.options=n.isObject(e[e.length-1])?e.pop():{},r.generateRequest=!0===e[e.length-1]&&e.pop(),r.options=this._parent._getOrSetDefaultOptions(r.options),r.options.data=this.encodeABI(),!this._deployData&&!a.isAddress(this._parent.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return this._deployData||(r.options.to=this._parent.options.address),r.options.data?r:a._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."),t.eventEmitter,t.reject,r.callback)},b.prototype._executeMethod=async function(){const e=this,t=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),r);var r=a.promiEvent("send"!==t.type);const f=e.constructor._klayAccounts||e._klayAccounts,o=e._parent._wallet||e._wallet;if(t.options&&0===t.options.gas)throw y.notAllowedZeroGas();if(t.generateRequest){const e={params:[m.inputCallFormatter.call(this._parent,t.options)],callback:t.callback};return"call"===t.type?(e.params.push(m.inputDefaultBlockNumberFormatter.call(this._parent,t.defaultBlock)),e.method="klay_call",e.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):e.method="klay_sendTransaction",e}switch(t.type){case"estimate":const s=new i({name:"estimateGas",call:"klay_estimateGas",params:1,inputFormatter:[m.inputCallFormatter],outputFormatter:a.hexToNumber,requestManager:e._parent._requestManager,accounts:f,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction();return s(t.options,t.callback);case"call":const u=new i({name:"call",call:"klay_call",params:2,inputFormatter:[m.inputCallFormatter,m.inputDefaultBlockNumberFormatter],outputFormatter(t){return e._parent._decodeMethodReturn(e._method.outputs,t)},requestManager:e._parent._requestManager,accounts:f,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction();return u(t.options,t.defaultBlock,t.callback);case"sign":case"signAsFeePayer":const c=await v(t,this._method,this._deployData,r);if(!o)return a._fireError(new Error("Contract sign/signAsFeePayer works with 'caver.wallet'. Set to use'caver.wallet' by calling'contract.setWallet'."),r.eventEmitter,r.reject,t.callback);const l="signAsFeePayer"===t.type?t.options.feePayer:t.options.from,h="signAsFeePayer"===t.type?o.signAsFeePayer.bind(o):o.sign.bind(o),d=await o.isExisted(l);if(!d)throw new Error(`Failed to find ${l}. Please check that the corresponding account or keyring exists.`);return h(l,c).then(e=>e);case"send":const y=await v(t,this._method,this._deployData,r),g={receiptFormatter(t){if(n.isArray(t.logs)){const r=n.map(t.logs,(function(t){return e._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:e._parent.options.jsonInterface},t)}));t.events={};let f=0;r.forEach((function(e){e.event?t.events[e.event]?Array.isArray(t.events[e.event])?t.events[e.event].push(e):t.events[e.event]=[t.events[e.event],e]:t.events[e.event]=e:(t.events[f]=e,f++)})),delete t.logs}return t},contractDeployFormatter(t){const r=e._parent.clone(t.contractAddress);return r}};g.contractDeployFormatter=t.options.contractDeployFormatter?t.options.contractDeployFormatter:g.contractDeployFormatter;const b=new i({name:"sendTransaction",call:"klay_sendTransaction",params:1,inputFormatter:[m.inputTransactionFormatter],requestManager:e._parent._requestManager,accounts:f,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock,extraFormatters:g}).createFunction();if(o){const r=await o.isExisted(t.options.from);if(!r){if(o instanceof p)return b(t.options,t.callback);throw new Error(`Failed to find ${t.options.from}. Please check that the corresponding account or keyring exists.`)}const n=new i({name:"sendRawTransaction",call:"klay_sendRawTransaction",params:1,requestManager:e._parent._requestManager,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock,extraFormatters:g}).createFunction();return o.sign(y.from,y).then(e=>e.feePayer?o.signAsFeePayer(y.feePayer,y).then(e=>n(e)):n(e))}if(void 0===t.options.type&&(void 0!==this._deployData?t.options.type="SMART_CONTRACT_DEPLOY":t.options.type="SMART_CONTRACT_EXECUTION"),"SMART_CONTRACT_EXECUTION"!==t.options.type&&"SMART_CONTRACT_DEPLOY"!==t.options.type)throw new Error("Unsupported transaction type. Please use SMART_CONTRACT_EXECUTION or SMART_CONTRACT_DEPLOY.");const w=b.method.accounts.wallet[t.options.from.toLowerCase()];return w&&w.privateKey||(t.options.type="LEGACY"),b(t.options,t.callback)}},e.exports=b},"9d96":function(e,t,r){const n=r("2ef0"),f=r("8e7f"),i=r("9cca"),{validateDeployParameterForKIP17:a,kip17JsonInterface:o,kip17ByteCode:s,determineSendParams:u,formatParamForUint256:c,interfaceIds:l}=r("bec2"),{toBuffer:h,isHexStrict:d,toHex:p}=r("19b5"),{isAddress:m}=r("19b5"),y=r("3070");class g extends i{static deploy(e,t){a(e);const{name:r,symbol:f}=e,i=new g;return n.isString(t)&&(t={from:t,gas:66e5,value:0}),t.gas=void 0!==t.gas?t.gas:66e5,i.deploy({data:s,arguments:[r,f]}).send(t)}static detectInterface(e){const t=new g(e);return t.detectInterface()}constructor(e,t=o){if(e)if(n.isString(e)){if(!m(e))throw new Error("Invalid token address "+e)}else t=e,e=void 0;super(t,e)}clone(e=this.options.address){const t=new this.constructor(e,this.options.jsonInterface);return t.setWallet(this._wallet),t}async detectInterface(){const e={IKIP17:!1,IKIP17Metadata:!1,IKIP17Enumerable:!1,IKIP17Mintable:!1,IKIP17MetadataMintable:!1,IKIP17Burnable:!1,IKIP17Pausable:!1},t="This contract does not support KIP-13.",r=this._address;try{const n=await y.isImplementedKIP13Interface(r);if(!0!==n)throw new Error(t);return e.IKIP17=await this.supportsInterface(l.kip17.IKIP17),!1===e.IKIP17?e:(await Promise.all(Object.keys(l.kip17).map(async t=>{l.kip17[t]!==l.kip17.IKIP17&&(e[t]=await this.supportsInterface(l.kip17[t]))})),e)}catch(n){throw new Error(t)}}async supportsInterface(e){const t=await this.methods.supportsInterface(e).call();return t}async name(){const e=await this.methods.name().call();return e}async symbol(){const e=await this.methods.symbol().call();return e}async tokenURI(e){const t=await this.methods.tokenURI(c(e)).call();return t}async totalSupply(){const e=await this.methods.totalSupply().call();return new f(e)}async tokenOfOwnerByIndex(e,t){const r=await this.methods.tokenOfOwnerByIndex(e,c(t)).call();return new f(r)}async tokenByIndex(e){const t=await this.methods.tokenByIndex(c(e)).call();return new f(t)}async balanceOf(e){const t=await this.methods.balanceOf(e).call();return new f(t)}async ownerOf(e){const t=await this.methods.ownerOf(c(e)).call();return t}async getApproved(e){const t=await this.methods.getApproved(c(e)).call();return t}async isApprovedForAll(e,t){const r=await this.methods.isApprovedForAll(e,t).call();return r}async isMinter(e){const t=await this.methods.isMinter(e).call();return t}async paused(){const e=await this.methods.paused().call();return e}async isPauser(e){const t=await this.methods.isPauser(e).call();return t}async approve(e,t,r={}){const n=this.methods.approve(e,c(t));return r=await u(n,r,this.options),n.send(r)}async setApprovalForAll(e,t,r={}){const n=this.methods.setApprovalForAll(e,t);return r=await u(n,r,this.options),n.send(r)}async transferFrom(e,t,r,n={}){const f=this.methods.transferFrom(e,t,c(r));return n=await u(f,n,this.options),f.send(n)}async safeTransferFrom(e,t,r,f,i={}){if(f&&n.isObject(f)&&(void 0!==f.gas||void 0!==f.from)){if(Object.keys(i).length>0)throw new Error("Invalid parameters");i=f,f=void 0}f&&!n.isBuffer(f)&&(n.isString(f)&&!d(f)&&(f=p(f)),f=h(f));const a=f?this.methods.safeTransferFrom(e,t,c(r),f):this.methods.safeTransferFrom(e,t,c(r));return i=await u(a,i,this.options),a.send(i)}async addMinter(e,t={}){const r=this.methods.addMinter(e);return t=await u(r,t,this.options),r.send(t)}async renounceMinter(e={}){const t=this.methods.renounceMinter();return e=await u(t,e,this.options),t.send(e)}async mint(e,t,r={}){const n=this.methods.mint(e,c(t));return r=await u(n,r,this.options),n.send(r)}async mintWithTokenURI(e,t,r,n={}){const f=this.methods.mintWithTokenURI(e,c(t),r);return n=await u(f,n,this.options),f.send(n)}async burn(e,t={}){const r=this.methods.burn(c(e));return t=await u(r,t,this.options),r.send(t)}async pause(e={}){const t=this.methods.pause();return e=await u(t,e,this.options),t.send(e)}async unpause(e={}){const t=this.methods.unpause();return e=await u(t,e,this.options),t.send(e)}async addPauser(e,t={}){const r=this.methods.addPauser(e);return t=await u(r,t,this.options),r.send(t)}async renouncePauser(e={}){const t=this.methods.renouncePauser();return e=await u(t,e,this.options),t.send(e)}}g.byteCode=s,e.exports=g},"9e697":function(e,t,r){const n=r("321b");function f(){}e.exports=f,f.prototype.setEngine=function(e){const t=this;t.engine||(t.engine=e,e.on("block",(function(e){t.currentBlock=e})),e.on("start",(function(){t.start()})),e.on("stop",(function(){t.stop()})))},f.prototype.handleRequest=function(e,t,r){throw new Error("Subproviders should override `handleRequest`.")},f.prototype.emitPayload=function(e,t){const r=this;r.engine.sendAsync(n(e),t)},f.prototype.stop=function(){},f.prototype.start=function(){}},"9f11":function(e,t,r){const n=r("431d"),f=r("2eeb");class i extends n{constructor(){super(({blockTracker:e,provider:t,engine:r})=>f({blockTracker:e,provider:t}))}}e.exports=i},a087:function(e,t,r){(function(e){var n=r("c973").default;r("96cf"),r("d3b7"),r("d81d"),r("a9e3"),r("25f0");var f=r("5b66"),i=r("c030"),a=i.utils.bigNumberify,o=r("db8d"),s=r("e32e"),u=s.NULL_BLOCK_HASH,c=s.ETH,l={};t.confirmTransaction=function(){var e=n(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){h(t,r,(function(t){t?e("Transaction complete!"):n(new Error("Transaction failed :( You might have already completed this action. See more on the mainnet at etherscan.io/tx/".concat(r)))}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();var h=function(e,t,r){if(l[t])l[t].push(r);else{l[t]=[r];var f=function(){var r=n(regeneratorRuntime.mark((function r(){var n,i,a;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,e.eth.getTransaction(t);case 2:if(n=r.sent,!n||!n.blockHash||n.blockHash===u){r.next=13;break}return r.next=6,e.eth.getTransactionReceipt(t);case 6:i=r.sent,a=i.status,l[t].map((function(e){return e(a)})),delete l[t],r.next=14;break;case 13:setTimeout(f,1e3);case 14:case"end":return r.stop()}}),r)})));return function(){return r.apply(this,arguments)}}();f().catch((function(e){}))}},d={AssetType:[{name:"assetClass",type:"bytes4"},{name:"data",type:"bytes"}],Asset:[{name:"assetType",type:"AssetType"},{name:"value",type:"uint256"}],Order:[{name:"maker",type:"address"},{name:"makeAsset",type:"Asset"},{name:"taker",type:"address"},{name:"takeAsset",type:"Asset"},{name:"salt",type:"uint256"},{name:"start",type:"uint256"},{name:"end",type:"uint256"},{name:"dataType",type:"bytes4"},{name:"data",type:"bytes"}]},p=function(){var e=n(regeneratorRuntime.mark((function e(t,r,n,f){var i,a,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.t0=Number,e.next=3,t.eth.getChainId();case 3:return e.t1=e.sent,i=(0,e.t0)(e.t1),a=o.createTypeData({name:"Exchange",version:"2",chainId:i,verifyingContract:f},"Order",r,d),e.next=8,o.signTypedData(t,n,a);case 8:return s=e.sent,e.abrupt("return",s);case 10:case"end":return e.stop()}}),e)})));return function(t,r,n,f){return e.apply(this,arguments)}}(),m="tuple(tuple(address,uint96)[],tuple(address,uint96)[])";t.encDataV1=function(e,t){return e.eth.abi.encodeParameter(m,t)},t.id=function(t){return"0x".concat(f.keccak256(e.from(t,"utf-8")).toString("hex").substring(0,8))},t.enc=function(e,t,r){return r?e.eth.abi.encodeParameters(["address","uint256"],[t,r]):e.eth.abi.encodeParameter("address",t)};var y=function(e,t){if(t.length>=67){var r=e.eth.abi.decodeParameters(["address","uint256"],t);return{contractAddress:r[0],tokenId:r[1]}}return{contractAddress:e.eth.abi.decodeParameter("address",t)}},g=function(e,t){var r,n,f=t.value,i=t.assetType.assetClass;if(i!=c){var a=y(e,t.assetType.data);r=a.contractAddress,n=a.tokenId}else r="0x",n=0;return{typeMV:i,contractAddress:r,tokenId:n,value:f}};t.decAsset=g,t.decOrder=function(e,t){var r=t,n=r.maker,f=g(e,r.makeAsset),i=f.typeMV,a=f.contractAddress,o=f.value;return{order:r,maker:n,maTypeMV:i,maContractAddress:a,maValue:o}};var b=function(){var e=n(regeneratorRuntime.mark((function e(t,r,n,f){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,p(t,n,f,r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t,r,n,f){return e.apply(this,arguments)}}();t.createTypedDataAndSignature=b,t.recoverTypedSignature=function(){var e=n(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",o.recoverTypedSignature(t,r));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),t.makeContractInstance=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,f=n||r.networks[t].address;return new e.eth.Contract(r.abi,f)},t.multiplyBigNumberByDecimal=function(e,t,r){"undefined"===typeof r&&(r=5);var n=Math.min(t.toString().length-1,r),f=a(10).pow(n),i=Math.round(t*f),o=a(i).mul(e);return o.div(f)}}).call(this,r("b639").Buffer)},a153:function(e,t,r){"use strict";const{Buffer:n}=r("b639"),f=r("9222");function i({path:e,content:t}){return{path:e||"",content:t?f(t):null}}e.exports=function(e){if(n.isBuffer(e)||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)return async function*(){yield i({path:"",content:e})}();if("undefined"!==typeof Blob&&e instanceof Blob)return async function*(){yield i({path:"",content:e})}();if(e[Symbol.iterator])return async function*(){for(const t of e){if("object"!==typeof t||!t.path&&!t.content)return void(yield i({path:"",content:e}));yield i(t)}}();if(e[Symbol.asyncIterator])return async function*(){for await(const t of e){if("object"!==typeof t||!t.path&&!t.content){let r="";return e.path&&e.path.split&&(r=e.path.split(/[/\\]/).pop()||""),void(yield i({path:r,content:async function*(){yield t;for await(const t of e)yield t}()}))}yield i(t)}}();if("object"===typeof e&&(e.path||e.content))return async function*(){yield i(e)}();if("function"===typeof e)return async function*(){yield i({path:"",content:e})}();throw new Error("Unexpected input: "+typeof e)}},a15b:function(e,t,r){"use strict";var n=r("23e7"),f=r("44ad"),i=r("fc6a"),a=r("a640"),o=[].join,s=f!=Object,u=a("join",",");n({target:"Array",proto:!0,forced:s||!u},{join:function(e){return o.call(i(this),void 0===e?",":e)}})},a211:function(e,t,r){"use strict";function n(e){return function(){return e}}var f=function(){};f.thatReturns=n,f.thatReturnsFalse=n(!1),f.thatReturnsTrue=n(!0),f.thatReturnsNull=n(null),f.thatReturnsThis=function(){return this},f.thatReturnsArgument=function(e){return e},e.exports=f},a237:function(e,t,r){const n=r("19d7"),f=r("0664"),i=r("19b5"),a=r("4695"),{CANCEL_TYPE_TAG:o,FEE_DELEGATED_CANCEL_TYPE_TAG:s,FEE_DELEGATED_CANCEL_WITH_RATIO_TYPE_TAG:u}=a.constants;function c(e){return n.encode([n.encode([o,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.from.toLowerCase()]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function l(e){if(e.senderRawTransaction){const t="0x"+e.senderRawTransaction.slice(4),[r,a,o,u,[[c,l,h]]]=i.rlpDecode(t);return n.encode([n.encode([s,f.fromNat(r),f.fromNat(a),f.fromNat(o),u.toLowerCase()]),e.feePayer.toLowerCase(),f.fromNat(e.chainId||"0x1"),"0x","0x"])}return n.encode([n.encode([s,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.from.toLowerCase()]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function h(e){if(e.senderRawTransaction){const t="0x"+e.senderRawTransaction.slice(4),[r,a,o,s,c,[[l,h,d]]]=i.rlpDecode(t);return n.encode([n.encode([u,f.fromNat(r),f.fromNat(a),f.fromNat(o),s.toLowerCase(),f.fromNat(c)]),e.feePayer.toLowerCase(),f.fromNat(e.chainId||"0x1"),"0x","0x"])}return n.encode([n.encode([u,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.from.toLowerCase(),f.fromNat(e.feeRatio)]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}e.exports={rlpEncodeForCancel:c,rlpEncodeForFeeDelegatedCancel:l,rlpEncodeForFeeDelegatedCancelWithRatio:h}},a406:function(e,t,r){"use strict";const n=r("1ff5"),{objectToQuery:f}=r("d518"),i=r("1eca"),{ok:a,toIterable:o}=r("7872"),{toFormData:s}=r("b5c0"),u=r("83c7");e.exports=i(({fetch:e,apiUrl:t,apiPath:r,headers:i})=>(c,l)=>async function*(){l=l||{};const h=f({"stream-channels":!0,chunker:l.chunker,"cid-version":l.cidVersion,"cid-base":l.cidBase,"enable-sharding-experiment":l.enableShardingExperiment,hash:l.hashAlg,"only-hash":l.onlyHash,pin:l.pin,progress:!!l.progress||null,quiet:l.quiet,quieter:l.quieter,"raw-leaves":l.rawLeaves,"shard-split-threshold":l.shardSplitThreshold,silent:l.silent,trickle:l.trickle,"wrap-with-directory":l.wrapWithDirectory,...l.qs||{}}),d=`${t}${r}/add${h}`,p=await a(e(d,{method:"POST",signal:l.signal,headers:l.headers||i,body:await s(c)}));for await(let e of n(o(p.body)))e=u(e),l.progress&&e.bytes?l.progress(e.bytes):yield u(e)}())},a44c:function(e,t,r){e.exports=r("6d58").version},a4ff:function(e,t){function r(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}r.keys=function(){return[]},r.resolve=r,e.exports=r,r.id="a4ff"},a531:function(e,t,r){"use strict";const n=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});e.exports={names:n}},a73f:function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("0664"),a=r("a9b0"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s}=r("1789"),u=r("19b5");function c(e){if(e=u.addHexPrefix(e),!e.startsWith(s.TxTypeValueTransfer))throw new Error(`Cannot decode to ValueTransfer. The prefix must be ${s.TxTypeValueTransfer}: ${e}`);const t="0x"+e.slice(4),[r,n,i,a,o,c,l]=f.decode(t);return{nonce:u.trimLeadingZero(r),gasPrice:u.trimLeadingZero(n),gas:u.trimLeadingZero(i),to:a,value:u.trimLeadingZero(o),from:c,signatures:l}}class l extends a{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){n.isString(e)&&(e=c(e)),super(o.TxTypeValueTransfer,e),this.to=e.to,this.value=e.value}get to(){return this._to}set to(e){if(!u.isAddress(e))throw new Error("Invalid address of to: "+e);this._to=e.toLowerCase()}get value(){return this._value}set value(e){this._value=u.numberToHex(e)}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode());return s.TxTypeValueTransfer+f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.from.toLowerCase(),e]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),f.encode([s.TxTypeValueTransfer,i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.from.toLowerCase()])}}e.exports=l},a7cb:function(e,t,r){"use strict";const n=r("1eca"),{ok:f}=r("7872"),{objectToQuery:i}=r("d518"),a=r("83c7");e.exports=n(({fetch:e,apiUrl:t,apiPath:r,headers:n})=>async o=>{o=o||{};const s=i(o.qs),u=`${t}${r}/id${s}`,c=await f(e(u,{signal:o.signal,headers:o.headers||n})),l=await c.json();return a(l)})},a8c0:function(e,t,r){"use strict";const n=new TextDecoder,f=e=>n.decode(e),i=new TextEncoder,a=e=>i.encode(e);function o(e,t){const r=new Uint8Array(t);let n=0;for(const f of e)r.set(f,n),n+=f.length;return r}e.exports={decodeText:f,encodeText:a,concat:o}},a8cf:function(e,t,r){const n=r("19d7"),f=r("0664"),i=r("2ef0"),{TX_TYPE_STRING:a,TX_TYPE_TAG:o}=r("1789"),s=r("749b"),u=r("19b5");function c(e){if(e=u.addHexPrefix(e),!e.startsWith(o.TxTypeFeeDelegatedValueTransferWithRatio))throw new Error(`Cannot decode to FeeDelegatedValueTransferWithRatio. The prefix must be ${o.TxTypeFeeDelegatedValueTransferWithRatio}: ${e}`);const t="0x"+e.slice(4),[r,f,i,a,s,c,l,h,d,p]=n.decode(t);return{nonce:u.trimLeadingZero(r),gasPrice:u.trimLeadingZero(f),gas:u.trimLeadingZero(i),to:a,value:u.trimLeadingZero(s),from:c,feeRatio:u.trimLeadingZero(l),signatures:h,feePayer:d,feePayerSignatures:p}}class l extends s{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){i.isString(e)&&(e=c(e)),super(a.TxTypeFeeDelegatedValueTransferWithRatio,e),this.to=e.to,this.value=e.value}get to(){return this._to}set to(e){if(!u.isAddress(e))throw new Error("Invalid address of to: "+e);this._to=e.toLowerCase()}get value(){return this._value}set value(e){this._value=u.numberToHex(e)}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode()),t=this.feePayerSignatures.map(e=>e.encode());return o.TxTypeFeeDelegatedValueTransferWithRatio+n.encode([f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.to.toLowerCase(),f.fromNat(this.value),this.from.toLowerCase(),this.feeRatio,e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),n.encode([o.TxTypeFeeDelegatedValueTransferWithRatio,f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.to.toLowerCase(),f.fromNat(this.value),this.from.toLowerCase(),this.feeRatio])}}e.exports=l},a988:function(e,t,r){"use strict";var n=function(){function e(e){this.subscriber=e}var t=e.prototype;return t.remove=function(){this.subscriber&&(this.subscriber.removeSubscription(this),this.subscriber=null)},e}();e.exports=n},a9b0:function(e,t,r){const n=r("2ef0"),f=r("0664"),i=r("19d7"),a=r("f3a4"),o=r("1910"),s=r("19b5"),u=r("0683"),c=r("92c9"),l=r("13dc"),h=r("50f4"),{TX_TYPE_STRING:d,refineSignatures:p,typeDetectionFromRLPEncoding:m}=r("1789"),{KEY_ROLE:y}=r("fc77"),{validateParams:g}=r("6561"),b=r("bed1");class v{constructor(e,t){this._type=e,t.type=e;const r=g(t);if(r)throw r;this.from=t.from,this.gas=t.gas,void 0!==t.nonce&&(this.nonce=t.nonce),void 0!==t.gasPrice&&(this.gasPrice=t.gasPrice),void 0!==t.chainId&&(this.chainId=t.chainId),this.signatures=t.signatures||[]}get type(){return this._type}get from(){return this._from}set from(e){if(this.type!==d.TxTypeLegacyTransaction||"0x"!==e&&"0x0000000000000000000000000000000000000000"!==e){if(!s.isAddress(e))throw new Error("Invalid address "+e);this._from=e.toLowerCase()}else this._from=e.toLowerCase()}get nonce(){return this._nonce}set nonce(e){this._nonce=s.numberToHex(e)}get gas(){return this._gas}set gas(e){this._gas=s.numberToHex(e)}get gasPrice(){return this._gasPrice}set gasPrice(e){this._gasPrice=s.numberToHex(e)}get chainId(){return this._chainId}set chainId(e){this._chainId=s.toHex(e)}get signatures(){return this._signatures}set signatures(e){this._signatures=p(e,this.type===d.TxTypeLegacyTransaction)}getRLPEncoding(){throw new Error("Not implemented.")}getCommonRLPEncodingForSignature(){throw new Error("Not implemented.")}async sign(e,t,r=o.getHashForSignature){n.isFunction(t)&&(r=t,t=void 0);let f=e;if(n.isString(e)&&(f=u.createFromPrivateKey(e)),!(f instanceof c)&&!(f instanceof l)&&!(f instanceof h))throw new Error("Unsupported key type. The key must be a single private key string, KlaytnWalletKey string, or Keyring instance.");if(this.type===d.TxTypeLegacyTransaction&&f.isDecoupled())throw new Error("A legacy transaction cannot be signed with a decoupled keyring.");if(this.from&&"0x"!==this.from&&"0x0000000000000000000000000000000000000000"!==this.from||(this.from=f.address),this.from.toLowerCase()!==f.address.toLowerCase())throw new Error("The from address of the transaction is different with the address of the keyring to use.");await this.fillTransaction();const i=r(this),a=this.type.includes("AccountUpdate")?y.roleAccountUpdateKey:y.roleTransactionKey,s=f.sign(i,this.chainId,a,t);return this.appendSignatures(s),this}appendSignatures(e){let t=e;if(n.isString(t)&&(t=s.resolveSignature(t)),t instanceof b&&(t=[t]),!n.isArray(t))throw new Error("Failed to append signatures: invalid signatures format "+t);n.isString(t[0])&&(t=[t]),this.signatures=this.signatures.concat(t)}combineSignedRawTransactions(e){if(!n.isArray(e))throw new Error("The parameter must be an array of RLP-encoded transaction strings.");let t=!1;s.isEmptySig(this.signatures)&&(t=!0);for(const r of e){const e=m(r);if(this.type!==e)throw new Error("Transaction type mismatch: Signatures from different transactions cannot be combined.");const n=this.constructor.decode(r);for(const r in n){if("_signatures"===r||"_feePayerSignatures"===r)continue;void 0===this[r]&&t&&(this[r]=n[r]);const e="Transactions containing different information cannot be combined.";if("_account"!==r){if(this[r]!==n[r])throw new Error(e)}else if(this[r].getRLPEncodingAccountKey()!==n[r].getRLPEncodingAccountKey())throw new Error(e)}this.appendSignatures(n.signatures)}return this.getRLPEncoding()}getRawTransaction(){return this.getRLPEncoding()}getTransactionHash(){return a.keccak256(this.getRLPEncoding())}getSenderTxHash(){return this.getTransactionHash()}getRLPEncodingForSignature(){if(this.validateOptionalValues(),void 0===this.chainId)throw new Error("chainId is undefined. Define chainId in transaction or use 'transaction.fillTransaction' to fill values.");return i.encode([this.getCommonRLPEncodingForSignature(),f.fromNat(this.chainId),"0x","0x"])}recoverPublicKeys(){if(s.isEmptySig(this.signatures))throw new Error("Failed to recover public keys from signatures: signatures is empty.");const e=f.toNumber(this.signatures[0].v),t=e<35?f.fromNat("0x1"):f.fromNumber(e-35>>1);this.chainId||(this.chainId=t);const r=this.getRLPEncodingForSignature(),n=a.keccak256(r),i=[];for(const a of this.signatures){const e=f.toNumber(a.v),t=e<35?f.fromNat("0x1"):f.fromNumber(e-35>>1);if(s.trimLeadingZero(this.chainId)!==s.trimLeadingZero(t))throw new Error("Invalid signatures data: recovery data is not matched.");i.push(s.recoverPublicKey(n,a,!0))}return i}async fillTransaction(){const[e,t,r]=await Promise.all([w(this.chainId)?v._klaytnCall.getChainId():this.chainId,w(this.gasPrice)?v._klaytnCall.getGasPrice():this.gasPrice,w(this.nonce)?v._klaytnCall.getTransactionCount(this.from,"pending"):this.nonce]);this.chainId=e,this.gasPrice=t,this.nonce=r}validateOptionalValues(){if(void 0===this.gasPrice)throw new Error("gasPrice is undefined. Define gasPrice in transaction or use 'transaction.fillTransaction' to fill values.");if(void 0===this.nonce)throw new Error("nonce is undefined. Define nonce in transaction or use 'transaction.fillTransaction' to fill values.")}}const w=function(e){return n.isUndefined(e)||n.isNull(e)};e.exports=v},aa4d5:function(e,t,r){(function(t,n){const f="[object process]"===Object.prototype.toString.call("undefined"!==typeof t?t:0);let i=null,a=null;if(f){i=function(e){return n.from(e).toString("base64")};const e=r("0b16");if(e.URL){const t=e.URL;a=function(e){return new t(e)}}else a=r("0b16").parse}else i=btoa.bind(window),a=function(e){return new URL(e)};e.exports={parseURL:a,btoa:i}}).call(this,r("4362"),r("b639").Buffer)},ab13:function(e,t,r){var n=r("b622"),f=n("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[f]=!1,"/./"[e](t)}catch(n){}}return!1}},ab51:function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("0664"),a=r("558a"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s}=r("1789"),u=r("19b5");function c(e){if(e=u.addHexPrefix(e),!e.startsWith(s.TxTypeFeeDelegatedSmartContractExecution))throw new Error(`Cannot decode to FeeDelegatedSmartContractExecution. The prefix must be ${s.TxTypeFeeDelegatedSmartContractExecution}: ${e}`);const t="0x"+e.slice(4),[r,n,i,a,o,c,l,h,d,p]=f.decode(t);return{nonce:u.trimLeadingZero(r),gasPrice:u.trimLeadingZero(n),gas:u.trimLeadingZero(i),to:a,value:u.trimLeadingZero(o),from:c,input:l,signatures:h,feePayer:d,feePayerSignatures:p}}class l extends a{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){if(n.isString(e)&&(e=c(e)),super(o.TxTypeFeeDelegatedSmartContractExecution,e),this.to=e.to,this.value=e.value||"0x0",e.input&&e.data)throw new Error("'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.");this.input=e.input||e.data}get to(){return this._to}set to(e){if(!u.isAddress(e))throw new Error("Invalid address of to: "+e);this._to=e.toLowerCase()}get value(){return this._value}set value(e){this._value=u.numberToHex(e)}get input(){return this._input}set input(e){if(!e||!u.isHex(e))throw new Error("Invalid input data "+e);this._input=u.addHexPrefix(e)}get data(){return this._input}set data(e){this._input=e}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode()),t=this.feePayerSignatures.map(e=>e.encode());return s.TxTypeFeeDelegatedSmartContractExecution+f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.from.toLowerCase(),this.input,e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),f.encode([s.TxTypeFeeDelegatedSmartContractExecution,i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.from.toLowerCase(),this.input])}}e.exports=l},ac5e:function(e,t,r){const n=r("2ef0"),f=r("7ac7"),i=r("9d96"),a=r("df4a"),o=r("3070"),s=r("19eb"),{validateDeployParameterForKIP7:u,validateDeployParameterForKIP17:c,kip7ByteCode:l,kip17ByteCode:h}=r("bec2");class d{constructor(...e){const t=this;s.packageInit(this,e);const r=this.setRequestManager;this.setRequestManager=function(e){return r(e),t.kip7._requestManager=t._requestManager,t.kip7.currentProvider=t._provider,t.kip17._requestManager=t._requestManager,t.kip17.currentProvider=t._provider,t.kip37._requestManager=t._requestManager,t.kip37.currentProvider=t._provider,!0};const d=this.setProvider;this.setProvider=function(){d.apply(t,arguments),t.setRequestManager(t._requestManager)};class p extends f{static create(e,t){return new p(e,t)}static deploy(e,t,r){u(e);const{name:f,symbol:i,decimals:a,initialSupply:o}=e,s=new p;return void 0!==r&&s.setWallet(r),n.isString(t)&&(t={from:t,gas:4e6,value:0}),t.gas=void 0!==t.gas?t.gas:4e6,s.deploy({data:l,arguments:[f,i,a,o]}).send(t)}constructor(r,n){super(r,n);const f=this,i=t.setRequestManager;t.setRequestManager=function(){i.apply(t,arguments),s.packageInit(f,[t])},this.setWallet(e[0].wallet)}}this.kip7=p;class m extends i{static create(e,t){return new m(e,t)}static deploy(e,t,r){c(e);const{name:f,symbol:i}=e,a=new m;return void 0!==r&&a.setWallet(r),n.isString(t)&&(t={from:t,gas:66e5,value:0}),t.gas=void 0!==t.gas?t.gas:66e5,a.deploy({data:h,arguments:[f,i]}).send(t)}constructor(r,n){super(r,n);const f=this,i=t.setRequestManager;t.setRequestManager=function(){i.apply(t,arguments),s.packageInit(f,[t])},this.setWallet(e[0].wallet)}}this.kip17=m,this.kip37=a,this.kip37.wallet=e[0].wallet,this.kip37._requestManager=this._requestManager,this.kip37.currentProvider=this._requestManager.provider,this.kip13=o,this.kip13._requestManager=this._requestManager,this.kip13.currentProvider=this._requestManager.provider}}e.exports=d},ad39:function(e,t,r){r("dca8"),t.Network=Object.freeze({Main:1,Rinkeby:4}),function(e){e["TransactionCreated"]="TransactionCreated",e["TransactionConfirmed"]="TransactionConfirmed",e["TransactionDenied"]="TransactionDenied",e["TransactionFailed"]="TransactionFailed",e["InitializeAccount"]="InitializeAccount",e["WrapEth"]="WrapEth",e["UnwrapWeth"]="UnwrapWeth",e["ApproveCurrency"]="ApproveCurrency",e["ApproveAsset"]="ApproveAsset",e["ApproveAllAssets"]="ApproveAllAssets",e["UnapproveCurrency"]="UnapproveCurrency",e["MatchOrders"]="MatchOrders",e["CancelOrder"]="CancelOrder",e["ApproveOrder"]="ApproveOrder",e["CreateOrder"]="CreateOrder",e["OrderDenied"]="OrderDenied",e["TransferAll"]="TransferAll",e["TransferOne"]="TransferOne",e["UpdateRoyalties"]="UpdateRoyalties",e["TransferRoyaltiesOwnership"]="TransferRoyaltiesOwnership",e["WrapAssets"]="WrapAssets",e["UnwrapAssets"]="UnwrapAssets",e["LiquidateAssets"]="LiquidateAssets",e["PurchaseAssets"]="PurchaseAssets"}(t.EventType||(t.EventType={}));var n=function(e,t){return{assetClass:e,data:t}};t.AssetType=n,t.Asset=function(e,t,r){return{assetType:n(e,t),value:r}},t.Order=function(e,t,r,n,f,i,a,o,s){return{maker:e,makeAsset:t,taker:r,takeAsset:n,salt:f,start:i,end:a,dataType:o,data:s}}},add0:function(e,t,r){"use strict";(function(e){class r{constructor(e){this.tasks=[],this.count=e}sched(){if(this.count>0&&this.tasks.length>0){this.count--;let e=this.tasks.shift();if(void 0===e)throw"Unexpected undefined value in tasks list";e()}}acquire(){return new Promise((t,r)=>{var n=()=>{var e=!1;t(()=>{e||(e=!0,this.count++,this.sched())})};this.tasks.push(n),e&&e.nextTick?e.nextTick(this.sched.bind(this)):setImmediate(this.sched.bind(this))})}use(e){return this.acquire().then(t=>e().then(e=>(t(),e)).catch(e=>{throw t(),e}))}}t.Semaphore=r;class n extends r{constructor(){super(1)}}t.Mutex=n}).call(this,r("4362"))},add8:function(e,t,r){const n=r("d532"),f=r("76bb").rpc.internal,{EthereumRpcError:i}=r("2dfe"),a="Unspecified server error.",o="Unspecified error message. This is a bug, please report it.",s={code:f,message:u(f)};function u(e,t=o){if(Number.isInteger(e)){const t=e.toString();if(n[t])return n[t].message;if(h(e))return a}return t}function c(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!n[t]||!!h(e)}function l(e,t=s){if(!t||!Number.isInteger(t.code)||"string"!==typeof t.message)throw new Error("fallbackError must contain integer number code and string message.");if(e instanceof i)return e.serialize();const r={};return e&&c(e.code)?(r.code=e.code,e.message&&"string"===typeof e.message?(r.message=e.message,e.hasOwnProperty("data")&&(r.data=e.data)):(r.message=u(r.code),r.data={originalError:d(e)})):(r.code=t.code,r.message=e&&e.message?e.message:t.message,r.data={originalError:d(e)}),e&&e.stack&&(r.stack=e.stack),r}function h(e){return e>=-32099&&e<=-32e3}function d(e){return e&&"object"===typeof e&&!Array.isArray(e)?Object.assign({},e):e}e.exports={getMessageFromCode:u,isValidCode:c,serializeError:l,JSON_RPC_SERVER_ERROR_MESSAGE:a}},add9:function(e,t,r){"use strict";(function(t){const n=r("1ff5"),f=r("c6d4"),{objectToQuery:i}=r("d518"),a=r("1eca"),{ok:o,toIterable:s}=r("7872"),u=r("3da3");e.exports=a(({fetch:e,apiUrl:r,apiPath:a,headers:c})=>{const l=u.singleton();return async(u,h,d)=>{d=d||{},d.signal=l.subscribe(u,h,d.signal);const p=i({arg:u,discover:d.discover,...d.qs||{}}),m=`${r}${a}/pubsub/sub${p}`;let y;try{y=await o(e(m,{method:"POST",signal:d.signal,headers:d.headers||c}))}catch(b){throw l.unsubscribe(u,h),b}const g=d.onError||(e=>console.error(e));(async()=>{try{for await(const e of n(s(y.body)))try{h({from:t.from(e.from,"base64"),data:t.from(e.data,"base64"),seqno:t.from(e.seqno,"base64"),topicIDs:e.topicIDs})}catch(b){g(f(b,"Failed to parse pubsub message"),!1)}}catch(b){"aborted"!==b.type&&"AbortError"!==b.name&&g(b,!0)}finally{l.unsubscribe(u,h)}})()}})}).call(this,r("b639").Buffer)},aea2:function(e,t,r){const n=r("ee69").AccountKeyEnum,f=r("0c0c"),i=r("148e"),a=r("19b5");class o{constructor(e={}){if(e instanceof o&&(e=e.keys),"object"!==typeof e)throw new Error("RoleBasedKey should be created with Object");u(e),this._transactionKey=s(e.transactionKey),this._updateKey=s(e.updateKey),this._feePayerKey=s(e.feePayerKey),this.type=n.ACCOUNT_KEY_ROLEBASED}get defaultKey(){const e=this._transactionKey?this._transactionKey:this._updateKey?this._updateKey:this._feePayerKey?this._feePayerKey:void 0;if(!e)throw new Error("There is no key defined in AccountKeyRoleBased.");return e.defaultKey}get keys(){const e={};return void 0!==this._transactionKey&&(e.transactionKey=this._transactionKey.keys),void 0!==this._updateKey&&(e.updateKey=this._updateKey.keys),void 0!==this._feePayerKey&&(e.feePayerKey=this._feePayerKey.keys),e}get transactionKey(){if(this._transactionKey)return this._transactionKey.keys}get updateKey(){if(this._updateKey)return this._updateKey.keys}get feePayerKey(){if(this._feePayerKey)return this._feePayerKey.keys}toPublicKey(e){const t={};return void 0!==this._transactionKey&&(t.transactionKey=this._transactionKey.toPublicKey(e)),void 0!==this._updateKey&&(t.updateKey=this._updateKey.toPublicKey(e)),void 0!==this._feePayerKey&&(t.feePayerKey=this._feePayerKey.toPublicKey(e)),t}update(e){e._transactionKey&&(this._transactionKey=e._transactionKey),e._updateKey&&(this._updateKey=e._updateKey),e._feePayerKey&&(this._feePayerKey=e._feePayerKey)}}function s(e){if(void 0!==e){if(Array.isArray(e)||e instanceof i)return new i(e);if("string"!==typeof e)throw new Error("Invalid account key type");return new f(e)}}function u(e){const t=Object.keys(e);if(0===t.length)throw new Error("Failed to create AccountKeyRoleBased: empty object");t.map(t=>{if(!a.isValidRole(t))throw new Error("Failed to create AccountKeyRoleBased. Invalid role is defined : "+t);if(Array.isArray(e[t]))for(let r of e[t]){const e=a.parsePrivateKey(r);if(r=e.privateKey,!a.isValidPrivateKey(r))throw new Error("Failed to create AccountKeyRoleBased. Invalid private key : "+r)}else if(!a.isValidPrivateKey(e[t]))throw new Error("Failed to create AccountKeyRoleBased. Invalid private key : "+e[t])})}e.exports=o},b048:function(e,t,r){"use strict";r.r(t),t["default"]=function(e,t){return t=t||{},new Promise((function(r,n){var f=new XMLHttpRequest,i=[],a=[],o={},s=function(){return{ok:2==(f.status/100|0),statusText:f.statusText,status:f.status,url:f.responseURL,text:function(){return Promise.resolve(f.responseText)},json:function(){return Promise.resolve(f.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([f.response]))},clone:s,headers:{keys:function(){return i},entries:function(){return a},get:function(e){return o[e.toLowerCase()]},has:function(e){return e.toLowerCase()in o}}}};for(var u in f.open(t.method||"get",e,!0),f.onload=function(){f.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){i.push(t=t.toLowerCase()),a.push([t,r]),o[t]=o[t]?o[t]+","+r:r})),r(s())},f.onerror=n,f.withCredentials="include"==t.credentials,t.headers)f.setRequestHeader(u,t.headers[u]);f.send(t.body||null)}))}},b056:function(e){e.exports=JSON.parse('{"contractName":"Paru1155V2","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"RoyaltyOwnerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"indexed":false,"internalType":"struct LibPart.Part[]","name":"royalty","type":"tuple[]"}],"name":"RoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"baseURI","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintItem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"address","name":"royaltyOwner","type":"address"},{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"internalType":"struct LibPart.Part[]","name":"royalties","type":"tuple[]"}],"name":"mintItemWithRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRoyalties","outputs":[{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"internalType":"struct LibPart.Part[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRoyaltyOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"internalType":"struct LibPart.Part[]","name":"royalties","type":"tuple[]"}],"name":"updateRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"transferRoyaltyOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function","constant":true}]}')},b328:function(e,t,r){const n=r("0664"),f=r("19b5");class i{constructor(e,t){this.weight=e,this.publicKey=t}get weight(){return this._weight}set weight(e){this._weight=f.hexToNumber(e)}get publicKey(){return this._publicKey}set publicKey(e){if(!f.isValidPublicKey(e))throw new Error("Invalid public key: "+e);this._publicKey=f.addHexPrefix(e)}encodeToBytes(){if(void 0===this.weight)throw new Error("weight should be specified for a multisig account");if(void 0===this.publicKey)throw new Error("publicKey should be specified for a multisig account");const e=f.compressPublicKey(this.publicKey);return[n.fromNat(f.numberToHex(this.weight)),e]}}e.exports=i},b3fc:function(e,t,r){r("7037").default;var n=r("ded3").default,f=r("c973").default,i=r("970b").default,a=r("5bc3").default;r("96cf"),r("a9e3"),r("b64b"),r("159b"),r("99af"),r("d3b7"),r("25f0"),r("b680");var o=r("6347"),s=o.EventEmitter,u=r("99e5"),c=r("c030"),l=(c.utils.bigNumberify,r("a087")),h=l.makeContractInstance,d=l.confirmTransaction,p=l.createTypedDataAndSignature,m=(l.recoverTypedSignature,l.enc),y=l.decAsset,g=l.encDataV1,b=(l.multiplyBigNumberByDecimal,r("2710")),v=b.ParulaAPI,w=r("e32e"),_=w.NULL_BLOCK_HASH,T=w.ZERO_ADDRESS,E=w.ORDER_DATA_V1,x=w.ERC20,M=w.ERC721,A=w.ERC1155,k=w.ETH,P=r("ad39"),C=(P.Network,P.EventType),S=P.Order,R=P.Asset,I=r("b924"),N=I.NFTContract,L=I.NFT1155Contract,F=I.Exchange,K=I.RoyaltiesRegistry,O=I.IERC20,D=I.IERC165,B=I.IERC1155,U=function(){"use strict";function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=arguments.length>2?arguments[2]:void 0;i(this,e);var a=Number(t.chainId);if(0==Object.keys(n))if(1==a){var o=r("22f7"),c=o.config;n=c}else if(3==a){var l=r("ccc8");c=l.config;n=c}else if(4==a){var h=r("d038");c=h.config;n=c}else if(1001==a){var d=r("4b73");c=d.config;n=c}else{if(8217!=a){var p="[!] Unsupported networkId : ".concat(a);throw p}var m=r("c757");c=m.config;n=c}if(a!=n.chainId)throw"parula-js.constructor:: provider.chain_id != config.chain_id";this.networkName=n.networkName,this.netId=n.netId,this.nftAddress=n.nftAddress,this.nft1155Address=n.nft1155Address,this.exchangeAddress=n.exchangeAddress,this.royaltiesAddress=n.royaltiesRegistryAddress,this.transferProxyAddress=n.transferProxyAddress,this.erc20TransferProxyAddress=n.erc20TransferProxyAddress;var y=["nftAddress","nft1155Address","netId","networkName","readonlyProviderUrl","exchangeAddress","royaltiesRegistryAddress","transferProxyAddress","erc20TransferProxyAddress"];y.forEach((function(e){if(void 0==n[e])throw"Configuration needed '".concat(e,"' is not defined")})),this.web3=new u(t),this.web3ReadOnly=new u(n.readonlyProviderUrl),this.gasPriceAddition=new u.utils.BN(2),n.web3=this.web3ReadOnly,this.api=new v(this.web3,n,f),this.logger=f||function(e){return e},this._emitter=new s}return a(e,[{key:"createArtwork",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r,f,i,a,o,s,u,c,l,h=this,d=arguments;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=d.length>1&&void 0!==d[1]?d[1]:"",f=d.length>2&&void 0!==d[2]?d[2]:[],this._verifyParamAddress([t]),r?this._verifyParamAddress([r]):r=t,i=this.nftAddress,a=this._makeContractInstance(N,this.nftAddress),f.forEach((function(e){var t=h.web3.utils.isAddress(e[0]);if(!t)throw"fail to mint with royalty, invalid address: ".concat(e[0]);var r=Number(e[1]);if(isNaN(r)||r<1||r>=1e3)throw"fail to mint with royalty, invalid value: ".concat(e[1])})),f.length>0?(this._verifyParamTypePart([f]),o=a.methods.mintItemWithRoyalty(r,r,f)):o=a.methods.mintItem(r),s=t,u={},e.next=12,this.sendTransactionAndConfirm(s,i,o,u,C.TransactionCreated,"Create NFT");case 12:if(c=e.sent,!c.status){e.next=18;break}return e.next=16,this._extractTransferInfo(c.tx.transactionHash);case 16:return l=e.sent,e.abrupt("return",n(n({},c),l));case 18:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"createArtwork1155",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r,f,i,a,o,s,u,c,l,h,d=arguments;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=d.length>1&&void 0!==d[1]?d[1]:"",f=d.length>2&&void 0!==d[2]?d[2]:1,i=d.length>3&&void 0!==d[3]?d[3]:[],this._verifyParamAddress([t]),r?this._verifyParamAddress([r]):r=t,this._verifyParamUintNumber([f]),a=this.nft1155Address,o=this._makeContractInstance(L,this.nft1155Address),i.length>0?(this._verifyParamTypePart([i]),s=o.methods.mintItemWithRoyalty(r,f,[],r,i)):s=o.methods.mintItem(r,f,[]),u=t,c={},e.next=13,this.sendTransactionAndConfirm(u,a,s,c,C.TransactionCreated,"Create NFT");case 13:if(l=e.sent,!l.status){e.next=19;break}return e.next=17,this._extractTransferInfo(l.tx.transactionHash);case 17:return h=e.sent,e.abrupt("return",n(n({},l),h));case 19:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"createSellOrder",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r,n,f,i,a,o,s,u,c,l,h,d,p,m,y,b,v,w,_,x,P,C,S,I,N;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r=t.maker,n=t.maTypeMV,f=t.maContractAddress,i=t.maValue,a=t.quantity,o=void 0===a?1:a,s=t.taker,u=void 0===s?T:s,c=t.taTypeMV,l=t.taContractAddress,h=t.taValue,d=t.salt,p=void 0===d?Date.now():d,m=t.startDatetime,y=void 0===m?0:m,b=t.endDatetime,v=void 0===b?0:b,c==k?this._verifyParamAddress([r,f,u]):this._verifyParamAddress([r,f,u,l]),this._verifyParamTypeMV([n,c]),this._verifyParamUintNumber([i,h]),n!=M){e.next=12;break}return e.next=7,this.getTokenOwnerOf(f,i);case 7:if(w=e.sent,w.toUpperCase()==r.toUpperCase()){e.next=10;break}return e.abrupt("return",{status:!1,err:"Orderer(".concat(r,") is not the token owner(").concat(w,")")});case 10:e.next=21;break;case 12:if(n!=A){e.next=20;break}return e.next=15,this.getBalanceOf(r,f,i);case 15:if(_=e.sent,!(Number(_)0&&(M=this._encAssetData(v.maTypeMV,v.maContAddr,v.maTokenId),x=R(v.maTypeMV,M,s)),e.next=19,this._makeOrderAndApprove(r,_,T,x,c,h,p,E,b);case 19:return A=e.sent,P=n==k?i:0,e.next=23,this._matchOrders(v.order,v.signature,A.order,A.signature,r,P);case 23:return C=e.sent,e.abrupt("return",C);case 25:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"createAuction",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r,f,i,a,o,s,u,c,l,h,d,p,m,y,g,b,v,w,_,E,x;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r=t.startDatetime,f=t.endDatetime,i=t.maker,a=t.maTypeMV,o=t.maContractAddress,s=t.maValue,u=t.quantity,c=void 0===u?1:u,l=t.taker,h=void 0===l?T:l,d=t.taTypeMV,p=t.taContractAddress,m=t.taPriceBegin,y=t.taPriceEnd,g=void 0===y?0:y,b=t.isTimeLimited,void 0===b||b,v=t.priceMinHidden,void 0===v?-1:v,this._verifyParamAddress([i,o,h]),this._verifyParamTypeMV([a,d]),this._verifyParamUintNumber([s,c,r,f,m,m]),a!=M){e.next=12;break}return e.next=7,this.getTokenOwnerOf(o,s);case 7:if(w=e.sent,w.toUpperCase()==i.toUpperCase()){e.next=10;break}return e.abrupt("return",{status:!1,err:"Orderer(".concat(i,") is not the token owner(").concat(w,")")});case 10:e.next=21;break;case 12:if(a!=A){e.next=20;break}return e.next=15,this.getBalanceOf(i,o,s);case 15:if(_=e.sent,!(_1&&void 0!==o[1]?o[1]:0,n=o.length>2&&void 0!==o[2]?o[2]:0,this._verifyParamAddress([t]),this._verifyParamUintNumber([n]),r){e.next=8;break}return e.next=7,this.web3.eth.getBalance(t);case 7:return e.abrupt("return",e.sent);case 8:return e.next=10,this.classify(r);case 10:if(f=e.sent,1155!=f){e.next=20;break}if(!(n<1)){e.next=14;break}throw"token id must bigger than 0";case 14:return i=this._makeContractInstance(B,r),e.next=17,i.methods.balanceOf(t,n).call();case 17:return e.abrupt("return",e.sent);case 20:if(20!=f&&721!=f){e.next=27;break}return a=this._makeContractInstance(O,r),e.next=24,a.methods.balanceOf(t).call();case 24:return e.abrupt("return",e.sent);case 27:throw"".concat(r," is not token(20,721,1155) contract.");case 28:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getTokenOwnerOf",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this._verifyParamAddress([t]),this._verifyParamUintNumber([r]),e.prev=2,n=this._makeContractInstance(N,t),e.next=6,n.methods.ownerOf(r).call();case 6:return e.abrupt("return",e.sent);case 9:throw e.prev=9,e.t0=e["catch"](2),"error:".concat(e.t0,": contract.ownerOf(").concat(r,") ");case 12:case"end":return e.stop()}}),e,this,[[2,9]])})));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"classify",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r,n,f,i,a,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this._verifyParamAddress([t]),r="0x80ac58cd",n="0xd9b67a26",f=this._makeContractInstance(D,t),e.prev=4,e.next=7,f.methods.supportsInterface(r).call();case 7:if(i=e.sent,!i){e.next=10;break}return e.abrupt("return",721);case 10:e.next=28;break;case 12:return e.prev=12,e.t0=e["catch"](4),a=this._makeContractInstance(O,t),e.prev=15,e.next=18,a.methods.totalSupply().call();case 18:return e.sent,e.next=21,a.methods.balanceOf(T).call();case 21:return e.sent,e.abrupt("return",20);case 25:return e.prev=25,e.t1=e["catch"](15),e.abrupt("return",9999);case 28:return e.next=30,f.methods.supportsInterface(n).call();case 30:if(o=e.sent,!o){e.next=33;break}return e.abrupt("return",1155);case 33:return e.abrupt("return",9999);case 34:case"end":return e.stop()}}),e,this,[[4,12],[15,25]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getRoyaltiesOwner",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r){var n,f,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this._verifyParamAddress([t]),this._verifyParamUintNumber([r]),n=this._makeContractInstance(N,t),e.next=5,n.methods.getRoyaltyOwner(r).call();case 5:if(f=e.sent,!f||f==T){e.next=8;break}return e.abrupt("return",f);case 8:return i=this._makeContractInstance(K,this.royaltiesAddress),e.next=11,i.methods.getRoyaltiesOwner(t,r).call();case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e,this)})));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"getRoyalties",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r){var n,f,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this._verifyParamAddress([t]),this._verifyParamUintNumber([r]),n=this._makeContractInstance(N,t),e.next=5,n.methods.getRoyalties(r).call();case 5:if(f=e.sent,!(f.length>0)){e.next=8;break}return e.abrupt("return",f);case 8:return i=this._makeContractInstance(K,this.royaltiesAddress),e.next=11,i.methods.getRoyalties(t,r).call();case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e,this)})));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"transferRoyaltiesOwnership",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r,f,i){var a,o,s,u,c;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this._verifyParamAddress([t,f,i]),this._verifyParamUintNumber([r]),f=f.toLowerCase(),e.next=5,this.getRoyaltiesOwner(t,r);case 5:if(a=e.sent,a.toLowerCase()!=f){e.next=8;break}return e.abrupt("return",{status:!0,ownerBefore:a});case 8:return e.prev=8,o=this._makeContractInstance(N,t),s=o.methods.transferRoyaltyOwnership(r,f),e.next=13,this.sendTransactionAndConfirm(i,t,s,{},C.TransferRoyaltiesOwnership,"Transfer royalties ownership");case 13:if(u=e.sent,1!=u.status){e.next=16;break}return e.abrupt("return",n(n({},u),{},{ownerBefore:a}));case 16:e.next=20;break;case 18:e.prev=18,e.t0=e["catch"](8);case 20:return c=this._makeContractInstance(K,this.royaltiesAddress),s=c.methods.transferRoyaltiesOwnership(t,r,f),e.next=24,this.sendTransactionAndConfirm(i,this.royaltiesAddress,s,{},C.TransferRoyaltiesOwnership,"Transfer royalties ownership");case 24:return u=e.sent,e.abrupt("return",n(n({},u),{},{ownerBefore:a}));case 26:case"end":return e.stop()}}),e,this,[[8,18]])})));function t(t,r,n,f){return e.apply(this,arguments)}return t}()},{key:"updateRoyalties",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r,f,i){var a,o,s,u,c,l,h;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this._verifyParamAddress([t,i]),this._verifyParamUintNumber([r]),this._verifyParamTypePart([f]),e.prev=3,e.next=6,this.getTokenOwnerOf(t,r);case 6:a=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e["catch"](3),e.abrupt("return",{status:!1,err:"contract or tokenId problem:: ".concat(JSON.stringify(e.t0))});case 12:return i=i.toLowerCase(),e.next=15,this.getRoyaltiesOwner(t,r);case 15:if(o=e.sent,(o!=T||a.toLowerCase()!=i)&&o.toLowerCase()!=i){e.next=42;break}return e.next=19,this.getRoyalties(t,r);case 19:return s=e.sent,e.prev=20,u=this._makeContractInstance(N,t),e.next=24,u.methods.updateRoyalty(r,f);case 24:return c=e.sent,e.next=27,this.sendTransactionAndConfirm(i,t,c,{},C.UpdateRoyalties,"Update royalties");case 27:if(l=e.sent,1!=l.status){e.next=30;break}return e.abrupt("return",n(n({},l),{},{royaltiesBefore:s,royaltiesNew:f}));case 30:e.next=34;break;case 32:e.prev=32,e.t1=e["catch"](20);case 34:return h=this._makeContractInstance(K,this.royaltiesAddress),c=h.methods.setRoyaltiesByTokenAndTokenId(t,r,f),e.next=38,this.sendTransactionAndConfirm(i,this.royaltiesAddress,c,{},C.UpdateRoyalties,"Update royalties");case 38:return l=e.sent,e.abrupt("return",n(n({},l),{},{royaltiesBefore:s,royaltiesNew:f}));case 42:return e.abrupt("return",{status:!1,tokenOwner:a,ownerBefore:o,updateRequestedFrom:i,err:"ownership problem"});case 43:case"end":return e.stop()}}),e,this,[[3,9],[20,32]])})));function t(t,r,n,f){return e.apply(this,arguments)}return t}()},{key:"_matchOrders",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r,n,f,i){var a,o,s,u,c,l,h=arguments;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=h.length>5&&void 0!==h[5]?h[5]:0,o=this._makeContractInstance(F,this.exchangeAddress),s=this.exchangeAddress,u=o.methods.matchOrders(t,r,n,f),c={value:a},e.next=7,this.sendTransactionAndConfirm(i,s,u,c,C.MatchOrders,"Match orders");case 7:return l=e.sent,e.abrupt("return",l);case 9:case"end":return e.stop()}}),e,this)})));function t(t,r,n,f,i){return e.apply(this,arguments)}return t}()},{key:"_approveTransferProxy",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r,f,i){var a,o,s,u,c,l,h,d,p,m,y,g,b,v;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(o=r,s={},t!=x){e.next=29;break}return u=this.erc20TransferProxyAddress,c=this._makeContractInstance(O,r),e.next=7,c.methods.allowance(i,u).call();case 7:if(l=e.sent,!this.toBN(l).gte(this.toBN(f))){e.next=23;break}return e.prev=9,e.next=12,this.web3.eth.call({from:i,to:r,data:this.web3.eth.abi.encodeFunctionSignature("symbol()")});case 12:h=e.sent,d=this.web3.eth.abi.decodeParameter("string",h),this.logger("".concat(i," approve ").concat(d,":").concat(l," for ").concat(u)),e.next=20;break;case 17:e.prev=17,e.t0=e["catch"](9),this.logger(e.t0);case 20:a={status:!0},e.next=27;break;case 23:return p=c.methods.approve(u,f),e.next=26,this.sendTransactionAndConfirm(i,o,p,s,C.ApproveCurrency,"Approve currency");case 26:a=e.sent;case 27:e.next=50;break;case 29:if(t!=M&&t!=A){e.next=49;break}return m=this.transferProxyAddress,y=t==M?this._makeContractInstance(N,r):this._makeContractInstance(L,r),e.next=34,y.methods.isApprovedForAll(i,m).call();case 34:if(b=e.sent,!b){e.next=43;break}return e.next=38,y.methods.symbol().call();case 38:d=e.sent,this.logger("".concat(i," approve ").concat(d,"# for ").concat(m)),a={status:!0},e.next=47;break;case 43:return g=y.methods.setApprovalForAll(m,!0),e.next=46,this.sendTransactionAndConfirm(i,o,g,s,C.ApproveOrder,"Set approval for all");case 46:a=e.sent;case 47:e.next=50;break;case 49:a={status:!0};case 50:return v=a.status?"":"approve fail",e.abrupt("return",n(n({},a),{},{err:v}));case 52:case"end":return e.stop()}}),e,this,[[9,17]])})));function t(t,r,n,f){return e.apply(this,arguments)}return t}()},{key:"_makeOrderAndApprove",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r,f,i,a,o,s,u,c){var l,h,d,m,g,b,v,w,_;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this._verifyParamAddress([t,f]),this._verifyParamUintNumber([a,o,s]),this._verifyParamAsset([r,i]),l=S(t,r,f,i,a,o,s,u,c),0==a){e.next=12;break}return e.next=7,p(this.web3,this.exchangeAddress,l,t);case 7:m=e.sent,d=m.sig,h=m.data,e.next=14;break;case 12:d="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",h="";case 14:return g=y(this.web3,r),b=g.typeMV,v=g.contractAddress,w=g.value,e.next=17,this._approveTransferProxy(b,v,w,t);case 17:return _=e.sent,e.abrupt("return",n(n({},_),{},{order:l,data:h,signature:d}));case 19:case"end":return e.stop()}}),e,this)})));function t(t,r,n,f,i,a,o,s,u){return e.apply(this,arguments)}return t}()},{key:"_extractTransferInfo",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r,n,f,i,a,o,s,u,c,l,h,d,p;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.web3.eth.getTransactionReceipt(t);case 2:if(r=e.sent,n=r.logs[0],f="0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",i="0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62",a=n.topics[0],c=0,a!=f){e.next=14;break}o=this.web3.eth.abi.decodeParameter("address",n.topics[1]),s=this.web3.eth.abi.decodeParameter("address",n.topics[2]),u=this.web3.eth.abi.decodeParameter("uint",n.topics[3]),e.next=24;break;case 14:if(a!=i){e.next=22;break}o=this.web3.eth.abi.decodeParameter("address",n.topics[2]),s=this.web3.eth.abi.decodeParameter("address",n.topics[3]),l=this.web3.eth.abi.decodeParameter("(uint256,uint256)",n.data),u=l[0],c=l[1],e.next=24;break;case 22:return this.logger("event type is not handled."),e.abrupt("return",{});case 24:return h=n.blockNumber,d=n.address,p=o==T,e.abrupt("return",{status:!0,blockNumber:h,transactionHash:t,contractAddress:d,tokenId:Number(u),quantity:Number(c),from:o,to:s,isMinted:p});case 28:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"sendTransactionAndConfirm",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r,n,f,i,a){var o,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._lowLevelSend(t,r,n,f);case 2:if(o=e.sent,!o.status){e.next=10;break}return e.next=6,this._confirmTransaction(o.transactionHash,i,a);case 6:return s=e.sent,e.abrupt("return",{status:s,tx:o});case 10:return e.abrupt("return",{status:!1,tx:o});case 11:case"end":return e.stop()}}),e,this)})));function t(t,r,n,f,i,a){return e.apply(this,arguments)}return t}()},{key:"_lowLevelSend",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r,f,i){var a,o,s,u,c,l;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=f.encodeABI(),e.prev=1,e.next=4,f.estimateGas(n({from:t,to:r},i));case 4:return o=e.sent,e.next=7,this.web3.eth.getBlock("latest");case 7:return s=e.sent,s.gasLimit,e.next=11,this.web3.eth.getTransactionCount(t);case 11:return u=e.sent,c=n({from:t,to:r,data:a,gas:o,nonce:u},i),1001!=this.netId&&8217!=this.netId?c.type="0x2":c.gasPrice=this.web3.utils.toWei("250","gwei"),e.next=16,this.web3.eth.sendTransaction(c).once("transactionHash",(function(e){})).once("receipt",(function(e){})).once("error",(function(e){return{status:!1,error:e}}));case 16:return l=e.sent,e.abrupt("return",l);case 20:return e.prev=20,e.t0=e["catch"](1),e.abrupt("return",{status:!1,err:e.t0});case 23:case"end":return e.stop()}}),e,this,[[1,20]])})));function t(t,r,n,f){return e.apply(this,arguments)}return t}()},{key:"_lowLevelCall",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r,n){var f,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return f=n.encodeABI(),e.prev=1,e.next=4,web3.eth.call({from:t,to:r,data:f});case 4:return i=e.sent,e.abrupt("return",this.web3.eth.abi.decodeParameters(n._method.outputs,i)[0]);case 8:return e.prev=8,e.t0=e["catch"](1),e.abrupt("return",{});case 11:case"end":return e.stop()}}),e,this,[[1,8]])})));function t(t,r,n){return e.apply(this,arguments)}return t}()},{key:"_computeGasPrice",value:function(){var e=f(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.web3.eth.getGasPrice();case 2:return t=e.sent,r=u.utils.toBN(this.web3.utils.toWei(this.gasPriceAddition,"gwei")),e.abrupt("return",u.utils.toBN(t).add(r).toString());case 5:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_getMaxPriorityToGas",value:function(){var e=f(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=u.utils.toBN(this.web3.utils.toWei(this.gasPriceAddition,"gwei")),e.abrupt("return",t.toString());case 2:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_confirmTransaction",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r,f,i){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(a={transactionHash:t,event:r},this.logger("transaction started - ".concat(f)),t!=_){e.next=12;break}if(this._dispatch(C.TransactionCreated,{event:r}),i){e.next=9;break}return this.logger("Unknown action, waiting 1 minute: ".concat(f)),e.next=8,delay(6e4);case 8:return e.abrupt("return");case 9:return e.next=11,this._pollCallbackForConfirmation(r,f,i);case 11:return e.abrupt("return",e.sent);case 12:return e.prev=12,this._dispatch(C.TransactionCreated,a),e.next=16,d(this.web3,t);case 16:return this.logger("transaction succeed - ".concat(f)),this._dispatch(C.TransactionConfirmed,a),e.abrupt("return",!0);case 21:throw e.prev=21,e.t0=e["catch"](12),this.logger("transaction failed: - ".concat(f)),this._dispatch(C.TransactionFailed,n(n({},a),{},{error:e.t0})),e.t0;case 26:case"end":return e.stop()}}),e,this,[[12,21]])})));function t(t,r,n,f){return e.apply(this,arguments)}return t}()},{key:"_pollCallbackForConfirmation",value:function(){var e=f(regeneratorRuntime.mark((function e(t,r,n){var i=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=f(regeneratorRuntime.mark((function e(a,o){var s,u;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return s=60,u=function(){var e=f(regeneratorRuntime.mark((function e(f){var c;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,n();case 2:if(c=e.sent,!c){e.next=9;break}return i.logger("Transaction succeeded: ".concat(r)),i._dispatch(C.TransactionConfirmed,{event:t}),e.abrupt("return",a(!0));case 9:if(!(f<=0)){e.next=11;break}return e.abrupt("return",o(!1));case 11:return f%10==0&&i.logger("Tested transaction ".concat(s-f+1," times: ").concat(r)),e.next=14,delay(5e3);case 14:return e.abrupt("return",u(f-1));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",u(s));case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)})));function t(t,r,n){return e.apply(this,arguments)}return t}()},{key:"_dispatch",value:function(e,t){this._emitter.emit(e,t)}},{key:"_makeContractInstance",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return h(this.web3,this.netId,e,t)}},{key:"_encAssetData",value:function(e,t,r){var n;if(e==k)n=m(this.web3,T);else if(e==x)n=m(this.web3,t);else{if(e!=M&&e!=A)throw"unknown type magic-value (".concat(e,")");n=m(this.web3,t,r)}return n}},{key:"_verifyParamAddress",value:function(e){e.forEach((function(e){if(void 0==e)throw"Address 'undefined' passed";if(42!=e.length)throw"Address length incorrect :".concat(e)}))}},{key:"_verifyParamTypeMV",value:function(e){e.forEach((function(e){if(void 0==e)throw"typeMV 'undefined' passed";if(10!=e.length)throw"typeMV length incorrect : ".concat(e)}))}},{key:"_verifyParamUintNumber",value:function(e){}},{key:"_verifyParamTypePart",value:function(e){var t=this;e.forEach((function(e){e.forEach((function(e){if(void 0==e)throw"value 'undefined' passed";if(e.length>0){var r=e[0],n=e[1];t._verifyParamAddress([r]),t._verifyParamUintNumber([n])}}))}))}},{key:"_verifyParamAsset",value:function(e){var t=this;e.forEach((function(e){if(void 0==e)throw"asset 'undefined' passed";var r=e.assetType,n=e.value;if(void 0==r)throw"assetType 'undefined' passed";t._verifyParamUintNumber([n])}))}},{key:"_checkDiffAssets",value:function(e,t){if(e.assetType.assetClass!=t.assetType.assetClass||e.assetType.data!=t.assetType.data)throw"asset not matched"}},{key:"toBN",value:function(e){return new this.web3.utils.BN(e)}},{key:"getERC721ContractInstance",value:function(){var e=f(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._makeContractInstance(N,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getERC1155ContractInstance",value:function(){var e=f(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._makeContractInstance(L,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getIERC20ContractInstance",value:function(){var e=f(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._makeContractInstance(O,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"get721TokenUri",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getParu721ContractInstance();case 2:return r=e.sent,e.next=5,r.methods.tokenURI(t).call();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"get1155TokenUri",value:function(){var e=f(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getParu1155ContractInstance();case 2:return r=e.sent,e.next=5,r.methods.uri(t).call();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getExchangeContractInstance",value:function(){var e=f(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(42==t.length){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this._makeContractInstance(F,t);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getParu721ContractInstance",value:function(){var e=f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._makeContractInstance(N,this.nftAddress);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"getParu1155ContractInstance",value:function(){var e=f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._makeContractInstance(L,this.nft1155Address);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"setGasAddition",value:function(e){this.gasPriceAddition=new u.utils.BN(e)}}]),e}();e.exports={Parula:U}},b437:function(e,t){const r=(e=>()=>(t,r,n)=>{if(!e[t.id])return e[t.id]=(new Date).getTime(),void n();e[t.id]=(new Date).getTime()-e[t.id],console.log(`request '${t.id}' takes an ${e[t.id]} milliseconds for responding. : ${t.method}`),r(Object.assign(t,{timeTakes:e[t.id]}))})({});e.exports=r},b460:function(e,t,r){"use strict";(function(t){var n=r("2213"),f=r("20b1"),i=r("0576"),a=function(e){return 32===e.length&&n.privateKeyVerify(Uint8Array.from(e))},o=function(e,t){if(32!==e.length)throw new RangeError("private key length is invalid");var r=f.privateKeyExport(e,t);return i.privateKeyExport(e,r,t)},s=function(e){if(e=i.privateKeyImport(e),null!==e&&32===e.length&&a(e))return e;throw new Error("couldn't import from DER format")},u=function(e){return t.from(n.privateKeyNegate(Uint8Array.from(e)))},c=function(e){if(32!==e.length)throw new Error("private key length is invalid");return t.from(f.privateKeyModInverse(Uint8Array.from(e)))},l=function(e,r){return t.from(n.privateKeyTweakAdd(Uint8Array.from(e),r))},h=function(e,r){return t.from(n.privateKeyTweakMul(Uint8Array.from(e),Uint8Array.from(r)))},d=function(e,r){return t.from(n.publicKeyCreate(Uint8Array.from(e),r))},p=function(e,r){return t.from(n.publicKeyConvert(Uint8Array.from(e),r))},m=function(e){return(33===e.length||65===e.length)&&n.publicKeyVerify(Uint8Array.from(e))},y=function(e,r,f){return t.from(n.publicKeyTweakAdd(Uint8Array.from(e),Uint8Array.from(r),f))},g=function(e,r,f){return t.from(n.publicKeyTweakMul(Uint8Array.from(e),Uint8Array.from(r),f))},b=function(e,r){var f=[];return e.forEach((function(e){f.push(Uint8Array.from(e))})),t.from(n.publicKeyCombine(f,r))},v=function(e){return t.from(n.signatureNormalize(Uint8Array.from(e)))},w=function(e){return t.from(n.signatureExport(Uint8Array.from(e)))},_=function(e){return t.from(n.signatureImport(Uint8Array.from(e)))},T=function(e){if(0===e.length)throw new RangeError("signature length is invalid");var t=i.signatureImportLax(e);if(null===t)throw new Error("couldn't parse DER signature");return f.signatureImport(t)},E=function(e,r,f){if(null===f)throw new TypeError("options should be an Object");var i=void 0;if(f){if(i={},null===f.data)throw new TypeError("options.data should be a Buffer");if(f.data){if(32!==f.data.length)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(f.data)}if(null===f.noncefn)throw new TypeError("options.noncefn should be a Function");f.noncefn&&(i.noncefn=function(e,r,n,i,a){var o=null!=n?t.from(n):null,s=null!=i?t.from(i):null,u=t.from("");return f.noncefn&&(u=f.noncefn(t.from(e),t.from(r),o,s,a)),Uint8Array.from(u)})}var a=n.ecdsaSign(Uint8Array.from(e),Uint8Array.from(r),i);return{signature:t.from(a.signature),recovery:a.recid}},x=function(e,t,r){return n.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),r)},M=function(e,r,f,i){return t.from(n.ecdsaRecover(Uint8Array.from(r),f,Uint8Array.from(e),i))},A=function(e,r){return t.from(n.ecdh(Uint8Array.from(e),Uint8Array.from(r),{}))},k=function(e,r,n){if(33!==e.length&&65!==e.length)throw new RangeError("public key length is invalid");if(32!==r.length)throw new RangeError("private key length is invalid");return t.from(f.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(r),n))};e.exports={privateKeyVerify:a,privateKeyExport:o,privateKeyImport:s,privateKeyNegate:u,privateKeyModInverse:c,privateKeyTweakAdd:l,privateKeyTweakMul:h,publicKeyCreate:d,publicKeyConvert:p,publicKeyVerify:m,publicKeyTweakAdd:y,publicKeyTweakMul:g,publicKeyCombine:b,signatureNormalize:v,signatureExport:w,signatureImport:_,signatureImportLax:T,sign:E,verify:x,recover:M,ecdh:A,ecdhUnsafe:k}}).call(this,r("b639").Buffer)},b47d:function(e,t,r){const n=r("2ef0"),f=r("19d7"),i=r("0664"),a=r("558a"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s,CODE_FORMAT:u,getCodeFormatTag:c}=r("1789"),l=r("19b5");function h(e){if(e=l.addHexPrefix(e),!e.startsWith(s.TxTypeFeeDelegatedSmartContractDeploy))throw new Error(`Cannot decode to FeeDelegatedSmartContractDeploy. The prefix must be ${s.TxTypeFeeDelegatedSmartContractDeploy}: ${e}`);const t="0x"+e.slice(4),[r,n,i,a,o,u,c,h,d,p,m,y]=f.decode(t);return{nonce:l.trimLeadingZero(r),gasPrice:l.trimLeadingZero(n),gas:l.trimLeadingZero(i),to:a,value:l.trimLeadingZero(o),from:u,input:c,humanReadable:"0x1"===h,codeFormat:d,signatures:p,feePayer:m,feePayerSignatures:y}}class d extends a{static create(e){return new d(e)}static decode(e){return new d(h(e))}constructor(e){if(n.isString(e)&&(e=h(e)),super(o.TxTypeFeeDelegatedSmartContractDeploy,e),this.to=e.to||"0x",this.value=e.value||"0x0",e.input&&e.data)throw new Error("'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.");this.input=e.input||e.data,this.humanReadable=void 0!==e.humanReadable&&e.humanReadable,this.codeFormat=void 0!==e.codeFormat?e.codeFormat:u.EVM}get to(){return this._to}set to(e){if("0x"!==e)throw new Error("Invalid address of to: 'to' should be '0x' with smart contract deploy transaction.");this._to=e.toLowerCase()}get value(){return this._value}set value(e){this._value=l.numberToHex(e)}get input(){return this._input}set input(e){if(!e||!l.isHex(e))throw new Error("Invalid input data "+e);this._input=l.addHexPrefix(e)}get data(){return this._input}set data(e){this._input=e}get humanReadable(){return this._humanReadable}set humanReadable(e){if(!n.isBoolean(e))throw new Error("Invalid humanReadable "+e);this._humanReadable=e}get codeFormat(){return this._codeFormat}set codeFormat(e){this._codeFormat=c(e)}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode()),t=this.feePayerSignatures.map(e=>e.encode());return s.TxTypeFeeDelegatedSmartContractDeploy+f.encode([i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.from.toLowerCase(),this.input,i.fromNat(!0===this.humanReadable?"0x1":"0x0"),i.fromNat(this.codeFormat),e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),f.encode([s.TxTypeFeeDelegatedSmartContractDeploy,i.fromNat(this.nonce),i.fromNat(this.gasPrice),i.fromNat(this.gas),this.to.toLowerCase(),i.fromNat(this.value),this.from.toLowerCase(),this.input,i.fromNat(!0===this.humanReadable?"0x1":"0x0"),i.fromNat(this.codeFormat)])}}e.exports=d},b4ba:function(e,t,r){"use strict";const n=r("d894"),{collectify:f,pullify:i,concatify:a}=r("9661");e.exports=e=>{const t=r("a406")(e),o=r("d057")(e),s=r("7e34")(e),u=r("d9b4")(e);return{add:n(f(t),{minArgs:1}),addPullStream:i.transform(t),addFromStream:n(f(t),{minArgs:1}),addFromURL:n(f(r("96ed")(e))),bitswap:{stat:n(r("69c7")(e)),wantlist:n(r("5c91")(e))},block:{get:n(r("3066")(e)),put:n(r("7ce7")(e)),stat:n(r("2d58")(e))},cat:n(a(o)),catPullStream:i.source(o),files:{cp:n(r("0b4a")(e)),mkdir:n(r("0a8f")(e)),write:n(r("3676")(e))},ls:n(f(s)),lsPullStream:i.source(s),id:n(r("a7cb")(e)),ping:n(f(u)),pingPullStream:i.source(u),pubsub:{ls:n(r("2473")(e)),peers:n(r("def2")(e)),publish:n(r("77a4")(e)),subscribe:n(r("add9")(e),{minArgs:2}),unsubscribe:n(r("74c8")(e),{minArgs:2})},swarm:{connect:n(r("d9f1")(e)),peers:n(r("651f")(e))},version:n(r("3a3a")(e))}}},b5c0:function(e,t,r){"use strict";(function(e){const n=r("a153");t.toFormData=async t=>{const r=n(t),f=new FormData;let i=0;for await(const n of r){if(n.content){const t=[];for await(const r of n.content)t.push(e.isBuffer(r)?r.buffer:r);f.append("file-"+i,new Blob(t,{type:"application/octet-stream"}),n.path)}else f.append("dir-"+i,new Blob([],{type:"application/x-directory"}),n.path);i++}return f}}).call(this,r("b639").Buffer)},b8a5:function(e,t,r){const{TX_TYPE_STRING:n,typeDetectionFromRLPEncoding:f}=r("1789"),i=r("74ef"),a=r("a73f"),o=r("8e37"),s=r("a8cf"),u=r("7d90"),c=r("67da"),l=r("1605"),h=r("03c7"),d=r("5a46"),p=r("eace"),m=r("6a9e"),y=r("b47d"),g=r("d287"),b=r("4bac"),v=r("ab51"),w=r("d9ea"),_=r("08e8"),T=r("db81"),E=r("df7a"),x=r("0b87"),M=r("064c"),A=r("1830");class k{static decode(e){const t=f(e);switch(t){case n.TxTypeLegacyTransaction:return i.decode(e);case n.TxTypeValueTransfer:return a.decode(e);case n.TxTypeFeeDelegatedValueTransfer:return o.decode(e);case n.TxTypeFeeDelegatedValueTransferWithRatio:return s.decode(e);case n.TxTypeValueTransferMemo:return u.decode(e);case n.TxTypeFeeDelegatedValueTransferMemo:return c.decode(e);case n.TxTypeFeeDelegatedValueTransferMemoWithRatio:return l.decode(e);case n.TxTypeAccountUpdate:return h.decode(e);case n.TxTypeFeeDelegatedAccountUpdate:return d.decode(e);case n.TxTypeFeeDelegatedAccountUpdateWithRatio:return p.decode(e);case n.TxTypeSmartContractDeploy:return m.decode(e);case n.TxTypeFeeDelegatedSmartContractDeploy:return y.decode(e);case n.TxTypeFeeDelegatedSmartContractDeployWithRatio:return g.decode(e);case n.TxTypeSmartContractExecution:return b.decode(e);case n.TxTypeFeeDelegatedSmartContractExecution:return v.decode(e);case n.TxTypeFeeDelegatedSmartContractExecutionWithRatio:return w.decode(e);case n.TxTypeCancel:return _.decode(e);case n.TxTypeFeeDelegatedCancel:return T.decode(e);case n.TxTypeFeeDelegatedCancelWithRatio:return E.decode(e);case n.TxTypeChainDataAnchoring:return x.decode(e);case n.TxTypeFeeDelegatedChainDataAnchoring:return M.decode(e);case n.TxTypeFeeDelegatedChainDataAnchoringWithRatio:return A.decode(e)}}}e.exports=k},b924:function(e,t,r){t.NFTContract=r("339a"),t.NFT1155Contract=r("b056"),t.Exchange=r("db92"),t.RoyaltiesRegistry=r("f001"),t.TransferProxy=r("148d"),t.ERC20TransferProxy=r("0c39"),t.IERC20=r("9bc81"),t.IERC721=r("58e7"),t.IERC1155=r("39c0"),t.IERC165=r("4af6")},b949:function(e,t,r){var n,f;(function(r,i,a,o,s,u){var c=m((function(e,t){var r=t.length;return m((function(n){for(var f=0;fc&&($("Max buffer length exceeded: textNode"),e=Math.max(e,F.length)),K.length>c&&($("Max buffer length exceeded: numberNode"),e=Math.max(e,K.length)),L=c-e+G}function $(e){F!==u&&(i(F),a(),F=u),t=o(e+"\nLn: "+q+"\nCol: "+W+"\nChr: "+r),s(ge(u,u,t))}function z(){if(B==d)return i({}),a(),void(D=!0);B===p&&0===H||$("Unexpected end"),F!==u&&(i(F),a(),F=u),D=!0}function Z(e){return"\r"==e||"\n"==e||" "==e||"\t"==e}function J(e){if(!t){if(D)return $("Cannot write after close");var o=0;r=e[0];while(r){if(n=r,r=e[o++],!r)break;switch(G++,"\n"==r?(q++,W=0):W++,B){case d:if("{"===r)B=m;else if("["===r)B=g;else if(!Z(r))return $("Non-whitespace before {[.");continue;case w:case m:if(Z(r))continue;if(B===w)U.push(_);else{if("}"===r){i({}),a(),B=U.pop()||p;continue}U.push(y)}if('"'!==r)return $('Malformed object key should start with " ');B=v;continue;case _:case y:if(Z(r))continue;if(":"===r)B===y?(U.push(y),F!==u&&(i({}),f(F),F=u),H++):F!==u&&(f(F),F=u),B=p;else if("}"===r)F!==u&&(i(F),a(),F=u),a(),H--,B=U.pop()||p;else{if(","!==r)return $("Bad object");B===y&&U.push(y),F!==u&&(i(F),a(),F=u),B=w}continue;case g:case p:if(Z(r))continue;if(B===g){if(i([]),H++,B=p,"]"===r){a(),H--,B=U.pop()||p;continue}U.push(b)}if('"'===r)B=v;else if("{"===r)B=m;else if("["===r)B=g;else if("t"===r)B=T;else if("f"===r)B=M;else if("n"===r)B=C;else if("-"===r)K+=r;else if("0"===r)K+=r,B=N;else{if(-1==="123456789".indexOf(r))return $("Bad value");K+=r,B=N}continue;case b:if(","===r)U.push(b),F!==u&&(i(F),a(),F=u),B=p;else{if("]"!==r){if(Z(r))continue;return $("Bad array")}F!==u&&(i(F),a(),F=u),a(),H--,B=U.pop()||p}continue;case v:F===u&&(F="");var s=o-1;e:while(1){while(V>0)if(j+=r,r=e.charAt(o++),4===V?(F+=String.fromCharCode(parseInt(j,16)),V=0,s=o-1):V++,!r)break e;if('"'===r&&!O){B=U.pop()||p,F+=e.substring(s,o-1);break}if("\\"===r&&!O&&(O=!0,F+=e.substring(s,o-1),r=e.charAt(o++),!r))break;if(O){if(O=!1,"n"===r?F+="\n":"r"===r?F+="\r":"t"===r?F+="\t":"f"===r?F+="\f":"b"===r?F+="\b":"u"===r?(V=1,j=""):F+=r,r=e.charAt(o++),s=o-1,r)continue;break}l.lastIndex=o;var c=l.exec(e);if(!c){o=e.length+1,F+=e.substring(s,o-1);break}if(o=c.index+1,r=e.charAt(c.index),!r){F+=e.substring(s,o-1);break}}continue;case T:if(!r)continue;if("r"!==r)return $("Invalid true started with t"+r);B=E;continue;case E:if(!r)continue;if("u"!==r)return $("Invalid true started with tr"+r);B=x;continue;case x:if(!r)continue;if("e"!==r)return $("Invalid true started with tru"+r);i(!0),a(),B=U.pop()||p;continue;case M:if(!r)continue;if("a"!==r)return $("Invalid false started with f"+r);B=A;continue;case A:if(!r)continue;if("l"!==r)return $("Invalid false started with fa"+r);B=k;continue;case k:if(!r)continue;if("s"!==r)return $("Invalid false started with fal"+r);B=P;continue;case P:if(!r)continue;if("e"!==r)return $("Invalid false started with fals"+r);i(!1),a(),B=U.pop()||p;continue;case C:if(!r)continue;if("u"!==r)return $("Invalid null started with n"+r);B=S;continue;case S:if(!r)continue;if("l"!==r)return $("Invalid null started with nu"+r);B=R;continue;case R:if(!r)continue;if("l"!==r)return $("Invalid null started with nul"+r);i(null),a(),B=U.pop()||p;continue;case I:if("."!==r)return $("Leading zero not followed by .");K+=r,B=N;continue;case N:if(-1!=="0123456789".indexOf(r))K+=r;else if("."===r){if(-1!==K.indexOf("."))return $("Invalid number has two dots");K+=r}else if("e"===r||"E"===r){if(-1!==K.indexOf("e")||-1!==K.indexOf("E"))return $("Invalid number has two exponential");K+=r}else if("+"===r||"-"===r){if("e"!==n&&"E"!==n)return $("Invalid symbol in number");K+=r}else K&&(i(parseFloat(K)),a(),K=""),o--,B=U.pop()||p;continue;default:return $("Unknown state: "+B)}}G>=L&&Y()}}e(le).on(J),e(he).on(z)}function j(e,t){"use strict";var r,n={};function f(e){return function(t){r=e(r,t)}}for(var i in t)e(i).on(f(t[i]),n);e(ie).on((function(e){var t,n=P(r),f=z(n),i=C(r);i&&(t=Z(P(i)),t[f]=e)})),e(ae).on((function(){var e,t=P(r),n=z(t),f=C(r);f&&(e=Z(P(f)),delete e[n])})),e(de).on((function(){for(var r in t)e(r).un(n)}))}function V(e){var t={};return e&&e.split("\r\n").forEach((function(e){var r=e.indexOf(": ");t[e.substring(0,r)]=e.substring(r+2)})),t}function H(e,t){function r(e){return{"http:":80,"https:":443}[e]}function n(t){return t.port||r(t.protocol||e.protocol)}return!!(t.protocol&&t.protocol!=e.protocol||t.host&&t.host!=e.host||t.host&&n(t)!=n(e))}function G(e){var t=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/,r=t.exec(e)||[];return{protocol:r[1]||"",host:r[2]||"",port:r[3]||""}}function W(){return new XMLHttpRequest}function q(e,t,n,f,i,a,o){"use strict";var s=e(le).emit,l=e(oe).emit,h=0,d=!0;function p(){var e=t.responseText,r=e.substr(h);r&&s(r),h=T(e)}e(de).on((function(){t.onreadystatechange=null,t.abort()})),"onprogress"in t&&(t.onprogress=p),t.onreadystatechange=function(){function r(){try{d&&e(ce).emit(t.status,V(t.getAllResponseHeaders())),d=!1}catch(r){}}switch(t.readyState){case 2:case 3:return r();case 4:r();var n=2==String(t.status)[0];n?(p(),e(he).emit()):l(ge(t.status,t.responseText))}};try{for(var m in t.open(n,f,!0),a)t.setRequestHeader(m,a[m]);H(r.location,G(f))||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=o,t.send(i)}catch(y){r.setTimeout(c(l,ge(u,u,y)),0)}}var Y=function(){var e=function(e){return e.exec.bind(e)},t=m((function(t){return t.unshift(/^/),e(RegExp(t.map(h("source")).join("")))})),r=/(\$?)/,n=/([\w-_]+|\*)/,f=/()/,i=/\["([^"]+)"\]/,a=/\[(\d+|\*)\]/,o=/{([\w ]*?)}/,s=/(?:{([\w ]*?)})?/,u=t(r,n,s),c=t(r,i,s),l=t(r,a,s),p=t(r,f,o),y=t(/\.\./),g=t(/\./),b=t(r,/!/),v=t(/$/);return function(e){return e(d(u,c,l,p),y,g,b,v)}}();function $(e,t){return{key:e,node:t}}var z=h("key"),Z=h("node"),J={};function X(e){var t=e(ne).emit,r=e(fe).emit,n=e(ue).emit,f=e(se).emit;function i(e,t){var r=Z(P(e));return _(a,r)?u(e,T(r),t):e}function o(e,t){if(!e)return n(t),u(e,J,t);var r=i(e,t),f=C(r),a=z(P(r));return s(f,a,t),A($(a,t),f)}function s(e,t,r){Z(P(e))[t]=r}function u(e,r,n){e&&s(e,r,n);var f=A($(r,n),e);return t(f),f}function c(e){return r(e),C(e)||f(Z(P(e)))}var l={};return l[me]=o,l[ye]=c,l[pe]=u,l}var Q=Y((function(e,t,r,n,f){var i=1,a=2,s=3,u=l(z,P),h=l(Z,P);function p(e,t){var r=t[a],n=r&&"*"!=r?function(e){return u(e)==r}:v;return g(n,e)}function m(e,t){var r=t[s];if(!r)return e;var n=c(M,S(r.split(/\W+/))),f=l(n,h);return g(f,e)}function y(e,t){var r=!!t[i];return r?g(e,P):e}function b(e){if(e==v)return v;function t(e){return u(e)!=J}return g(t,l(e,C))}function w(e){if(e==v)return v;var t=_(),r=e,n=b((function(e){return f(e)})),f=d(t,r,n);return f}function _(){return function(e){return u(e)==J}}function E(e){return function(t){var r=e(t);return!0===r?P(t):r}}function x(e,t,r){return L((function(e,t){return t(e,r)}),t,e)}function A(e,t,r,n,f){var i=e(r);if(i){var a=x(t,n,i),o=r.substr(T(i[0]));return f(o,a)}}function k(e,t){return c(A,e,t)}var I=d(k(e,R(y,m,p,b)),k(t,R(w)),k(r,R()),k(n,R(y,_)),k(f,R(E)),(function(e){throw o('"'+e+'" could not be tokenised')}));function N(e,t){return t}function F(e,t){var r=e?F:N;return I(e,t,r)}return function(e){try{return F(e,v)}catch(t){throw o('Could not compile "'+e+'" because '+t.message)}}}));function ee(e,t,r){var n,f;function i(e){return function(t){return t.id==e}}return{on:function(r,i){var a={listener:r,id:i||r};return t&&t.emit(e,r,a.id),n=A(a,n),f=A(r,f),this},emit:function(){O(f,arguments)},un:function(t){var a;n=F(n,i(t),(function(e){a=e})),a&&(f=F(f,(function(e){return e==a.listener})),r&&r.emit(e,a.listener,a.id))},listeners:function(){return f},hasListener:function(e){var t=e?i(e):v;return x(B(t,n))}}}function te(){var e={},t=n("newListener"),r=n("removeListener");function n(n){return e[n]=ee(n,t,r)}function f(t){return e[t]||n(t)}return["emit","on","un"].forEach((function(e){f[e]=m((function(t,r){p(r,f(t)[e])}))})),f}var re=1,ne=re++,fe=re++,ie=re++,ae=re++,oe="fail",se=re++,ue=re++,ce="start",le="data",he="end",de=re++,pe=re++,me=re++,ye=re++;function ge(e,t,r){try{var n=s.parse(t)}catch(f){}return{statusCode:e,body:t,jsonBody:n,thrown:r}}function be(e,t){var r={node:e(fe),path:e(ne)};function n(e,t,r){var n=D(r);e(t,I(C(N(z,n))),I(N(Z,n)))}function f(t,r,f){var i=e(t).emit;r.on((function(e){var t=f(e);!1!==t&&n(i,Z(t),e)}),t),e("removeListener").on((function(n){n==t&&(e(n).listeners()||r.un(t))}))}e("newListener").on((function(e){var n=/(node|path):(.*)/.exec(e);if(n){var i=r[n[1]];i.hasListener(e)||f(e,i,t(n[2]))}}))}function ve(e,t){var r,n=/^(node|path):./,f=e(se),i=e(ae).emit,a=e(ie).emit,o=m((function(t,f){if(r[t])p(f,r[t]);else{var i=e(t),a=f[0];n.test(t)?l(i,a):i.on(a)}return r})),s=function(t,n,i){if("done"==t)f.un(n);else if("node"==t||"path"==t)e.un(t+":"+n,i);else{var a=n;e(t).un(a)}return r};function u(t,n){return e(t).on(h(n),n),r}function l(e,t,n){n=n||t;var f=h(t);return e.on((function(){var t=!1;r.forget=function(){t=!0},p(arguments,f),delete r.forget,t&&e.un(n)}),n),r}function h(e){return function(){try{return e.apply(r,arguments)}catch(t){setTimeout((function(){throw t}))}}}function d(t,r){return e(t+":"+r)}function y(e){return function(){var t=e.apply(this,arguments);x(t)&&(t==Te.drop?i():a(t))}}function g(e,t,r){var n;n="node"==e?y(r):r,l(d(e,t),n,r)}function v(e,t){for(var r in t)g(e,r,t[r])}function _(e,t,n){return E(t)?g(e,t,n):v(e,t),r}return e(ue).on((function(e){r.root=w(e)})),e(ce).on((function(e,t){r.header=function(e){return e?t[e]:t}})),r={on:o,addListener:o,removeListener:s,emit:e.emit,node:c(_,"node"),path:c(_,"path"),done:c(l,f),start:c(u,ce),fail:e(oe).on,abort:e(de).emit,header:b,root:b,source:t}}function we(e,t,r,n,f){var i=te();return t&&q(i,W(),e,t,r,n,f),U(i),j(i,X(i)),be(i,Q),ve(i,t)}function _e(e,t,r,n,f,i,a){function o(e,t){return!1===t&&(-1==e.indexOf("?")?e+="?":e+="&",e+="_="+(new Date).getTime()),e}return f=f?s.parse(s.stringify(f)):{},n?E(n)||(n=s.stringify(n),f["Content-Type"]=f["Content-Type"]||"application/json"):n=null,e(r||"GET",o(t,a),n,f,i||!1)}function Te(e){var t=R("resume","pause","pipe"),r=c(M,t);return e?r(e)||E(e)?_e(we,e):_e(we,e.url,e.method,e.body,e.headers,e.withCredentials,e.cached):we()}Te.drop=function(){return Te.drop},n=[],f=function(){return Te}.apply(t,n),f===u||(e.exports=f)})(function(){try{return window}catch(e){return self}}(),Object,Array,Error,JSON)},b978:function(e,t,r){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f=r("c331"),i=f.keccak224,a=f.keccak384,o=f.keccak256,s=f.keccak512,u=r("8d9e"),c=r("f654"),l=r("a3ca"),h=r("f934"),d=r("98e6"),p=r("8707").Buffer;Object.assign(t,r("9a12")),t.MAX_INTEGER=new h("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new h("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.SHA3_NULL_S=t.KECCAK256_NULL_S,t.KECCAK256_NULL=p.from(t.KECCAK256_NULL_S,"hex"),t.SHA3_NULL=t.KECCAK256_NULL,t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.SHA3_RLP_ARRAY_S=t.KECCAK256_RLP_ARRAY_S,t.KECCAK256_RLP_ARRAY=p.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.SHA3_RLP_ARRAY=t.KECCAK256_RLP_ARRAY,t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.SHA3_RLP_S=t.KECCAK256_RLP_S,t.KECCAK256_RLP=p.from(t.KECCAK256_RLP_S,"hex"),t.SHA3_RLP=t.KECCAK256_RLP,t.BN=h,t.rlp=l,t.secp256k1=u,t.zeros=function(e){return p.allocUnsafe(e).fill(0)},t.zeroAddress=function(){var e=20,r=t.zeros(e);return t.bufferToHex(r)},t.setLengthLeft=t.setLength=function(e,r,n){var f=t.zeros(r);return e=t.toBuffer(e),n?e.length0&&"0"===r.toString())e=e.slice(1),r=e[0];return e},t.toBuffer=function(e){if(!p.isBuffer(e))if(Array.isArray(e))e=p.from(e);else if("string"===typeof e)e=t.isHexString(e)?p.from(t.padToEven(t.stripHexPrefix(e)),"hex"):p.from(e);else if("number"===typeof e)e=t.intToBuffer(e);else if(null===e||void 0===e)e=p.allocUnsafe(0);else if(h.isBN(e))e=e.toArrayLike(p);else{if(!e.toArray)throw new Error("invalid type");e=p.from(e.toArray())}return e},t.bufferToInt=function(e){return new h(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return e=t.toBuffer(e),"0x"+e.toString("hex")},t.fromSigned=function(e){return new h(e).fromTwos(256)},t.toUnsigned=function(e){return p.from(e.toTwos(256).toArray())},t.keccak=function(e,r){switch(e=t.toBuffer(e),r||(r=256),r){case 224:return i(e);case 256:return o(e);case 384:return a(e);case 512:return s(e);default:throw new Error("Invald algorithm: keccak"+r)}},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),d("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=d("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(l.encode(e))},t.isValidPrivate=function(e){return u.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?u.publicKeyVerify(p.concat([p.from([4]),e])):!!t&&u.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=u.publicKeyConvert(e,!1).slice(1)),c(64===e.length),t.keccak(e).slice(-20)};var m=t.privateToPublic=function(e){return e=t.toBuffer(e),u.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return e=t.toBuffer(e),64!==e.length&&(e=u.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=u.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("Ethereum Signed Message:\n"+e.length.toString());return t.keccak(p.concat([r,e]))},t.ecrecover=function(e,r,n,f){var i=p.concat([t.setLength(n,32),t.setLength(f,32)],64),a=r-27;if(0!==a&&1!==a)throw new Error("Invalid signature v value");var o=u.recover(e,i,a);return u.publicKeyConvert(o,!1).slice(1)},t.toRpcSig=function(e,r,n){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(p.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(e=t.toBuffer(e),65!==e.length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(m(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){var r=t.zeroAddress();return r===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",f=0;f=8?n+=e[f].toUpperCase():n+=e[f];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=new h(r),r=r.isZero()?null:p.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!==typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var f=new h("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),i=new h("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&((27===e||28===e)&&(t=new h(t),r=new h(r),!(t.isZero()||t.gt(i)||r.isZero()||r.gt(i))&&(!1!==n||1!==new h(r).cmp(f))))},t.baToJSON=function(e){if(p.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n=f.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===f.length||!r.length||c(r.length===f.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=f}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:f,set:i}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:i,get:f})})),f)if("string"===typeof f&&(f=p.from(t.stripHexPrefix(f),"hex")),p.isBuffer(f)&&(f=l.decode(f)),Array.isArray(f)){if(f.length>e._fields.length)throw new Error("wrong number of fields in data");f.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==("undefined"===typeof f?"undefined":n(f)))throw new Error("invalid data");var i=Object.keys(f);r.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=f[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=f[t.alias])}))}}},ba9f:function(e,t,r){const n=r("2ef0"),f=r("379f"),i=r("4695").formatters,a=r("4695").payloadTransformer,o={},s=r("f06b").map(e=>{e.inputFormatter=e.inputFormatter&&n.map(e.inputFormatter,e=>i[e]),e.outputFormatter=i[e.outputFormatter],e.transformPayload=a[e.transformPayload];const[t,r]=e.call.split("_");if(r&&(o[t]||(o[t]={}),o[t][e.name]=new f(e)),!o[e.name])return o[e.name]=new f(e)}).filter(e=>!!e);e.exports=s,e.exports.rpc=o},bb2f:function(e,t,r){var n=r("d039");e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},bc56:function(e,t,r){const n=r("6223"),f=r("53a8");function i(e){return f({id:n(),jsonrpc:"2.0",params:[]},e)}e.exports=i},bd68:function(e,t,r){(function(t){const n=r("0b38"),f=r("faa1"),i=(r("3022").inherits,t.WebSocket||r(35)),a=r("9e697"),o=r("321b");class s extends a{constructor({rpcUrl:e,debug:t,origin:r}){super(),f.call(this),Object.defineProperties(this,{_backoff:{value:n.exponential({randomisationFactor:.2,maxDelay:5e3})},_connectTime:{value:null,writable:!0},_log:{value:t?(...e)=>console.info.apply(console,["[WSProvider]",...e]):()=>{}},_origin:{value:r},_pendingRequests:{value:new Map},_socket:{value:null,writable:!0},_unhandledRequests:{value:[]},_url:{value:e}}),this._handleSocketClose=this._handleSocketClose.bind(this),this._handleSocketMessage=this._handleSocketMessage.bind(this),this._handleSocketOpen=this._handleSocketOpen.bind(this),this._backoff.on("ready",()=>{this._openSocket()}),this._openSocket()}handleRequest(e,t,r){if(!this._socket||this._socket.readyState!==i.OPEN)return this._unhandledRequests.push(Array.from(arguments)),void this._log("Socket not open. Request queued.");this._pendingRequests.set(e.id,[e,r]);const n=o(e);delete n.origin,this._socket.send(JSON.stringify(n)),this._log(`Sent: ${n.method} #${n.id}`)}_handleSocketClose({reason:e,code:t}){this._log(`Socket closed, code ${t} (${e||"no reason"})`),this._connectTime&&Date.now()-this._connectTime>5e3&&this._backoff.reset(),this._socket.removeEventListener("close",this._handleSocketClose),this._socket.removeEventListener("message",this._handleSocketMessage),this._socket.removeEventListener("open",this._handleSocketOpen),this._socket=null,this._backoff.backoff()}_handleSocketMessage(e){let t;try{t=JSON.parse(e.data)}catch(f){return void this._log("Received a message that is not valid JSON:",t)}if(void 0===t.id)return this.engine.emit("data",null,t);if(!this._pendingRequests.has(t.id))return;const[r,n]=this._pendingRequests.get(t.id);if(this._pendingRequests.delete(t.id),this._log(`Received: ${r.method} #${t.id}`),t.error)return n(new Error(t.error.message));n(null,t.result)}_handleSocketOpen(){this._log("Socket open."),this._connectTime=Date.now(),this._pendingRequests.forEach(([e,t])=>{this._unhandledRequests.push([e,null,t])}),this._pendingRequests.clear();const e=this._unhandledRequests.splice(0,this._unhandledRequests.length);e.forEach(e=>{this.handleRequest.apply(this,e)})}_openSocket(){this._log("Opening socket..."),this._socket=new i(this._url,[],this._origin?{headers:{origin:this._origin}}:{}),this._socket.addEventListener("close",this._handleSocketClose),this._socket.addEventListener("message",this._handleSocketMessage),this._socket.addEventListener("open",this._handleSocketOpen)}}Object.assign(s.prototype,f.prototype),e.exports=s}).call(this,r("c8ba"))},bd8b:function(e,t){const r=(e,t)=>{let r=[];for(var n=0;nr(e,()=>t),f=(e,t)=>e.concat(t),i=e=>{let t=[];for(let r=0,n=e.length;r{let r=[];for(let n=0,f=t.length;n{if("mnemonic"in e)return e.mnemonic};t.getMnemonic=n},c44e:function(e,t,r){(function(e){(function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function f(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(33).Buffer}catch(k){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function u(e,t,r,n){for(var f=0,i=Math.min(e.length,r),a=t;a=49?o-49+10:o>=17?o-17+10:o}return f}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var f=0;"-"===e[0]&&(f++,this.negative=1),f=0;f-=3)a=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[i]|=a<>>26-o&67108863,o+=24,o>=26&&(o-=26,i++);else if("le"===r)for(f=0,i=0;f>>26-o&67108863,o+=24,o>=26&&(o-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)f=s(e,t,n)<=18?(i-=18,a+=1,this.words[a]|=f>>>26):i+=8;else{var o=e.length-t;for(n=o%2===0?t+1:t;n=18?(i-=18,a+=1,this.words[a]|=f>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,f=1;f<=67108863;f*=t)n++;n--,f=f/t|0;for(var i=e.length-r,a=i%n,o=Math.min(i,i-a)+r,s=0,c=r;c1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e){for(var t=new Array(e.bitLength()),r=0;r>>f}return t}function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var f=0|e.words[0],i=0|t.words[0],a=f*i,o=67108863&a,s=a/67108864|0;r.words[0]=o;for(var u=1;u>>26,l=67108863&s,h=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=h;d++){var p=u-d|0;f=0|e.words[p],i=0|t.words[d],a=f*i+l,c+=a/67108864|0,l=67108863&a}r.words[u]=0|l,s=0|c}return 0!==s?r.words[u]=0|s:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var f=0,i=0,a=0;a>>24-f&16777215,r=0!==i||a!==this.length-1?c[6-s.length]+s+r:s+r,f+=2,f>=26&&(f-=26,a--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],d=h[e];r="";var p=this.clone();p.negative=0;while(!p.isZero()){var m=p.modn(d).toString(e);p=p.idivn(d),r=p.isZero()?m+r:c[u-m.length]+m+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n("undefined"!==typeof a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var f=this.byteLength(),i=r||Math.max(1,f);n(f<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,o,s="le"===t,u=new e(i),c=this.clone();if(s){for(o=0;!c.isZero();o++)a=c.andln(255),c.iushrn(8),u[o]=a;for(;o=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,f=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var f=0,i=0;i>>26;for(;0!==f&&i>>26;if(this.length=r.length,0!==f)this.words[this.length]=f,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,y=0|a[2],g=8191&y,b=y>>>13,v=0|a[3],w=8191&v,_=v>>>13,T=0|a[4],E=8191&T,x=T>>>13,M=0|a[5],A=8191&M,k=M>>>13,P=0|a[6],C=8191&P,S=P>>>13,R=0|a[7],I=8191&R,N=R>>>13,L=0|a[8],F=8191&L,K=L>>>13,O=0|a[9],D=8191&O,B=O>>>13,U=0|o[0],j=8191&U,V=U>>>13,H=0|o[1],G=8191&H,W=H>>>13,q=0|o[2],Y=8191&q,$=q>>>13,z=0|o[3],Z=8191&z,J=z>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,fe=0|o[6],ie=8191&fe,ae=fe>>>13,oe=0|o[7],se=8191&oe,ue=oe>>>13,ce=0|o[8],le=8191&ce,he=ce>>>13,de=0|o[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(l,j),f=Math.imul(l,V),f=f+Math.imul(h,j)|0,i=Math.imul(h,V);var ye=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,j),f=Math.imul(p,V),f=f+Math.imul(m,j)|0,i=Math.imul(m,V),n=n+Math.imul(l,G)|0,f=f+Math.imul(l,W)|0,f=f+Math.imul(h,G)|0,i=i+Math.imul(h,W)|0;var ge=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,j),f=Math.imul(g,V),f=f+Math.imul(b,j)|0,i=Math.imul(b,V),n=n+Math.imul(p,G)|0,f=f+Math.imul(p,W)|0,f=f+Math.imul(m,G)|0,i=i+Math.imul(m,W)|0,n=n+Math.imul(l,Y)|0,f=f+Math.imul(l,$)|0,f=f+Math.imul(h,Y)|0,i=i+Math.imul(h,$)|0;var be=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,j),f=Math.imul(w,V),f=f+Math.imul(_,j)|0,i=Math.imul(_,V),n=n+Math.imul(g,G)|0,f=f+Math.imul(g,W)|0,f=f+Math.imul(b,G)|0,i=i+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,f=f+Math.imul(p,$)|0,f=f+Math.imul(m,Y)|0,i=i+Math.imul(m,$)|0,n=n+Math.imul(l,Z)|0,f=f+Math.imul(l,J)|0,f=f+Math.imul(h,Z)|0,i=i+Math.imul(h,J)|0;var ve=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,j),f=Math.imul(E,V),f=f+Math.imul(x,j)|0,i=Math.imul(x,V),n=n+Math.imul(w,G)|0,f=f+Math.imul(w,W)|0,f=f+Math.imul(_,G)|0,i=i+Math.imul(_,W)|0,n=n+Math.imul(g,Y)|0,f=f+Math.imul(g,$)|0,f=f+Math.imul(b,Y)|0,i=i+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,f=f+Math.imul(p,J)|0,f=f+Math.imul(m,Z)|0,i=i+Math.imul(m,J)|0,n=n+Math.imul(l,Q)|0,f=f+Math.imul(l,ee)|0,f=f+Math.imul(h,Q)|0,i=i+Math.imul(h,ee)|0;var we=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,j),f=Math.imul(A,V),f=f+Math.imul(k,j)|0,i=Math.imul(k,V),n=n+Math.imul(E,G)|0,f=f+Math.imul(E,W)|0,f=f+Math.imul(x,G)|0,i=i+Math.imul(x,W)|0,n=n+Math.imul(w,Y)|0,f=f+Math.imul(w,$)|0,f=f+Math.imul(_,Y)|0,i=i+Math.imul(_,$)|0,n=n+Math.imul(g,Z)|0,f=f+Math.imul(g,J)|0,f=f+Math.imul(b,Z)|0,i=i+Math.imul(b,J)|0,n=n+Math.imul(p,Q)|0,f=f+Math.imul(p,ee)|0,f=f+Math.imul(m,Q)|0,i=i+Math.imul(m,ee)|0,n=n+Math.imul(l,re)|0,f=f+Math.imul(l,ne)|0,f=f+Math.imul(h,re)|0,i=i+Math.imul(h,ne)|0;var _e=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(C,j),f=Math.imul(C,V),f=f+Math.imul(S,j)|0,i=Math.imul(S,V),n=n+Math.imul(A,G)|0,f=f+Math.imul(A,W)|0,f=f+Math.imul(k,G)|0,i=i+Math.imul(k,W)|0,n=n+Math.imul(E,Y)|0,f=f+Math.imul(E,$)|0,f=f+Math.imul(x,Y)|0,i=i+Math.imul(x,$)|0,n=n+Math.imul(w,Z)|0,f=f+Math.imul(w,J)|0,f=f+Math.imul(_,Z)|0,i=i+Math.imul(_,J)|0,n=n+Math.imul(g,Q)|0,f=f+Math.imul(g,ee)|0,f=f+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,f=f+Math.imul(p,ne)|0,f=f+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,n=n+Math.imul(l,ie)|0,f=f+Math.imul(l,ae)|0,f=f+Math.imul(h,ie)|0,i=i+Math.imul(h,ae)|0;var Te=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(I,j),f=Math.imul(I,V),f=f+Math.imul(N,j)|0,i=Math.imul(N,V),n=n+Math.imul(C,G)|0,f=f+Math.imul(C,W)|0,f=f+Math.imul(S,G)|0,i=i+Math.imul(S,W)|0,n=n+Math.imul(A,Y)|0,f=f+Math.imul(A,$)|0,f=f+Math.imul(k,Y)|0,i=i+Math.imul(k,$)|0,n=n+Math.imul(E,Z)|0,f=f+Math.imul(E,J)|0,f=f+Math.imul(x,Z)|0,i=i+Math.imul(x,J)|0,n=n+Math.imul(w,Q)|0,f=f+Math.imul(w,ee)|0,f=f+Math.imul(_,Q)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,f=f+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0,n=n+Math.imul(p,ie)|0,f=f+Math.imul(p,ae)|0,f=f+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0,n=n+Math.imul(l,se)|0,f=f+Math.imul(l,ue)|0,f=f+Math.imul(h,se)|0,i=i+Math.imul(h,ue)|0;var Ee=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,j),f=Math.imul(F,V),f=f+Math.imul(K,j)|0,i=Math.imul(K,V),n=n+Math.imul(I,G)|0,f=f+Math.imul(I,W)|0,f=f+Math.imul(N,G)|0,i=i+Math.imul(N,W)|0,n=n+Math.imul(C,Y)|0,f=f+Math.imul(C,$)|0,f=f+Math.imul(S,Y)|0,i=i+Math.imul(S,$)|0,n=n+Math.imul(A,Z)|0,f=f+Math.imul(A,J)|0,f=f+Math.imul(k,Z)|0,i=i+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,f=f+Math.imul(E,ee)|0,f=f+Math.imul(x,Q)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,f=f+Math.imul(w,ne)|0,f=f+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(g,ie)|0,f=f+Math.imul(g,ae)|0,f=f+Math.imul(b,ie)|0,i=i+Math.imul(b,ae)|0,n=n+Math.imul(p,se)|0,f=f+Math.imul(p,ue)|0,f=f+Math.imul(m,se)|0,i=i+Math.imul(m,ue)|0,n=n+Math.imul(l,le)|0,f=f+Math.imul(l,he)|0,f=f+Math.imul(h,le)|0,i=i+Math.imul(h,he)|0;var xe=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,j),f=Math.imul(D,V),f=f+Math.imul(B,j)|0,i=Math.imul(B,V),n=n+Math.imul(F,G)|0,f=f+Math.imul(F,W)|0,f=f+Math.imul(K,G)|0,i=i+Math.imul(K,W)|0,n=n+Math.imul(I,Y)|0,f=f+Math.imul(I,$)|0,f=f+Math.imul(N,Y)|0,i=i+Math.imul(N,$)|0,n=n+Math.imul(C,Z)|0,f=f+Math.imul(C,J)|0,f=f+Math.imul(S,Z)|0,i=i+Math.imul(S,J)|0,n=n+Math.imul(A,Q)|0,f=f+Math.imul(A,ee)|0,f=f+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,f=f+Math.imul(E,ne)|0,f=f+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(w,ie)|0,f=f+Math.imul(w,ae)|0,f=f+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,n=n+Math.imul(g,se)|0,f=f+Math.imul(g,ue)|0,f=f+Math.imul(b,se)|0,i=i+Math.imul(b,ue)|0,n=n+Math.imul(p,le)|0,f=f+Math.imul(p,he)|0,f=f+Math.imul(m,le)|0,i=i+Math.imul(m,he)|0,n=n+Math.imul(l,pe)|0,f=f+Math.imul(l,me)|0,f=f+Math.imul(h,pe)|0,i=i+Math.imul(h,me)|0;var Me=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,G),f=Math.imul(D,W),f=f+Math.imul(B,G)|0,i=Math.imul(B,W),n=n+Math.imul(F,Y)|0,f=f+Math.imul(F,$)|0,f=f+Math.imul(K,Y)|0,i=i+Math.imul(K,$)|0,n=n+Math.imul(I,Z)|0,f=f+Math.imul(I,J)|0,f=f+Math.imul(N,Z)|0,i=i+Math.imul(N,J)|0,n=n+Math.imul(C,Q)|0,f=f+Math.imul(C,ee)|0,f=f+Math.imul(S,Q)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(A,re)|0,f=f+Math.imul(A,ne)|0,f=f+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(E,ie)|0,f=f+Math.imul(E,ae)|0,f=f+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,n=n+Math.imul(w,se)|0,f=f+Math.imul(w,ue)|0,f=f+Math.imul(_,se)|0,i=i+Math.imul(_,ue)|0,n=n+Math.imul(g,le)|0,f=f+Math.imul(g,he)|0,f=f+Math.imul(b,le)|0,i=i+Math.imul(b,he)|0,n=n+Math.imul(p,pe)|0,f=f+Math.imul(p,me)|0,f=f+Math.imul(m,pe)|0,i=i+Math.imul(m,me)|0;var Ae=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,Y),f=Math.imul(D,$),f=f+Math.imul(B,Y)|0,i=Math.imul(B,$),n=n+Math.imul(F,Z)|0,f=f+Math.imul(F,J)|0,f=f+Math.imul(K,Z)|0,i=i+Math.imul(K,J)|0,n=n+Math.imul(I,Q)|0,f=f+Math.imul(I,ee)|0,f=f+Math.imul(N,Q)|0,i=i+Math.imul(N,ee)|0,n=n+Math.imul(C,re)|0,f=f+Math.imul(C,ne)|0,f=f+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(A,ie)|0,f=f+Math.imul(A,ae)|0,f=f+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,n=n+Math.imul(E,se)|0,f=f+Math.imul(E,ue)|0,f=f+Math.imul(x,se)|0,i=i+Math.imul(x,ue)|0,n=n+Math.imul(w,le)|0,f=f+Math.imul(w,he)|0,f=f+Math.imul(_,le)|0,i=i+Math.imul(_,he)|0,n=n+Math.imul(g,pe)|0,f=f+Math.imul(g,me)|0,f=f+Math.imul(b,pe)|0,i=i+Math.imul(b,me)|0;var ke=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Z),f=Math.imul(D,J),f=f+Math.imul(B,Z)|0,i=Math.imul(B,J),n=n+Math.imul(F,Q)|0,f=f+Math.imul(F,ee)|0,f=f+Math.imul(K,Q)|0,i=i+Math.imul(K,ee)|0,n=n+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,f=f+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,n=n+Math.imul(C,ie)|0,f=f+Math.imul(C,ae)|0,f=f+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,n=n+Math.imul(A,se)|0,f=f+Math.imul(A,ue)|0,f=f+Math.imul(k,se)|0,i=i+Math.imul(k,ue)|0,n=n+Math.imul(E,le)|0,f=f+Math.imul(E,he)|0,f=f+Math.imul(x,le)|0,i=i+Math.imul(x,he)|0,n=n+Math.imul(w,pe)|0,f=f+Math.imul(w,me)|0,f=f+Math.imul(_,pe)|0,i=i+Math.imul(_,me)|0;var Pe=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Q),f=Math.imul(D,ee),f=f+Math.imul(B,Q)|0,i=Math.imul(B,ee),n=n+Math.imul(F,re)|0,f=f+Math.imul(F,ne)|0,f=f+Math.imul(K,re)|0,i=i+Math.imul(K,ne)|0,n=n+Math.imul(I,ie)|0,f=f+Math.imul(I,ae)|0,f=f+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,n=n+Math.imul(C,se)|0,f=f+Math.imul(C,ue)|0,f=f+Math.imul(S,se)|0,i=i+Math.imul(S,ue)|0,n=n+Math.imul(A,le)|0,f=f+Math.imul(A,he)|0,f=f+Math.imul(k,le)|0,i=i+Math.imul(k,he)|0,n=n+Math.imul(E,pe)|0,f=f+Math.imul(E,me)|0,f=f+Math.imul(x,pe)|0,i=i+Math.imul(x,me)|0;var Ce=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,re),f=Math.imul(D,ne),f=f+Math.imul(B,re)|0,i=Math.imul(B,ne),n=n+Math.imul(F,ie)|0,f=f+Math.imul(F,ae)|0,f=f+Math.imul(K,ie)|0,i=i+Math.imul(K,ae)|0,n=n+Math.imul(I,se)|0,f=f+Math.imul(I,ue)|0,f=f+Math.imul(N,se)|0,i=i+Math.imul(N,ue)|0,n=n+Math.imul(C,le)|0,f=f+Math.imul(C,he)|0,f=f+Math.imul(S,le)|0,i=i+Math.imul(S,he)|0,n=n+Math.imul(A,pe)|0,f=f+Math.imul(A,me)|0,f=f+Math.imul(k,pe)|0,i=i+Math.imul(k,me)|0;var Se=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,ie),f=Math.imul(D,ae),f=f+Math.imul(B,ie)|0,i=Math.imul(B,ae),n=n+Math.imul(F,se)|0,f=f+Math.imul(F,ue)|0,f=f+Math.imul(K,se)|0,i=i+Math.imul(K,ue)|0,n=n+Math.imul(I,le)|0,f=f+Math.imul(I,he)|0,f=f+Math.imul(N,le)|0,i=i+Math.imul(N,he)|0,n=n+Math.imul(C,pe)|0,f=f+Math.imul(C,me)|0,f=f+Math.imul(S,pe)|0,i=i+Math.imul(S,me)|0;var Re=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,se),f=Math.imul(D,ue),f=f+Math.imul(B,se)|0,i=Math.imul(B,ue),n=n+Math.imul(F,le)|0,f=f+Math.imul(F,he)|0,f=f+Math.imul(K,le)|0,i=i+Math.imul(K,he)|0,n=n+Math.imul(I,pe)|0,f=f+Math.imul(I,me)|0,f=f+Math.imul(N,pe)|0,i=i+Math.imul(N,me)|0;var Ie=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,le),f=Math.imul(D,he),f=f+Math.imul(B,le)|0,i=Math.imul(B,he),n=n+Math.imul(F,pe)|0,f=f+Math.imul(F,me)|0,f=f+Math.imul(K,pe)|0,i=i+Math.imul(K,me)|0;var Ne=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(D,pe),f=Math.imul(D,me),f=f+Math.imul(B,pe)|0,i=Math.imul(B,me);var Le=(u+n|0)+((8191&f)<<13)|0;return u=(i+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,s[0]=ye,s[1]=ge,s[2]=be,s[3]=ve,s[4]=we,s[5]=_e,s[6]=Te,s[7]=Ee,s[8]=xe,s[9]=Me,s[10]=Ae,s[11]=ke,s[12]=Pe,s[13]=Ce,s[14]=Se,s[15]=Re,s[16]=Ie,s[17]=Ne,s[18]=Le,0!==u&&(s[19]=u,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,f=0,i=0;i>>26)|0,f+=a>>>26,a&=67108863}r.words[i]=o,n=a,a=f}return 0!==n?r.words[i]=n:r.length--,r.strip()}function g(e,t,r){var n=new b;return n.mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=p),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?m(this,e,t):n<63?p(this,e,t):n<1024?y(this,e,t):g(this,e,t),r},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,f,i){for(var a=0;a>>=1)f++;return 1<>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=f/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=d(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,r=e%26,f=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==f){for(t=this.length-1;t>=0;t--)this.words[t+f]=this.words[t];for(t=0;t=0),f=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),o=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==c||u>=f);u--){var l=0|this.words[u];this.words[u]=c<<26-i|l>>>i,c=l&o}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,f=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var f=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(s/67108864|0),this.words[f+r]=67108863&i}for(;f>26,this.words[f+r]=67108863&i;if(0===o)return this.strip();for(n(-1===o),o=0,f=0;f>26,this.words[f]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),f=e,a=0|f.words[f.length-1],o=this._countBits(a);r=26-o,0!==r&&(f=f.ushln(r),n.iushln(r),a=0|f.words[f.length-1]);var s,u=n.length-f.length;if("mod"!==t){s=new i(null),s.length=u+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var d=67108864*(0|n.words[f.length+h])+(0|n.words[f.length+h-1]);d=Math.min(d/a|0,67108863),n._ishlnsubmul(f,d,h);while(0!==n.negative)d--,n.negative=0,n._ishlnsubmul(f,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(f=o.div.neg()),"div"!==t&&(a=o.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:f,mod:a}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(f=o.div.neg()),{div:f,mod:o.mod}):0!==(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(a=o.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:o.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var f,a,o},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),f=e.andln(1),i=r.cmp(n);return i<0||1===f&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,f=this.length-1;f>=0;f--)r=(t*r+(0|this.words[f]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var f=(0|this.words[r])+67108864*t;this.words[r]=f/e|0,t=f%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var f=new i(1),a=new i(0),o=new i(0),s=new i(1),u=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++u;var c=r.clone(),l=t.clone();while(!t.isZero()){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0){t.iushrn(h);while(h-- >0)(f.isOdd()||a.isOdd())&&(f.iadd(c),a.isub(l)),f.iushrn(1),a.iushrn(1)}for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0){r.iushrn(p);while(p-- >0)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(l)),o.iushrn(1),s.iushrn(1)}t.cmp(r)>=0?(t.isub(r),f.isub(o),a.isub(s)):(r.isub(t),o.isub(f),s.isub(a))}return{a:o,b:s,gcd:r.iushln(u)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var f,a=new i(1),o=new i(0),s=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var u=0,c=1;0===(t.words[0]&c)&&u<26;++u,c<<=1);if(u>0){t.iushrn(u);while(u-- >0)a.isOdd()&&a.iadd(s),a.iushrn(1)}for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0){r.iushrn(l);while(l-- >0)o.isOdd()&&o.iadd(s),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),a.isub(o)):(r.isub(t),o.isub(a))}return f=0===t.cmpn(1)?a:o,f.cmpn(0)<0&&f.iadd(e),f},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var f=t.cmp(r);if(f<0){var i=t;t=r,r=i}else if(0===f||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,f=1<>>26,o&=67108863,this.words[a]=o}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var f=0|this.words[0];t=f===e?0:fe.length)return 1;if(this.length=0;r--){var n=0|this.words[r],f=0|e.words[r];if(n!==f){nf&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new M(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function T(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},f(_,w),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),f=0;f>>22,i=a}i>>>=22,e.words[f-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=f,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new T;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return v[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var f=this.m.subn(1),a=0;while(!f.isZero()&&0===f.andln(1))a++,f.iushrn(1);n(!f.isZero());var o=new i(1).toRed(this),s=o.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();c=new i(2*c*c).toRed(this);while(0!==this.pow(c,u).cmp(s))c.redIAdd(s);var l=this.pow(c,f),h=this.pow(e,f.addn(1).iushrn(1)),d=this.pow(e,f),p=a;while(0!==d.cmp(o)){for(var m=d,y=0;0!==m.cmp(o);y++)m=m.redSqr();n(y=0;f--){for(var c=t.words[f],l=u-1;l>=0;l--){var h=c>>l&1;a!==n[0]&&(a=this.sqr(a)),0!==h||0!==o?(o<<=1,o|=h,s++,(s===r||0===f&&0===l)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}u=26}return a},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new A(e)},f(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=r.isub(n).iushrn(this.shift),i=f;return f.cmp(this.m)>=0?i=f.isub(this.m):f.cmpn(0)<0&&(i=f.iadd(this.m)),i._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=r.isub(n).iushrn(this.shift),a=f;return f.cmp(this.m)>=0?a=f.isub(this.m):f.cmpn(0)<0&&(a=f.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(e,this)}).call(this,r("62e4")(e))},c5e1:function(e,t,r){(function(t){const n=r("3022").inherits,f=r("6b49"),i=r("6ef0"),a=r("9e697"),o=r("398c").blockTagForPayload;function s(e){const t=this;t.nonceCache={}}e.exports=s,n(s,a),s.prototype.handleRequest=function(e,r,n){const a=this;switch(e.method){case"eth_getTransactionCount":var s=o(e),u=e.params[0].toLowerCase(),c=a.nonceCache[u];return void("pending"===s?c?n(null,c):r((function(e,t,r){if(e)return r();void 0===a.nonceCache[u]&&(a.nonceCache[u]=t),r()})):r());case"eth_sendRawTransaction":return void r((function(r,n,o){if(r)return o();var s=e.params[0],u=(i.stripHexPrefix(s),t.from(i.stripHexPrefix(s),"hex"),new f(t.from(i.stripHexPrefix(s),"hex"))),c="0x"+u.getSenderAddress().toString("hex").toLowerCase(),l=i.bufferToInt(u.nonce);l++;var h=l.toString(16);h.length%2&&(h="0"+h),h="0x"+h,a.nonceCache[c]=h,o()}));case"evm_revert":return a.nonceCache={},void r();default:return void r()}}}).call(this,r("b639").Buffer)},c64e:function(e,t,r){var n=r("e1f4"),f=r("2366");function i(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null),e=e||{};var a=e.random||(e.rng||n)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var o=0;o<16;++o)t[i+o]=a[o];return t||f(a)}e.exports=i},c6d4:function(e,t){function r(e){return e.stack&&e.name&&e.message?e.stack.substring(e.name.length+3+e.message.length).split("\n"):e.stack?e.stack.split("\n"):void 0}function n(e,t){return e.filter((function(e){return!~t.indexOf(e)}))}e.exports=function(e,t){if(!(e.stack&&e.name&&e.message))return console.error(new Error("stackless error")),e;var f=new Error(t),i=n(r(f).slice(1),r(e)).join("\n");return f.__proto__=e,f.stack=f.name+": "+f.message+"\n"+i+"\n "+e.stack,f}},c757:function(e,t,r){(function(t){r("d3b7"),r("25f0");var n=r("0913"),f="cypress",i=8217,a=8217,o="https://node-api.klaytnapi.com/v1/klaytn";try{var s=r("a4ff")("".concat(process.env.HOME,"/.klaytn/cypress_deployer")),u=s.accessKeyId,c=s.secretAccessKey,l=(s.privateKey,{headers:[{name:"Authorization",value:"Basic "+t.from(u+":"+c).toString("base64")},{name:"x-chain-id",value:"1001"}]}),h=new n.providers.HttpProvider(o,l);h.chainId=i}catch(d){}e.exports={config:{networkName:f,chainId:i,netId:a,apiUrl:"https://api.cilo.io/v1",apiKey:"",readonlyProviderUrl:o,nftAddress:"0x279e2A8ED0479a20D6daeEC89d6aCe04c1E9F195",nft1155Address:"0xC1d3622C5897299F5b9b7e02D5F7647D2a0B154c",exchangeAddress:"0x6a2546E41412CaaeC86eF703675398634A829193",royaltiesRegistryAddress:"0x819743514726cEdC0C75379c28E72D173a83aE14",transferProxyAddress:"0x200Af6C6b26Ec55F75f5a33cdD2892fb1FE97eD0",erc20TransferProxyAddress:"0xbe16A259d993ED21d5ED0e232C40DC1eF48962C6",communityWalletAddress:"0xbbd546281301CCCF287173fB2437C387aDeC16b6"}}}).call(this,r("b639").Buffer)},c8cf1:function(e,t,r){(function(t){const n=r("2ef0"),f=r("4a84").AbiCoder,i=r("4a84").ParamType,a=r("19b5"),o=new f((function(e,t){return!e.match(/^u?int/)||n.isArray(t)||n.isObject(t)&&"BN"===t.constructor.name?t:t.toString()}));function s(){}const u=function(){};u.prototype.encodeFunctionSignature=function(e){return n.isObject(e)&&(e=a._jsonInterfaceMethodToString(e)),a.sha3(e).slice(0,10)},u.prototype.encodeEventSignature=function(e){return n.isObject(e)&&(e=a._jsonInterfaceMethodToString(e)),a.sha3(e)},u.prototype.encodeParameter=function(e,t){return this.encodeParameters([e],[t])},u.prototype.encodeParameters=function(e,t){const r=this;return e=r.mapTypes(e),t=t.map((function(t,n){let f=e[n];if("object"===typeof f&&f.type&&(f=f.type),t=r.formatParam(f,t),"string"===f&&"string"!==typeof t)throw new Error("Invalid parameter: Parameter value and type do not match.");if("string"===typeof f&&f.includes("tuple")){const e=o._getCoder(i.from(f)),n=(e,t)=>{if("array"===e.name)return t.map(t=>{const r=e.type.replace(/\[[1-9]*\]/g,""),f=i.from(r),a=o._getCoder(f);n(a,t)});e.coders.forEach((e,f)=>{"tuple"===e.name?n(e,t[f]):t[f]=r.formatParam(e.name,t[f])})};n(e,t)}return t})),o.encode(e,t)},u.prototype.encodeContractDeploy=function(e,t,...r){if(!e)throw new Error("jsonInterface should be provided for encoding contract deployment.");if(!t)throw new Error("bytecode should be provided for encoding contract deployment.");const f=e.filter(({type:e})=>"constructor"===e)[0],i=f&&f.inputs;if(!f||!i||n.isEmpty(i))return t;if(i.length!==r.length)throw new Error(`invalid number of parameters for deploying. Got ${r.length} expected ${i.length}!`);const a=i.map(({type:e})=>e);return t+this.encodeParameters(a,r).replace("0x","")},u.prototype.mapTypes=function(e){const t=this,r=[];return e.forEach((function(e){if("object"===typeof e&&"function"===e.type&&(e=Object.assign({},e,{type:"bytes24"})),t.isSimplifiedStructFormat(e)){const n=Object.keys(e)[0];r.push(Object.assign(t.mapStructNameAndType(n),{components:t.mapStructToCoderFormat(e[n])}))}else r.push(e)})),r},u.prototype.isSimplifiedStructFormat=function(e){return"object"===typeof e&&"undefined"===typeof e.components&&"undefined"===typeof e.name},u.prototype.mapStructNameAndType=function(e){let t="tuple";return e.indexOf("[]")>-1&&(t="tuple[]",e=e.slice(0,-2)),{type:t,name:e}},u.prototype.mapStructToCoderFormat=function(e){const t=this,r=[];return Object.keys(e).forEach((function(n){"object"!==typeof e[n]?r.push({name:n,type:e[n]}):r.push(Object.assign(t.mapStructNameAndType(n),{components:t.mapStructToCoderFormat(e[n])}))})),r},u.prototype.formatParam=function(e,r){const n=new RegExp(/^bytes([0-9]*)$/),f=new RegExp(/^bytes([0-9]*)\[\]$/),i=new RegExp(/^(u?int)([0-9]*)$/),o=new RegExp(/^(u?int)([0-9]*)\[\]$/);if(a.isBN(r)||a.isBigNumber(r))return r.toString(10);if(e.match(f)||e.match(o))return r.map(t=>this.formatParam(e.replace("[]",""),t));let s=e.match(i);if(s){const e=parseInt(s[2]||"256");e/80&&(!t||"0x"===t||"0X"===t))throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");const f=o.decode(this.mapTypes(e),"0x"+t.replace(/0x/i,""),r),i=new s;return i.__length__=0,e.forEach((function(e,t){let r=f[i.__length__];r="0x"===r?null:r,i[t]=r,n.isObject(e)&&e.name&&(i[e.name]=r),i.__length__++})),i},u.prototype.decodeLog=function(e,t,r){const f=this;r=n.isArray(r)?r:[r],t=t||"";const i=[],a=[];let o=0;e.forEach((function(e,t){e.indexed?(a[t]=["bool","int","uint","address","fixed","ufixed"].find((function(t){return-1!==e.type.indexOf(t)}))?f.decodeParameter(e.type,r[o]):r[o],o++):i[t]=e}));const u=t,c=u?this.decodeParametersWith(i,u,!0):[],l=new s;return l.__length__=0,e.forEach((function(e,t){l[t]="string"===e.type?"":null,"undefined"!==typeof c[t]&&(l[t]=c[t]),"undefined"!==typeof a[t]&&(l[t]=a[t]),e.name&&(l[e.name]=l[t]),l.__length__++})),l};const c=new u;e.exports=c}).call(this,r("b639").Buffer)},c973:function(e,t,r){function n(e,t,r,n,f,i,a){try{var o=e[i](a),s=o.value}catch(u){return void r(u)}o.done?t(s):Promise.resolve(s).then(n,f)}function f(e){return function(){var t=this,r=arguments;return new Promise((function(f,i){var a=e.apply(t,r);function o(e){n(a,f,i,o,s,"next",e)}function s(e){n(a,f,i,o,s,"throw",e)}o(void 0)}))}}r("d3b7"),e.exports=f,e.exports["default"]=e.exports,e.exports.__esModule=!0},c9b8:function(e,t,r){"use strict";(function(e){var n=r("8d08"),f=r("3337").ec,i=new f("secp256k1"),a=i.curve;t.privateKeyExport=function(e,t){var r=new n(e);if(r.ucmp(a.n)>=0)throw new Error("couldn't export to DER format");var f=i.g.mul(r);return o(f.getX(),f.getY(),t)},t.privateKeyModInverse=function(t){var r=new n(t);if(r.ucmp(a.n)>=0||r.isZero())throw new Error("private key range is invalid");return r.invm(a.n).toArrayLike(e,"be",32)},t.signatureImport=function(t){var r=new n(t.r);r.ucmp(a.n)>=0&&(r=new n(0));var f=new n(t.s);return f.ucmp(a.n)>=0&&(f=new n(0)),e.concat([r.toArrayLike(e,"be",32),f.toArrayLike(e,"be",32)])},t.ecdhUnsafe=function(e,t,r){var f=i.keyFromPublic(e),s=new n(t);if(s.ucmp(a.n)>=0||s.isZero())throw new Error("scalar was invalid (zero or overflow)");var u=f.pub.mul(s);return o(u.getX(),u.getY(),r)};var o=function(t,r,n){var f=void 0;return n?(f=e.alloc(33),f[0]=r.isOdd()?3:2,t.toArrayLike(e,"be",32).copy(f,1)):(f=e.alloc(65),f[0]=4,t.toArrayLike(e,"be",32).copy(f,1),r.toArrayLike(e,"be",32).copy(f,33)),f}}).call(this,r("b639").Buffer)},ca51:function(e,t,r){const{rlpEncodeForLegacyTransaction:n}=r("22f8"),{rlpEncodeForValueTransfer:f,rlpEncodeForValueTransferMemo:i,rlpEncodeForFeeDelegatedValueTransfer:a,rlpEncodeForFeeDelegatedValueTransferWithRatio:o,rlpEncodeForFeeDelegatedValueTransferMemo:s,rlpEncodeForFeeDelegatedValueTransferMemoWithRatio:u}=r("37a0"),{rlpEncodeForAccountUpdate:c,rlpEncodeForFeeDelegatedAccountUpdate:l,rlpEncodeForFeeDelegatedAccountUpdateWithRatio:h,parseAccountKey:d}=r("f102"),{rlpEncodeForContractDeploy:p,rlpEncodeForContractExecution:m,rlpEncodeForFeeDelegatedSmartContractDeploy:y,rlpEncodeForFeeDelegatedSmartContractDeployWithRatio:g,rlpEncodeForFeeDelegatedSmartContractExecution:b,rlpEncodeForFeeDelegatedSmartContractExecutionWithRatio:v}=r("8131"),{rlpEncodeForCancel:w,rlpEncodeForFeeDelegatedCancel:_,rlpEncodeForFeeDelegatedCancelWithRatio:T}=r("a237"),{rlpEncodeForChainDataAnchoring:E}=r("d482");e.exports={rlpEncodeForLegacyTransaction:n,rlpEncodeForValueTransfer:f,rlpEncodeForValueTransferMemo:i,rlpEncodeForFeeDelegatedValueTransfer:a,rlpEncodeForFeeDelegatedValueTransferWithRatio:o,rlpEncodeForFeeDelegatedValueTransferMemo:s,rlpEncodeForFeeDelegatedValueTransferMemoWithRatio:u,rlpEncodeForAccountUpdate:c,rlpEncodeForFeeDelegatedAccountUpdate:l,rlpEncodeForFeeDelegatedAccountUpdateWithRatio:h,parseAccountKey:d,rlpEncodeForContractDeploy:p,rlpEncodeForFeeDelegatedSmartContractDeploy:y,rlpEncodeForFeeDelegatedSmartContractDeployWithRatio:g,rlpEncodeForFeeDelegatedSmartContractExecutionWithRatio:v,rlpEncodeForContractExecution:m,rlpEncodeForFeeDelegatedSmartContractExecution:b,rlpEncodeForCancel:w,rlpEncodeForFeeDelegatedCancel:_,rlpEncodeForFeeDelegatedCancelWithRatio:T,rlpEncodeForChainDataAnchoring:E}},caad:function(e,t,r){"use strict";var n=r("23e7"),f=r("4d64").includes,i=r("44d2");n({target:"Array",proto:!0},{includes:function(e){return f(this,e,arguments.length>1?arguments[1]:void 0)}}),i("includes")},cc15:function(e,t,r){"use strict";(function(e){var r=Object.prototype.toString;t.isArray=function(e,t){if(!Array.isArray(e))throw TypeError(t)},t.isBoolean=function(e,t){if("[object Boolean]"!==r.call(e))throw TypeError(t)},t.isBuffer=function(t,r){if(!e.isBuffer(t))throw TypeError(r)},t.isFunction=function(e,t){if("[object Function]"!==r.call(e))throw TypeError(t)},t.isNumber=function(e,t){if("[object Number]"!==r.call(e))throw TypeError(t)},t.isObject=function(e,t){if("[object Object]"!==r.call(e))throw TypeError(t)},t.isBufferLength=function(e,t,r){if(e.length!==t)throw RangeError(r)},t.isBufferLength2=function(e,t,r,n){if(e.length!==t&&e.length!==r)throw RangeError(n)},t.isLengthGTZero=function(e,t){if(0===e.length)throw RangeError(t)},t.isNumberInInterval=function(e,t,r,n){if(e<=t||e>=r)throw RangeError(n)}}).call(this,r("b639").Buffer)},ccaa:function(e,t){e.exports=function(e){if(e){if("function"===typeof e[Symbol.iterator])return e[Symbol.iterator]();if("function"===typeof e[Symbol.asyncIterator])return e[Symbol.asyncIterator]();if("function"===typeof e.next)return e}throw new Error("argument is not an iterator or iterable")}},ccc1:function(e,t,r){e.exports=r("1cdc4")},ccc8:function(e,t){var r="ropsten",n=3,f=3,i="https://ropsten.infura.io/v3/b6ae638ae8aa47c996394354e364014e";e.exports={config:{networkName:r,chainId:n,netId:f,apiUrl:"https://api.cilo.kr/v1",apiKey:"",readonlyProviderUrl:i,nftAddress:"0x2FBDC8653927e486d31E8e5b2c4fb6b152A030c8",nft1155Address:"0x0f7BA137DF62466b8572abFBF4C796671dF95bdD",exchangeAddress:"0x752F90380840fBd07Fd8ddB0Bec63A3254bDa688",royaltiesRegistryAddress:"0xb1aD37053D66C9Ac18434C818C529B1818830f67",transferProxyAddress:"0xD59DFAc3DE1D1359147FE6CB39753CE14b3A0B5e",erc20TransferProxyAddress:"0x09e089E18fEF66B1097CB9f3b02EEe81e5EC721F",communityWalletAddress:"0x1F33dBC958e70b3467716b283C5c49708f3bA2dB"}}},ccf6:function(e,t,r){const n=r("19d7"),f=r("f3a4"),i=r("19b5"),{rlpEncodeForLegacyTransaction:a,rlpEncodeForValueTransfer:o,rlpEncodeForValueTransferMemo:s,rlpEncodeForFeeDelegatedValueTransferMemoWithRatio:u,rlpEncodeForFeeDelegatedValueTransfer:c,rlpEncodeForFeeDelegatedValueTransferWithRatio:l,rlpEncodeForFeeDelegatedValueTransferMemo:h,rlpEncodeForAccountUpdate:d,rlpEncodeForContractDeploy:p,rlpEncodeForContractExecution:m,rlpEncodeForFeeDelegatedAccountUpdate:y,rlpEncodeForFeeDelegatedAccountUpdateWithRatio:g,rlpEncodeForFeeDelegatedSmartContractDeploy:b,rlpEncodeForFeeDelegatedSmartContractDeployWithRatio:v,rlpEncodeForFeeDelegatedSmartContractExecution:w,rlpEncodeForFeeDelegatedSmartContractExecutionWithRatio:_,rlpEncodeForCancel:T,rlpEncodeForFeeDelegatedCancel:E,rlpEncodeForFeeDelegatedCancelWithRatio:x,rlpEncodeForChainDataAnchoring:M,parseAccountKey:A}=r("ca51"),k="ACCOUNT_CREATION transaction type is not supported yet.";function P(e){switch(e.type=e.senderRawTransaction?i.getTxTypeStringFromRawTransaction(e.senderRawTransaction):e.type,e.type){case"ACCOUNT_CREATION":throw new Error(k);case"ACCOUNT_UPDATE":return d(e);case"FEE_DELEGATED_ACCOUNT_UPDATE":return y(e);case"FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO":return g(e);case"VALUE_TRANSFER":return o(e);case"VALUE_TRANSFER_MEMO":return s(e);case"FEE_DELEGATED_VALUE_TRANSFER":return c(e);case"FEE_DELEGATED_VALUE_TRANSFER_WITH_RATIO":return l(e);case"FEE_DELEGATED_VALUE_TRANSFER_MEMO":return h(e);case"FEE_DELEGATED_VALUE_TRANSFER_MEMO_WITH_RATIO":return u(e);case"FEE_DELEGATED_SMART_CONTRACT_DEPLOY":return b(e);case"SMART_CONTRACT_DEPLOY":return p(e);case"FEE_DELEGATED_SMART_CONTRACT_DEPLOY_WITH_RATIO":return v(e);case"SMART_CONTRACT_EXECUTION":return m(e);case"FEE_DELEGATED_SMART_CONTRACT_EXECUTION":return w(e);case"FEE_DELEGATED_SMART_CONTRACT_EXECUTION_WITH_RATIO":return _(e);case"CANCEL":return T(e);case"FEE_DELEGATED_CANCEL":return E(e);case"FEE_DELEGATED_CANCEL_WITH_RATIO":return x(e);case"CHAIN_DATA_ANCHORING":return M(e);case"LEGACY":default:return a(e)}}function C(e,t,r){const f=n.decode(e);let a;switch(r.type=r.senderRawTransaction?i.getTxTypeStringFromRawTransaction(r.senderRawTransaction):r.type,r.type){case"ACCOUNT_CREATION":throw new Error(k);case"VALUE_TRANSFER":case"VALUE_TRANSFER_MEMO":case"ACCOUNT_UPDATE":case"SMART_CONTRACT_DEPLOY":case"SMART_CONTRACT_EXECUTION":case"CANCEL":case"CHAIN_DATA_ANCHORING":return S(e,t);case"FEE_DELEGATED_VALUE_TRANSFER":case"FEE_DELEGATED_VALUE_TRANSFER_WITH_RATIO":case"FEE_DELEGATED_VALUE_TRANSFER_MEMO":case"FEE_DELEGATED_VALUE_TRANSFER_MEMO_WITH_RATIO":case"FEE_DELEGATED_SMART_CONTRACT_DEPLOY":case"FEE_DELEGATED_SMART_CONTRACT_DEPLOY_WITH_RATIO":case"FEE_DELEGATED_CANCEL":case"FEE_DELEGATED_CANCEL_WITH_RATIO":case"FEE_DELEGATED_ACCOUNT_UPDATE":case"FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO":case"FEE_DELEGATED_SMART_CONTRACT_EXECUTION":case"FEE_DELEGATED_SMART_CONTRACT_EXECUTION_WITH_RATIO":if(r.senderRawTransaction){const n=F(r.senderRawTransaction);return R(e,t,r,n.signatures)}return r.feePayer&&"0x"!==r.feePayer&&"0x0000000000000000000000000000000000000000"!==r.feePayer&&r.feePayerSignatures?R(e,r.feePayerSignatures,r,t):S(e,t);case"LEGACY":default:return a=f.slice(0,6).concat(t[0]),{rawTransaction:n.encode(a),signatures:t[0],feePayerSignatures:void 0}}}function S(e,t){const r=n.decode(e),[f]=r;let[a,...o]=n.decode(f);Array.isArray(t[0])||(t=[t]),t=I(t),o=[...o,t];const s=i.getTxTypeStringFromRawTransaction(a);return void 0!==s&&s.includes("FEE_DELEGATED")&&(o=[...o,"0x0000000000000000000000000000000000000000",[["0x01","0x","0x"]]]),{rawTransaction:a+n.encode(o).slice(2),signatures:t,feePayerSignatures:void 0}}function R(e,t,r,f){const i=n.decode(e),[a]=i;let[o,...s]=n.decode(a);return Array.isArray(t[0])||(t=[t]),f=I(f),t=I(t),s=[...s,f,r.feePayer.toLowerCase(),t],{rawTransaction:o+n.encode(s).slice(2),signatures:f,feePayerSignatures:t}}function I(e){const t=new Set;let r=[];for(const n of e)if(n.length>0&&!i.isEmptySig(n)){const e=n.join("");t.has(e)||(t.add(e,!0),r.push(n))}return 0===r.length&&(r=[["0x01","0x","0x"]]),r}function N(e){let t=[],r=[];const n=K(e);return t=t.concat(n.signatures),n.feePayerSignatures&&(r=r.concat(n.feePayerSignatures)),{senderSignatures:t,feePayerSignatures:r,decodedTransaction:n}}function L(e){const t=i.getTxTypeStringFromRawTransaction(e);if(!t||!t.includes("FEE_DELEGATED"))throw new Error(`Failed to split fee payer: not a fee delegated transaction type('${t||"LEGACY"}')`);const r=e.slice(0,4),f=n.decode(i.addHexPrefix(e.slice(4))),a=f.splice(0,f.length-2);return a.push("0x0000000000000000000000000000000000000000"),a.push([["0x01","0x","0x"]]),{senderRawTransaction:r+n.encode(a).slice(2),feePayer:f[0],feePayerSignatures:f[1]}}function F(e,t){let r=K(e,t);switch(r.type){case"ACCOUNT_UPDATE":case"FEE_DELEGATED_ACCOUNT_UPDATE":case"FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO":r=A(r)}return r}function K(e,t){let r=t;switch(void 0!==r&&"LEGACY"===r||(r=i.getTxTypeStringFromRawTransaction(e),void 0===r?r="LEGACY":e="0x"+e.slice(4)),r){case"LEGACY":{const[t,f,i,a,o,s,u,c,l]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,data:s,v:u,r:c,s:l,signatures:[u,c,l]}}case"VALUE_TRANSFER":{const[t,f,i,a,o,s,u]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,from:s,v:u[0][0],r:u[0][1],s:u[0][2],signatures:u}}case"FEE_DELEGATED_VALUE_TRANSFER":{const[t,f,i,a,o,s,u,c,l]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,from:s,v:u[0][0],r:u[0][1],s:u[0][2],signatures:u,feePayer:c,payerV:l[0][0],payerR:l[0][1],payerS:l[0][2],feePayerSignatures:l}}case"FEE_DELEGATED_VALUE_TRANSFER_WITH_RATIO":{const[t,f,i,a,o,s,u,c,l,h]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,from:s,feeRatio:u,v:c[0][0],r:c[0][1],s:c[0][2],signatures:c,feePayer:l,payerV:h[0][0],payerR:h[0][1],payerS:h[0][2],feePayerSignatures:h}}case"VALUE_TRANSFER_MEMO":{const[t,f,i,a,o,s,u,c]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,from:s,data:u,v:c[0][0],r:c[0][1],s:c[0][2],signatures:c}}case"FEE_DELEGATED_VALUE_TRANSFER_MEMO":{const[t,f,i,a,o,s,u,c,l,h]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,from:s,data:u,v:c[0][0],r:c[0][1],s:c[0][2],signatures:c,feePayer:l,payerV:h[0][0],payerR:h[0][1],payerS:h[0][2],feePayerSignatures:h}}case"FEE_DELEGATED_VALUE_TRANSFER_MEMO_WITH_RATIO":{const[t,f,i,a,o,s,u,c,l,h,d]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,from:s,data:u,feeRatio:c,v:l[0][0],r:l[0][1],s:l[0][2],signatures:l,feePayer:h,payerV:d[0][0],payerR:d[0][1],payerS:d[0][2],feePayerSignatures:d}}case"ACCOUNT_CREATION":throw new Error(k);case"ACCOUNT_UPDATE":{const[t,f,i,a,o,s]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,from:a,accountKey:o,v:s[0][0],r:s[0][1],s:s[0][2],signatures:s}}case"FEE_DELEGATED_ACCOUNT_UPDATE":{const[t,f,i,a,o,s,u,c]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,from:a,accountKey:o,v:s[0][0],r:s[0][1],s:s[0][2],signatures:s,feePayer:u,payerV:c[0][0],payerR:c[0][1],payerS:c[0][2],feePayerSignatures:c}}case"FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO":{const[t,f,i,a,o,s,u,c,l]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,from:a,accountKey:o,feeRatio:s,v:u[0][0],r:u[0][1],s:u[0][2],signatures:u,feePayer:c,payerV:l[0][0],payerR:l[0][1],payerS:l[0][2],feePayerSignatures:l}}case"SMART_CONTRACT_DEPLOY":{const[t,f,i,a,o,s,u,c,l,h]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,from:s,data:u,humanReadable:"0x01"===c,codeFormat:l,v:h[0][0],r:h[0][1],s:h[0][2],signatures:h}}case"FEE_DELEGATED_SMART_CONTRACT_DEPLOY":{const[t,f,i,a,o,s,u,c,l,h,d,p]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,from:s,data:u,humanReadable:"0x01"===c,codeFormat:l,v:h[0][0],r:h[0][1],s:h[0][2],signatures:h,feePayer:d,payerV:p[0][0],payerR:p[0][1],payerS:p[0][2],feePayerSignatures:p}}case"FEE_DELEGATED_SMART_CONTRACT_DEPLOY_WITH_RATIO":{const[t,f,i,a,o,s,u,c,l,h,d,p,m]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,from:s,data:u,humanReadable:"0x01"===c,feeRatio:l,codeFormat:h,v:d[0][0],r:d[0][1],s:d[0][2],signatures:d,feePayer:p,payerV:m[0][0],payerR:m[0][1],payerS:m[0][2],feePayerSignatures:m}}case"SMART_CONTRACT_EXECUTION":{const[t,f,i,a,o,s,u,c]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,from:s,data:u,v:c[0][0],r:c[0][1],s:c[0][2],signatures:c}}case"FEE_DELEGATED_SMART_CONTRACT_EXECUTION":{const[t,f,i,a,o,s,u,c,l,h]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,from:s,data:u,v:c[0][0],r:c[0][1],s:c[0][2],signatures:c,feePayer:l,payerV:h[0][0],payerR:h[0][1],payerS:h[0][2],feePayerSignatures:h}}case"FEE_DELEGATED_SMART_CONTRACT_EXECUTION_WITH_RATIO":{const[t,f,i,a,o,s,u,c,l,h,d]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,to:a,value:o,from:s,data:u,feeRatio:c,v:l[0][0],r:l[0][1],s:l[0][2],signatures:l,feePayer:h,payerV:d[0][0],payerR:d[0][1],payerS:d[0][2],feePayerSignatures:d}}case"CANCEL":{const[t,f,i,a,o]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,from:a,v:o[0][0],r:o[0][1],s:o[0][2],signatures:o}}case"FEE_DELEGATED_CANCEL":{const[t,f,i,a,o,s,u]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,from:a,v:o[0][0],r:o[0][1],s:o[0][2],signatures:o,feePayer:s,payerV:u[0][0],payerR:u[0][1],payerS:u[0][2],feePayerSignatures:u}}case"FEE_DELEGATED_CANCEL_WITH_RATIO":{const[t,f,i,a,o,s,u,c]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,from:a,feeRatio:o,v:s[0][0],r:s[0][1],s:s[0][2],signatures:s,feePayer:u,payerV:c[0][0],payerR:c[0][1],payerS:c[0][2],feePayerSignatures:c}}case"CHAIN_DATA_ANCHORING":{const[t,f,i,a,o,s]=n.decode(e);return{type:r,nonce:t,gasPrice:f,gas:i,from:a,data:o,v:s[0][0],r:s[0][1],s:s[0][2],signatures:s}}}}function O(e,t,r,f){if(void 0===r&&(r=[t.v,t.r,t.s]),t.type.includes("FEE_DELEGATED")&&void 0===f&&(f=[t.payerV,t.payerR,t.payerS]),"LEGACY"===t.type){let t=n.decode(e);return t=t.slice(0,6).concat(r),n.encode(t)}const i=e.slice(0,4),a="0x"+e.slice(4),o=n.decode(a);return t.type.includes("FEE_DELEGATED")?(o[o.length-3]=[r],o[o.length-1]=[f]):o[o.length-1]=[r],i+n.encode(o).slice(2)}function D(e){const t=i.getTxTypeStringFromRawTransaction(e);if(void 0===t||!t.includes("FEE_DELEGATED"))return f.keccak256(e);const r=e.slice(0,4),a="0x"+e.slice(4),o=n.decode(a);return f.keccak256(r+n.encode(o.slice(0,o.length-2)).slice(2))}e.exports={encodeRLPByTxType:P,makeRawTransaction:C,decodeFromRawTransaction:F,overwriteSignature:O,getSenderTxHash:D,splitFeePayer:L,extractSignatures:N}},cd10:function(e,t,r){var n=r("8707").Buffer;function f(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return 0!==r&&(6+t+r===e.length&&(!(128&e[4])&&(!(t>1&&0===e[4]&&!(128&e[5]))&&(!(128&e[t+6])&&!(r>1&&0===e[t+6]&&!(128&e[t+7]))))))}function i(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}}function a(e,t){var r=e.length,f=t.length;if(0===r)throw new Error("R length is zero");if(0===f)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(f>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(f>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=n.allocUnsafe(6+r+f);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+r]=2,i[5+r]=t.length,t.copy(i,6+r),i}e.exports={check:f,decode:i,encode:a}},cd47:function(e,t,r){const{EthereumRpcError:n,EthereumProviderError:f}=r("2dfe"),{getMessageFromCode:i}=r("add8"),a=r("76bb");function o(e,t){const[r,f]=u(t);return new n(e,r||i(e),f)}function s(e,t){const[r,n]=u(t);return new f(e,r||i(e),n)}function u(e){let t,r;return e&&("string"===typeof e?t=e:"object"!==typeof e||Array.isArray(e)||(t=e.message,r=e.data)),[t,r]}e.exports={rpc:{parse:e=>o(a.rpc.parse,e),invalidRequest:e=>o(a.rpc.invalidRequest,e),invalidParams:e=>o(a.rpc.invalidParams,e),methodNotFound:e=>o(a.rpc.methodNotFound,e),internal:e=>o(a.rpc.internal,e),server:e=>{if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return o(t,e)},invalidInput:e=>o(a.rpc.invalidInput,e),resourceNotFound:e=>o(a.rpc.resourceNotFound,e),resourceUnavailable:e=>o(a.rpc.resourceUnavailable,e),transactionRejected:e=>o(a.rpc.transactionRejected,e),methodNotSupported:e=>o(a.rpc.methodNotSupported,e)},provider:{userRejectedRequest:e=>s(a.provider.userRejectedRequest,e),unauthorized:e=>s(a.provider.unauthorized,e),unsupportedMethod:e=>s(a.provider.unsupportedMethod,e),custom:e=>{if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||"string"!==typeof r)throw new Error('"message" must be a nonempty string');return new f(t,r,n)}}}},ce08:function(e,t,r){e.exports=self.fetch||(self.fetch=r("b048").default||r("b048"))},cf45:function(e,t,r){(function(t){const n=r("e240"),f=r("dc02"),i=r("3337"),a=new i.ec("secp256k1"),o=r("19b5"),s=r("bed1");class u{constructor(e){this.privateKey=e}get privateKey(){return this._privateKey}set privateKey(e){if(!o.isValidPrivateKey(e))throw new Error("Invalid private key: "+e);this._privateKey=o.addHexPrefix(e)}sign(e,t){t=o.toHex(t);const r=n.makeSigner(2*f.toNumber(t)+35)(e,this.privateKey),[i,a,u]=n.decodeSignature(r).map(e=>o.makeEven(o.trimLeadingZero(e)));return new s([i,a,u])}signMessage(e){const t=n.sign(e,this.privateKey),[r,f,i]=n.decodeSignature(t);return new s([r,f,i])}getPublicKey(e=!1){const r=o.stripHexPrefix(this.privateKey),n=a.keyFromPrivate(t.from(r,"hex"));return e?"0x"+n.getPublic(!0,"hex"):"0x"+n.getPublic(!1,"hex").slice(2)}getDerivedAddress(){return n.fromPrivate(this.privateKey).address.toLowerCase()}}e.exports=u}).call(this,r("b639").Buffer)},cfbe:function(e,t,r){const n=r("2ef0");class f{static fromObject(e){if(e.weight&&!e.weights&&(e.weights=e.weight,delete e.weight),void 0===e.threshold&&void 0===e.weights)return new f;if(void 0===e.threshold||void 0===e.weights)throw new Error("Invalid object for creating WeightedMultiSigOptions. 'threshold' and 'weights' should be defined.");return new f(e.threshold,e.weights)}constructor(e,t){if(void 0!==e&&void 0===t||void 0===e&&void 0!==t)throw new Error("For creating an WeightedMultiSigOptions, 'threshold' and 'weights' should be defined.");void 0!==e&&(this.threshold=e),void 0!==t&&(this.weights=t)}get threshold(){return this._threshold}set threshold(e){if(!n.isNumber(e))throw new Error("The threshold must be number type.");if(!i(e,this.weights))throw new Error("Invalid options for AccountKeyWeightedMultiSig: The sum of weights is less than the threshold.");this._threshold=e}get weights(){return this._weights}set weights(e){if(!n.isArray(e))throw new Error("weight should be an array that stores the weight of each public key.");for(const t of e)if(!n.isNumber(t))throw new Error("The weight of each key must be number type.");if(!i(this.threshold,e))throw new Error("Invalid options for AccountKeyWeightedMultiSig: The sum of weights is less than the threshold.");this._weights=e}isEmpty(){return void 0===this.threshold&&void 0===this.weights}}function i(e,t){if(void 0===e||void 0===t)return!0;let r=0;for(const n of t)r+=n;return!(e>r)}e.exports=f},cfcf:function(e,t,r){const{EthereumRpcError:n,EthereumProviderError:f}=r("2dfe"),{serializeError:i,getMessageFromCode:a}=r("add8"),o=r("cd47"),s=r("76bb");e.exports={ethErrors:o,EthereumRpcError:n,EthereumProviderError:f,serializeError:i,getMessageFromCode:a,ERROR_CODES:s}},d038:function(e,t){var r="rinkeby",n=4,f=4,i="https://eth-rinkeby.alchemyapi.io/v2/qgSA05UjKWC0SDBdcBGNMVOosOzSxEJ2";e.exports={config:{networkName:r,chainId:n,netId:f,apiUrl:"https://api.parula.kr/v1",apiKey:"",readonlyProviderUrl:i,nftAddress:"0x72d89B7FB7Ec49F3E8BDaEA02A5a009B1cbd2b6F",nft1155Address:"0x421b8189992791178e6f510db34086FB9e9ee3ce",exchangeAddress:"0xbC752EcEAaB83a8dE25500AfA4597dDC0C030480",royaltiesRegistryAddress:"0x24CD275aa022b5A35378B40C3D231C201B6Cd884",transferProxyAddress:"0x192e69D6F6ec4F4153D9FAc676162362877FC9e4",erc20TransferProxyAddress:"0xDc5D82454dB33b8A9b913cCDA7Ac0da26FB88108",communityWalletAddress:"0xFC016457a887672a37170e9F7969aBC9207f711F"}}},d057:function(e,t,r){"use strict";const{Buffer:n}=r("b639"),f=r("1eca"),{ok:i,toIterable:a}=r("7872"),{objectToQuery:o}=r("d518");e.exports=f(({fetch:e,apiUrl:t,apiPath:r,headers:f})=>(s,u)=>async function*(){u=u||{};const c=o({arg:s.toString(),...u.qs||{}}),l=`${t}${r}/cat${c}`,h=await i(e(l,{signal:u.signal,headers:u.headers||f}));for await(const e of a(h.body))yield n.from(e)}())},d287:function(e,t,r){const n=r("19d7"),f=r("0664"),i=r("2ef0"),a=r("749b"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s,CODE_FORMAT:u,getCodeFormatTag:c}=r("1789"),l=r("19b5");function h(e){if(e=l.addHexPrefix(e),!e.startsWith(s.TxTypeFeeDelegatedSmartContractDeployWithRatio))throw new Error(`Cannot decode to FeeDelegatedSmartContractDeployWithRatio. The prefix must be ${s.TxTypeFeeDelegatedSmartContractDeployWithRatio}: ${e}`);const t="0x"+e.slice(4),[r,f,i,a,o,u,c,h,d,p,m,y,g]=n.decode(t);return{nonce:l.trimLeadingZero(r),gasPrice:l.trimLeadingZero(f),gas:l.trimLeadingZero(i),to:a,value:l.trimLeadingZero(o),from:u,input:c,humanReadable:"0x1"===h,feeRatio:l.trimLeadingZero(d),codeFormat:p,signatures:m,feePayer:y,feePayerSignatures:g}}class d extends a{static create(e){return new d(e)}static decode(e){return new d(h(e))}constructor(e){if(i.isString(e)&&(e=h(e)),super(o.TxTypeFeeDelegatedSmartContractDeployWithRatio,e),this.to=e.to||"0x",this.value=e.value||"0x0",e.input&&e.data)throw new Error("'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.");this.input=e.input||e.data,this.humanReadable=void 0!==e.humanReadable&&e.humanReadable,this.codeFormat=void 0!==e.codeFormat?e.codeFormat:u.EVM}get to(){return this._to}set to(e){if("0x"!==e)throw new Error("Invalid address of to: 'to' should be '0x' with smart contract deploy transaction.");this._to=e.toLowerCase()}get value(){return this._value}set value(e){this._value=l.numberToHex(e)}get input(){return this._input}set input(e){if(!e||!l.isHex(e))throw new Error("Invalid input data "+e);this._input=l.addHexPrefix(e)}get data(){return this._input}set data(e){this._input=e}get humanReadable(){return this._humanReadable}set humanReadable(e){if(!i.isBoolean(e))throw new Error("Invalid humanReadable "+e);this._humanReadable=e}get codeFormat(){return this._codeFormat}set codeFormat(e){this._codeFormat=c(e)}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode()),t=this.feePayerSignatures.map(e=>e.encode());return s.TxTypeFeeDelegatedSmartContractDeployWithRatio+n.encode([f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.to.toLowerCase(),f.fromNat(this.value),this.from.toLowerCase(),this.input,f.fromNat(!0===this.humanReadable?"0x1":"0x0"),this.feeRatio,f.fromNat(this.codeFormat),e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),n.encode([s.TxTypeFeeDelegatedSmartContractDeployWithRatio,f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.to.toLowerCase(),f.fromNat(this.value),this.from.toLowerCase(),this.input,f.fromNat(!0===this.humanReadable?"0x1":"0x0"),this.feeRatio,f.fromNat(this.codeFormat)])}}e.exports=d},d28b:function(e,t,r){var n=r("746f");n("iterator")},d2f2:function(e,t){function r(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}r.keys=function(){return[]},r.resolve=r,e.exports=r,r.id="d2f2"},d321:function(e,t,r){(function(t){const n=r("2ef0"),f=r("3e8f"),i=r("b4ba"),a=r("32fe");class o{constructor(e,t,r){void 0!==e&&void 0!==t&&void 0!==r&&this.setIPFSNode(e,t,r)}setIPFSNode(e,t,r){const n=r?"https":"http";this.ipfs=i({apiUrl:`${n}://${e}:${t}`})}async add(e){if(!this.ipfs)throw new Error("Please set IPFS Node through 'caver.ipfs.setIPFSNode'.");if(n.isString(e)){if("undefined"!==typeof window)throw new Error("Cannot use fs module: Please pass the file contents as a parameter of type Buffer or ArrayBuffer.");e=f.readFileSync(e)}if(!n.isBuffer(e)&&!n.isArrayBuffer(e))throw new Error("Invalid data: "+e);const r=await this.ipfs.add(t.from(e));return r[0].hash}async get(e){if(!this.ipfs)throw new Error("Please set IPFS Node through 'caver.ipfs.setIPFSNode'.");const t=await this.ipfs.cat(e);return t}toHex(e){const t=a.fromB58String(e);return"0x"+a.toHexString(t)}fromHex(e){const t=e.substring(2),r=a.fromHexString(t);return a.toB58String(r)}}e.exports=o}).call(this,r("b639").Buffer)},d482:function(e,t,r){const n=r("19d7"),f=r("0664"),i=r("4695"),{CHAIN_DATA_ANCHORING_TYPE_TAG:a}=i.constants;function o(e){return n.encode([n.encode([a,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.from.toLowerCase(),f.fromNat(e.data)]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}e.exports={rlpEncodeForChainDataAnchoring:o}},d518:function(e,t,r){"use strict";const n=r("b383");t.objectToQuery=e=>{if(!e)return"";const t=Object.entries(e).reduce((e,[t,r])=>(null!=r&&(e[t]=r),e),{});return Object.keys(t).length?"?"+n.stringify(t):""}},d532:function(e){e.exports=JSON.parse('{"4001":{"standard":"EIP 1193","message":"User rejected the request."},"4100":{"standard":"EIP 1193","message":"The requested account and/or method has not been authorized by the user."},"4200":{"standard":"EIP 1193","message":"The requested method is not supported by this Ethereum provider."},"-32700":{"standard":"JSON RPC 2.0","message":"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{"standard":"JSON RPC 2.0","message":"The JSON sent is not a valid Request object."},"-32601":{"standard":"JSON RPC 2.0","message":"The method does not exist / is not available."},"-32602":{"standard":"JSON RPC 2.0","message":"Invalid method parameter(s)."},"-32603":{"standard":"JSON RPC 2.0","message":"Internal JSON-RPC error."},"-32000":{"standard":"EIP 1474","message":"Invalid input."},"-32001":{"standard":"EIP 1474","message":"Resource not found."},"-32002":{"standard":"EIP 1474","message":"Resource unavailable."},"-32003":{"standard":"EIP 1474","message":"Transaction rejected."},"-32004":{"standard":"EIP 1474","message":"Method not supported."}}')},d5c5:function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("9a12"),f=r("d968");t.zeros=function(t){return e.allocUnsafe(t).fill(0)},t.setLengthLeft=function(e,r,n){void 0===n&&(n=!1);var f=t.zeros(r);return e=t.toBuffer(e),n?e.length0&&"0"===t.toString())e=e.slice(1),t=e[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"===typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"===typeof t)t=n.intToBuffer(t);else if(null===t||void 0===t)t=e.allocUnsafe(0);else if(f.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new f(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return e=t.toBuffer(e),"0x"+e.toString("hex")},t.fromSigned=function(e){return new f(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!==typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],f=0;f1?arguments[1]:void 0)}})},d820:function(e,t,r){for(var n=r("0d70"),f=[],i={},a=0;a<256;++a)f[a]=(a+256).toString(16).substr(1),i[f[a]]=a;function o(e,t){var r=t||0,n=f;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]}var s=n(),u=[1|s[0],s[1],s[2],s[3],s[4],s[5]],c=16383&(s[6]<<8|s[7]),l=0,h=0;function d(e,t,r){var n=t&&r||0,f=t||[];e=e||{};var i=void 0!==e.clockseq?e.clockseq:c,a=void 0!==e.msecs?e.msecs:(new Date).getTime(),s=void 0!==e.nsecs?e.nsecs:h+1,d=a-l+(s-h)/1e4;if(d<0&&void 0===e.clockseq&&(i=i+1&16383),(d<0||a>l)&&void 0===e.nsecs&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=a,h=s,c=i,a+=122192928e5;var p=(1e4*(268435455&a)+s)%4294967296;f[n++]=p>>>24&255,f[n++]=p>>>16&255,f[n++]=p>>>8&255,f[n++]=255&p;var m=a/4294967296*1e4&268435455;f[n++]=m>>>8&255,f[n++]=255&m,f[n++]=m>>>24&15|16,f[n++]=m>>>16&255,f[n++]=i>>>8|128,f[n++]=255&i;for(var y=e.node||u,g=0;g<6;++g)f[n+g]=y[g];return t||o(f)}function p(e,t,r){var f=t&&r||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var i=e.random||(e.rng||n)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var a=0;a<16;++a)t[f+a]=i[a];return t||o(i)}var m=p;m.v1=d,m.v4=p,e.exports=m},d894:function(e,t,r){"use strict";e.exports=(e,t)=>(t=t||{},t.minArgs=null==t.minArgs?0:t.minArgs,(...r)=>{const n=r[r.length-1];if("function"!==typeof n||r.length===t.minArgs)return e(...r);e(...r.slice(0,-1)).then(e=>n(null,e),n)})},d8db:function(e,t,r){"use strict";var n=function(e){};function f(e,t){for(var r=arguments.length,f=new Array(r>2?r-2:0),i=2;i>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(f.p1600(this.state),this.count=0);return t},i.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=i},d968:function(e,t,r){(function(e){(function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function f(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a=r("b639").Buffer}catch(A){}function o(e,t,r){for(var n=0,f=Math.min(e.length,r),i=t;i=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function s(e,t,r,n){for(var f=0,i=Math.min(e.length,r),a=t;a=49?o-49+10:o>=17?o-17+10:o}return f}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var f=0;"-"===e[0]&&f++,16===t?this._parseHex(e,f):this._parseBase(e,t,f),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var f=0;f=0;f-=3)a=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[i]|=a<>>26-o&67108863,o+=24,o>=26&&(o-=26,i++);else if("le"===r)for(f=0,i=0;f>>26-o&67108863,o+=24,o>=26&&(o-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)f=o(e,r,r+6),this.words[n]|=f<>>26-i&4194303,i+=24,i>=26&&(i-=26,n++);r+6!==t&&(f=o(e,t,r+6),this.words[n]|=f<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,f=1;f<=67108863;f*=t)n++;n--,f=f/t|0;for(var i=e.length-r,a=i%n,o=Math.min(i,i-a)+r,u=0,c=r;c1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e){for(var t=new Array(e.bitLength()),r=0;r>>f}return t}function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var f=0|e.words[0],i=0|t.words[0],a=f*i,o=67108863&a,s=a/67108864|0;r.words[0]=o;for(var u=1;u>>26,l=67108863&s,h=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=h;d++){var p=u-d|0;f=0|e.words[p],i=0|t.words[d],a=f*i+l,c+=a/67108864|0,l=67108863&a}r.words[u]=0|l,s=0|c}return 0!==s?r.words[u]=0|s:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var f=0,i=0,a=0;a>>24-f&16777215,r=0!==i||a!==this.length-1?u[6-s.length]+s+r:s+r,f+=2,f>=26&&(f-=26,a--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var h=c[e],d=l[e];r="";var p=this.clone();p.negative=0;while(!p.isZero()){var m=p.modn(d).toString(e);p=p.idivn(d),r=p.isZero()?m+r:u[h-m.length]+m+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n("undefined"!==typeof a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var f=this.byteLength(),i=r||Math.max(1,f);n(f<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,o,s="le"===t,u=new e(i),c=this.clone();if(s){for(o=0;!c.isZero();o++)a=c.andln(255),c.iushrn(8),u[o]=a;for(;o=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,f=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var f=0,i=0;i>>26;for(;0!==f&&i>>26;if(this.length=r.length,0!==f)this.words[this.length]=f,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,y=0|a[2],g=8191&y,b=y>>>13,v=0|a[3],w=8191&v,_=v>>>13,T=0|a[4],E=8191&T,x=T>>>13,M=0|a[5],A=8191&M,k=M>>>13,P=0|a[6],C=8191&P,S=P>>>13,R=0|a[7],I=8191&R,N=R>>>13,L=0|a[8],F=8191&L,K=L>>>13,O=0|a[9],D=8191&O,B=O>>>13,U=0|o[0],j=8191&U,V=U>>>13,H=0|o[1],G=8191&H,W=H>>>13,q=0|o[2],Y=8191&q,$=q>>>13,z=0|o[3],Z=8191&z,J=z>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,fe=0|o[6],ie=8191&fe,ae=fe>>>13,oe=0|o[7],se=8191&oe,ue=oe>>>13,ce=0|o[8],le=8191&ce,he=ce>>>13,de=0|o[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(l,j),f=Math.imul(l,V),f=f+Math.imul(h,j)|0,i=Math.imul(h,V);var ye=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,j),f=Math.imul(p,V),f=f+Math.imul(m,j)|0,i=Math.imul(m,V),n=n+Math.imul(l,G)|0,f=f+Math.imul(l,W)|0,f=f+Math.imul(h,G)|0,i=i+Math.imul(h,W)|0;var ge=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,j),f=Math.imul(g,V),f=f+Math.imul(b,j)|0,i=Math.imul(b,V),n=n+Math.imul(p,G)|0,f=f+Math.imul(p,W)|0,f=f+Math.imul(m,G)|0,i=i+Math.imul(m,W)|0,n=n+Math.imul(l,Y)|0,f=f+Math.imul(l,$)|0,f=f+Math.imul(h,Y)|0,i=i+Math.imul(h,$)|0;var be=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,j),f=Math.imul(w,V),f=f+Math.imul(_,j)|0,i=Math.imul(_,V),n=n+Math.imul(g,G)|0,f=f+Math.imul(g,W)|0,f=f+Math.imul(b,G)|0,i=i+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,f=f+Math.imul(p,$)|0,f=f+Math.imul(m,Y)|0,i=i+Math.imul(m,$)|0,n=n+Math.imul(l,Z)|0,f=f+Math.imul(l,J)|0,f=f+Math.imul(h,Z)|0,i=i+Math.imul(h,J)|0;var ve=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,j),f=Math.imul(E,V),f=f+Math.imul(x,j)|0,i=Math.imul(x,V),n=n+Math.imul(w,G)|0,f=f+Math.imul(w,W)|0,f=f+Math.imul(_,G)|0,i=i+Math.imul(_,W)|0,n=n+Math.imul(g,Y)|0,f=f+Math.imul(g,$)|0,f=f+Math.imul(b,Y)|0,i=i+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,f=f+Math.imul(p,J)|0,f=f+Math.imul(m,Z)|0,i=i+Math.imul(m,J)|0,n=n+Math.imul(l,Q)|0,f=f+Math.imul(l,ee)|0,f=f+Math.imul(h,Q)|0,i=i+Math.imul(h,ee)|0;var we=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,j),f=Math.imul(A,V),f=f+Math.imul(k,j)|0,i=Math.imul(k,V),n=n+Math.imul(E,G)|0,f=f+Math.imul(E,W)|0,f=f+Math.imul(x,G)|0,i=i+Math.imul(x,W)|0,n=n+Math.imul(w,Y)|0,f=f+Math.imul(w,$)|0,f=f+Math.imul(_,Y)|0,i=i+Math.imul(_,$)|0,n=n+Math.imul(g,Z)|0,f=f+Math.imul(g,J)|0,f=f+Math.imul(b,Z)|0,i=i+Math.imul(b,J)|0,n=n+Math.imul(p,Q)|0,f=f+Math.imul(p,ee)|0,f=f+Math.imul(m,Q)|0,i=i+Math.imul(m,ee)|0,n=n+Math.imul(l,re)|0,f=f+Math.imul(l,ne)|0,f=f+Math.imul(h,re)|0,i=i+Math.imul(h,ne)|0;var _e=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(C,j),f=Math.imul(C,V),f=f+Math.imul(S,j)|0,i=Math.imul(S,V),n=n+Math.imul(A,G)|0,f=f+Math.imul(A,W)|0,f=f+Math.imul(k,G)|0,i=i+Math.imul(k,W)|0,n=n+Math.imul(E,Y)|0,f=f+Math.imul(E,$)|0,f=f+Math.imul(x,Y)|0,i=i+Math.imul(x,$)|0,n=n+Math.imul(w,Z)|0,f=f+Math.imul(w,J)|0,f=f+Math.imul(_,Z)|0,i=i+Math.imul(_,J)|0,n=n+Math.imul(g,Q)|0,f=f+Math.imul(g,ee)|0,f=f+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,f=f+Math.imul(p,ne)|0,f=f+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,n=n+Math.imul(l,ie)|0,f=f+Math.imul(l,ae)|0,f=f+Math.imul(h,ie)|0,i=i+Math.imul(h,ae)|0;var Te=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(I,j),f=Math.imul(I,V),f=f+Math.imul(N,j)|0,i=Math.imul(N,V),n=n+Math.imul(C,G)|0,f=f+Math.imul(C,W)|0,f=f+Math.imul(S,G)|0,i=i+Math.imul(S,W)|0,n=n+Math.imul(A,Y)|0,f=f+Math.imul(A,$)|0,f=f+Math.imul(k,Y)|0,i=i+Math.imul(k,$)|0,n=n+Math.imul(E,Z)|0,f=f+Math.imul(E,J)|0,f=f+Math.imul(x,Z)|0,i=i+Math.imul(x,J)|0,n=n+Math.imul(w,Q)|0,f=f+Math.imul(w,ee)|0,f=f+Math.imul(_,Q)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,f=f+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0,n=n+Math.imul(p,ie)|0,f=f+Math.imul(p,ae)|0,f=f+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0,n=n+Math.imul(l,se)|0,f=f+Math.imul(l,ue)|0,f=f+Math.imul(h,se)|0,i=i+Math.imul(h,ue)|0;var Ee=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,j),f=Math.imul(F,V),f=f+Math.imul(K,j)|0,i=Math.imul(K,V),n=n+Math.imul(I,G)|0,f=f+Math.imul(I,W)|0,f=f+Math.imul(N,G)|0,i=i+Math.imul(N,W)|0,n=n+Math.imul(C,Y)|0,f=f+Math.imul(C,$)|0,f=f+Math.imul(S,Y)|0,i=i+Math.imul(S,$)|0,n=n+Math.imul(A,Z)|0,f=f+Math.imul(A,J)|0,f=f+Math.imul(k,Z)|0,i=i+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,f=f+Math.imul(E,ee)|0,f=f+Math.imul(x,Q)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,f=f+Math.imul(w,ne)|0,f=f+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(g,ie)|0,f=f+Math.imul(g,ae)|0,f=f+Math.imul(b,ie)|0,i=i+Math.imul(b,ae)|0,n=n+Math.imul(p,se)|0,f=f+Math.imul(p,ue)|0,f=f+Math.imul(m,se)|0,i=i+Math.imul(m,ue)|0,n=n+Math.imul(l,le)|0,f=f+Math.imul(l,he)|0,f=f+Math.imul(h,le)|0,i=i+Math.imul(h,he)|0;var xe=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,j),f=Math.imul(D,V),f=f+Math.imul(B,j)|0,i=Math.imul(B,V),n=n+Math.imul(F,G)|0,f=f+Math.imul(F,W)|0,f=f+Math.imul(K,G)|0,i=i+Math.imul(K,W)|0,n=n+Math.imul(I,Y)|0,f=f+Math.imul(I,$)|0,f=f+Math.imul(N,Y)|0,i=i+Math.imul(N,$)|0,n=n+Math.imul(C,Z)|0,f=f+Math.imul(C,J)|0,f=f+Math.imul(S,Z)|0,i=i+Math.imul(S,J)|0,n=n+Math.imul(A,Q)|0,f=f+Math.imul(A,ee)|0,f=f+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,f=f+Math.imul(E,ne)|0,f=f+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(w,ie)|0,f=f+Math.imul(w,ae)|0,f=f+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,n=n+Math.imul(g,se)|0,f=f+Math.imul(g,ue)|0,f=f+Math.imul(b,se)|0,i=i+Math.imul(b,ue)|0,n=n+Math.imul(p,le)|0,f=f+Math.imul(p,he)|0,f=f+Math.imul(m,le)|0,i=i+Math.imul(m,he)|0,n=n+Math.imul(l,pe)|0,f=f+Math.imul(l,me)|0,f=f+Math.imul(h,pe)|0,i=i+Math.imul(h,me)|0;var Me=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,G),f=Math.imul(D,W),f=f+Math.imul(B,G)|0,i=Math.imul(B,W),n=n+Math.imul(F,Y)|0,f=f+Math.imul(F,$)|0,f=f+Math.imul(K,Y)|0,i=i+Math.imul(K,$)|0,n=n+Math.imul(I,Z)|0,f=f+Math.imul(I,J)|0,f=f+Math.imul(N,Z)|0,i=i+Math.imul(N,J)|0,n=n+Math.imul(C,Q)|0,f=f+Math.imul(C,ee)|0,f=f+Math.imul(S,Q)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(A,re)|0,f=f+Math.imul(A,ne)|0,f=f+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(E,ie)|0,f=f+Math.imul(E,ae)|0,f=f+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,n=n+Math.imul(w,se)|0,f=f+Math.imul(w,ue)|0,f=f+Math.imul(_,se)|0,i=i+Math.imul(_,ue)|0,n=n+Math.imul(g,le)|0,f=f+Math.imul(g,he)|0,f=f+Math.imul(b,le)|0,i=i+Math.imul(b,he)|0,n=n+Math.imul(p,pe)|0,f=f+Math.imul(p,me)|0,f=f+Math.imul(m,pe)|0,i=i+Math.imul(m,me)|0;var Ae=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,Y),f=Math.imul(D,$),f=f+Math.imul(B,Y)|0,i=Math.imul(B,$),n=n+Math.imul(F,Z)|0,f=f+Math.imul(F,J)|0,f=f+Math.imul(K,Z)|0,i=i+Math.imul(K,J)|0,n=n+Math.imul(I,Q)|0,f=f+Math.imul(I,ee)|0,f=f+Math.imul(N,Q)|0,i=i+Math.imul(N,ee)|0,n=n+Math.imul(C,re)|0,f=f+Math.imul(C,ne)|0,f=f+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(A,ie)|0,f=f+Math.imul(A,ae)|0,f=f+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,n=n+Math.imul(E,se)|0,f=f+Math.imul(E,ue)|0,f=f+Math.imul(x,se)|0,i=i+Math.imul(x,ue)|0,n=n+Math.imul(w,le)|0,f=f+Math.imul(w,he)|0,f=f+Math.imul(_,le)|0,i=i+Math.imul(_,he)|0,n=n+Math.imul(g,pe)|0,f=f+Math.imul(g,me)|0,f=f+Math.imul(b,pe)|0,i=i+Math.imul(b,me)|0;var ke=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Z),f=Math.imul(D,J),f=f+Math.imul(B,Z)|0,i=Math.imul(B,J),n=n+Math.imul(F,Q)|0,f=f+Math.imul(F,ee)|0,f=f+Math.imul(K,Q)|0,i=i+Math.imul(K,ee)|0,n=n+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,f=f+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,n=n+Math.imul(C,ie)|0,f=f+Math.imul(C,ae)|0,f=f+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,n=n+Math.imul(A,se)|0,f=f+Math.imul(A,ue)|0,f=f+Math.imul(k,se)|0,i=i+Math.imul(k,ue)|0,n=n+Math.imul(E,le)|0,f=f+Math.imul(E,he)|0,f=f+Math.imul(x,le)|0,i=i+Math.imul(x,he)|0,n=n+Math.imul(w,pe)|0,f=f+Math.imul(w,me)|0,f=f+Math.imul(_,pe)|0,i=i+Math.imul(_,me)|0;var Pe=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Q),f=Math.imul(D,ee),f=f+Math.imul(B,Q)|0,i=Math.imul(B,ee),n=n+Math.imul(F,re)|0,f=f+Math.imul(F,ne)|0,f=f+Math.imul(K,re)|0,i=i+Math.imul(K,ne)|0,n=n+Math.imul(I,ie)|0,f=f+Math.imul(I,ae)|0,f=f+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,n=n+Math.imul(C,se)|0,f=f+Math.imul(C,ue)|0,f=f+Math.imul(S,se)|0,i=i+Math.imul(S,ue)|0,n=n+Math.imul(A,le)|0,f=f+Math.imul(A,he)|0,f=f+Math.imul(k,le)|0,i=i+Math.imul(k,he)|0,n=n+Math.imul(E,pe)|0,f=f+Math.imul(E,me)|0,f=f+Math.imul(x,pe)|0,i=i+Math.imul(x,me)|0;var Ce=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,re),f=Math.imul(D,ne),f=f+Math.imul(B,re)|0,i=Math.imul(B,ne),n=n+Math.imul(F,ie)|0,f=f+Math.imul(F,ae)|0,f=f+Math.imul(K,ie)|0,i=i+Math.imul(K,ae)|0,n=n+Math.imul(I,se)|0,f=f+Math.imul(I,ue)|0,f=f+Math.imul(N,se)|0,i=i+Math.imul(N,ue)|0,n=n+Math.imul(C,le)|0,f=f+Math.imul(C,he)|0,f=f+Math.imul(S,le)|0,i=i+Math.imul(S,he)|0,n=n+Math.imul(A,pe)|0,f=f+Math.imul(A,me)|0,f=f+Math.imul(k,pe)|0,i=i+Math.imul(k,me)|0;var Se=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,ie),f=Math.imul(D,ae),f=f+Math.imul(B,ie)|0,i=Math.imul(B,ae),n=n+Math.imul(F,se)|0,f=f+Math.imul(F,ue)|0,f=f+Math.imul(K,se)|0,i=i+Math.imul(K,ue)|0,n=n+Math.imul(I,le)|0,f=f+Math.imul(I,he)|0,f=f+Math.imul(N,le)|0,i=i+Math.imul(N,he)|0,n=n+Math.imul(C,pe)|0,f=f+Math.imul(C,me)|0,f=f+Math.imul(S,pe)|0,i=i+Math.imul(S,me)|0;var Re=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,se),f=Math.imul(D,ue),f=f+Math.imul(B,se)|0,i=Math.imul(B,ue),n=n+Math.imul(F,le)|0,f=f+Math.imul(F,he)|0,f=f+Math.imul(K,le)|0,i=i+Math.imul(K,he)|0,n=n+Math.imul(I,pe)|0,f=f+Math.imul(I,me)|0,f=f+Math.imul(N,pe)|0,i=i+Math.imul(N,me)|0;var Ie=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,le),f=Math.imul(D,he),f=f+Math.imul(B,le)|0,i=Math.imul(B,he),n=n+Math.imul(F,pe)|0,f=f+Math.imul(F,me)|0,f=f+Math.imul(K,pe)|0,i=i+Math.imul(K,me)|0;var Ne=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(D,pe),f=Math.imul(D,me),f=f+Math.imul(B,pe)|0,i=Math.imul(B,me);var Le=(u+n|0)+((8191&f)<<13)|0;return u=(i+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,s[0]=ye,s[1]=ge,s[2]=be,s[3]=ve,s[4]=we,s[5]=_e,s[6]=Te,s[7]=Ee,s[8]=xe,s[9]=Me,s[10]=Ae,s[11]=ke,s[12]=Pe,s[13]=Ce,s[14]=Se,s[15]=Re,s[16]=Ie,s[17]=Ne,s[18]=Le,0!==u&&(s[19]=u,r.length++),r};function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,f=0,i=0;i>>26)|0,f+=a>>>26,a&=67108863}r.words[i]=o,n=a,a=f}return 0!==n?r.words[i]=n:r.length--,r.strip()}function y(e,t,r){var n=new g;return n.mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?d(this,e,t):n<1024?m(this,e,t):y(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,f,i){for(var a=0;a>>=1)f++;return 1<>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=f/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=h(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,r=e%26,f=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==f){for(t=this.length-1;t>=0;t--)this.words[t+f]=this.words[t];for(t=0;t=0),f=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),o=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==c||u>=f);u--){var l=0|this.words[u];this.words[u]=c<<26-i|l>>>i,c=l&o}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,f=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var f=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(s/67108864|0),this.words[f+r]=67108863&i}for(;f>26,this.words[f+r]=67108863&i;if(0===o)return this.strip();for(n(-1===o),o=0,f=0;f>26,this.words[f]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),f=e,a=0|f.words[f.length-1],o=this._countBits(a);r=26-o,0!==r&&(f=f.ushln(r),n.iushln(r),a=0|f.words[f.length-1]);var s,u=n.length-f.length;if("mod"!==t){s=new i(null),s.length=u+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var d=67108864*(0|n.words[f.length+h])+(0|n.words[f.length+h-1]);d=Math.min(d/a|0,67108863),n._ishlnsubmul(f,d,h);while(0!==n.negative)d--,n.negative=0,n._ishlnsubmul(f,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(f=o.div.neg()),"div"!==t&&(a=o.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:f,mod:a}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(f=o.div.neg()),{div:f,mod:o.mod}):0!==(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(a=o.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:o.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var f,a,o},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),f=e.andln(1),i=r.cmp(n);return i<0||1===f&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,f=this.length-1;f>=0;f--)r=(t*r+(0|this.words[f]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var f=(0|this.words[r])+67108864*t;this.words[r]=f/e|0,t=f%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var f=new i(1),a=new i(0),o=new i(0),s=new i(1),u=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++u;var c=r.clone(),l=t.clone();while(!t.isZero()){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0){t.iushrn(h);while(h-- >0)(f.isOdd()||a.isOdd())&&(f.iadd(c),a.isub(l)),f.iushrn(1),a.iushrn(1)}for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0){r.iushrn(p);while(p-- >0)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(l)),o.iushrn(1),s.iushrn(1)}t.cmp(r)>=0?(t.isub(r),f.isub(o),a.isub(s)):(r.isub(t),o.isub(f),s.isub(a))}return{a:o,b:s,gcd:r.iushln(u)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var f,a=new i(1),o=new i(0),s=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var u=0,c=1;0===(t.words[0]&c)&&u<26;++u,c<<=1);if(u>0){t.iushrn(u);while(u-- >0)a.isOdd()&&a.iadd(s),a.iushrn(1)}for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0){r.iushrn(l);while(l-- >0)o.isOdd()&&o.iadd(s),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),a.isub(o)):(r.isub(t),o.isub(a))}return f=0===t.cmpn(1)?a:o,f.cmpn(0)<0&&f.iadd(e),f},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var f=t.cmp(r);if(f<0){var i=t;t=r,r=i}else if(0===f||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,f=1<>>26,o&=67108863,this.words[a]=o}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var f=0|this.words[0];t=f===e?0:fe.length)return 1;if(this.length=0;r--){var n=0|this.words[r],f=0|e.words[r];if(n!==f){nf&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new x(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function T(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},f(w,v),w.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),f=0;f>>22,i=a}i>>>=22,e.words[f-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=f,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new _;else if("p192"===e)t=new T;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return b[e]=t,t},x.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var f=this.m.subn(1),a=0;while(!f.isZero()&&0===f.andln(1))a++,f.iushrn(1);n(!f.isZero());var o=new i(1).toRed(this),s=o.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();c=new i(2*c*c).toRed(this);while(0!==this.pow(c,u).cmp(s))c.redIAdd(s);var l=this.pow(c,f),h=this.pow(e,f.addn(1).iushrn(1)),d=this.pow(e,f),p=a;while(0!==d.cmp(o)){for(var m=d,y=0;0!==m.cmp(o);y++)m=m.redSqr();n(y=0;f--){for(var c=t.words[f],l=u-1;l>=0;l--){var h=c>>l&1;a!==n[0]&&(a=this.sqr(a)),0!==h||0!==o?(o<<=1,o|=h,s++,(s===r||0===f&&0===l)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}u=26}return a},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new M(e)},f(M,x),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=r.isub(n).iushrn(this.shift),i=f;return f.cmp(this.m)>=0?i=f.isub(this.m):f.cmpn(0)<0&&(i=f.iadd(this.m)),i._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=r.isub(n).iushrn(this.shift),a=f;return f.cmp(this.m)>=0?a=f.isub(this.m):f.cmpn(0)<0&&(a=f.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(e,this)}).call(this,r("62e4")(e))},d9b4:function(e,t,r){"use strict";const n=r("1ff5"),{objectToQuery:f}=r("d518"),i=r("1eca"),{ok:a,toIterable:o}=r("7872"),s=r("83c7");e.exports=i(({fetch:e,apiUrl:t,apiPath:r,headers:i})=>(u,c)=>async function*(){c=c||{};const l=f({arg:u,count:c.count,...c.qs||{}}),h=`${t}${r}/ping${l}`,d=await a(e(h,{signal:c.signal,headers:c.headers||i}));for await(const e of n(o(d.body)))yield s(e)}())},d9ea:function(e,t,r){const n=r("19d7"),f=r("0664"),i=r("2ef0"),a=r("749b"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s}=r("1789"),u=r("19b5");function c(e){if(e=u.addHexPrefix(e),!e.startsWith(s.TxTypeFeeDelegatedSmartContractExecutionWithRatio))throw new Error(`Cannot decode to FeeDelegatedSmartContractExecutionWithRatio. The prefix must be ${s.TxTypeFeeDelegatedSmartContractExecutionWithRatio}: ${e}`);const t="0x"+e.slice(4),[r,f,i,a,o,c,l,h,d,p,m]=n.decode(t);return{nonce:u.trimLeadingZero(r),gasPrice:u.trimLeadingZero(f),gas:u.trimLeadingZero(i),to:a,value:u.trimLeadingZero(o),from:c,input:l,feeRatio:u.trimLeadingZero(h),signatures:d,feePayer:p,feePayerSignatures:m}}class l extends a{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){if(i.isString(e)&&(e=c(e)),super(o.TxTypeFeeDelegatedSmartContractExecutionWithRatio,e),this.to=e.to,this.value=e.value||"0x0",e.input&&e.data)throw new Error("'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.");this.input=e.input||e.data}get to(){return this._to}set to(e){if(!u.isAddress(e))throw new Error("Invalid address of to: "+e);this._to=e.toLowerCase()}get value(){return this._value}set value(e){this._value=u.numberToHex(e)}get input(){return this._input}set input(e){if(!e||!u.isHex(e))throw new Error("Invalid input data "+e);this._input=u.addHexPrefix(e)}get data(){return this._input}set data(e){this._input=e}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode()),t=this.feePayerSignatures.map(e=>e.encode());return s.TxTypeFeeDelegatedSmartContractExecutionWithRatio+n.encode([f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.to.toLowerCase(),f.fromNat(this.value),this.from.toLowerCase(),this.input,this.feeRatio,e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),n.encode([s.TxTypeFeeDelegatedSmartContractExecutionWithRatio,f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.to.toLowerCase(),f.fromNat(this.value),this.from.toLowerCase(),this.input,this.feeRatio])}}e.exports=l},d9f1:function(e,t,r){"use strict";const{objectToQuery:n}=r("d518"),f=r("1eca"),{ok:i}=r("7872");e.exports=f(({fetch:e,apiUrl:t,apiPath:r,headers:f})=>async(a,o)=>{a=Array.isArray(a)?a:[a],o=o||{};const s=n({arg:a.map(e=>e.toString()),...o.qs||{}}),u=`${t}${r}/swarm/connect${s}`,c=await i(e(u,{signal:o.signal,headers:o.headers||f})),l=await c.json();return(l||{}).Strings||[]})},da80:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("bb44").ripemd160,f=r("990e");t.ripemd160=f.createHashFunction((function(){return new n}))},db81:function(e,t,r){const n=r("19d7"),f=r("0664"),i=r("2ef0"),a=r("558a"),{TX_TYPE_STRING:o,TX_TYPE_TAG:s}=r("1789"),u=r("19b5");function c(e){if(e=u.addHexPrefix(e),!e.startsWith(s.TxTypeFeeDelegatedCancel))throw new Error(`Cannot decode to FeeDelegatedCancel. The prefix must be ${s.TxTypeFeeDelegatedCancel}: ${e}`);const t="0x"+e.slice(4),[r,f,i,a,o,c,l]=n.decode(t);return{nonce:u.trimLeadingZero(r),gasPrice:u.trimLeadingZero(f),gas:u.trimLeadingZero(i),from:a,signatures:o,feePayer:c,feePayerSignatures:l}}class l extends a{static create(e){return new l(e)}static decode(e){return new l(c(e))}constructor(e){i.isString(e)&&(e=c(e)),super(o.TxTypeFeeDelegatedCancel,e)}getRLPEncoding(){this.validateOptionalValues();const e=this.signatures.map(e=>e.encode()),t=this.feePayerSignatures.map(e=>e.encode());return s.TxTypeFeeDelegatedCancel+n.encode([f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.from.toLowerCase(),e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),n.encode([s.TxTypeFeeDelegatedCancel,f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.from.toLowerCase()])}}e.exports=l},db8d:function(e,t,r){(function(t){var n=r("c973").default;r("96cf"),r("d3b7"),r("fb6a");var f=[{type:"string",name:"name"},{type:"string",name:"version"},{type:"uint256",name:"chainId"},{type:"address",name:"verifyingContract"}],i=r("f10a");e.exports={createTypeData:function(e,t,r,n){return{types:Object.assign({EIP712Domain:f},n),domain:e,primaryType:t,message:r}},signTypedData:function(e,r,f){return new Promise(function(){var a=n(regeneratorRuntime.mark((function n(a,o){var s,u,c,l;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(s=function(e,t){if(e)return o(e);if(t.error)return o(t.error);var r=t.result?t.result:t,n=r.substring(2),i="0x"+n.substring(0,64),s="0x"+n.substring(64,128),u=parseInt(n.substring(128,130),16);a({data:f,sig:r,v:u,r:i,s:s})},e.klay)try{u=e.klay.accounts.wallet[r.toLowerCase()].privateKey,c=t.from(u.slice(2),"hex"),l=i.signTypedData(t.from(c,"hex"),{data:f}),s("",l)}catch(h){o(h)}else e.currentProvider.isMetaMask?e.currentProvider.sendAsync({jsonrpc:"2.0",method:"eth_signTypedData_v3",params:[r,JSON.stringify(f)],id:(new Date).getTime()},s):(l=i.signTypedData(e._provider.wallets[r.toLowerCase()].privateKey,{data:f}),s("",l));case 2:case"end":return n.stop()}}),n)})));return function(e,t){return a.apply(this,arguments)}}())},recoverTypedSignature:function(e,t){return i.recoverTypedSignature({data:e,sig:t})}}}).call(this,r("b639").Buffer)},db92:function(e){e.exports=JSON.parse('{"contractName":"ExchangeV2","abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct LibAsset.AssetType","name":"makeAssetType","type":"tuple"},{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct LibAsset.AssetType","name":"takeAssetType","type":"tuple"}],"name":"Cancel","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"leftHash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"rightHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"leftMaker","type":"address"},{"indexed":false,"internalType":"address","name":"rightMaker","type":"address"},{"indexed":false,"internalType":"uint256","name":"newLeftFill","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRightFill","type":"uint256"},{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct LibAsset.AssetType","name":"leftAsset","type":"tuple"},{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct LibAsset.AssetType","name":"rightAsset","type":"tuple"}],"name":"Match","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes4","name":"assetType","type":"bytes4"},{"indexed":false,"internalType":"address","name":"matcher","type":"address"}],"name":"MatcherChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes4","name":"assetType","type":"bytes4"},{"indexed":false,"internalType":"address","name":"proxy","type":"address"}],"name":"ProxyChange","type":"event"},{"anonymous":false,"inputs":[{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct LibAsset.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"indexed":false,"internalType":"struct LibAsset.Asset","name":"asset","type":"tuple"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"bytes4","name":"transferDirection","type":"bytes4"},{"indexed":false,"internalType":"bytes4","name":"transferType","type":"bytes4"}],"name":"Transfer","type":"event"},{"inputs":[{"components":[{"internalType":"address","name":"maker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct LibAsset.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct LibAsset.Asset","name":"makeAsset","type":"tuple"},{"internalType":"address","name":"taker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct LibAsset.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct LibAsset.Asset","name":"takeAsset","type":"tuple"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"bytes4","name":"dataType","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct LibOrder.Order","name":"order","type":"tuple"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultFeeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeReceivers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"fills","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"components":[{"internalType":"address","name":"maker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct LibAsset.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct LibAsset.Asset","name":"makeAsset","type":"tuple"},{"internalType":"address","name":"taker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct LibAsset.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct LibAsset.Asset","name":"takeAsset","type":"tuple"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"bytes4","name":"dataType","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct LibOrder.Order","name":"orderLeft","type":"tuple"},{"internalType":"bytes","name":"signatureLeft","type":"bytes"},{"components":[{"internalType":"address","name":"maker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct LibAsset.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct LibAsset.Asset","name":"makeAsset","type":"tuple"},{"internalType":"address","name":"taker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct LibAsset.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct LibAsset.Asset","name":"takeAsset","type":"tuple"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"bytes4","name":"dataType","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct LibOrder.Order","name":"orderRight","type":"tuple"},{"internalType":"bytes","name":"signatureRight","type":"bytes"}],"name":"matchOrders","outputs":[],"stateMutability":"payable","type":"function","payable":true},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"protocolFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltiesRegistry","outputs":[{"internalType":"contract IRoyaltiesProvider","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"bytes4","name":"assetType","type":"bytes4"},{"internalType":"address","name":"matcher","type":"address"}],"name":"setAssetMatcher","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"newDefaultFeeReceiver","type":"address"}],"name":"setDefaultFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"wallet","type":"address"}],"name":"setFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newProtocolFee","type":"uint256"}],"name":"setProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IRoyaltiesProvider","name":"newRoyaltiesRegistry","type":"address"}],"name":"setRoyaltiesRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"assetType","type":"bytes4"},{"internalType":"address","name":"proxy","type":"address"}],"name":"setTransferProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INftTransferProxy","name":"_transferProxy","type":"address"},{"internalType":"contract IERC20TransferProxy","name":"_erc20TransferProxy","type":"address"},{"internalType":"uint256","name":"newProtocolFee","type":"uint256"},{"internalType":"address","name":"newDefaultFeeReceiver","type":"address"},{"internalType":"contract IRoyaltiesProvider","name":"newRoyaltiesProvider","type":"address"}],"name":"__ExchangeV2_init","outputs":[],"stateMutability":"nonpayable","type":"function"}]}')},dc02:function(e,t,r){const n=r("d968"),f=r("0664"),i=e=>"0x"+e.toString("hex"),a=e=>new n(e.slice(2),16),o=e=>{const t="0x"+("0x"===e.slice(0,2)?new n(e.slice(2),16):new n(e,10)).toString("hex");return"0x0"===t?"0x":t},s=e=>h(g(e,o("10000000000")))/1e8,u=e=>y(l(Math.floor(1e8*e)),o("10000000000")),c=e=>a(e).toString(10),l=e=>"string"===typeof e?/^0x/.test(e)?e:"0x"+e:"0x"+new n(e).toString("hex"),h=e=>a(e).toNumber(),d=e=>f.pad(32,e),p=e=>(t,r)=>i(a(t)[e](a(r))),m=p("add"),y=p("mul"),g=p("div"),b=p("sub");e.exports={toString:c,fromString:o,toNumber:h,fromNumber:l,toEther:s,fromEther:u,toUint256:d,add:m,mul:y,div:g,sub:b}},dc44:function(e,t,r){(function(t,n){const f=r("2ef0"),i=r("9ba9"),a=r("e240"),o=r("f3a4"),s=r("19d7"),u=r("dc02"),c=r("0664"),l=r("1c46"),h=r("d820"),d=r("3337"),p=r("9f6a"),m=r("19b5"),y=r("4695"),g=r("379f"),b=r("19eb"),{encodeRLPByTxType:v,makeRawTransaction:w,getSenderTxHash:_,decodeFromRawTransaction:T,splitFeePayer:E,extractSignatures:x}=r("ccf6"),M=new d.ec("secp256k1"),A=r("0c0c"),k=r("148e"),P=r("aea2"),{AccountKeyEnum:C}=r("ee69"),S=r("69b0"),R=r("91dd6"),{rpc:I}=r("ba9f"),N=function(e){return f.isUndefined(e)||f.isNull(e)};function L(e){if("object"!==typeof e)throw new Error("Invalid transaction");return e.senderRawTransaction||e.type&&"LEGACY"!==e.type&&!e.type.includes("SMART_CONTRACT_DEPLOY")||(e.to=e.to||"0x",e.data=m.addHexPrefix(e.data||"0x")),e.chainId=m.numberToHex(e.chainId),e}function F(e){if(0===e.length||e.length>3)throw new Error("Invalid parameter: The number of parameters is invalid.");const t=e[0];let r,n;if(!t||!f.isObject(t)&&!f.isString(t))throw new Error("Invalid parameter: The transaction must be defined as an object or RLP encoded string");if(2===e.length)f.isFunction(e[1])?n=e[1]:r=e[1];else if(3===e.length){if(e[1]&&"string"!==typeof e[1]&&!f.isArray(e[1]))throw new Error("Invalid parameter: The parameter for the private key is invalid");r=e[1],n=e[2]}return n=n||function(){},{tx:t,privateKey:r,callback:n}}function K(e){if(0===e.length||e.length>4)throw new Error("Invalid parameter: The number of parameters is invalid.");const t=e[0],r=e[1];let n,i;if(!t||!f.isObject(t)&&!f.isString(t))throw new Error("Invalid parameter: The transaction must be defined as an object or RLP encoded string");if(!m.isAddress(r))throw new Error("Invalid fee payer address : "+r);if(3===e.length)f.isFunction(e[2])?i=e[2]:n=e[2];else if(4===e.length){if(e[2]&&"string"!==typeof e[2]&&!f.isArray(e[2]))throw new Error("Invalid parameter: The parameter for the private key is invalid");n=e[2],i=e[3]}return i=i||function(){},{tx:t,privateKey:n,feePayer:r,callback:i}}function O(e){if(e.length<2||e.length>4)throw new Error("Invalid parameter: The number of parameters is invalid.");const t=e[0],r=e[1];let n,i;if(!t)throw new Error("Invalid parameter: The hash of transaction must be defined as a parameter.");if(!m.isValidHashStrict(t))throw new Error("Invalid parameter: The hash of transaction must be 0x-hex prefixed string format.");if(!r||!Array.isArray(r)&&!f.isString(r))throw new Error("Invalid parameter: The private key should be a private key string or an array of private keys.");if(3===e.length)f.isFunction(e[2])?i=e[2]:n=e[2];else if(4===e.length){if(e[2]&&!f.isString(e[2])&&!f.isNumber(e[2]))throw new Error("Invalid parameter: The parameter for the chain id is invalid.");n=e[2],i=e[3]}return i=i||function(){},{hash:t,privateKeys:r,chainId:n,callback:i}}function D(e,t,r){const i=[];if(!e)return i;const a=f.isArray(e)?e:[e];for(let f=0;f{"legacyKey"!==t[e]&&"failKey"!==t[e]||(n[e]=t[e],delete t[e])}),0===Object.keys(t).length))return new R(e,n,r);const i=this.accountKeyToPublicKey(t);return void 0!==n&&Object.assign(i,n),new R(e,i,r)},B.prototype.createAccountForUpdateWithPublicKey=function(e,t,r){return new R(e,t,r)},B.prototype.createAccountForUpdateWithLegacyKey=function(e){return new R(e,"legacyKey")},B.prototype.createAccountForUpdateWithFailKey=function(e){return new R(e,"failKey")},B.prototype.isDecoupled=function(e,t){const{legacyAccount:r,klaytnWalletKeyAddress:n}=this.getLegacyAccount(e),f=this._determineAddress(r,n,t);return r.address.toLowerCase()!==f.toLowerCase()},B.prototype.getLegacyAccount=function(e){const t=m.parsePrivateKey(e);if(!m.isValidPrivateKey(t.privateKey))throw new Error("Invalid private key");const r=m.addHexPrefix(t.privateKey),n=this._addAccountFunctions(S.fromObject(a.fromPrivate(r)));return{legacyAccount:n,klaytnWalletKeyAddress:t.address}},B.prototype.signTransaction=function(){const e=this;let t,r,n,s,c=!1,l=!1,h=[],d=[];const p=e=>(e=e instanceof Error?e:new Error(e),s&&s(e),i.reject(e));try{const e=F(arguments);r=e.tx,n=e.privateKey,s=e.callback}catch(M){return p(M)}f.isString(r)&&(r=T(r));const g=y.validateFunction.validateParams(r);if(g)return p(g);if(r.senderRawTransaction){r.feePayerSignatures&&(d=d.concat(r.feePayerSignatures));try{const{senderRawTransaction:e,feePayer:t,feePayerSignatures:n}=E(r.senderRawTransaction);if("0x"!==t&&"0x0000000000000000000000000000000000000000"!==t){if(t.toLowerCase()!==r.feePayer.toLowerCase())return p(`Invalid feePayer: The fee payer(${t}) included in the transaction does not match the fee payer(${r.feePayer}) you want to sign.`);d=d.concat(n)}r.senderRawTransaction=e,l=!0}catch(M){return p(M)}}else if(c=!(void 0!==r.type&&"LEGACY"!==r.type),r.signatures){if(c)return p("Legacy transaction cannot be signed with multiple keys.");h=h.concat(r.signatures)}if(void 0===n)try{const e=this.wallet.getAccount(l?r.feePayer:r.from);if(!e)return p("Failed to find get private key to sign. The account you want to use for signing must exist in caver.klay.accounts.wallet or you must pass the private key as a parameter.");n=this._getRoleKey(r,e)}catch(M){return p(M)}const b=f.isArray(n)?n:[n];try{for(let e=0;e1)return p("Legacy transaction cannot signed with multiple keys");if(e.isDecoupled(b[0],r.from))return p("A legacy transaction must be with a legacy account key")}function x(e){try{e=y.formatters.inputCallFormatter(e);const r=L(e),n=v(r),f=o.keccak256(n),i=l?d:h;for(const e of b){const t=a.makeSigner(2*u.toNumber(r.chainId||"0x1")+35)(f,e),[n,o,s]=a.decodeSignature(t).map(e=>m.makeEven(m.trimLeadingZero(e)));i.push([n,o,s])}const{rawTransaction:s,signatures:c,feePayerSignatures:p}=w(n,i,r);t={messageHash:f,v:i[0][0],r:i[0][1],s:i[0][2],rawTransaction:s,txHash:o.keccak256(s),senderTxHash:_(s)},l?t.feePayerSignatures=p:t.signatures=c}catch(M){return s(M),i.reject(M)}return s(null,t),t}return void 0!==r.nonce&&void 0!==r.chainId&&void 0!==r.gasPrice?i.resolve(x(r)):l?i.all([N(r.chainId)?e._klaytnCall.getChainId():r.chainId]).then((function(e){if(N(e[0]))throw new Error('"chainId" couldn\'t be fetched: '+JSON.stringify(e));return x(f.extend(r,{chainId:e[0]}))})):i.all([N(r.chainId)?e._klaytnCall.getChainId():r.chainId,N(r.gasPrice)?e._klaytnCall.getGasPrice():r.gasPrice,N(r.nonce)?e._klaytnCall.getTransactionCount(r.from,"pending"):r.nonce]).then((function(e){if(N(e[0])||N(e[1])||N(e[2]))throw new Error('One of the values "chainId", "gasPrice", or "nonce" couldn\'t be fetched: '+JSON.stringify(e));return x(f.extend(r,{chainId:e[0],gasPrice:e[1],nonce:e[2]}))}))},B.prototype.feePayerSignTransaction=function(){const e=this;let t,r,n,a;const o=e=>(e=e instanceof Error?e:new Error(e),a&&a(e),i.reject(e));try{const e=K(arguments);t=e.tx,r=e.feePayer,n=e.privateKey,a=e.callback}catch(s){return o(s)}if(f.isString(t))return this.signTransaction({senderRawTransaction:t,feePayer:r},n,a);if(t.feePayer&&"0x"!==t.feePayer&&"0x0000000000000000000000000000000000000000"!==t.feePayer||(t.feePayer=r),!t.senderRawTransaction&&(!t.type||!t.type.includes("FEE_DELEGATED")))return o(`Failed to sign transaction with fee payer: invalid transaction type(${t.type?t.type:"LEGACY"})`);const s=y.validateFunction.validateParams(t);return s?o(s):t.feePayer.toLowerCase()!==r.toLowerCase()?o("Invalid parameter: The address of fee payer does not match."):t.senderRawTransaction?this.signTransaction(t,n,a):i.all([N(t.chainId)?e._klaytnCall.getChainId():t.chainId,N(t.gasPrice)?e._klaytnCall.getGasPrice():t.gasPrice,N(t.nonce)?e._klaytnCall.getTransactionCount(t.from,"pending"):t.nonce]).then((function(i){const o=i[0],s=i[1],u=i[2];if(N(o)||N(s)||N(u))throw new Error('One of the values "chainId", "gasPrice", or "nonce" couldn\'t be fetched: '+JSON.stringify(i));let c=f.extend(t,{chainId:o,gasPrice:s,nonce:u});c=y.formatters.inputCallFormatter(c),c=L(c);const l=v(c),h=c.signatures?c.signatures:[["0x01","0x","0x"]],{rawTransaction:d}=w(l,h,c);return e.signTransaction({senderRawTransaction:d,feePayer:r,chainId:o},n,a)}))},B.prototype.signTransactionWithHash=function(){const e=this;let t,r,n,f;const o=e=>(e=e instanceof Error?e:new Error(e),f&&f(e),i.reject(e));try{const e=O(arguments);t=e.hash,n=e.chainId,r=e.privateKeys,f=e.callback}catch(c){return o(c)}function s(e,t,r,n){const f=[];r=m.numberToHex(r);try{for(const n of t){const t=m.addHexPrefix(m.parsePrivateKey(n).privateKey);if(!m.isValidPrivateKey(t))return o("Failed to sign transaction with hash: Invalid private key "+n);const i=a.makeSigner(2*u.toNumber(r||"0x1")+35)(e,t),[s,c,l]=a.decodeSignature(i).map(e=>m.makeEven(m.trimLeadingZero(e)));f.push(m.transformSignaturesToObject([s,c,l]))}}catch(c){return n(c),i.reject(c)}return n(null,f),f}return r=Array.isArray(r)?r:[r],i.resolve(N(n)?e._klaytnCall.getChainId():n).then(e=>s(t,r,e,f))},B.prototype.getRawTransactionWithSignatures=function(e,t){const r=this;let n;t=t||function(){};const a=e=>(e=e instanceof Error?e:new Error(e),t&&t(e),i.reject(e));if(!e||!f.isObject(e))return a("Invalid parameter: The transaction must be defined as an object");if(!e.signatures&&!e.feePayerSignatures)return a("There are no signatures or feePayerSignatures defined in the transaction object.");const s=y.validateFunction.validateParams(e);if(s)return a(s);if(e.senderRawTransaction){e.feePayerSignatures=e.feePayerSignatures||[["0x01","0x","0x"]];const t=T(e.senderRawTransaction);if("0x"!==t.feePayer&&"0x0000000000000000000000000000000000000000"!==t.feePayer&&!m.isEmptySig(t.feePayerSignatures)){if(t.feePayer.toLowerCase()!==e.feePayer.toLowerCase())return a("Invalid feePayer");e.feePayerSignatures=e.feePayerSignatures.concat(t.feePayerSignatures)}t.feePayer=e.feePayer,t.feePayerSignatures=e.feePayerSignatures,e.signatures&&(t.signatures=t.signatures.concat(e.signatures)),e=t}function u(e){try{e=y.formatters.inputCallFormatter(e);const t=L(e),r=v(t);let i=t.signatures?t.signatures:["0x01","0x","0x"];f.isArray(i[0])||(i=[i]);const{rawTransaction:a,signatures:s,feePayerSignatures:u}=w(r,i,t);n={rawTransaction:a,txHash:o.keccak256(a),senderTxHash:_(a)},s&&!m.isEmptySig(s)&&(n.signatures=s),u&&!m.isEmptySig(u)&&(n.feePayerSignatures=u)}catch(r){return t(r),i.reject(r)}return t(null,n),n}return void 0!==e.nonce&&void 0!==e.chainId&&void 0!==e.gasPrice?i.resolve(u(e)):i.all([N(e.chainId)?r._klaytnCall.getChainId():e.chainId,N(e.gasPrice)?r._klaytnCall.getGasPrice():e.gasPrice,N(e.nonce)?r._klaytnCall.getTransactionCount(e.from,"pending"):e.nonce]).then((function(t){if(N(t[0])||N(t[1])||N(t[2]))throw new Error('One of the values "chainId", "gasPrice", or "nonce" couldn\'t be fetched: '+JSON.stringify(t));return u(f.extend(e,{chainId:t[0],gasPrice:t[1],nonce:t[2]}))}))},B.prototype.combineSignatures=function(e,t){let r,n,a=[],o=[];t=t||function(){};const s=e=>(e=e instanceof Error?e:new Error(e),t&&t(e),i.reject(e));if(!f.isArray(e))return s("The parameter of the combineSignatures function must be an array of RLP encoded transaction strings.");for(const f of e){const{senderSignatures:e,feePayerSignatures:t,decodedTransaction:i}=x(f);if(a=a.concat(e),o=o.concat(t),r){let e=!0;const t=Object.keys(r);for(const f of t)if("v"!==f&&"r"!==f&&"s"!==f&&"signatures"!==f&&"payerV"!==f&&"payerR"!==f&&"payerS"!==f&&"feePayerSignatures"!==f){if("feePayer"===f){if("0x"===i[f]||"0x0000000000000000000000000000000000000000"===i[f])continue;n=i[f],"0x"!==r[f]&&"0x0000000000000000000000000000000000000000"!==r[f]||(r[f]=i[f])}if(void 0===i[f]||r[f]!==i[f]){e=!1;break}}if(!e)return s("Failed to combineSignatures: Signatures that sign to different transaction cannot be combined.")}else r=i}const u=T(e[0]);return u.signatures=a,n&&(u.feePayer=n,o.length>0&&(u.feePayerSignatures=o)),this.getRawTransactionWithSignatures(u,t)},B.prototype.recoverTransaction=function(e){if(void 0!==m.getTxTypeStringFromRawTransaction(e))throw new Error('recoverTransaction only supports transactions of type "LEGACY".');const t=s.decode(e),r=t.slice(7,9).map(e=>{e=e.replace("0x","");while(e.length<64)e="0"+e;return"0x"+e});r.unshift(t[6]);const n=a.encodeSignature(r),f=c.toNumber(t[6]),i=f<35?[]:[c.fromNumber(f-35>>1),"0x","0x"],u=t.slice(0,6).concat(i),l=s.encode(u);return a.recover(o.keccak256(l),n)},B.prototype.hashMessage=function(e){const t=m.isHexStrict(e)?m.hexToBytes(e):e,r=n.from(t),f="Klaytn Signed Message:\n"+t.length,i=n.from(f),a=n.concat([i,r]);return o.keccak256(a)},B.prototype.sign=function(e,t){const r=m.parsePrivateKey(t);if(t=r.privateKey,!m.isValidPrivateKey(t))throw new Error("Invalid private key");const n=this.hashMessage(e),f=a.sign(n,t),[i,o,s]=a.decodeSignature(f);return{message:e,messageHash:n,v:i,r:o,s:s,signature:f}},B.prototype.recover=function(e,t,r){const n=[].slice.apply(arguments);return f.isObject(e)?this.recover(e.messageHash,a.encodeSignature([e.v,e.r,e.s]),!0):(r||(e=this.hashMessage(e)),n.length>=4?(r=n.slice(-1)[0],r=!!f.isBoolean(r)&&!!r,this.recover(e,a.encodeSignature(n.slice(1,4)),r)):a.recover(e,t))},B.prototype.decrypt=function(e,t,r){if(!f.isString(t))throw new Error("No password given.");const i=f.isObject(e)?f.cloneDeep(e):JSON.parse(r?e.toLowerCase():e);if(3!==i.version&&4!==i.version&&console.warn("This is not a V3 or V4 wallet."),3===i.version&&!i.crypto)throw new Error("Invalid keystore V3 format: 'crypto' is not defined.");if(i.crypto){if(i.keyring)throw new Error("Invalid key store format: 'crypto' can not be with 'keyring'");i.keyring=[i.crypto],delete i.crypto}if(f.isArray(i.keyring[0])&&i.keyring.length>3)throw new Error("Invalid key store format");let a={};if(f.isArray(i.keyring[0])){const e=o(i.keyring[0]);e&&(a.transactionKey=e);const t=o(i.keyring[1]);t&&(a.updateKey=t);const r=o(i.keyring[2]);r&&(a.feePayerKey=r)}else a=o(i.keyring);function o(e){if(!e||0===e.length)return;const r=[];for(const f of e){let e,i;if("scrypt"===f.kdf)i=f.kdfparams,e=p.syncScrypt(n.from(t),n.from(i.salt,"hex"),i.n,i.r,i.p,i.dklen);else{if("pbkdf2"!==f.kdf)throw new Error("Unsupported key derivation scheme");if(i=f.kdfparams,"hmac-sha256"!==i.prf)throw new Error("Unsupported parameters to PBKDF2");e=l.pbkdf2Sync(n.from(t),n.from(i.salt,"hex"),i.c,i.dklen,"sha256")}const a=n.from(f.ciphertext,"hex"),o=m.sha3(n.from([...e.slice(16,32),...a])).replace("0x","");if(o!==f.mac)throw new Error("Key derivation failed - possibly wrong password");const s=l.createDecipheriv(f.cipher,e.slice(0,16),n.from(f.cipherparams.iv,"hex"));r.push("0x"+n.from([...s.update(a),...s.final()]).toString("hex"))}return 1===r.length?r[0]:r}return this.createWithAccountKey(i.address,a)},B.prototype.encrypt=function(e,t,r){let n,i,a,o,s,u;if(r=r||{},e instanceof S){if(r.address&&r.address!==e.address)throw new Error("Address in account is not matched with address in options object");n=e.address,i=e}else if(f.isString(e))i=this.privateKeyToAccount(e,r.address),n=i.address;else{if(!r.address)throw new Error("The address must be defined inside the options object.");n=r.address}switch(i||(i=this.createWithAccountKey(n,e)),i.accountKeyType){case C.ACCOUNT_KEY_PUBLIC:case C.ACCOUNT_KEY_MULTISIG:a=D(i.keys,t,r);break;case C.ACCOUNT_KEY_ROLEBASED:a=[],o=D(i.transactionKey,t,r),s=D(i.updateKey,t,r),u=D(i.feePayerKey,t,r),a.push(o),a.push(s),a.push(u);for(let e=a.length-1;e>=0;e--){if(0!==a[e].length)break;a=a.slice(0,e)}break;default:throw new Error("Unsupported account key type: "+i.accountKeyType)}return{version:4,id:h.v4({random:r.uuid||l.randomBytes(16)}),address:i.address.toLowerCase(),keyring:a}},B.prototype.encryptV3=function(e,t,r){let n,i;r=r||{};const a="Invalid parameter: encryptV3 only supports a single private key (also supports KlantnWalletKey format), or an instance of Account or AccountKeyPublic as a parameter. If you want to encrypt multiple keys, use caver.klay.accounts.encrypt which encrypts to keystore v4.";if(e instanceof S){if(r.address&&r.address!==e.address)throw new Error("Address in account is not matched with address in options object");if(e.accountKeyType!==C.ACCOUNT_KEY_PUBLIC)throw new Error(a);n=e.address,i=e}else if(f.isString(e))i=this.privateKeyToAccount(e,r.address),n=i.address;else{if(!S.isAccountKey(e))throw new Error(a);if(e.type!==C.ACCOUNT_KEY_PUBLIC)throw new Error(a);if(!r.address)throw new Error("The address must be defined inside the options object.");n=r.address}i||(i=this.createWithAccountKey(n,e));const o=D(i.keys,t,r);return{version:3,id:h.v4({random:r.uuid||l.randomBytes(16)}),address:i.address.toLowerCase(),crypto:o[0]}},B.prototype.privateKeyToPublicKey=function(e,t=!1){const r=m.parsePrivateKey(e);if(e=r.privateKey,e="0x"===e.slice(0,2)?e.slice(2):e,64!==e.length)throw new Error("Received a invalid privateKey. The length of privateKey should be 64.");const f=n.from(e,"hex"),i=M.keyFromPrivate(f);let a;return a=t?"0x"+i.getPublic(!0,"hex"):"0x"+i.getPublic(!1,"hex").slice(2),a},B.prototype.encodeRLPByTxType=v,B.prototype.setAccounts=function(e){this.wallet.clear();for(let t=0;th(e.toString(2),"0",8)).join("")}function m(e){const t=8*e.length,r=t/32,n=f("sha256").update(e).digest();return p([...n]).slice(0,r)}function y(e){return"mnemonic"+(e||"")}function g(t,r){const n=e.from((t||"").normalize("NFKD"),"utf8"),f=e.from(y((r||"").normalize("NFKD")),"utf8");return i.pbkdf2Sync(n,f,2048,64,"sha512")}function b(t,r){return new Promise((n,f)=>{try{const a=e.from((t||"").normalize("NFKD"),"utf8"),o=e.from(y((r||"").normalize("NFKD")),"utf8");i.pbkdf2(a,o,2048,64,"sha512",(e,t)=>e?f(e):n(t))}catch(a){return f(a)}})}function v(t,r){if(r=r||n,!r)throw new Error(l);const f=(t||"").normalize("NFKD").split(" ");if(f.length%3!==0)throw new Error(o);const i=f.map(e=>{const t=r.indexOf(e);if(-1===t)throw new Error(o);return h(t.toString(2),"0",11)}).join(""),a=32*Math.floor(i.length/33),u=i.slice(0,a),p=i.slice(a),y=u.match(/(.{1,8})/g).map(d);if(y.length<16)throw new Error(s);if(y.length>32)throw new Error(s);if(y.length%4!==0)throw new Error(s);const g=e.from(y),b=m(g);if(b!==p)throw new Error(c);return g.toString("hex")}function w(t,r){if(e.isBuffer(t)||(t=e.from(t,"hex")),r=r||n,!r)throw new Error(l);if(t.length<16)throw new TypeError(s);if(t.length>32)throw new TypeError(s);if(t.length%4!==0)throw new TypeError(s);const f=p([...t]),i=m(t),a=f+i,o=a.match(/(.{1,11})/g),u=o.map(e=>{const t=d(e);return r[t]});return"あいこくしん"===r[0]?u.join(" "):u.join(" ")}function _(e,t,r){if(e=e||128,e%32!==0)throw new TypeError(s);return t=t||a,w(t(e/8),r)}function T(e,t){try{v(e,t)}catch(r){return!1}return!0}function E(e){const t=u.wordlists[e];if(!t)throw new Error('Could not find wordlist for language "'+e+'"');n=t}function x(){if(!n)throw new Error("No Default Wordlist set");return Object.keys(u.wordlists).filter(e=>"JA"!==e&&"EN"!==e&&u.wordlists[e].every((e,t)=>e===n[t]))[0]}r.mnemonicToSeedSync=g,r.mnemonicToSeed=b,r.mnemonicToEntropy=v,r.entropyToMnemonic=w,r.generateMnemonic=_,r.validateMnemonic=T,r.setDefaultWordlist=E,r.getDefaultWordlist=x;var M=u;r.wordlists=M.wordlists})),l=o(c),h=c.mnemonicToSeedSync,d=c.mnemonicToSeed,p=c.mnemonicToEntropy,m=c.entropyToMnemonic,y=c.generateMnemonic,g=c.validateMnemonic,b=c.setDefaultWordlist,v=c.getDefaultWordlist,w=c.wordlists;t.default=l,t.entropyToMnemonic=m,t.generateMnemonic=y,t.getDefaultWordlist=v,t.mnemonicToEntropy=p,t.mnemonicToSeed=d,t.mnemonicToSeedSync=h,t.setDefaultWordlist=b,t.validateMnemonic=g,t.wordlists=w}).call(this,r("b639").Buffer)},def2:function(e,t,r){"use strict";const{objectToQuery:n}=r("d518"),f=r("1eca"),{ok:i}=r("7872");e.exports=f(({fetch:e,apiUrl:t,apiPath:r,headers:f})=>async(a,o)=>{o||"object"!==typeof a||(o=a,a=null),o=o||{};const s=n({arg:a,...o.qs||{}}),u=`${t}${r}/pubsub/peers${s}`,c=await i(e(u,{signal:o.signal,headers:o.headers||f})),l=await c.json();return l.Strings||[]})},df4a:function(e,t,r){(function(t){const n=r("2ef0"),f=r("8e7f"),i=r("9cca"),{kip37JsonInterface:a,kip37ByteCode:o,determineSendParams:s,formatParamForUint256:u,validateDeployParameterForKIP37:c,interfaceIds:l}=r("bec2"),{isAddress:h,toBuffer:d,isHexStrict:p,toHex:m,stripHexPrefix:y,leftPad:g}=r("19b5"),b=r("3070");class v extends i{static create(e,t){return new v(e,t)}static deploy(e,t,r){c(e);const{uri:f}=e,i=new v;return void 0!==r&&i.setWallet(r),n.isString(t)&&(t={from:t,gas:7e6,value:0}),t.gas=void 0!==t.gas?t.gas:7e6,i.deploy({data:o,arguments:[f]}).send(t)}static detectInterface(e){const t=new v(e);return t.detectInterface()}constructor(e,t=a){if(e)if(n.isString(e)){if(!h(e))throw new Error("Invalid token address "+e)}else t=e,e=void 0;super(t,e),this.setWallet(v.wallet)}clone(e=this.options.address){const t=new this.constructor(e,this.options.jsonInterface);return t.setWallet(this._wallet),t}async detectInterface(){const e={IKIP37:!1,IKIP37Metadata:!1,IKIP37Mintable:!1,IKIP37Burnable:!1,IKIP37Pausable:!1},t="This contract does not support KIP-13.",r=this._address;try{const n=await b.isImplementedKIP13Interface(r);if(!0!==n)throw new Error(t);return e.IKIP37=await this.supportsInterface(l.kip37.IKIP37),!1===e.IKIP37?e:(await Promise.all(Object.keys(l.kip37).map(async t=>{l.kip37[t]!==l.kip37.IKIP37&&(e[t]=await this.supportsInterface(l.kip37[t]))})),e)}catch(n){throw new Error(t)}}async supportsInterface(e){const t=await this.methods.supportsInterface(e).call();return t}async uri(e){let t=await this.methods.uri(u(e)).call();if(t.includes("{id}")){let r=y(m(e));r=g(r,64,"0"),t=t.replace("{id}",r)}return t}async totalSupply(e){const t=await this.methods.totalSupply(u(e)).call();return new f(t)}async balanceOf(e,t){const r=await this.methods.balanceOf(e,u(t)).call();return new f(r)}async balanceOfBatch(e,t){if(t.length!==e.length)throw new Error("ids and accounts must have the same length.");const r=[];for(let f=0;f0)throw new Error("Invalid parameters");f=r,r=""}const i=this.methods.create(u(e),u(t),r);return f=await s(i,f,this.options),i.send(f)}async setApprovalForAll(e,t,r={}){const n=this.methods.setApprovalForAll(e,t);return r=await s(n,r,this.options),n.send(r)}async safeTransferFrom(e,r,f,i,a,o={}){if(a&&n.isObject(a)&&(void 0!==a.gas||void 0!==a.from)){if(Object.keys(o).length>0)throw new Error("Invalid parameters");o=a,a=t.from("")}a&&!n.isBuffer(a)&&(n.isString(a)&&!p(a)&&(a=m(a)),a=d(a));const c=this.methods.safeTransferFrom(e,r,u(f),u(i),a);return o=await s(c,o,this.options),c.send(o)}async safeBatchTransferFrom(e,r,f,i,a,o={}){if(a&&n.isObject(a)&&(void 0!==a.gas||void 0!==a.from)){if(Object.keys(o).length>0)throw new Error("Invalid parameters");o=a,a=t.from("")}if(a&&!n.isBuffer(a)&&(n.isString(a)&&!p(a)&&(a=m(a)),a=d(a)),f.length!==i.length)throw new Error("ids and amounts must have the same length.");const c=[],l=[];for(let t=0;te.encode()),t=this.feePayerSignatures.map(e=>e.encode());return o.TxTypeFeeDelegatedCancelWithRatio+n.encode([f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.from.toLowerCase(),this.feeRatio,e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),n.encode([o.TxTypeFeeDelegatedCancelWithRatio,f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.from.toLowerCase(),this.feeRatio])}}e.exports=l},e01a:function(e,t,r){"use strict";var n=r("23e7"),f=r("83ab"),i=r("da84"),a=r("5135"),o=r("861d"),s=r("9bf2").f,u=r("e893"),c=i.Symbol;if(f&&"function"==typeof c&&(!("description"in c.prototype)||void 0!==c().description)){var l={},h=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof h?new c(e):void 0===e?c():c(e);return""===e&&(l[t]=!0),t};u(h,c);var d=h.prototype=c.prototype;d.constructor=h;var p=d.toString,m="Symbol(test)"==String(c("test")),y=/^Symbol\((.*)\)[^)]+$/;s(d,"description",{configurable:!0,get:function(){var e=o(this)?this.valueOf():this,t=p.call(e);if(a(l,e))return"";var r=m?t.slice(7,-1):t.replace(y,"$1");return""===r?void 0:r}}),n({global:!0,forced:!0},{Symbol:h})}},e04c:function(e){e.exports=JSON.parse('{"genesisGasLimit":{"v":5000,"d":"Gas limit of the Genesis block."},"genesisDifficulty":{"v":17179869184,"d":"Difficulty of the Genesis block."},"genesisNonce":{"v":"0x0000000000000042","d":"the geneis nonce"},"genesisExtraData":{"v":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa","d":"extra data "},"genesisHash":{"v":"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3","d":"genesis hash"},"genesisStateRoot":{"v":"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544","d":"the genesis state root"},"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be."},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations."},"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be."},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations."},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},"maximumExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis."},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs."},"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed."},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack."},"tierStepGas":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them."},"expGas":{"v":10,"d":"Once per EXP instuction."},"expByteGas":{"v":10,"d":"Times ceil(log256(exponent)) for the EXP instruction."},"sha3Gas":{"v":30,"d":"Once per SHA3 operation."},"sha3WordGas":{"v":6,"d":"Once per word of the SHA3 operation\'s data."},"sloadGas":{"v":50,"d":"Once per SLOAD operation."},"sstoreSetGas":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero."},"sstoreResetGas":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero."},"sstoreRefundGas":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero."},"jumpdestGas":{"v":1,"d":"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},"logGas":{"v":375,"d":"Per LOG* operation."},"logDataGas":{"v":8,"d":"Per byte in a LOG* operation\'s data."},"logTopicGas":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},"createGas":{"v":32000,"d":"Once per CREATE operation & contract-creation transaction."},"callGas":{"v":40,"d":"Once per CALL operation & message call transaction."},"callStipend":{"v":2300,"d":"Free gas given at beginning of call."},"callValueTransferGas":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero."},"callNewAccountGas":{"v":25000,"d":"Paid for CALL when the destination address didn\'t exist prior."},"suicideRefundGas":{"v":24000,"d":"Refunded following a suicide operation."},"memoryGas":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation."},"createDataGas":{"v":200,"d":""},"txGas":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions."},"txCreation":{"v":32000,"d":"the cost of creating a contract via tx"},"txDataZeroGas":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},"txDataNonZeroGas":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},"copyGas":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},"ecrecoverGas":{"v":3000,"d":""},"sha256Gas":{"v":60,"d":""},"sha256WordGas":{"v":12,"d":""},"ripemd160Gas":{"v":600,"d":""},"ripemd160WordGas":{"v":120,"d":""},"identityGas":{"v":15,"d":""},"identityWordGas":{"v":3,"d":""},"minerReward":{"v":"5000000000000000000","d":"the amount a miner get rewarded for mining a block"},"ommerReward":{"v":"625000000000000000","d":"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},"niblingReward":{"v":"156250000000000000","d":"the amount a miner gets for inculding a uncle"},"homeSteadForkNumber":{"v":1150000,"d":"the block that the Homestead fork started at"},"homesteadRepriceForkNumber":{"v":2463000,"d":"the block that the Homestead Reprice (EIP150) fork started at"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"freeBlockPeriod":{"v":2}}')},e1f4:function(e,t){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);e.exports=function(){return r(n),n}}else{var f=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),f[t]=e>>>((3&t)<<3)&255;return f}}},e240:function(e,t,r){(function(t){const n=r("0664"),f=r("dc02"),i=r("3337"),a=(r("19d7"),new i.ec("secp256k1")),{keccak256:o,keccak256s:s}=r("f3a4"),u=e=>{const t=o(n.concat(n.random(32),e||n.random(32))),r=n.concat(n.concat(n.random(32),t),n.random(32)),f=o(r);return l(f)},c=e=>{const t=s(e.slice(2));let r="0x";for(let n=0;n<40;n++)r+=parseInt(t[n+2],16)>7?e[n+2].toUpperCase():e[n+2];return r},l=e=>{const r=new t(e.slice(2),"hex"),n=a.keyFromPrivate(r),f="0x"+n.getPublic(!1,"hex").slice(2),i=o(f),s=c("0x"+i.slice(-40));return{address:s,privateKey:e}},h=([e,t,r])=>n.flatten([t,r,e]),d=e=>[n.slice(64,n.length(e),e),n.slice(0,32,e),n.slice(32,64,e)],p=e=>(r,i)=>{const o=a.keyFromPrivate(new t(i.slice(2),"hex")).sign(new t(r.slice(2),"hex"),{canonical:!0});return h([f.fromString(n.fromNumber(e+o.recoveryParam)),n.pad(32,n.fromNat("0x"+o.r.toString(16))),n.pad(32,n.fromNat("0x"+o.s.toString(16)))])},m=p(27),y=(e,r)=>{const f=d(r),i={v:n.toNumber(f[0]),r:f[1].slice(2),s:f[2].slice(2)},s=a.recoverPubKey(new t(e.slice(2),"hex"),i,i.v<2?i.v:1-i.v%2),u="0x"+s.encode("hex",!1).slice(2),l=o(u),h=c("0x"+l.slice(-40));return h};e.exports={create:u,toChecksum:c,fromPrivate:l,sign:m,makeSigner:p,recover:y,encodeSignature:h,decodeSignature:d}}).call(this,r("b639").Buffer)},e32d:function(e,t,r){e.exports=r("1c46")},e32e:function(e,t){t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000",t.NULL_BLOCK_HASH="0x0000000000000000000000000000000000000000000000000000000000000000",t.ETH="0xaaaebeba",t.ERC20="0x8ae85d84",t.ERC721="0x73ad2146",t.ERC1155="0x973bb640",t.KLAY="0xaaaebeba",t.ORDER_DATA_V1="0x4c234266",t.TYPE_ERC20=20,t.TYPE_ERC721=721,t.TYPE_ERC1155=1155,t.TYPE_MARKETPLACE=100},e351:function(e){e.exports=JSON.parse('{"COMPRESSED_TYPE_INVALID":"compressed should be a boolean","EC_PRIVATE_KEY_TYPE_INVALID":"private key should be a Buffer","EC_PRIVATE_KEY_LENGTH_INVALID":"private key length is invalid","EC_PRIVATE_KEY_RANGE_INVALID":"private key range is invalid","EC_PRIVATE_KEY_TWEAK_ADD_FAIL":"tweak out of range or resulting private key is invalid","EC_PRIVATE_KEY_TWEAK_MUL_FAIL":"tweak out of range","EC_PRIVATE_KEY_EXPORT_DER_FAIL":"couldn\'t export to DER format","EC_PRIVATE_KEY_IMPORT_DER_FAIL":"couldn\'t import from DER format","EC_PUBLIC_KEYS_TYPE_INVALID":"public keys should be an Array","EC_PUBLIC_KEYS_LENGTH_INVALID":"public keys Array should have at least 1 element","EC_PUBLIC_KEY_TYPE_INVALID":"public key should be a Buffer","EC_PUBLIC_KEY_LENGTH_INVALID":"public key length is invalid","EC_PUBLIC_KEY_PARSE_FAIL":"the public key could not be parsed or is invalid","EC_PUBLIC_KEY_CREATE_FAIL":"private was invalid, try again","EC_PUBLIC_KEY_TWEAK_ADD_FAIL":"tweak out of range or resulting public key is invalid","EC_PUBLIC_KEY_TWEAK_MUL_FAIL":"tweak out of range","EC_PUBLIC_KEY_COMBINE_FAIL":"the sum of the public keys is not valid","ECDH_FAIL":"scalar was invalid (zero or overflow)","ECDSA_SIGNATURE_TYPE_INVALID":"signature should be a Buffer","ECDSA_SIGNATURE_LENGTH_INVALID":"signature length is invalid","ECDSA_SIGNATURE_PARSE_FAIL":"couldn\'t parse signature","ECDSA_SIGNATURE_PARSE_DER_FAIL":"couldn\'t parse DER signature","ECDSA_SIGNATURE_SERIALIZE_DER_FAIL":"couldn\'t serialize signature to DER format","ECDSA_SIGN_FAIL":"nonce generation function failed or private key is invalid","ECDSA_RECOVER_FAIL":"couldn\'t recover public key from signature","MSG32_TYPE_INVALID":"message should be a Buffer","MSG32_LENGTH_INVALID":"message length is invalid","OPTIONS_TYPE_INVALID":"options should be an Object","OPTIONS_DATA_TYPE_INVALID":"options.data should be a Buffer","OPTIONS_DATA_LENGTH_INVALID":"options.data length is invalid","OPTIONS_NONCEFN_TYPE_INVALID":"options.noncefn should be a Function","RECOVERY_ID_TYPE_INVALID":"recovery should be a Number","RECOVERY_ID_VALUE_INVALID":"recovery should have value between -1 and 4","TWEAK_TYPE_INVALID":"tweak should be a Buffer","TWEAK_LENGTH_INVALID":"tweak length is invalid"}')},e3fd:function(e,t){e.exports={VALID_GAS_PRICE:25e9,ACCOUNT_UPDATE_TYPE_TAG:"0x20",FEE_DELEGATED_ACCOUNT_UPDATE_TYPE_TAG:"0x21",FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO_TYPE_TAG:"0x22",VALUE_TRANFSER_TYPE_TAG:"0x08",VALUE_TRANSFER_MEMO_TYPE_TAG:"0x10",FEE_DELEGATED_VALUE_TRANSFER_TYPE_TAG:"0x09",FEE_DELEGATED_VALUE_TRANSFER_WITH_RATIO_TYPE_TAG:"0x0a",FEE_DELEGATED_VALUE_TRANSFER_MEMO_TYPE_TAG:"0x11",FEE_DELEGATED_VALUE_TRANSFER_MEMO_WITH_RATIO_TYPE_TAG:"0x12",SMART_CONTRACT_DEPLOY_TYPE_TAG:"0x28",FEE_DELEGATED_SMART_CONTRACT_DEPLOY_TYPE_TAG:"0x29",FEE_DELEGATED_SMART_CONTRACT_DEPLOY_WITH_RATIO_TYPE_TAG:"0x2a",SMART_CONTRACT_EXECUTION_TYPE_TAG:"0x30",FEE_DELEGATED_SMART_CONTRACT_EXECUTION_TYPE_TAG:"0x31",FEE_DELEGATED_SMART_CONTRACT_EXECUTION_WITH_RATIO_TYPE_TAG:"0x32",CANCEL_TYPE_TAG:"0x38",FEE_DELEGATED_CANCEL_TYPE_TAG:"0x39",FEE_DELEGATED_CANCEL_WITH_RATIO_TYPE_TAG:"0x3a",CHAIN_DATA_ANCHORING_TYPE_TAG:"0x48",ACCOUNT_KEY_NIL_TAG:"0x80",ACCOUNT_KEY_LEGACY_TAG:"0x01c0",ACCOUNT_KEY_PUBLIC_TAG:"0x02",ACCOUNT_KEY_FAIL_TAG:"0x03c0",ACCOUNT_KEY_WEIGHTED_MULTISIG_TAG:"0x04",ACCOUNT_KEY_ROLE_BASED_TAG:"0x05",CODE_FORMAT_EVM_TAG:"0x0"}},e478:function(e,t,r){"use strict";e.exports=(e,t)=>async function*(){t=t||{};const r=new FileReader,n=t.chunkSize||1048576;let f=t.offset||0;const i=()=>new Promise((t,i)=>{r.onloadend=e=>{const r=e.target.result;t(0===r.byteLength?null:r)},r.onerror=i;const a=f+n,o=e.slice(f,a);r.readAsArrayBuffer(o),f=a});while(1){const e=await i();if(null==e)return;yield e}}()},e680:function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("72a4"),f=r("d968"),i=r("d5c5"),a=r("2803");function o(e,t){return t?e-(2*t+35):e-27}function s(e){return 0===e||1===e}t.ecsign=function(e,t,r){var f=n.sign(e,t),i=f.recovery,a={r:f.signature.slice(0,32),s:f.signature.slice(32,64),v:r?i+(2*r+35):i+27};return a},t.ecrecover=function(t,r,f,a,u){var c=e.concat([i.setLength(f,32),i.setLength(a,32)],64),l=o(r,u);if(!s(l))throw new Error("Invalid signature v value");var h=n.recover(t,c,l);return n.publicKeyConvert(h,!1).slice(1)},t.toRpcSig=function(t,r,n,f){var a=o(t,f);if(!s(a))throw new Error("Invalid signature v value");return i.bufferToHex(e.concat([i.setLengthLeft(r,32),i.setLengthLeft(n,32),i.toBuffer(t)]))},t.fromRpcSig=function(e){var t=i.toBuffer(e);if(65!==t.length)throw new Error("Invalid signature length");var r=t[64];return r<27&&(r+=27),{v:r,r:t.slice(0,32),s:t.slice(32,64)}},t.isValidSignature=function(e,t,r,n,i){void 0===n&&(n=!0);var a=new f("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),u=new f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!s(o(e,i)))return!1;var c=new f(t),l=new f(r);return!(c.isZero()||c.gt(u)||l.isZero()||l.gt(u))&&(!n||1!==l.cmp(a))},t.hashPersonalMessage=function(t){var r=e.from("Ethereum Signed Message:\n"+t.length.toString(),"utf-8");return a.keccak(e.concat([r,t]))}}).call(this,r("b639").Buffer)},e71f:function(e,t,r){const n=r("bc56");function f(){}e.exports=f,f.prototype.setEngine=function(e){const t=this;t.engine=e,e.on("block",(function(e){t.currentBlock=e}))},f.prototype.handleRequest=function(){throw new Error("Subproviders should override `handleRequest`.")},f.prototype.emitPayload=function(e,t){const r=this;r.engine.sendAsync(n(e),t)}},e8af:function(e,t,r){"use strict";var n=r("85fd"),f=r("2f1b"),i=r("d8db"),a=r("a211"),o=function(){function e(){this._subscriber=new f,this._currentSubscription=null}var t=e.prototype;return t.addListener=function(e,t,r){return this._subscriber.addSubscription(e,new n(this._subscriber,t,r))},t.once=function(e,t,r){var n=this;return this.addListener(e,(function(){n.removeCurrentListener(),t.apply(r,arguments)}))},t.removeAllListeners=function(e){this._subscriber.removeAllSubscriptions(e)},t.removeCurrentListener=function(){this._currentSubscription||i(!1),this._subscriber.removeSubscription(this._currentSubscription)},t.listeners=function(e){var t=this._subscriber.getSubscriptionsForType(e);return t?t.filter(a.thatReturnsTrue).map((function(e){return e.listener})):[]},t.emit=function(e){var t=this._subscriber.getSubscriptionsForType(e);if(t){for(var r=Object.keys(t),n=0;ne.encode()),t=this.feePayerSignatures.map(e=>e.encode());return s.TxTypeFeeDelegatedAccountUpdateWithRatio+n.encode([f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.from.toLowerCase(),this.account.getRLPEncodingAccountKey(),this.feeRatio,e,this.feePayer.toLowerCase(),t]).slice(2)}getCommonRLPEncodingForSignature(){return this.validateOptionalValues(),n.encode([s.TxTypeFeeDelegatedAccountUpdateWithRatio,f.fromNat(this.nonce),f.fromNat(this.gasPrice),f.fromNat(this.gas),this.from.toLowerCase(),this.account.getRLPEncodingAccountKey(),this.feeRatio])}}e.exports=h},eb02:function(e){e.exports=JSON.parse('{"name":"caver-js","version":"1.6.3","description":"caver-js is a JavaScript API library that allows developers to interact with a Klaytn node","main":"index.js","scripts":{"test":"npm run build && npm run unitTest","unitTest":" npm run txUnitTest && npm run utilUnitTest && npm run netUnitTest && npm run accountUnitTest && npm run serUnitTest && npm run walletUnitTest && npm run etcUnitTest && npm run validatorUnitTest","fullTest":" npm run unitTest && npm run rpcTest && npm run txTest && npm run etcTest && npm run accountKeyTest && npm run kctTest && npm run intTest","build-all":"gulp all","build":"./node_modules/.bin/webpack --mode production","lint":"./node_modules/.bin/eslint \'./**/*.js\'","lintFix":"./node_modules/.bin/eslint \'./**/*.js\' --fix","serUnitTest":"./node_modules/mocha/bin/mocha test/transactionType/serializationTest.js && ./node_modules/mocha/bin/mocha test/compressionPublicKey.js && ./node_modules/mocha/bin/mocha test/encodeContractDeploy.js && ./node_modules/mocha/bin/mocha test/parseAccountKey.js && ./node_modules/mocha/bin/mocha test/decodeTransaction.js && ./node_modules/mocha/bin/mocha ./test/abi.encodeParameter.js && ./node_modules/mocha/bin/mocha ./test/abi.decodeParameter.js && ./node_modules/mocha/bin/mocha ./test/abi.decodeLog.js","accountUnitTest":"./node_modules/mocha/bin/mocha test/packages/caver.account.js && ./node_modules/mocha/bin/mocha test/packages/caver.account.accountKey.js","walletUnitTest":"./node_modules/mocha/bin/mocha test/packages/caver.wallet.js && ./node_modules/mocha/bin/mocha test/packages/caver.wallet.keyring.js && ./node_modules/mocha/bin/mocha test/accountLib.js && ./node_modules/mocha/bin/mocha test/accounts.privateKeyToPublicKey.js && ./node_modules/mocha/bin/mocha test/accounts.recover.js && ./node_modules/mocha/bin/mocha test/packages/caver.klay.accounts.js && ./node_modules/mocha/bin/mocha test/isValidPrivateKey.js && ./node_modules/mocha/bin/mocha test/privateKeyToAccount.js","utilUnitTest":"./node_modules/mocha/bin/mocha test/packages/caver.utils.js","netUnitTest":"./node_modules/mocha/bin/mocha test/packages/caver.klay.net.js","validatorUnitTest":"./node_modules/mocha/bin/mocha test/packages/caver.validator.js","txUnitTest":"./node_modules/mocha/bin/mocha test/packages/caver.transaction/*.js && ./node_modules/mocha/bin/mocha test/createTest.js","etcUnitTest":"./node_modules/mocha/bin/mocha test/decodeFunctionCall.js && ./node_modules/mocha/bin/mocha test/contractError.js && ./node_modules/mocha/bin/mocha test/contractOverloading.js && ./node_modules/mocha/bin/mocha ./test/contract.setWallet.js && ./node_modules/mocha/bin/mocha ./test/setRequestManager.js && ./node_modules/mocha/bin/mocha test/reconnectTest.js && ./node_modules/mocha/bin/mocha test/hashMessage.js && ./node_modules/mocha/bin/mocha test/iban.* && ./node_modules/mocha/bin/mocha test/randomHex.js && ./node_modules/mocha/bin/mocha test/sha3.js && ./node_modules/mocha/bin/mocha test/toChecksumAddress.js && ./node_modules/mocha/bin/mocha test/default*&& ./node_modules/mocha/bin/mocha test/getNodeInfo.js && ./node_modules/mocha/bin/mocha test/getNetworkType.js && ./node_modules/mocha/bin/mocha test/isContractDeployment.js && ./node_modules/mocha/bin/mocha test/multiProviderTest.js && ./node_modules/mocha/bin/mocha test/unitMap.js && ./node_modules/mocha/bin/mocha test/invalidResponse.js && ./node_modules/mocha/bin/mocha test/createTest.js && ./node_modules/mocha/bin/mocha test/setProvider.js && ./node_modules/mocha/bin/mocha test/contractOverloading.js && ./node_modules/mocha/bin/mocha test/supportsSubscriptions.js && ./node_modules/mocha/bin/mocha test/packages/caver.abi.js","rpcTest":"./node_modules/mocha/bin/mocha test/packages/caver.rpc.js","txTest":"./node_modules/mocha/bin/mocha test/methodErrorHandling.js && ./node_modules/mocha/bin/mocha test/sendSignedTransaction.js && ./node_modules/mocha/bin/mocha test/estimateComputationCost.js && ./node_modules/mocha/bin/mocha test/getTransactionReceipt.js && ./node_modules/mocha/bin/mocha test/setNonceWithPendingTag.js && ./node_modules/mocha/bin/mocha test/getTransaction.js && ./node_modules/mocha/bin/mocha test/setContractOptions.js && ./node_modules/mocha/bin/mocha test/encodeContractDeploy.js && ./node_modules/mocha/bin/mocha test/accounts.signTransaction.js && ./node_modules/mocha/bin/mocha test/sendTransactionCallback.js && ./node_modules/mocha/bin/mocha test/signWithMultiSig.js && ./node_modules/mocha/bin/mocha test/transactionType/legacyTransaction.js && ./node_modules/mocha/bin/mocha test/transactionType/valueTransfer* && ./node_modules/mocha/bin/mocha test/transactionType/accountUpdate.js && ./node_modules/mocha/bin/mocha test/transactionType/contract* && ./node_modules/mocha/bin/mocha test/transactionType/cancelTransaction.js && ./node_modules/mocha/bin/mocha test/transactionType/feeDelegated*","etcTest":"./node_modules/mocha/bin/mocha ./test/packages/caver.contract.js && ./node_modules/mocha/bin/mocha ./test/tupleTest.js && ./node_modules/mocha/bin/mocha test/confirmationListener.js && ./node_modules/mocha/bin/mocha test/eventEmitter.js && ./node_modules/mocha/bin/mocha test/personal.js && ./node_modules/mocha/bin/mocha test/subscription.js && ./node_modules/mocha/bin/mocha test/contract.once.js && ./node_modules/mocha/bin/mocha test/ipfsTest.js","accountKeyTest":"./node_modules/mocha/bin/mocha test/scenarioTest/accountKeyPublic.js && ./node_modules/mocha/bin/mocha test/scenarioTest/accountKeyMultiSig.js && ./node_modules/mocha/bin/mocha test/scenarioTest/accountKeyRoleBased.js","kctTest":"./node_modules/mocha/bin/mocha test/packages/caver.klay.KIP7.js && ./node_modules/mocha/bin/mocha test/packages/caver.klay.KIP17.js && ./node_modules/mocha/bin/mocha test/packages/caver.kct.kip37.js && ./node_modules/mocha/bin/mocha test/createTest.js","intTest":"npm run intTxTest && npm run intSIGVALITest && npm run intAPITest && npm run intSOLTest","intTxTest":"npm run intLEGACYTest && npm run intVTTest && npm run intVTMTest && npm run intACCUPTest && npm run intDEPLTest && npm run intEXETest && npm run intCANCELTest && npm run intFDTest && npm run intFDRTest","intLEGACYTest":"./node_modules/mocha/bin/mocha --grep INT-LEGACY/ test/intTest.js","intVTTest":"./node_modules/mocha/bin/mocha --grep INT-VT/ test/intTest.js","intVTMTest":"./node_modules/mocha/bin/mocha --grep INT-VTM/ test/intTest.js","intACCUPTest":"./node_modules/mocha/bin/mocha --grep INT-ACCUP/ test/intTest.js","intDEPLTest":"./node_modules/mocha/bin/mocha --grep INT-DEPL/ test/intTest.js","intEXETest":"./node_modules/mocha/bin/mocha --grep INT-EXE/ test/intTest.js","intCANCELTest":"./node_modules/mocha/bin/mocha --grep INT-CANCEL/ test/intTest.js","intFDTest":"./node_modules/mocha/bin/mocha --grep INT-FD/ test/intTest.js","intFDRTest":"./node_modules/mocha/bin/mocha --grep INT-FDR/ test/intTest.js","intSIGVALITest":"./node_modules/mocha/bin/mocha --grep INT-SIGVALI/ test/intTest.js","intAPITest":"./node_modules/mocha/bin/mocha --grep INT-API/ test/intTest.js","intSOLTest":"./node_modules/mocha/bin/mocha --grep INT-SOL/00 test/intTest.js && ./node_modules/mocha/bin/mocha --grep INT-SOL/01 test/intTest.js && ./node_modules/mocha/bin/mocha --grep INT-SOL/02 test/intTest.js && ./node_modules/mocha/bin/mocha --grep INT-SOL/03 test/intTest.js && ./node_modules/mocha/bin/mocha --grep INT-SOL/04 test/intTest.js && ./node_modules/mocha/bin/mocha --grep INT-SOL/05 test/intTest.js && ./node_modules/mocha/bin/mocha --grep INT-SOL/06 test/intTest.js && ./node_modules/mocha/bin/mocha --grep INT-SOL/07 test/intTest.js && ./node_modules/mocha/bin/mocha --grep INT-SOL/08 test/intTest.js && ./node_modules/mocha/bin/mocha --grep INT-SOL/09 test/intTest.js && ./node_modules/mocha/bin/mocha --grep INT-SOL/1 test/intTest.js","cover":"npm run build && nyc --silent ./node_modules/mocha/bin/mocha test/packages/caver.utils.js && nyc --silent --no-clean ./node_modules/mocha/bin/mocha test/packages/caver.klay.net.js && npm run cover:serialization && npm run cover:wallet && npm run cover:report","cover:serialization":"nyc --silent --no-clean npm run serTest","cover:wallet":"nyc --silent --no-clean npm run walletTest","cover:report":"nyc report --reporter=html --reporter=text"},"keywords":["caver","caverjs","caver-js","caver.js","klaytn","klaytn sdk","klaytn api"],"repository":{"type":"git","url":"https://github.com/klaytn/caver-js.git"},"bugs":{"url":"https://github.com/klaytn/caver-js/issues"},"homepage":"https://github.com/klaytn/caver-js","author":"Klaytn Team","license":"LGPL","dependencies":{"@babel/runtime":"7.3.1","@ethersproject/abi":"5.0.7","@web3-js/scrypt-shim":"0.1.0","any-promise":"1.3.0","bignumber.js":"8.0.2","bn.js":"4.11.6","chai":"4.1.2","crypto-browserify":"3.12.0","dotenv":"8.2.0","elliptic":"6.5.4","eth-lib":"0.2.8","ethers":"5.0.32","ethjs-unit":"0.1.6","eventemitter3":"4.0.0","ipfs-http-client-lite":"0.3.0","it-each":"0.4.0","lodash":"4.17.21","mocha":"8.3.2","multihashes":"4.0.2","node-fetch":"2.6.1","number-to-bn":"1.7.0","oboe":"2.1.3","request":"2.87.0","requestretry":"2.0.2","scrypt-js":"3.0.1","semver":"6.2.0","utf8":"2.1.1","uuid":"3.0.0","webpack":"4.44.2","webpack-cli":"3.3.12","websocket":"1.0.31","xhr2-cookies":"1.1.0"},"devDependencies":{"@babel/core":"7.1.2","@babel/plugin-external-helpers":"7.0.0","@babel/plugin-transform-runtime":"7.1.0","@babel/preset-env":"7.3.1","babel-eslint":"10.1.0","babel-plugin-external-helpers":"6.22.0","babelrc-rollup":"3.0.0","browserify":"16.2.2","chai-as-promised":"7.1.1","del":"3.0.0","eslint":"7.11.0","eslint-config-airbnb":"17.0.0","eslint-config-google":"0.14.0","eslint-config-prettier":"6.4.0","eslint-plugin-import":"2.13.0","eslint-plugin-jsx-a11y":"6.1.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-react":"7.10.0","exorcist":"2.0.0","gulp":"4.0.0","gulp-babel":"8.0.0","gulp-jshint":"2.1.0","gulp-newer":"1.4.0","gulp-plumber":"1.2.0","gulp-rename":"1.4.0","gulp-replace":"1.0.0","gulp-streamify":"1.0.2","gulp-uglify":"3.0.1","jshint":"2.9.7","nock":"10.0.6","nyc":"14.1.1","path":"0.12.7","prettier":"1.18.2","sinon":"9.0.0","sinon-chai":"3.5.0","vinyl-source-stream":"2.0.0"}}')},ed19:function(e,t,r){const n=r("19b5"),{ACCOUNT_KEY_TAG:f}=r("6369");class i{static decode(e){if(e=n.addHexPrefix(e),!e.startsWith(f.ACCOUNT_KEY_LEGACY_TAG))throw new Error(`Cannot decode to AccountKeyLegacy. The prefix must be ${f.ACCOUNT_KEY_LEGACY_TAG}: ${e}`);return new i}getRLPEncoding(){return f.ACCOUNT_KEY_LEGACY_TAG}}e.exports=i},ee69:function(e,t){e.exports={AccountKeyEnum:{ACCOUNT_KEY_PUBLIC:"AccountKeyPublic",ACCOUNT_KEY_MULTISIG:"AccountKeyMultiSig",ACCOUNT_KEY_ROLEBASED:"AccountKeyRoleBased"}}},f001:function(e){e.exports=JSON.parse('{"contractName":"RoyaltiesRegistryV2","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"indexed":false,"internalType":"struct LibPart.Part[]","name":"royalties","type":"tuple[]"}],"name":"getRoyaltiesTest","type":"event"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"royaltiesByToken","outputs":[{"internalType":"bool","name":"initialized","type":"bool"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"royaltiesByTokenAndTokenId","outputs":[{"internalType":"bool","name":"initialized","type":"bool"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"royaltiesOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"royaltiesProviders","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"__RoyaltiesRegistry_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"provider","type":"address"}],"name":"setProviderByToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"internalType":"struct LibPart.Part[]","name":"royalties","type":"tuple[]"}],"name":"setRoyaltiesByToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"internalType":"struct LibPart.Part[]","name":"royalties","type":"tuple[]"}],"name":"setRoyaltiesByTokenAndTokenId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferRoyaltiesOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRoyaltiesOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":true},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRoyalties","outputs":[{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"internalType":"struct LibPart.Part[]","name":"","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"}]}')},f06b:function(e){e.exports=JSON.parse('[{"name":"getNodeInfo","call":"klay_clientVersion"},{"name":"getProtocolVersion","call":"klay_protocolVersion","params":0},{"name":"isMining","call":"klay_mining","params":0},{"name":"isSyncing","call":"klay_syncing","params":0,"outputFormatter":"outputSyncingFormatter"},{"name":"getGasPrice","call":"klay_gasPrice","params":0,"outputFormatter":"outputBigNumberFormatter"},{"name":"getAccounts","call":"klay_accounts","params":0,"outputFormatter":"toChecksumAddress"},{"name":"getBlockNumber","call":"klay_blockNumber","params":0,"outputFormatter":"hexToNumber"},{"name":"getBalance","call":"klay_getBalance","params":2,"inputFormatter":["inputAddressFormatter","inputDefaultBlockNumberFormatter"],"outputFormatter":"outputBigNumberFormatter"},{"name":"getStorageAt","call":"klay_getStorageAt","params":3,"inputFormatter":["inputAddressFormatter","numberToHex","inputDefaultBlockNumberFormatter"]},{"name":"getCode","call":"klay_getCode","params":2,"inputFormatter":["inputAddressFormatter","inputDefaultBlockNumberFormatter"]},{"name":"getTransaction","call":"klay_getTransactionByHash","outputFormatter":"outputTransactionFormatter","params":1},{"name":"getTransactionReceipt","call":"klay_getTransactionReceipt","params":1,"outputFormatter":"outputTransactionReceiptFormatter"},{"name":"getTransactionCount","call":"klay_getTransactionCount","params":2,"inputFormatter":["inputAddressFormatter","inputDefaultBlockNumberFormatter"],"outputFormatter":"hexToNumber"},{"name":"sendSignedTransaction","call":"klay_sendRawTransaction","params":1},{"name":"signTransaction","call":"klay_signTransaction","params":1,"inputFormatter":["inputTransactionFormatter"]},{"name":"sendTransaction","call":"klay_sendTransaction","params":1,"inputFormatter":["inputTransactionFormatter"]},{"name":"call","call":"klay_call","params":2,"inputFormatter":["inputCallFormatter","inputDefaultBlockNumberFormatter"]},{"name":"estimateGas","call":"klay_estimateGas","params":1,"inputFormatter":["inputCallFormatter"],"outputFormatter":"hexToNumber"},{"name":"getPastLogs","call":"klay_getLogs","params":1,"inputFormatter":["inputLogFormatter"],"outputFormatter":"outputLogFormatter"},{"name":"sign","call":"klay_sign","params":2,"inputFormatter":["inputSignFormatter","inputAddressFormatter"],"transformPayload":"reversePayload"},{"name":"getBlock","call":"klay_getBlockByNumber","hexCall":"klay_getBlockByHash","params":2,"inputFormatter":["inputBlockNumberFormatter","toBoolean"]},{"name":"getBlockTransactionCount","call":"klay_getBlockTransactionCountByNumber","hexCall":"klay_getBlockTransactionCountByHash","params":1,"inputFormatter":["inputBlockNumberFormatter"],"outputFormatter":"hexToNumber"},{"name":"getTransactionFromBlock","call":"klay_getTransactionByBlockNumberAndIndex","hexCall":"klay_getTransactionByBlockHashAndIndex","params":2,"inputFormatter":["inputBlockNumberFormatter","numberToHex"],"outputFormatter":"outputTransactionFormatter"},{"name":"getId","call":"net_networkID","params":0,"outputFormatter":"hexToNumber"},{"name":"isListening","call":"net_listening","params":0},{"name":"getPeerCount","call":"net_peerCount","params":0,"outputFormatter":"hexToNumber"},{"name":"getChainId","call":"klay_chainID","outputFormatter":"hexToNumber"},{"name":"getAccounts","call":"personal_listAccounts","params":0,"outputFormatter":"toChecksumAddress"},{"name":"newAccount","call":"personal_newAccount","params":1,"outputFormatter":"toChecksumAddress"},{"name":"unlockAccount","call":"personal_unlockAccount","params":3,"inputFormatter":["inputAddressFormatter",null,null]},{"name":"lockAccount","call":"personal_lockAccount","params":1,"inputFormatter":["inputAddressFormatter"]},{"name":"importRawKey","call":"personal_importRawKey","params":2,"inputFormatter":["inputRawKeyFormatter",null]},{"name":"sendTransaction","call":"personal_sendTransaction","params":2,"inputFormatter":["inputTransactionFormatter",null]},{"name":"signTransaction","call":"personal_signTransaction","params":2,"inputFormatter":["inputTransactionFormatter",null]},{"name":"sign","call":"personal_sign","params":3,"inputFormatter":["inputSignFormatter","inputAddressFormatter",null]},{"name":"ecRecover","call":"personal_ecRecover","params":2,"inputFormatter":["inputSignFormatter",null]},{"name":"getBlockWithConsensusInfo","call":"klay_getBlockWithConsensusInfoByNumber","hexCall":"klay_getBlockWithConsensusInfoByHash","params":1,"inputFormatter":["inputDefaultBlockNumberFormatter"]},{"name":"debugTraceTransaction","call":"debug_traceTransaction","params":1},{"name":"accountCreated","call":"klay_accountCreated","params":2,"inputFormatter":["inputAddressFormatter","inputDefaultBlockNumberFormatter"]},{"name":"getAccountKey","call":"klay_getAccountKey","params":2,"inputFormatter":["inputAddressFormatter","inputDefaultBlockNumberFormatter"]},{"name":"isContractAccount","call":"klay_isContractAccount","params":2,"inputFormatter":["inputAddressFormatter","inputDefaultBlockNumberFormatter"]},{"name":"getCommittee","call":"klay_getCommittee","params":1,"inputFormatter":["inputDefaultBlockNumberFormatter"]},{"name":"getCommitteeSize","call":"klay_getCommitteeSize","params":1,"inputFormatter":["inputDefaultBlockNumberFormatter"]},{"name":"getCouncil","call":"klay_getCouncil","params":1,"inputFormatter":["inputDefaultBlockNumberFormatter"]},{"name":"getCouncilSize","call":"klay_getCouncilSize","params":1,"inputFormatter":["inputDefaultBlockNumberFormatter"]},{"name":"getCypressCredit","call":"klay_getCypressCredit","params":1,"inputFormatter":["inputDefaultBlockNumberFormatter"]},{"name":"sha3","call":"klay_sha3","params":1},{"name":"getAccount","call":"klay_getAccount","params":2,"inputFormatter":["inputAddressFormatter","inputDefaultBlockNumberFormatter"]},{"name":"getTransactionBySenderTxHash","call":"klay_getTransactionBySenderTxHash","outputFormatter":"outputTransactionFormatter","params":1},{"name":"getTransactionReceiptBySenderTxHash","call":"klay_getTransactionReceiptBySenderTxHash","params":1,"outputFormatter":"outputTransactionReceiptFormatter"},{"name":"gasPriceAt","call":"klay_gasPriceAt","params":1,"inputFormatter":["inputDefaultBlockNumberFormatter"]},{"name":"isSenderTxHashIndexingEnabled","call":"klay_isSenderTxHashIndexingEnabled","params":0},{"name":"isParallelDBWrite","call":"klay_isParallelDBWrite","params":0},{"name":"rewardbase","call":"klay_rewardbase","params":0},{"name":"writeThroughCaching","call":"klay_writeThroughCaching","params":0},{"name":"getFilterChanges","call":"klay_getFilterChanges","params":1,"inputFormatter":["numberToHex"],"outputFormatter":"outputLogFormatter"},{"name":"getFilterLogs","call":"klay_getFilterLogs","params":1,"inputFormatter":["numberToHex"],"outputFormatter":"outputLogFormatter"},{"name":"newBlockFilter","call":"klay_newBlockFilter","params":0},{"name":"newFilter","call":"klay_newFilter","params":1,"inputFormatter":["inputLogFormatter"]},{"name":"newPendingTransactionFilter","call":"klay_newPendingTransactionFilter","params":0},{"name":"uninstallFilter","call":"klay_uninstallFilter","params":1,"inputFormatter":["numberToHex"]},{"name":"getBlockReceipts","call":"klay_getBlockReceipts","params":1},{"name":"peerCountByType","call":"net_peerCountByType","params":0},{"name":"estimateComputationCost","call":"klay_estimateComputationCost","params":2,"inputFormatter":["inputCallFormatter","inputDefaultBlockNumberFormatter"]},{"name":"replaceRawKey","call":"personal_replaceRawKey","params":3,"inputFormatter":["inputRawKeyFormatter",null,null]},{"name":"sendValueTransfer","call":"personal_sendValueTransfer","params":2,"inputFormatter":["inputPersonalTransactionFormatter",null]},{"name":"sendAccountUpdate","call":"personal_sendAccountUpdate","params":2,"inputFormatter":["inputPersonalTransactionFormatter",null]}]')},f102:function(e,t,r){const n=r("19d7"),f=r("0664"),i=r("19b5"),a=r("4695"),{ACCOUNT_UPDATE_TYPE_TAG:o,ACCOUNT_KEY_NIL_TAG:s,ACCOUNT_KEY_LEGACY_TAG:u,ACCOUNT_KEY_PUBLIC_TAG:c,ACCOUNT_KEY_FAIL_TAG:l,ACCOUNT_KEY_WEIGHTED_MULTISIG_TAG:h,ACCOUNT_KEY_ROLE_BASED_TAG:d,FEE_DELEGATED_ACCOUNT_UPDATE_TYPE_TAG:p,FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO_TYPE_TAG:m}=a.constants;function y(e){const t=v(e);return n.encode([n.encode([o,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.from.toLowerCase(),t]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function g(e){if(e.senderRawTransaction){const t="0x"+e.senderRawTransaction.slice(4),[r,a,o,s,u,[[c,l,h]]]=i.rlpDecode(t);return n.encode([n.encode([p,f.fromNat(r),f.fromNat(a),f.fromNat(o),s.toLowerCase(),u]),e.feePayer.toLowerCase(),f.fromNat(e.chainId||"0x1"),"0x","0x"])}const t=v(e);return n.encode([n.encode([p,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.from.toLowerCase(),t]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function b(e){if(e.senderRawTransaction){const t="0x"+e.senderRawTransaction.slice(4),[r,a,o,s,u,c,[[l,h,d]]]=i.rlpDecode(t);return n.encode([n.encode([m,f.fromNat(r),f.fromNat(a),f.fromNat(o),s.toLowerCase(),u,f.fromNat(c)]),e.feePayer.toLowerCase(),f.fromNat(e.chainId||"0x1"),"0x","0x"])}const t=v(e);return n.encode([n.encode([m,f.fromNat(e.nonce),f.fromNat(e.gasPrice),f.fromNat(e.gas),e.from.toLowerCase(),t,f.fromNat(e.feeRatio)]),f.fromNat(e.chainId||"0x1"),"0x","0x"])}function v(e){if(e.key){if(e.from&&e.from.toLowerCase()!==e.key.address.toLowerCase())throw new Error("The value of the from field of the transaction does not match the address of AccountForUpdate.");e.key.fillUpdateObject(e)}if(e.legacyKey)return u;if(e.failKey)return l;if(e.multisig){const{threshold:t,keys:r}=e.multisig,a=r.map(({weight:e,publicKey:t})=>{if(!e)throw new Error("weight should be specified for multisig account");if(!t)throw new Error("publicKey should be specified for multisig account");const r=i.compressPublicKey(t);return[f.fromNat(i.numberToHex(e)),r]});return h+n.encode([f.fromNat(i.numberToHex(t)),a]).slice(2)}if(e.publicKey){const t=i.compressPublicKey(e.publicKey);return c+n.encode(t).slice(2)}if(e.roleTransactionKey||e.roleAccountUpdateKey||e.roleFeePayerKey){const t={};t.roleTransactionKey=e.roleTransactionKey?v(e.roleTransactionKey):s,t.roleAccountUpdateKey=e.roleAccountUpdateKey?v(e.roleAccountUpdateKey):s,t.roleFeePayerKey=e.roleFeePayerKey?v(e.roleFeePayerKey):s;const r=[t.roleTransactionKey,t.roleAccountUpdateKey,t.roleFeePayerKey];return d+n.encode(r).slice(2)}return s}function w(e){const t=e.accountKey;if(delete e.accountKey,t.startsWith(u))e.legacyKey=!0;else if(t.startsWith(l))e.failKey=!0;else if(t.startsWith(c))e.publicKey=n.decode("0x"+t.slice(c.length));else if(t.startsWith(h)){let[r,f]=n.decode("0x"+t.slice(h.length));f=f.map(e=>({weight:i.hexToNumber(e[0]),publicKey:e[1]})),e.multisig={threshold:i.hexToNumber(r),keys:f}}else if(t.startsWith(d)){const r=n.decode("0x"+t.slice(d.length));r.map(e=>{if(e.startsWith(d))throw new Error("Nested role based key.")}),r.length>0&&!r[0].startsWith(s)&&(e.roleTransactionKey=w({accountKey:r[0]})),r.length>1&&!r[1].startsWith(s)&&(e.roleAccountUpdateKey=w({accountKey:r[1]})),r.length>2&&!r[2].startsWith(s)&&(e.roleFeePayerKey=w({accountKey:r[2]}))}return e}e.exports={rlpEncodeForAccountUpdate:y,rlpEncodeForFeeDelegatedAccountUpdate:g,rlpEncodeForFeeDelegatedAccountUpdateWithRatio:b,parseAccountKey:w}},f10a:function(e,t,r){"use strict";(function(e){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),f=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return f(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.recoverTypedSignature_v4=t.recoverTypedSignature=t.signTypedData_v4=t.signTypedData=t.recoverTypedMessage=t.signTypedMessage=t.getEncryptionPublicKey=t.decryptSafely=t.decrypt=t.encryptSafely=t.encrypt=t.recoverTypedSignatureLegacy=t.signTypedDataLegacy=t.typedSignatureHash=t.extractPublicKey=t.recoverPersonalSignature=t.personalSign=t.normalize=t.concatSig=t.TypedDataUtils=t.TYPED_MESSAGE_SCHEMA=void 0;const a=i(r("b978")),o=i(r("81ad")),s=i(r("0849")),u=i(r("427a")),c={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]};t.TYPED_MESSAGE_SCHEMA=c;const l={encodeData(t,r,n,f=!0){const i=["bytes32"],s=[this.hashType(t,n)];if(f){const u=(t,r,i)=>{if(void 0!==n[r])return["bytes32",null==i?"0x0000000000000000000000000000000000000000000000000000000000000000":a.keccak(this.encodeData(r,i,n,f))];if(void 0===i)throw new Error(`missing value for field ${t} of type ${r}`);if("bytes"===r)return["bytes32",a.keccak(i)];if("string"===r)return"string"===typeof i&&(i=e.from(i,"utf8")),["bytes32",a.keccak(i)];if(r.lastIndexOf("]")===r.length-1){const e=r.slice(0,r.lastIndexOf("[")),n=i.map(r=>u(t,e,r));return["bytes32",a.keccak(o.rawEncode(n.map(([e])=>e),n.map(([,e])=>e)))]}return[r,i]};for(const e of n[t]){const[t,n]=u(e.name,e.type,r[e.name]);i.push(t),s.push(n)}}else for(const o of n[t]){let t=r[o.name];if(void 0!==t)if("bytes"===o.type)i.push("bytes32"),t=a.keccak(t),s.push(t);else if("string"===o.type)i.push("bytes32"),"string"===typeof t&&(t=e.from(t,"utf8")),t=a.keccak(t),s.push(t);else if(void 0!==n[o.type])i.push("bytes32"),t=a.keccak(this.encodeData(o.type,t,n,f)),s.push(t);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");i.push(o.type),s.push(t)}}return o.rawEncode(i,s)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(t=>t!==e);n=[e].concat(n.sort());for(const f of n){const e=t[f];if(!e)throw new Error("No type definition specified: "+f);r+=`${f}(${t[f].map(({name:e,type:t})=>`${t} ${e}`).join(",")})`}return r},findTypeDependencies(e,t,r=[]){if([e]=e.match(/^\w*/u),r.includes(e)||void 0===t[e])return r;r.push(e);for(const n of t[e])for(const e of this.findTypeDependencies(n.type,t,r))!r.includes(e)&&r.push(e);return r},hashStruct(e,t,r,n=!0){return a.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return a.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in c.properties)e[r]&&(t[r]=e[r]);return"types"in t&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},sign(t,r=!0){const n=this.sanitizeData(t),f=[e.from("1901","hex")];return f.push(this.hashStruct("EIP712Domain",n.domain,n.types,r)),"EIP712Domain"!==n.primaryType&&f.push(this.hashStruct(n.primaryType,n.message,n.types,r)),a.keccak(e.concat(f))}};function h(e,t,r){const n=a.fromSigned(t),f=a.fromSigned(r),i=a.bufferToInt(e),o=L(a.toUnsigned(n).toString("hex"),64),s=L(a.toUnsigned(f).toString("hex"),64),u=a.stripHexPrefix(a.intToHex(i));return a.addHexPrefix(o.concat(s,u)).toString("hex")}function d(e){if(e){if("number"===typeof e){const t=a.toBuffer(e);e=a.bufferToHex(t)}if("string"!==typeof e){let t="eth-sig-util.normalize() requires hex string or integer input.";throw t+=` received ${typeof e}: ${e}`,new Error(t)}return a.addHexPrefix(e.toLowerCase())}}function p(e,t){const r=a.toBuffer(t.data),n=a.hashPersonalMessage(r),f=a.ecsign(n,e),i=a.bufferToHex(h(f.v,f.r,f.s));return i}function m(e){const t=N(e),r=a.publicToAddress(t),n=a.bufferToHex(r);return n}function y(e){const t=N(e);return"0x"+t.toString("hex")}function g(e){const t=R(e);return a.bufferToHex(t)}function b(e,t){const r=R(t.data),n=a.ecsign(r,e);return a.bufferToHex(h(n.v,n.r,n.s))}function v(e){const t=R(e.data),r=I(t,e.sig),n=a.publicToAddress(r);return a.bufferToHex(n)}function w(e,t,r){switch(r){case"x25519-xsalsa20-poly1305":{if("string"!==typeof t.data)throw new Error('Cannot detect secret message, message params should be of the form {data: "secret message"} ');const r=s.box.keyPair();let f;try{f=u.decodeBase64(e)}catch(n){throw new Error("Bad public key")}const i=u.decodeUTF8(t.data),a=s.randomBytes(s.box.nonceLength),o=s.box(i,a,f,r.secretKey),c={version:"x25519-xsalsa20-poly1305",nonce:u.encodeBase64(a),ephemPublicKey:u.encodeBase64(r.publicKey),ciphertext:u.encodeBase64(o)};return c}default:throw new Error("Encryption type/version not supported")}}function _(t,r,n){const f=2048,i=16,{data:a}=r;if(!a)throw new Error("Cannot encrypt empty msg.data");if("object"===typeof a&&"toJSON"in a)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const o={data:a,padding:""},s=e.byteLength(JSON.stringify(o),"utf-8"),u=s%f;let c=0;u>0&&(c=f-u-i),o.padding="0".repeat(c);const l={data:JSON.stringify(o)};return w(t,l,n)}function T(e,t){switch(e.version){case"x25519-xsalsa20-poly1305":{const n=F(t),f=s.box.keyPair.fromSecretKey(n).secretKey,i=u.decodeBase64(e.nonce),a=u.decodeBase64(e.ciphertext),o=u.decodeBase64(e.ephemPublicKey),c=s.box.open(a,i,o,f);let l;try{l=u.encodeUTF8(c)}catch(r){throw new Error("Decryption failed.")}if(l)return l;throw new Error("Decryption failed.")}default:throw new Error("Encryption type/version not supported.")}}function E(e,t){const r=JSON.parse(T(e,t));return r.data}function x(e){const t=F(e),r=s.box.keyPair.fromSecretKey(t).publicKey;return u.encodeBase64(r)}function M(e,t,r="V4"){switch(r){case"V1":return b(e,t);case"V3":return k(e,t);case"V4":default:return P(e,t)}}function A(e,t="V4"){switch(t){case"V1":return v(e);case"V3":return C(e);case"V4":default:return S(e)}}function k(e,t){const r=l.sign(t.data,!1),n=a.ecsign(r,e);return a.bufferToHex(h(n.v,n.r,n.s))}function P(e,t){const r=l.sign(t.data),n=a.ecsign(r,e);return a.bufferToHex(h(n.v,n.r,n.s))}function C(e){const t=l.sign(e.data,!1),r=I(t,e.sig),n=a.publicToAddress(r);return a.bufferToHex(n)}function S(e){const t=l.sign(e.data),r=I(t,e.sig),n=a.publicToAddress(r);return a.bufferToHex(n)}function R(e){const t=new Error("Expect argument to be non-empty array");if("object"!==typeof e||!("length"in e)||!e.length)throw t;const r=e.map((function(e){return"bytes"===e.type?a.toBuffer(e.value):e.value})),n=e.map((function(e){return e.type})),f=e.map((function(e){if(!e.name)throw t;return`${e.type} ${e.name}`}));return o.soliditySHA3(["bytes32","bytes32"],[o.soliditySHA3(new Array(e.length).fill("string"),f),o.soliditySHA3(n,r)])}function I(e,t){const r=a.toBuffer(t),n=a.fromRpcSig(r);return a.ecrecover(e,n.v,n.r,n.s)}function N(e){const t=a.toBuffer(e.data),r=a.hashPersonalMessage(t);return I(r,e.sig)}function L(e,t){let r=""+e;while(r.length({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(e=>[].concat(e,e,e,e,e))([0,0,0,0,0,0,0,0,0,0])}),o=(e,t)=>{var i,a=t.length,o=e.blocks,u=e.blockCount<<2,c=e.blockCount,l=e.outputBlocks,h=e.s,d=0;while(d>2]|=t[d]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[y>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=u){for(e.start=y-u,e.block=o[c],y=0;y>2]|=n[3&y],e.lastByteIndex===u)for(o[0]=o[c],y=1;y>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];g%c===0&&(s(h),y=0)}return"0x"+m},s=e=>{var t,r,n,f,a,o,s,u,c,l,h,d,p,m,y,g,b,v,w,_,T,E,x,M,A,k,P,C,S,R,I,N,L,F,K,O,D,B,U,j,V,H,G,W,q,Y,$,z,Z,J,X,Q,ee,te,re,ne,fe,ie,ae,oe,se,ue,ce;for(n=0;n<48;n+=2)f=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],d=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],t=d^(o<<1|s>>>31),r=p^(s<<1|o>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=f^(u<<1|c>>>31),r=a^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=o^(l<<1|h>>>31),r=s^(h<<1|l>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(d<<1|p>>>31),r=c^(p<<1|d>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=l^(f<<1|a>>>31),r=h^(a<<1|f>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],y=e[1],Y=e[11]<<4|e[10]>>>28,$=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,oe=e[31]<<9|e[30]>>>23,se=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,G=e[41]<<18|e[40]>>>14,F=e[2]<<1|e[3]>>>31,K=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,z=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,I=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,O=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,A=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,fe=e[16]<<23|e[17]>>>9,B=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,T=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,q=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,P=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,j=e[38]<<8|e[39]>>>24,V=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,x=e[49]<<14|e[48]>>>18,e[0]=m^~g&v,e[1]=y^~b&w,e[10]=M^~k&C,e[11]=A^~P&S,e[20]=F^~O&B,e[21]=K^~D&U,e[30]=W^~Y&z,e[31]=q^~$&Z,e[40]=te^~ne&ie,e[41]=re^~fe&ae,e[2]=g^~v&_,e[3]=b^~w&T,e[12]=k^~C&R,e[13]=P^~S&I,e[22]=O^~B&j,e[23]=D^~U&V,e[32]=Y^~z&J,e[33]=$^~Z&X,e[42]=ne^~ie&oe,e[43]=fe^~ae&se,e[4]=v^~_&E,e[5]=w^~T&x,e[14]=C^~R&N,e[15]=S^~I&L,e[24]=B^~j&H,e[25]=U^~V&G,e[34]=z^~J&Q,e[35]=Z^~X&ee,e[44]=ie^~oe&ue,e[45]=ae^~se&ce,e[6]=_^~E&m,e[7]=T^~x&y,e[16]=R^~N&M,e[17]=I^~L&A,e[26]=j^~H&F,e[27]=V^~G&K,e[36]=J^~Q&W,e[37]=X^~ee&q,e[46]=oe^~ue&te,e[47]=se^~ce&re,e[8]=E^~m&g,e[9]=x^~y&b,e[18]=N^~M&k,e[19]=L^~A&P,e[28]=H^~F&O,e[29]=G^~K&D,e[38]=Q^~W&Y,e[39]=ee^~q&$,e[48]=ue^~te&ne,e[49]=ce^~re&fe,e[0]^=i[n],e[1]^=i[n+1]},u=e=>t=>{var r;if("0x"===t.slice(0,2)){r=[];for(var n=2,f=t.length;n1,"Exponential factor should be greater than 1 but got %s.",e.factor),this.factor_=e.factor)}n.inherits(a,i),a.DEFAULT_FACTOR=2,a.prototype.next_=function(){return this.backoffDelay_=Math.min(this.nextBackoffDelay_,this.getMaxDelay()),this.nextBackoffDelay_=this.backoffDelay_*this.factor_,this.backoffDelay_},a.prototype.reset_=function(){this.backoffDelay_=0,this.nextBackoffDelay_=this.getInitialDelay()},e.exports=a},f76c:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordlist=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]},f7ab:function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("f654"),f=r("9a12"),i=r("72a4"),a=r("d968"),o=r("d5c5"),s=r("2803");t.zeroAddress=function(){var e=20,t=o.zeros(e);return o.bufferToHex(t)},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){var r=t.zeroAddress();return r===o.addHexPrefix(e)},t.toChecksumAddress=function(e,t){e=f.stripHexPrefix(e).toLowerCase();for(var r=void 0!==t?t.toString()+"0x":"",n=s.keccak(r+e).toString("hex"),i="0x",a=0;a=8?i+=e[a].toUpperCase():i+=e[a];return i},t.isValidChecksumAddress=function(e,r){return t.isValidAddress(e)&&t.toChecksumAddress(e,r)===e},t.generateAddress=function(t,r){t=o.toBuffer(t);var n=new a(r);return n.isZero()?s.rlphash([t,null]).slice(-20):s.rlphash([t,e.from(n.toArray())]).slice(-20)},t.generateAddress2=function(t,r,f){var i=o.toBuffer(t),a=o.toBuffer(r),u=o.toBuffer(f);n(20===i.length),n(32===a.length);var c=s.keccak256(e.concat([e.from("ff","hex"),i,a,s.keccak256(u)]));return c.slice(-20)},t.isPrecompiled=function(e){var t=o.unpad(e);return 1===t.length&&t[0]>=1&&t[0]<=8},t.isValidPrivate=function(e){return i.privateKeyVerify(e)},t.isValidPublic=function(t,r){return void 0===r&&(r=!1),64===t.length?i.publicKeyVerify(e.concat([e.from([4]),t])):!!r&&i.publicKeyVerify(t)},t.pubToAddress=function(e,t){return void 0===t&&(t=!1),e=o.toBuffer(e),t&&64!==e.length&&(e=i.publicKeyConvert(e,!1).slice(1)),n(64===e.length),s.keccak(e).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToAddress=function(e){return t.publicToAddress(t.privateToPublic(e))},t.privateToPublic=function(e){return e=o.toBuffer(e),i.publicKeyCreate(e,!1).slice(1)},t.importPublic=function(e){return e=o.toBuffer(e),64!==e.length&&(e=i.publicKeyConvert(e,!1).slice(1)),e}}).call(this,r("b639").Buffer)},f90d:function(e,t,r){const n=r("e3fd"),f=e=>!!e&&!!e.error&&!!e.error.message,i={"0x2":"VM error occurs while running smart contract","0x3":"max call depth exceeded","0x4":"contract address collision","0x5":"contract creation code storage out of gas","0x6":"evm: max code size exceeded","0x7":"out of gas","0x8":"evm: write protection","0x9":"evm: execution reverted","0xa":"reached the opcode count limit","0xb":"account already exists","0xc":"not a program account (e.g., an account having code and storage)","0xd":"Human-readable address is not supported now","0xe":"fee ratio is out of range [1, 99]","0xf":"AccountKeyFail is not updatable","0x10":"different account key type","0x11":"AccountKeyNil cannot be initialized to an account","0x12":"public key is not on curve","0x13":"key weight is zero","0x14":"key is not serializable","0x15":"duplicated key","0x16":"weighted sum overflow","0x17":"unsatisfiable threshold. Weighted sum of keys is less than the threshold.","0x18":"length is zero","0x19":"length too long","0x1a":"nested role-based key","0x1b":"a legacy transaction must be with a legacy account key","0x1c":"deprecated feature","0x1d":"not supported","0x1e":"smart contract code format is invalid"};e.exports={InvalidConnection:e=>new Error(`CONNECTION ERROR: Couldn't connect to node ${e}.`),RequestFailed:e=>new Error("Request failed: "+e),ConnectionTimeout:e=>new Error(`CONNECTION TIMEOUT: timeout of ${e}ms achived`),ConnectionNotOpenError:e=>{const t=new Error("connection not open on send()");return e&&(t.code=e.code,t.reason=e.reason),t},MaxAttemptsReachedOnReconnectingError:()=>new Error("Maximum number of reconnect attempts reached!"),PendingRequestsOnReconnectingError:()=>new Error("CONNECTION ERROR: Provider started to reconnect before the response got received!"),InvalidProvider:()=>new Error("Provider not set or invalid"),InvalidNumberOfParams:(e,t,r)=>new Error(`\n Invalid number of parameters for "${r}". Got ${e} expected ${t}!\n `),ErrorResponse:e=>{const t=f(e)?e.error.message:JSON.stringify(e);return new Error("Returned error: "+t)},InvalidResponse:e=>{if(null===e)return new Error("Invalid response: null");const t=f(e)?e.error.message:"Invalid JSON RPC response: "+JSON.stringify(e);return new Error(t)},needNameCallPropertyToCreateMethod:new Error('When creating a method you need to provide at least the "name" and "call" property.'),blockHashNull:new Error("blockHash null"),contractCouldntBeStored:new Error("The contract code couldn't be stored, please check your gas limit."),receiptDidntContainContractAddress:new Error("The transaction receipt didn't contain a contract address."),transactionReverted:e=>new Error("Transaction has been reverted by the EVM:\n"+e),transactionRanOutOfGas:e=>new Error("Transaction ran out of gas. Please provide more gas:\n"+e),invalidGasPrice:()=>new Error("Invalid gas price. Please provide valid gas price: "+n.VALID_GAS_PRICE),invalidGasLimit:()=>new Error("Invalid gas limit. Please provide valid gas."),invalidData:()=>new Error("Invalid data. Please provide valid hex-strict data."),notAllowedZeroGas:()=>new Error("gas can't be 0. Please provide more gas."),txErrorTable:i}},f934:function(e,t,r){(function(e){(function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function f(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(29).Buffer}catch(k){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function u(e,t,r,n){for(var f=0,i=Math.min(e.length,r),a=t;a=49?o-49+10:o>=17?o-17+10:o}return f}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var f=0;"-"===e[0]&&(f++,this.negative=1),f=0;f-=3)a=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[i]|=a<>>26-o&67108863,o+=24,o>=26&&(o-=26,i++);else if("le"===r)for(f=0,i=0;f>>26-o&67108863,o+=24,o>=26&&(o-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)f=s(e,t,n)<=18?(i-=18,a+=1,this.words[a]|=f>>>26):i+=8;else{var o=e.length-t;for(n=o%2===0?t+1:t;n=18?(i-=18,a+=1,this.words[a]|=f>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,f=1;f<=67108863;f*=t)n++;n--,f=f/t|0;for(var i=e.length-r,a=i%n,o=Math.min(i,i-a)+r,s=0,c=r;c1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e){for(var t=new Array(e.bitLength()),r=0;r>>f}return t}function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var f=0|e.words[0],i=0|t.words[0],a=f*i,o=67108863&a,s=a/67108864|0;r.words[0]=o;for(var u=1;u>>26,l=67108863&s,h=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=h;d++){var p=u-d|0;f=0|e.words[p],i=0|t.words[d],a=f*i+l,c+=a/67108864|0,l=67108863&a}r.words[u]=0|l,s=0|c}return 0!==s?r.words[u]=0|s:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var f=0,i=0,a=0;a>>24-f&16777215,r=0!==i||a!==this.length-1?c[6-s.length]+s+r:s+r,f+=2,f>=26&&(f-=26,a--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],d=h[e];r="";var p=this.clone();p.negative=0;while(!p.isZero()){var m=p.modn(d).toString(e);p=p.idivn(d),r=p.isZero()?m+r:c[u-m.length]+m+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n("undefined"!==typeof a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var f=this.byteLength(),i=r||Math.max(1,f);n(f<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,o,s="le"===t,u=new e(i),c=this.clone();if(s){for(o=0;!c.isZero();o++)a=c.andln(255),c.iushrn(8),u[o]=a;for(;o=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,f=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var f=0,i=0;i>>26;for(;0!==f&&i>>26;if(this.length=r.length,0!==f)this.words[this.length]=f,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,y=0|a[2],g=8191&y,b=y>>>13,v=0|a[3],w=8191&v,_=v>>>13,T=0|a[4],E=8191&T,x=T>>>13,M=0|a[5],A=8191&M,k=M>>>13,P=0|a[6],C=8191&P,S=P>>>13,R=0|a[7],I=8191&R,N=R>>>13,L=0|a[8],F=8191&L,K=L>>>13,O=0|a[9],D=8191&O,B=O>>>13,U=0|o[0],j=8191&U,V=U>>>13,H=0|o[1],G=8191&H,W=H>>>13,q=0|o[2],Y=8191&q,$=q>>>13,z=0|o[3],Z=8191&z,J=z>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,fe=0|o[6],ie=8191&fe,ae=fe>>>13,oe=0|o[7],se=8191&oe,ue=oe>>>13,ce=0|o[8],le=8191&ce,he=ce>>>13,de=0|o[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(l,j),f=Math.imul(l,V),f=f+Math.imul(h,j)|0,i=Math.imul(h,V);var ye=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,j),f=Math.imul(p,V),f=f+Math.imul(m,j)|0,i=Math.imul(m,V),n=n+Math.imul(l,G)|0,f=f+Math.imul(l,W)|0,f=f+Math.imul(h,G)|0,i=i+Math.imul(h,W)|0;var ge=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,j),f=Math.imul(g,V),f=f+Math.imul(b,j)|0,i=Math.imul(b,V),n=n+Math.imul(p,G)|0,f=f+Math.imul(p,W)|0,f=f+Math.imul(m,G)|0,i=i+Math.imul(m,W)|0,n=n+Math.imul(l,Y)|0,f=f+Math.imul(l,$)|0,f=f+Math.imul(h,Y)|0,i=i+Math.imul(h,$)|0;var be=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,j),f=Math.imul(w,V),f=f+Math.imul(_,j)|0,i=Math.imul(_,V),n=n+Math.imul(g,G)|0,f=f+Math.imul(g,W)|0,f=f+Math.imul(b,G)|0,i=i+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,f=f+Math.imul(p,$)|0,f=f+Math.imul(m,Y)|0,i=i+Math.imul(m,$)|0,n=n+Math.imul(l,Z)|0,f=f+Math.imul(l,J)|0,f=f+Math.imul(h,Z)|0,i=i+Math.imul(h,J)|0;var ve=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,j),f=Math.imul(E,V),f=f+Math.imul(x,j)|0,i=Math.imul(x,V),n=n+Math.imul(w,G)|0,f=f+Math.imul(w,W)|0,f=f+Math.imul(_,G)|0,i=i+Math.imul(_,W)|0,n=n+Math.imul(g,Y)|0,f=f+Math.imul(g,$)|0,f=f+Math.imul(b,Y)|0,i=i+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,f=f+Math.imul(p,J)|0,f=f+Math.imul(m,Z)|0,i=i+Math.imul(m,J)|0,n=n+Math.imul(l,Q)|0,f=f+Math.imul(l,ee)|0,f=f+Math.imul(h,Q)|0,i=i+Math.imul(h,ee)|0;var we=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,j),f=Math.imul(A,V),f=f+Math.imul(k,j)|0,i=Math.imul(k,V),n=n+Math.imul(E,G)|0,f=f+Math.imul(E,W)|0,f=f+Math.imul(x,G)|0,i=i+Math.imul(x,W)|0,n=n+Math.imul(w,Y)|0,f=f+Math.imul(w,$)|0,f=f+Math.imul(_,Y)|0,i=i+Math.imul(_,$)|0,n=n+Math.imul(g,Z)|0,f=f+Math.imul(g,J)|0,f=f+Math.imul(b,Z)|0,i=i+Math.imul(b,J)|0,n=n+Math.imul(p,Q)|0,f=f+Math.imul(p,ee)|0,f=f+Math.imul(m,Q)|0,i=i+Math.imul(m,ee)|0,n=n+Math.imul(l,re)|0,f=f+Math.imul(l,ne)|0,f=f+Math.imul(h,re)|0,i=i+Math.imul(h,ne)|0;var _e=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(C,j),f=Math.imul(C,V),f=f+Math.imul(S,j)|0,i=Math.imul(S,V),n=n+Math.imul(A,G)|0,f=f+Math.imul(A,W)|0,f=f+Math.imul(k,G)|0,i=i+Math.imul(k,W)|0,n=n+Math.imul(E,Y)|0,f=f+Math.imul(E,$)|0,f=f+Math.imul(x,Y)|0,i=i+Math.imul(x,$)|0,n=n+Math.imul(w,Z)|0,f=f+Math.imul(w,J)|0,f=f+Math.imul(_,Z)|0,i=i+Math.imul(_,J)|0,n=n+Math.imul(g,Q)|0,f=f+Math.imul(g,ee)|0,f=f+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,f=f+Math.imul(p,ne)|0,f=f+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,n=n+Math.imul(l,ie)|0,f=f+Math.imul(l,ae)|0,f=f+Math.imul(h,ie)|0,i=i+Math.imul(h,ae)|0;var Te=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(I,j),f=Math.imul(I,V),f=f+Math.imul(N,j)|0,i=Math.imul(N,V),n=n+Math.imul(C,G)|0,f=f+Math.imul(C,W)|0,f=f+Math.imul(S,G)|0,i=i+Math.imul(S,W)|0,n=n+Math.imul(A,Y)|0,f=f+Math.imul(A,$)|0,f=f+Math.imul(k,Y)|0,i=i+Math.imul(k,$)|0,n=n+Math.imul(E,Z)|0,f=f+Math.imul(E,J)|0,f=f+Math.imul(x,Z)|0,i=i+Math.imul(x,J)|0,n=n+Math.imul(w,Q)|0,f=f+Math.imul(w,ee)|0,f=f+Math.imul(_,Q)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,f=f+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0,n=n+Math.imul(p,ie)|0,f=f+Math.imul(p,ae)|0,f=f+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0,n=n+Math.imul(l,se)|0,f=f+Math.imul(l,ue)|0,f=f+Math.imul(h,se)|0,i=i+Math.imul(h,ue)|0;var Ee=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,j),f=Math.imul(F,V),f=f+Math.imul(K,j)|0,i=Math.imul(K,V),n=n+Math.imul(I,G)|0,f=f+Math.imul(I,W)|0,f=f+Math.imul(N,G)|0,i=i+Math.imul(N,W)|0,n=n+Math.imul(C,Y)|0,f=f+Math.imul(C,$)|0,f=f+Math.imul(S,Y)|0,i=i+Math.imul(S,$)|0,n=n+Math.imul(A,Z)|0,f=f+Math.imul(A,J)|0,f=f+Math.imul(k,Z)|0,i=i+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,f=f+Math.imul(E,ee)|0,f=f+Math.imul(x,Q)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,f=f+Math.imul(w,ne)|0,f=f+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(g,ie)|0,f=f+Math.imul(g,ae)|0,f=f+Math.imul(b,ie)|0,i=i+Math.imul(b,ae)|0,n=n+Math.imul(p,se)|0,f=f+Math.imul(p,ue)|0,f=f+Math.imul(m,se)|0,i=i+Math.imul(m,ue)|0,n=n+Math.imul(l,le)|0,f=f+Math.imul(l,he)|0,f=f+Math.imul(h,le)|0,i=i+Math.imul(h,he)|0;var xe=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,j),f=Math.imul(D,V),f=f+Math.imul(B,j)|0,i=Math.imul(B,V),n=n+Math.imul(F,G)|0,f=f+Math.imul(F,W)|0,f=f+Math.imul(K,G)|0,i=i+Math.imul(K,W)|0,n=n+Math.imul(I,Y)|0,f=f+Math.imul(I,$)|0,f=f+Math.imul(N,Y)|0,i=i+Math.imul(N,$)|0,n=n+Math.imul(C,Z)|0,f=f+Math.imul(C,J)|0,f=f+Math.imul(S,Z)|0,i=i+Math.imul(S,J)|0,n=n+Math.imul(A,Q)|0,f=f+Math.imul(A,ee)|0,f=f+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,f=f+Math.imul(E,ne)|0,f=f+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(w,ie)|0,f=f+Math.imul(w,ae)|0,f=f+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,n=n+Math.imul(g,se)|0,f=f+Math.imul(g,ue)|0,f=f+Math.imul(b,se)|0,i=i+Math.imul(b,ue)|0,n=n+Math.imul(p,le)|0,f=f+Math.imul(p,he)|0,f=f+Math.imul(m,le)|0,i=i+Math.imul(m,he)|0,n=n+Math.imul(l,pe)|0,f=f+Math.imul(l,me)|0,f=f+Math.imul(h,pe)|0,i=i+Math.imul(h,me)|0;var Me=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,G),f=Math.imul(D,W),f=f+Math.imul(B,G)|0,i=Math.imul(B,W),n=n+Math.imul(F,Y)|0,f=f+Math.imul(F,$)|0,f=f+Math.imul(K,Y)|0,i=i+Math.imul(K,$)|0,n=n+Math.imul(I,Z)|0,f=f+Math.imul(I,J)|0,f=f+Math.imul(N,Z)|0,i=i+Math.imul(N,J)|0,n=n+Math.imul(C,Q)|0,f=f+Math.imul(C,ee)|0,f=f+Math.imul(S,Q)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(A,re)|0,f=f+Math.imul(A,ne)|0,f=f+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(E,ie)|0,f=f+Math.imul(E,ae)|0,f=f+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,n=n+Math.imul(w,se)|0,f=f+Math.imul(w,ue)|0,f=f+Math.imul(_,se)|0,i=i+Math.imul(_,ue)|0,n=n+Math.imul(g,le)|0,f=f+Math.imul(g,he)|0,f=f+Math.imul(b,le)|0,i=i+Math.imul(b,he)|0,n=n+Math.imul(p,pe)|0,f=f+Math.imul(p,me)|0,f=f+Math.imul(m,pe)|0,i=i+Math.imul(m,me)|0;var Ae=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,Y),f=Math.imul(D,$),f=f+Math.imul(B,Y)|0,i=Math.imul(B,$),n=n+Math.imul(F,Z)|0,f=f+Math.imul(F,J)|0,f=f+Math.imul(K,Z)|0,i=i+Math.imul(K,J)|0,n=n+Math.imul(I,Q)|0,f=f+Math.imul(I,ee)|0,f=f+Math.imul(N,Q)|0,i=i+Math.imul(N,ee)|0,n=n+Math.imul(C,re)|0,f=f+Math.imul(C,ne)|0,f=f+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(A,ie)|0,f=f+Math.imul(A,ae)|0,f=f+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,n=n+Math.imul(E,se)|0,f=f+Math.imul(E,ue)|0,f=f+Math.imul(x,se)|0,i=i+Math.imul(x,ue)|0,n=n+Math.imul(w,le)|0,f=f+Math.imul(w,he)|0,f=f+Math.imul(_,le)|0,i=i+Math.imul(_,he)|0,n=n+Math.imul(g,pe)|0,f=f+Math.imul(g,me)|0,f=f+Math.imul(b,pe)|0,i=i+Math.imul(b,me)|0;var ke=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Z),f=Math.imul(D,J),f=f+Math.imul(B,Z)|0,i=Math.imul(B,J),n=n+Math.imul(F,Q)|0,f=f+Math.imul(F,ee)|0,f=f+Math.imul(K,Q)|0,i=i+Math.imul(K,ee)|0,n=n+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,f=f+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,n=n+Math.imul(C,ie)|0,f=f+Math.imul(C,ae)|0,f=f+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,n=n+Math.imul(A,se)|0,f=f+Math.imul(A,ue)|0,f=f+Math.imul(k,se)|0,i=i+Math.imul(k,ue)|0,n=n+Math.imul(E,le)|0,f=f+Math.imul(E,he)|0,f=f+Math.imul(x,le)|0,i=i+Math.imul(x,he)|0,n=n+Math.imul(w,pe)|0,f=f+Math.imul(w,me)|0,f=f+Math.imul(_,pe)|0,i=i+Math.imul(_,me)|0;var Pe=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Q),f=Math.imul(D,ee),f=f+Math.imul(B,Q)|0,i=Math.imul(B,ee),n=n+Math.imul(F,re)|0,f=f+Math.imul(F,ne)|0,f=f+Math.imul(K,re)|0,i=i+Math.imul(K,ne)|0,n=n+Math.imul(I,ie)|0,f=f+Math.imul(I,ae)|0,f=f+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,n=n+Math.imul(C,se)|0,f=f+Math.imul(C,ue)|0,f=f+Math.imul(S,se)|0,i=i+Math.imul(S,ue)|0,n=n+Math.imul(A,le)|0,f=f+Math.imul(A,he)|0,f=f+Math.imul(k,le)|0,i=i+Math.imul(k,he)|0,n=n+Math.imul(E,pe)|0,f=f+Math.imul(E,me)|0,f=f+Math.imul(x,pe)|0,i=i+Math.imul(x,me)|0;var Ce=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,re),f=Math.imul(D,ne),f=f+Math.imul(B,re)|0,i=Math.imul(B,ne),n=n+Math.imul(F,ie)|0,f=f+Math.imul(F,ae)|0,f=f+Math.imul(K,ie)|0,i=i+Math.imul(K,ae)|0,n=n+Math.imul(I,se)|0,f=f+Math.imul(I,ue)|0,f=f+Math.imul(N,se)|0,i=i+Math.imul(N,ue)|0,n=n+Math.imul(C,le)|0,f=f+Math.imul(C,he)|0,f=f+Math.imul(S,le)|0,i=i+Math.imul(S,he)|0,n=n+Math.imul(A,pe)|0,f=f+Math.imul(A,me)|0,f=f+Math.imul(k,pe)|0,i=i+Math.imul(k,me)|0;var Se=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,ie),f=Math.imul(D,ae),f=f+Math.imul(B,ie)|0,i=Math.imul(B,ae),n=n+Math.imul(F,se)|0,f=f+Math.imul(F,ue)|0,f=f+Math.imul(K,se)|0,i=i+Math.imul(K,ue)|0,n=n+Math.imul(I,le)|0,f=f+Math.imul(I,he)|0,f=f+Math.imul(N,le)|0,i=i+Math.imul(N,he)|0,n=n+Math.imul(C,pe)|0,f=f+Math.imul(C,me)|0,f=f+Math.imul(S,pe)|0,i=i+Math.imul(S,me)|0;var Re=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,se),f=Math.imul(D,ue),f=f+Math.imul(B,se)|0,i=Math.imul(B,ue),n=n+Math.imul(F,le)|0,f=f+Math.imul(F,he)|0,f=f+Math.imul(K,le)|0,i=i+Math.imul(K,he)|0,n=n+Math.imul(I,pe)|0,f=f+Math.imul(I,me)|0,f=f+Math.imul(N,pe)|0,i=i+Math.imul(N,me)|0;var Ie=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,le),f=Math.imul(D,he),f=f+Math.imul(B,le)|0,i=Math.imul(B,he),n=n+Math.imul(F,pe)|0,f=f+Math.imul(F,me)|0,f=f+Math.imul(K,pe)|0,i=i+Math.imul(K,me)|0;var Ne=(u+n|0)+((8191&f)<<13)|0;u=(i+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(D,pe),f=Math.imul(D,me),f=f+Math.imul(B,pe)|0,i=Math.imul(B,me);var Le=(u+n|0)+((8191&f)<<13)|0;return u=(i+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,s[0]=ye,s[1]=ge,s[2]=be,s[3]=ve,s[4]=we,s[5]=_e,s[6]=Te,s[7]=Ee,s[8]=xe,s[9]=Me,s[10]=Ae,s[11]=ke,s[12]=Pe,s[13]=Ce,s[14]=Se,s[15]=Re,s[16]=Ie,s[17]=Ne,s[18]=Le,0!==u&&(s[19]=u,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,f=0,i=0;i>>26)|0,f+=a>>>26,a&=67108863}r.words[i]=o,n=a,a=f}return 0!==n?r.words[i]=n:r.length--,r.strip()}function g(e,t,r){var n=new b;return n.mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=p),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?m(this,e,t):n<63?p(this,e,t):n<1024?y(this,e,t):g(this,e,t),r},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,f,i){for(var a=0;a>>=1)f++;return 1<>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=f/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=d(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,r=e%26,f=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==f){for(t=this.length-1;t>=0;t--)this.words[t+f]=this.words[t];for(t=0;t=0),f=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),o=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==c||u>=f);u--){var l=0|this.words[u];this.words[u]=c<<26-i|l>>>i,c=l&o}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,f=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var f=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(s/67108864|0),this.words[f+r]=67108863&i}for(;f>26,this.words[f+r]=67108863&i;if(0===o)return this.strip();for(n(-1===o),o=0,f=0;f>26,this.words[f]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),f=e,a=0|f.words[f.length-1],o=this._countBits(a);r=26-o,0!==r&&(f=f.ushln(r),n.iushln(r),a=0|f.words[f.length-1]);var s,u=n.length-f.length;if("mod"!==t){s=new i(null),s.length=u+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var d=67108864*(0|n.words[f.length+h])+(0|n.words[f.length+h-1]);d=Math.min(d/a|0,67108863),n._ishlnsubmul(f,d,h);while(0!==n.negative)d--,n.negative=0,n._ishlnsubmul(f,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(f=o.div.neg()),"div"!==t&&(a=o.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:f,mod:a}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(f=o.div.neg()),{div:f,mod:o.mod}):0!==(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(a=o.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:o.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var f,a,o},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),f=e.andln(1),i=r.cmp(n);return i<0||1===f&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,f=this.length-1;f>=0;f--)r=(t*r+(0|this.words[f]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var f=(0|this.words[r])+67108864*t;this.words[r]=f/e|0,t=f%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var f=new i(1),a=new i(0),o=new i(0),s=new i(1),u=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++u;var c=r.clone(),l=t.clone();while(!t.isZero()){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0){t.iushrn(h);while(h-- >0)(f.isOdd()||a.isOdd())&&(f.iadd(c),a.isub(l)),f.iushrn(1),a.iushrn(1)}for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0){r.iushrn(p);while(p-- >0)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(l)),o.iushrn(1),s.iushrn(1)}t.cmp(r)>=0?(t.isub(r),f.isub(o),a.isub(s)):(r.isub(t),o.isub(f),s.isub(a))}return{a:o,b:s,gcd:r.iushln(u)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var f,a=new i(1),o=new i(0),s=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var u=0,c=1;0===(t.words[0]&c)&&u<26;++u,c<<=1);if(u>0){t.iushrn(u);while(u-- >0)a.isOdd()&&a.iadd(s),a.iushrn(1)}for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0){r.iushrn(l);while(l-- >0)o.isOdd()&&o.iadd(s),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),a.isub(o)):(r.isub(t),o.isub(a))}return f=0===t.cmpn(1)?a:o,f.cmpn(0)<0&&f.iadd(e),f},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var f=t.cmp(r);if(f<0){var i=t;t=r,r=i}else if(0===f||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,f=1<>>26,o&=67108863,this.words[a]=o}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var f=0|this.words[0];t=f===e?0:fe.length)return 1;if(this.length=0;r--){var n=0|this.words[r],f=0|e.words[r];if(n!==f){nf&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new M(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function T(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},f(_,w),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),f=0;f>>22,i=a}i>>>=22,e.words[f-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=f,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new T;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return v[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var f=this.m.subn(1),a=0;while(!f.isZero()&&0===f.andln(1))a++,f.iushrn(1);n(!f.isZero());var o=new i(1).toRed(this),s=o.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();c=new i(2*c*c).toRed(this);while(0!==this.pow(c,u).cmp(s))c.redIAdd(s);var l=this.pow(c,f),h=this.pow(e,f.addn(1).iushrn(1)),d=this.pow(e,f),p=a;while(0!==d.cmp(o)){for(var m=d,y=0;0!==m.cmp(o);y++)m=m.redSqr();n(y=0;f--){for(var c=t.words[f],l=u-1;l>=0;l--){var h=c>>l&1;a!==n[0]&&(a=this.sqr(a)),0!==h||0!==o?(o<<=1,o|=h,s++,(s===r||0===f&&0===l)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}u=26}return a},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new A(e)},f(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=r.isub(n).iushrn(this.shift),i=f;return f.cmp(this.m)>=0?i=f.isub(this.m):f.cmpn(0)<0&&(i=f.iadd(this.m)),i._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=r.isub(n).iushrn(this.shift),a=f;return f.cmp(this.m)>=0?a=f.isub(this.m):f.cmpn(0)<0&&(a=f.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(e,this)}).call(this,r("62e4")(e))},fb5f:function(e,t,r){const n=r("19b5"),{ACCOUNT_KEY_TAG:f}=r("6369");class i{static decode(e){if(e=n.addHexPrefix(e),!e.startsWith(f.ACCOUNT_KEY_FAIL_TAG))throw new Error(`Cannot decode to AccountKeyFail. The prefix must be ${f.ACCOUNT_KEY_FAIL_TAG}: ${e}`);return new i}getRLPEncoding(){return f.ACCOUNT_KEY_FAIL_TAG}}e.exports=i},fc69:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrivateKeys=void 0;const n=e=>"privateKeys"in e?e.privateKeys:void 0;t.getPrivateKeys=n},fc77:function(e,t,r){(function(t,n){const f=r("2ef0"),i=r("9f6a"),a=r("d820"),o=r("1c46"),s=r("19b5"),u=r("cf45"),c={roleTransactionKey:0,0:"roleTransactionKey",roleAccountUpdateKey:1,1:"roleAccountUpdateKey",roleFeePayerKey:2,2:"roleFeePayerKey",roleLast:3},l=10,h=e=>!!f.isArray(e)&&e.every(e=>f.isString(e)),d=e=>!!f.isArray(e)&&(!(e.length>c.roleLast)&&e.every(e=>f.isArray(e))),p=(e,t)=>{if(!s.isValidHashStrict(e))throw new Error("Invalid transaction hash: "+e);if(void 0===t)throw new Error("chainId should be defined to sign.")},m=(e,t)=>{if(!f.isNumber(e))throw new Error(`Invalid type of index(${e}): index should be number type.`);if(e<0)throw new Error(`Invalid index(${e}): index cannot be negative.`);if(e>=t)throw new Error(`Invalid index(${e}): index must be less than the length of keys(${t}).`)},y=(e,t)=>{if(!e||0===e.length)return;const r=[];for(const f of e){let e,a;if("scrypt"===f.kdf)a=f.kdfparams,e=i.syncScrypt(n.from(t),n.from(a.salt,"hex"),a.n,a.r,a.p,a.dklen);else{if("pbkdf2"!==f.kdf)throw new Error("Unsupported key derivation scheme");if(a=f.kdfparams,"hmac-sha256"!==a.prf)throw new Error("Unsupported parameters to PBKDF2");e=o.pbkdf2Sync(n.from(t),n.from(a.salt,"hex"),a.c,a.dklen,"sha256")}const u=n.from(f.ciphertext,"hex"),c=s.sha3(n.from([...e.slice(16,32),...u])).replace("0x","");if(c!==f.mac)throw new Error("Key derivation failed - possibly wrong password");const l=o.createDecipheriv(f.cipher,e.slice(0,16),n.from(f.cipherparams.iv,"hex"));r.push("0x"+n.from([...l.update(u),...l.final()]).toString("hex"))}return r},g=(e,t,r)=>{const a=[];if(!e)return a;const c=f.isArray(e)?e:[e];for(let f=0;f{const f={version:e,id:a.v4({random:n.uuid||o.randomBytes(16)}),address:t.toLowerCase()};if(3===e)f.crypto=r;else{if(4!==e)throw new Error("Unsupported version of keystore");f.keyring=r}return f};e.exports={KEY_ROLE:c,MAXIMUM_KEY_NUM:l,isMultipleKeysFormat:h,isRoleBasedKeysFormat:d,validateForSigning:p,validateIndexWithKeys:m,decryptKey:y,encryptKey:g,formatEncrypted:b}}).call(this,r("c8ba"),r("b639").Buffer)},fd8f:function(e,t,r){const n=r("2ef0"),f=function(e){const t=this;let r;return this.net.getId().then((function(e){return r=e,t.getBlock(0)})).then((function(t){let f="private";return"0xe33ff05ceec2581ca9496f38a2bf9baad5d4eed629e896ccb33d1dc991bc4b4a"===t.hash&&1001===r&&(f="baobab"),"0xc72e5293c3c3ba38ed8ae910f780e4caaa9fb95e79784f7ab74c3c262ea7137e"===t.hash&&8217===r&&(f="cypress"),n.isFunction(e)&&e(null,f),f})).catch((function(t){if(!n.isFunction(e))throw t;e(t)}))};e.exports=f},fee1:function(e,t,r){(function(e,n){var f;/*! https://mths.be/utf8js v2.0.0 by @mathias */(function(i){var a=t,o=(e&&e.exports,"object"==typeof n&&n);o.global!==o&&o.window;var s,u,c,l=String.fromCharCode;function h(e){var t,r,n=[],f=0,i=e.length;while(f=55296&&t<=56319&&f65535&&(t-=65536,f+=l(t>>>10&1023|55296),t=56320|1023&t),f+=l(t);return f}function p(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function m(e,t){return l(e>>t&63|128)}function y(e){if(0==(4294967168&e))return l(e);var t="";return 0==(4294965248&e)?t=l(e>>6&31|192):0==(4294901760&e)?(p(e),t=l(e>>12&15|224),t+=m(e,6)):0==(4292870144&e)&&(t=l(e>>18&7|240),t+=m(e,12),t+=m(e,6)),t+=l(63&e|128),t}function g(e){var t,r=h(e),n=r.length,f=-1,i="";while(++f=u)throw Error("Invalid byte index");var e=255&s[c];if(c++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function v(){var e,t,r,n;if(c>u)throw Error("Invalid byte index");if(c==u)return!1;if(e=255&s[c],c++,0==(128&e))return e;if(192==(224&e)){var f=b();if(n=(31&e)<<6|f,n>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&e)){if(f=b(),t=b(),n=(15&e)<<12|f<<6|t,n>=2048)return p(n),n;throw Error("Invalid continuation byte")}if(240==(248&e)&&(f=b(),t=b(),r=b(),n=(15&e)<<18|f<<12|t<<6|r,n>=65536&&n<=1114111))return n;throw Error("Invalid UTF-8 detected")}function w(e){s=h(e),u=s.length,c=0;var t,r=[];while(!1!==(t=v()))r.push(t);return d(r)}var _={version:"2.0.0",encode:g,decode:w};f=function(){return _}.call(t,r,t,e),void 0===f||(e.exports=f)})()}).call(this,r("62e4")(e),r("c8ba"))},ff29:function(e,t,r){const n=r("7409"),f=r("3c73"),i=r("5e37"),{incrementHexInt:a}=r("1d6f");class o extends f{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const t=e,r=a(e),f=await i({provider:this.provider,fromBlock:r,toBlock:t}),o=n(f,e=>e.transactions);this.addResults(o)}}e.exports=o}}]); //# sourceMappingURL=chunk-5584f7ff.e0050e8d.js.map